GettingStartedWithOde         A way to transfer position and orientation info from ode to ogre
Print
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

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:

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]);

 


Contributors to this page: jacmoe111451 points  and Spacegaier3733 points  .
Page last modified on Saturday 02 of January, 2010 22:28:13 GMT by jacmoe111451 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.