This is just a code snippet taken from this post on the forums: Link to forum post. Example here uses Example Frame Listener in Ogre/Samples/Common/include
Copy to clipboard
iCamera->yaw(iRotX); Ogre::Radian originalPitch = iCamera->getOrientation().getPitch(); Ogre::Radian newPitch = Ogre::Math::Abs(iRotY + originalPitch); if(newPitch < Ogre::Radian(Ogre::Math::PI/2 - Offset) || newPitch > Ogre::Radian(Ogre::Math::PI/2 + Offset)) { iCamera->pitch(iRotY); }
Note: A correct offset value must be around 0.2 - 0.5.