1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:59:57 +00:00

Apply legs yaw to accumulated movement.

This commit is contained in:
Mads Buvik Sandvei 2023-11-01 19:47:08 +01:00
parent 7742ba165a
commit 93b723a066

View file

@ -1235,9 +1235,11 @@ namespace MWRender
mRootController->setEnabled(enable);
if (enable)
{
mRootController->setRotate(osg::Quat(mLegsYawRadians, osg::Vec3f(0, 0, 1))
* osg::Quat(mBodyPitchRadians, osg::Vec3f(1, 0, 0)));
osg::Quat legYaw = osg::Quat(mLegsYawRadians, osg::Vec3f(0, 0, 1));
mRootController->setRotate(legYaw * osg::Quat(mBodyPitchRadians, osg::Vec3f(1, 0, 0)));
yawOffset = mLegsYawRadians;
// When yawing the root, also update the accumulated movement.
movement = legYaw * movement;
}
}
if (mSpineController)