Hello,
I know there is a way to set the initial body transform via btMotionState passed to the btRigidBody constructor. But is there a way to set it later?
Thanks
Initial body transform
-
Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Initial body transform
body->setWorldTransform(newTransform) should work.
Thanks,
Erwin
Thanks,
Erwin
-
frca
- Posts: 39
- Joined: Sat May 02, 2009 9:38 am
Re: Initial body transform
I was so focused to the btRigidBody class that I forgot to check the btCollisionObject from which it is inherited for the appropriate function.
Thanks for your patience
Thanks for your patience
-
frca
- Posts: 39
- Joined: Sat May 02, 2009 9:38 am
Re: Initial body transform
My current impression is that body->setWorldTransform(newTransform) should be used for initial body transform only. For changing body transform during simulation body->getMotionState()->setWorldTransform(newTransform) should be used. Is that right?
Or should the btMotionState be used only for getting the current transform and setting body's transform should be done always directly (i. e. body->setWorldTransform(newTransform))?
Thanks.
Or should the btMotionState be used only for getting the current transform and setting body's transform should be done always directly (i. e. body->setWorldTransform(newTransform))?
Thanks.