diff --git a/OgreMain/include/OgreFrustum.h b/OgreMain/include/OgreFrustum.h index 2d92c5cf82..a834833b7c 100644 --- a/OgreMain/include/OgreFrustum.h +++ b/OgreMain/include/OgreFrustum.h @@ -66,9 +66,9 @@ namespace Ogre FRUSTUM_PLANE_BOTTOM = 5 }; - /** Specify how the frustrum extents are represented. + /** Specify how the frustum extents are represented. */ - enum FrustrumExtentsType + enum FrustumExtentsType { /// Represent extents as positions on the near clip plane FET_PROJ_PLANE_POS, @@ -106,7 +106,7 @@ namespace Ogre /// Stored versions of parent orientation / position mutable Quaternion mLastParentOrientation; - mutable Vector3 mLastParentPosition; + mutable Vector3 mLastParentPosition; /// Pre-calced standard projection matrix but with render system depth range mutable Matrix4 mProjMatrixRSDepth; @@ -132,7 +132,7 @@ namespace Ogre bool mFrustumExtentsManuallySet; /// Whether to treat frustum extents as tangents of the angles between the viewing /// vector and the edges of the field of view or as positions on the projection plane - FrustrumExtentsType mFrustrumExtentsType; + FrustumExtentsType mFrustumExtentsType; /// Frustum extents mutable Real mLeft, mRight, mTop, mBottom; /// Frustum orientation mode @@ -167,7 +167,7 @@ namespace Ogre mutable AxisAlignedBox mBoundingBox; mutable v1::VertexData mVertexData; // TODO: Remove this - mutable Vector3 mWorldSpaceCorners[8]; + mutable Vector3 mWorldSpaceCorners[8]; /// Is this frustum to act as a reflection of itself? bool mReflect; @@ -323,7 +323,7 @@ namespace Ogre @param left, right, top, bottom The position where the side clip planes intersect the near clip plane, in eye space OR the tangent of the half angles from the eye to the edges of the near clip plane - @param frustrumExtentsType + @param frustumExtentsType Specifies how the extents are represented. Be default they are the positions on near clip plane. However if this is a scene camera it is recommended that you actually use the tangent of the half angles. ie Half the FoV angles. This is because Ogre uses this camera setup to calculate @@ -335,7 +335,7 @@ namespace Ogre Ogre can apply different near clip distances dynamically. */ virtual void setFrustumExtents( Real left, Real right, Real top, Real bottom, - FrustrumExtentsType frustrumExtentsType = FET_PROJ_PLANE_POS ); + FrustumExtentsType frustumExtentsType = FET_PROJ_PLANE_POS ); bool getFrustumExtentsManuallySet() const; @@ -346,13 +346,13 @@ namespace Ogre @param outleft, outright, outtop, outbottom The position where the side clip planes intersect the near clip plane, in eye space OR the tangent of the half angles from the eye to the edges of the near clip plane - @param frustrumExtentsType - Specifies in what format the extents are returned. See OgreFrustrum::setFrustumExtents for + @param frustumExtentsType + Specifies in what format the extents are returned. See OgreFrustum::setFrustumExtents for more information */ virtual void getFrustumExtents( Real &outleft, Real &outright, Real &outtop, Real &outbottom, - FrustrumExtentsType frustrumExtentsType = FET_PROJ_PLANE_POS ) const; + FrustumExtentsType frustumExtentsType = FET_PROJ_PLANE_POS ) const; /** Gets the depth-adjusted projection matrix for the current rendersystem, but one which still conforms to right-hand rules. @@ -442,9 +442,9 @@ namespace Ogre range conversion, so don't expect Frustum::getProjectionMatrix to return you exactly the same projection matrix you passed to us! */ - virtual void setCustomProjectionMatrix( bool enable, + virtual void setCustomProjectionMatrix( bool enable, const Matrix4 &projectionMatrix = Matrix4::IDENTITY, - bool alternateDepthRange = false ); + bool alternateDepthRange = false ); /// Returns whether a custom projection matrix is in use virtual bool isCustomProjectionMatrixEnabled() const { return mCustomProjMatrix; } @@ -455,7 +455,7 @@ namespace Ogre const Plane *getFrustumPlanes() const; /// Returns the frustum planes, doesn't check if dirty. - const Plane *_getCachedFrustumPlanes() const { return mFrustumPlanes; } + const Plane *_getCachedFrustumPlanes() const { return mFrustumPlanes; } const Vector3 *_getCachedWorldSpaceCorners() const { return mWorldSpaceCorners; } /** Retrieves a specified plane of the frustum (world space). @@ -524,7 +524,7 @@ namespace Ogre void getCustomWorldSpaceCorners( ArrayVector3 outCorners[( 8 + ARRAY_PACKED_REALS - 1 ) / ARRAY_PACKED_REALS], - Real customFarPlane ) const; + Real customFarPlane ) const; /** Gets the world space corners of the frustum. @remarks diff --git a/OgreMain/src/OgreFrustum.cpp b/OgreMain/src/OgreFrustum.cpp index 77072927bb..cb32c2af21 100644 --- a/OgreMain/src/OgreFrustum.cpp +++ b/OgreMain/src/OgreFrustum.cpp @@ -67,7 +67,7 @@ namespace Ogre mCustomViewMatrix( false ), mCustomProjMatrix( false ), mFrustumExtentsManuallySet( false ), - mFrustrumExtentsType( FET_PROJ_PLANE_POS ), + mFrustumExtentsType( FET_PROJ_PLANE_POS ), mOrientationMode( OR_DEGREE_0 ), mVertexData( NULL ), mReflect( false ), @@ -351,7 +351,7 @@ namespace Ogre top = mTop; bottom = mBottom; - if( mFrustrumExtentsType == FET_TAN_HALF_ANGLES && mProjType != PT_ORTHOGRAPHIC ) + if( mFrustumExtentsType == FET_TAN_HALF_ANGLES && mProjType != PT_ORTHOGRAPHIC ) { left *= mNearDist; right *= mNearDist; @@ -553,7 +553,7 @@ namespace Ogre mProjMatrix[2][3] = qn; mProjMatrix[3][3] = 1; } // ortho - } // !mCustomProjMatrix + } // !mCustomProjMatrix #if OGRE_NO_VIEWPORT_ORIENTATIONMODE == 0 // Deal with orientation mode @@ -1330,10 +1330,10 @@ namespace Ogre Real Frustum::getOrthoWindowWidth() const { return mOrthoHeight * mAspect; } //--------------------------------------------------------------------- void Frustum::setFrustumExtents( Real left, Real right, Real top, Real bottom, - FrustrumExtentsType frustrumExtentsType ) + FrustumExtentsType frustumExtentsType ) { mFrustumExtentsManuallySet = true; - mFrustrumExtentsType = frustrumExtentsType; + mFrustumExtentsType = frustumExtentsType; mLeft = left; mRight = right; mTop = top; @@ -1347,15 +1347,15 @@ namespace Ogre void Frustum::resetFrustumExtents() { mFrustumExtentsManuallySet = false; - mFrustrumExtentsType = FET_PROJ_PLANE_POS; + mFrustumExtentsType = FET_PROJ_PLANE_POS; invalidateFrustum(); } //--------------------------------------------------------------------- void Frustum::getFrustumExtents( Real &outleft, Real &outright, Real &outtop, Real &outbottom, - FrustrumExtentsType frustrumExtentsType ) const + FrustumExtentsType frustumExtentsType ) const { updateFrustum(); - if( frustrumExtentsType == FET_TAN_HALF_ANGLES && mFrustrumExtentsType == FET_PROJ_PLANE_POS && + if( frustumExtentsType == FET_TAN_HALF_ANGLES && mFrustumExtentsType == FET_PROJ_PLANE_POS && mProjType != PT_ORTHOGRAPHIC ) { outleft = mLeft / mNearDist; @@ -1363,8 +1363,8 @@ namespace Ogre outtop = mTop / mNearDist; outbottom = mBottom / mNearDist; } - else if( frustrumExtentsType == FET_PROJ_PLANE_POS && - mFrustrumExtentsType == FET_TAN_HALF_ANGLES && mProjType != PT_ORTHOGRAPHIC ) + else if( frustumExtentsType == FET_PROJ_PLANE_POS && + mFrustumExtentsType == FET_TAN_HALF_ANGLES && mProjType != PT_ORTHOGRAPHIC ) { outleft = mLeft * mNearDist; outright = mRight * mNearDist; @@ -1397,8 +1397,8 @@ namespace Ogre void Frustum::setOrientationMode( OrientationMode orientationMode ) { #if OGRE_NO_VIEWPORT_ORIENTATIONMODE != 0 - OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, - "Setting Frustrum orientation mode is not supported", __FUNCTION__ ); + OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, "Setting Frustum orientation mode is not supported", + __FUNCTION__ ); #endif if( mOrientationMode != orientationMode ) { @@ -1410,8 +1410,8 @@ namespace Ogre OrientationMode Frustum::getOrientationMode() const { #if OGRE_NO_VIEWPORT_ORIENTATIONMODE != 0 - OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, - "Getting Frustrum orientation mode is not supported", __FUNCTION__ ); + OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED, "Getting Frustum orientation mode is not supported", + __FUNCTION__ ); #endif return mOrientationMode; }