How to implement yaw(Degree(angle)) in OgreNewt

Buckcherry

27-06-2006 18:37:54

How could I change the following line to another equivalent using setPositionOrientation ?.

mBody->yaw (Radian (2 * elapsedTime));

The bodies in OgreNewt have to be rotated using setPositionOrientation. But, how to rotate an angle?.

syedhs

27-06-2006 19:08:43

Instead of

body->setPositionOrientation(...)

change it to

body->getOgreNode()->yaw(Radian(2*elapsedTime));


Edit:
Okay maybe not correct, since you also have to do NewtonBodySetMatrix :lol:

abecam

28-06-2006 13:32:10

I use that to calculate my quaternion:


Ogre::Quaternion orientBox(Ogre::Vector3(0,-1,0),Ogre::Vector3(1,0,0),Ogre::Vector3(0,0,1));
// The value will be overwritten, I pushed them because I'm stupid :)

orientBox.FromAngleAxis(Ogre::Radian(Ogre::Degree(-90)),Ogre::Vector3(1,0,0));
orientBox.normalise();


It should allow you to use setPositionOrientation then, and still rotate using an angle (I am a lamer with Quaternions... ).