Commits

Jeremy Sandell  committed 065c2f1 Draft

fix order of initialization

  • Participants
  • Parent commits d73e2fa

Comments (0)

Files changed (1)

File CameraControlSystem/include/CCSBasicCameraModes.h

 
         ThroughTargetCameraMode(CameraControlSystem* cam, Ogre::Real margin, bool inverse = false
             , Ogre::Vector3 focusPos = Ogre::Vector3::ZERO, const Ogre::Vector3 &fixedAxis = Ogre::Vector3::UNIT_Y) 
-            : CameraControlSystem::CameraMode(cam)
-			, mFixedAxis(fixedAxis)
-			, mMargin(margin)
-            , mInverse(inverse)
-			, mFocusPos(focusPos)
+            : CameraControlSystem::CameraMode(cam),
+			  mFixedAxis(fixedAxis),
+			  mFocusPos(focusPos),
+			  mMargin(margin),
+              mInverse(inverse)
         { };
 
         virtual ~ThroughTargetCameraMode(){};
             , const Ogre::Vector3 &leftAxis = Ogre::Vector3::NEGATIVE_UNIT_X
             , const Ogre::Radian cameraPitch = Ogre::Radian(Ogre::Degree(90))
             , Ogre::Real minZoom = 0, Ogre::Real maxZoom = 0) 
-            : CameraControlSystem::CameraMode(cam)
-            , mUpAxis(upAxis.normalisedCopy())
-            , mLeftAxis(leftAxis.normalisedCopy())
-            , mMoveFactor(1)
-            , mCameraPitch(cameraPitch)
-            , mMinZoom(minZoom)
-            , mMaxZoom(maxZoom)
-            , mZoom(0)
+            : CameraControlSystem::CameraMode(cam),
+              mRotation(cameraPitch, leftAxis),
+              mCameraPitch(cameraPitch),
+              mUpAxis(upAxis.normalisedCopy()),
+              mLeftAxis(leftAxis.normalisedCopy()),
+              mHeightAxis(0,0,0),
+              mMoveFactor(1),
+              mHeightDisplacement(0),
+              mLateralDisplacement(0),
+              mVerticalDisplacement(0),
+              mZoom(0),
+              mMinZoom(minZoom),
+              mMaxZoom(maxZoom)
         {
-            mRotation = Ogre::Quaternion(cameraPitch,leftAxis);
             mHeightAxis = -upAxis.crossProduct(leftAxis).normalisedCopy();
             mCameraPosition = initialPosition;
-
-            mHeightDisplacement = 0;
-            mLateralDisplacement = 0;
-            mVerticalDisplacement = 0;
         };
 
         virtual ~RTSCameraMode(){};