Skip to main content
GettingStartedWithOde         A way to transfer position and orientation info from ode to ogre
Image

I try to learn Ogre and Ode by combining the examples (and not by using the OgreOde Wrapper) and I was looking for a way to transfer position and orientation info from ode to ogre:

This is the corresponding code snippet from the Ogre ReferenceApplication

// Get position & rotation from ODE

Copy to clipboard
const dReal* pos = mOdeBody->getPosition(); const dReal* quat = mOdeBody->getQuaternion();

Warning!
for me (on new versions of ODE, and 'mOdeBody' is a dBodyID) the above two lines should be:

Copy to clipboard
const dReal* pos = dBodyGetPosition(mOdeBody); const dReal* quat = dBodyGetQuaternion(mOdeBody); mSceneNode->setPosition((Real)pos[0], (Real)pos[1], (Real)pos[2]); mSceneNode->setOrientation((Real)quat[0], (Real)quat[1], (Real)quat[2], (Real)quat[3]);