newbie question:
Should I move a body with:
btRigidBody::setTransform or btMotionState::setTransform
Can someone explain what the difference is in moving the objects in these ways
thanks
Moving objects
-
- Posts: 10
- Joined: Fri Jan 25, 2013 1:51 pm
Re: Moving objects
You can use either, but it depends on the scenario. Would you like to synchronize your transforms across systems in your code?
btRigidBody::setWorldTransform simply does exactly what you'd think it would do.
btMotionState::setWorldTransform provides you the ability to override the transform's get/set, and will let you update any transforms that may relevant to the associated rigidbody at the same time. The documentation suggests using this method for keeping a rigidbody's rendering transform and physical transform in-sync during simulation.
btRigidBody::setWorldTransform simply does exactly what you'd think it would do.
btMotionState::setWorldTransform provides you the ability to override the transform's get/set, and will let you update any transforms that may relevant to the associated rigidbody at the same time. The documentation suggests using this method for keeping a rigidbody's rendering transform and physical transform in-sync during simulation.