btMotionState::setWorldTransform

cengkarim
Posts: 3
Joined: Wed Mar 27, 2013 2:14 am

btMotionState::setWorldTransform

Post by cengkarim »

Hi all,

I'm just new to Bullet and I'm trying to integrate it to Ogre3d. I'm deriving from btMotionState and using getWorldTransfrom and setWorldTransform. I know that getWorldTransform requires the renderable object "World relative" position and orientation, my question is about setWorldTransform, does it supplies the same? The new "World relative" position and orientation? or it provides the delta local transform of the object? I appreciate your help.
norbie
Posts: 21
Joined: Mon Feb 11, 2013 1:57 pm

Re: btMotionState::setWorldTransform

Post by norbie »

btMotionState setWorldTransform supplies world transformation. If you have an Ogre::SceneNode attached to the root scene node (root scene node in the "world center"), then you can directly use the position and rotation information from this world transform in e.g. Ogre::SceneNode::setPosition/setOrientation. However if you have a hierarchy of Ogre::SceneNode-s, you might need to apply other tricks, or try using Ogre::SceneNode::_setDerivedPosition/_setDerivedOrientation.

Hope this helps.
cengkarim
Posts: 3
Joined: Wed Mar 27, 2013 2:14 am

Re: btMotionState::setWorldTransform

Post by cengkarim »

Thanks a lot, this makes it clear, it was puzzling me for a week.