|
|
|
@ -1116,13 +1116,15 @@ namespace MWWorld
|
|
|
|
|
while(ptr.getRefData().getLocalRotation().rot[2]<=-fullRotateRad)
|
|
|
|
|
ptr.getRefData().getLocalRotation().rot[2]+=fullRotateRad;
|
|
|
|
|
|
|
|
|
|
Ogre::Quaternion worldRotQuat(Ogre::Quaternion(Ogre::Radian(ptr.getRefData().getPosition().rot[0]), Ogre::Vector3::NEGATIVE_UNIT_X)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Radian(ptr.getRefData().getPosition().rot[1]), Ogre::Vector3::NEGATIVE_UNIT_Y)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Radian(ptr.getRefData().getPosition().rot[2]), Ogre::Vector3::NEGATIVE_UNIT_Z));
|
|
|
|
|
|
|
|
|
|
Ogre::Quaternion rot(Ogre::Quaternion(Ogre::Degree(x), Ogre::Vector3::NEGATIVE_UNIT_X)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Degree(y), Ogre::Vector3::NEGATIVE_UNIT_Y)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Degree(z), Ogre::Vector3::NEGATIVE_UNIT_Z));
|
|
|
|
|
Ogre::Quaternion worldRotQuat(Ogre::Radian(ptr.getRefData().getPosition().rot[2]), Ogre::Vector3::NEGATIVE_UNIT_Z);
|
|
|
|
|
if (!ptr.getClass().isActor())
|
|
|
|
|
worldRotQuat = Ogre::Quaternion(Ogre::Radian(ptr.getRefData().getPosition().rot[0]), Ogre::Vector3::NEGATIVE_UNIT_X)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Radian(ptr.getRefData().getPosition().rot[1]), Ogre::Vector3::NEGATIVE_UNIT_Y)* worldRotQuat;
|
|
|
|
|
|
|
|
|
|
Ogre::Quaternion rot(Ogre::Degree(z), Ogre::Vector3::NEGATIVE_UNIT_Z);
|
|
|
|
|
if (!ptr.getClass().isActor())
|
|
|
|
|
rot = Ogre::Quaternion(Ogre::Degree(x), Ogre::Vector3::NEGATIVE_UNIT_X)*
|
|
|
|
|
Ogre::Quaternion(Ogre::Degree(y), Ogre::Vector3::NEGATIVE_UNIT_Y)*rot;
|
|
|
|
|
|
|
|
|
|
ptr.getRefData().getBaseNode()->setOrientation(worldRotQuat*rot);
|
|
|
|
|
mPhysics->rotateObject(ptr);
|
|
|
|
|