Skip to content
Open
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
16 changes: 8 additions & 8 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 @@ -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 @@ -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
24 changes: 12 additions & 12 deletions OgreMain/src/OgreFrustum.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
rustumfrustumFrustum/*
-----------------------------------------------------------------------------
This source file is part of OGRE-Next
(Object-oriented Graphics Rendering Engine)
Expand Down 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 @@ -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 @@ -1398,7 +1398,7 @@ namespace Ogre
{
#if OGRE_NO_VIEWPORT_ORIENTATIONMODE != 0
OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
"Setting Frustrum orientation mode is not supported", __FUNCTION__ );
"Setting Frustum orientation mode is not supported", __FUNCTION__ );
#endif
if( mOrientationMode != orientationMode )
{
Expand All @@ -1411,7 +1411,7 @@ namespace Ogre
{
#if OGRE_NO_VIEWPORT_ORIENTATIONMODE != 0
OGRE_EXCEPT( Exception::ERR_NOT_IMPLEMENTED,
"Getting Frustrum orientation mode is not supported", __FUNCTION__ );
"Getting Frustum orientation mode is not supported", __FUNCTION__ );
#endif
return mOrientationMode;
}
Expand Down