Get MotionProperties with bodyInterface #1130
-
Hello, thanks again for the excellent library. In my task, I need to change the linear and angular damping for the bodies during some simulation cycles. It seemed a little strange to me, because I can SetGravityFactor for the body through the BodyInterface, but can't change another parameters, and, as I understand, directly change the properties of motion using the Body* body is a bad practice. So, is there a proper way to set MotionProperties? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The BodyInterface provides a lot of convenience functions to quickly set properties. I did not expose everything (mainly because I was lazy). To set these properties you would do something like:
B.t.w. if you have a |
Beta Was this translation helpful? Give feedback.
The BodyInterface provides a lot of convenience functions to quickly set properties. I did not expose everything (mainly because I was lazy). To set these properties you would do something like:
B.t.w. if you have a
Body *
then you can also set these properties directly, just make sure that it is not done while something else is reading the values (Jolt itself only reads this during very specific times inPhysicsSystem::Update
).