mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Reset local rotation axis in SetAngle (Fixes #1630)
This commit is contained in:
parent
df80c436fb
commit
0704fa2b3d
2 changed files with 12 additions and 1 deletions
|
@ -86,16 +86,24 @@ namespace MWScript
|
|||
float ay = Ogre::Radian(ptr.getRefData().getPosition().rot[1]).valueDegrees();
|
||||
float az = Ogre::Radian(ptr.getRefData().getPosition().rot[2]).valueDegrees();
|
||||
|
||||
MWWorld::LocalRotation localRot = ptr.getRefData().getLocalRotation();
|
||||
|
||||
if (axis == "x")
|
||||
{
|
||||
localRot.rot[0] = 0;
|
||||
ptr.getRefData().setLocalRotation(localRot);
|
||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,angle,ay,az);
|
||||
}
|
||||
else if (axis == "y")
|
||||
{
|
||||
localRot.rot[1] = 0;
|
||||
ptr.getRefData().setLocalRotation(localRot);
|
||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,angle,az);
|
||||
}
|
||||
else if (axis == "z")
|
||||
{
|
||||
localRot.rot[2] = 0;
|
||||
ptr.getRefData().setLocalRotation(localRot);
|
||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,ay,angle);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1123,7 +1123,10 @@ namespace MWWorld
|
|||
|
||||
ptr.getRefData().setPosition(pos);
|
||||
|
||||
mWorldScene->updateObjectRotation(ptr);
|
||||
if (ptr.getClass().isActor())
|
||||
mWorldScene->updateObjectRotation(ptr);
|
||||
else
|
||||
mWorldScene->updateObjectLocalRotation(ptr);
|
||||
}
|
||||
|
||||
void World::localRotateObject (const Ptr& ptr, float x, float y, float z)
|
||||
|
|
Loading…
Reference in a new issue