Initial body transform

User avatar
frca
Posts: 39
Joined: Sat May 02, 2009 9:38 am

Initial body transform

Post by frca »

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
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Initial body transform

Post by Erwin Coumans »

body->setWorldTransform(newTransform) should work.

Thanks,
Erwin
User avatar
frca
Posts: 39
Joined: Sat May 02, 2009 9:38 am

Re: Initial body transform

Post by frca »

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
User avatar
frca
Posts: 39
Joined: Sat May 02, 2009 9:38 am

Re: Initial body transform

Post by frca »

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.