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:
parent
77ab249d06
commit
4e720afbd9
1 changed files with 4 additions and 9 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue