Skip to content

Custom Gravity Direction (per Body) #166

Answered by jrouwe
PhoenixIllusion asked this question in Q&A
Discussion options

You must be logged in to vote

Is this the best approach with Jolt's logic?

Yes it is (it's also what we're doing), the accumulated force is applied at the same time as gravity so they're mathematically equivalent:

https://github.com/jrouwe/JoltPhysics/blob/7edba88d5336047ebae8c6e26a5aa89dd5ae069e/Jolt/Physics/Body/MotionProperties.inl#L127

CharacterVirtual pretty much already uses faked gravity for lots of things

Correct, the update function takes the gravity vector as input, which was done on purpose to allow custom gravity for the character (see CharacterSpaceShipTest C++ demo).

I do see that likely I will need to allow infinite 'PitchRoll' on a vehicle and fix it myself per-frame, due to VehicleConstraint's mW…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@PhoenixIllusion
Comment options

@jrouwe
Comment options

@jrouwe
Comment options

@PhoenixIllusion
Comment options

Answer selected by PhoenixIllusion
Comment options

You must be logged in to vote
2 replies
@PhoenixIllusion
Comment options

@jrouwe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants