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
I want to know how to do this with Ogre3dBody. Because it does not have any yaw method.
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.