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:
parent
e4dc01832b
commit
994e33e3d2
1 changed files with 5 additions and 5 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue