Moving objects

TheIvanHouse
Posts: 1
Joined: Tue May 21, 2013 4:47 pm

Moving objects

Post by TheIvanHouse »

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
User avatar
nullChar
Posts: 10
Joined: Fri Jan 25, 2013 1:51 pm

Re: Moving objects

Post by nullChar »

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.