Ogre3dBody quaternion rotation by 180 degrees

deshan

12-12-2009 09:58:58

Hi
Ogre suggest to handle special case when rotating 180 degrees to handle Divide by Zero error.
Following is an example code

void Dorotation()
{
if ((1.0f + src.dotProduct(mDirection)) < 0.0001f) // Work around 180 degree quaternion rotation quirk
{
//mNode->yaw(Degree(180));
// how to complete this for the Ogre3dBody?
}
else
{
Quaternion quat = src.getRotationTo(mDirection);
enemyBody->setGlobalOrientationQuat(quat);
}
}


I want to know how to do this with Ogre3dBody. Because it does not have any yaw method.

Druha

13-12-2009 15:16:44


OGRE3DBody::getSceneNode()->yaw(..);

deshan

14-12-2009 03:27:33

OGRE3DBody::getSceneNode()->yaw(..);
Ok druha Thanx !!!
I completely forgot about the scene node :D