-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Extend RigidBodyComponent to include useGravity and gravity
#5163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
RigidBodyComponent to include useGravity and gravity-related functions
|
Could this API be simplified to: If set to null, simply use world gravity. |
Unfortunately |
|
I don't get how this is different to |
Oh alright, I have to admit I don't use the whole API so I have not seen all the variation but yeah it makes the code much more simple, I was just afraid about the clarity to users that they should not edit the base value. It's updated then! |
RigidBodyComponent to include useGravity and gravity-related functionsRigidBodyComponent to include useGravity and gravity
setFlags(and optionallygetFlagsfor counterpart) fromAmmo.btRigidBodyto workAllows a better management of gravity for rigid bodies.
Changes to
pcpublic API:BODYFLAG_GRAVITY_WORLD_ENABLE: constant to enable world gravity on bodyBODYFLAG_GRAVITY_WORLD_DISABLE: constant to disable world gravity on bodyBODYFLAG_GRAVITY_GYROSCOPIC_EXPLICIT: constant to enable explicit gyroscopic forcesBODYFLAG_GRAVITY_GYROSCOPIC_IMPLICIT_WORLD: constant to enable implicit world gyroscopic forcesBODYFLAG_GRAVITY_GYROSCOPIC_EXPLICIT_BODY: constant to enable implicit body gyroscopic forcesBODYFLAG_GRAVITY_GYROSCOPIC_ENABLE: constant to enable all gyroscopic forcesChanges to
pc.RigidBodyComponentpublic API:useGravity: boolean, defining whether or not the body should use gravity.gravity: Vec3 to represent gravity applying only to this entity. Defaults to null (use world gravity).I confirm I have read the contributing guidelines and signed the Contributor License Agreement.