void CameraMan::setStyle(CameraStyle style) { if (mStyle != CS_ORBIT && style == CS_ORBIT) { setTarget(mTarget ? mTarget : mCamera->getCreator()->getRootSceneNode()); mCamera->setFixedYawAxis(true); // also fix axis with lookAt calls manualStop(); // try to replicate the camera configuration Ogre::Real dist = getDistToTarget(); const Ogre::Quaternion& q = mCamera->getOrientation(); setYawPitchDist(q.getYaw(), q.getPitch(), dist == 0 ? 150 : dist); // enforce some distance } else if (mStyle != CS_FREELOOK && style == CS_FREELOOK) { mCamera->setFixedYawAxis(true); // also fix axis with lookAt calls } else if (mStyle != CS_MANUAL && style == CS_MANUAL) { manualStop(); } mStyle = style; mCamera->setAutoTracking(false); }
void CameraMan::setInteracting(bool s) { mInteracting = s; if (mInteracting) manualStop(); }