1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 04:49:54 +00:00

Better management of orientation. You should now be able to pitch and roll freely with no awkward limitations.

This commit is contained in:
Mads Buvik Sandvei 2020-11-01 17:17:40 +01:00
parent 77ab249d06
commit 4e720afbd9

View file

@ -67,13 +67,10 @@ namespace MWVR
yaw += mYawOffset;
if (player.isDisabled() || !mTrackingNode)
if (!player.isDisabled() && mTrackingNode)
{
rotateCamera(-pitch, -roll, -yaw, false);
}
else
{
world->rotateObject(playerPtr, pitch, roll, yaw, MWBase::RotationFlag_none);
world->rotateObject(playerPtr, pitch, 0.f, yaw, MWBase::RotationFlag_none);
world->rotateWorldObject(playerPtr, mHeadPose.orientation);
}
}
@ -165,9 +162,7 @@ namespace MWVR
}
void VRCamera::getOrientation(osg::Quat& orientation) const
{
orientation = osg::Quat(getPitch(), osg::Vec3d(1, 0, 0))
* osg::Quat(getRoll(), osg::Vec3d(0, 1, 0))
* osg::Quat(getYaw(), osg::Vec3d(0, 0, 1));
orientation = mHeadPose.orientation * osg::Quat(-mYawOffset, osg::Vec3d(0, 0, 1));
}
void VRCamera::processViewChange()