1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +00:00

Fix for issue #2051. Not perfect (can get into a lock in some situations) but usable.

This commit is contained in:
cc9cii 2014-11-12 14:02:08 +11:00
parent 273a80e2c0
commit b86148411b

View file

@ -44,10 +44,11 @@ bool CSVRender::Navigation1st::mouseMoved (const QPoint& delta, int mode)
float deltaPitch = getFactor (true) * delta.y(); float deltaPitch = getFactor (true) * delta.y();
Ogre::Radian newPitch = oldPitch + Ogre::Degree (deltaPitch); Ogre::Radian newPitch = oldPitch + Ogre::Degree (deltaPitch);
Ogre::Radian limit (Ogre::Math::PI/2-0.5); if ((deltaPitch>0 && newPitch<Ogre::Radian(Ogre::Math::PI-0.5)) ||
(deltaPitch<0 && newPitch>Ogre::Radian(0.5)))
if ((deltaPitch>0 && newPitch<limit) || (deltaPitch<0 && newPitch>-limit)) {
mCamera->pitch (Ogre::Degree (deltaPitch)); mCamera->pitch (Ogre::Degree (deltaPitch));
}
} }
return true; return true;