Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions OgreMain/include/OgreFrustum.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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.
Expand Down Expand Up @@ -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; }

Expand All @@ -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).
Expand Down Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions OgreMain/src/OgreFrustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -1347,24 +1347,24 @@ 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;
outright = mRight / mNearDist;
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;
Expand Down Expand Up @@ -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 )
{
Expand All @@ -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;
}
Expand Down
Loading