1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 07:53:52 +00:00

fixed object rotation code

This commit is contained in:
Marc Zinnschlag 2012-08-04 09:34:49 +02:00
parent e4dc01832b
commit 994e33e3d2

View file

@ -606,10 +606,10 @@ namespace MWWorld
ptr.getRefData().getPosition().rot[1] = Ogre::Degree(y).valueRadians(); ptr.getRefData().getPosition().rot[1] = Ogre::Degree(y).valueRadians();
ptr.getRefData().getPosition().rot[2] = Ogre::Degree(z).valueRadians(); ptr.getRefData().getPosition().rot[2] = Ogre::Degree(z).valueRadians();
Ogre::Quaternion rotx(Ogre::Degree(x),Ogre::Vector3::UNIT_X); Ogre::Quaternion rotx(Ogre::Degree(-x),Ogre::Vector3::UNIT_X);
Ogre::Quaternion roty(Ogre::Degree(y),Ogre::Vector3::UNIT_Y); Ogre::Quaternion roty(Ogre::Degree(-y),Ogre::Vector3::UNIT_Y);
Ogre::Quaternion rotz(Ogre::Degree(z),Ogre::Vector3::UNIT_Z); Ogre::Quaternion rotz(Ogre::Degree(-z),Ogre::Vector3::UNIT_Z);
ptr.getRefData().getBaseNode()->setOrientation(rotz*roty*rotx); ptr.getRefData().getBaseNode()->setOrientation(rotx*roty*rotz);
mPhysics->rotateObject(ptr.getRefData().getHandle(),ptr.getRefData().getBaseNode()->getOrientation()); mPhysics->rotateObject(ptr.getRefData().getHandle(),ptr.getRefData().getBaseNode()->getOrientation());
} }