FrustumData

Engine/source/math/util/frustum.h

Polyhedron data for use by frustums.

More...

Lazily Updated Data

bool

When true, points, planes and bounds must be re-calculated before use.

mPlaneCenters [PlaneCount]

The center points of the individual faces of the frustum.

The clipping-space axis-aligned bounding box which contains the extents of the frustum.

Accessors

Return the number of planes that a frustum has.

Return the number of corner points that a frustum has.

Return the number of edges that a frustum has.

Return the edge definitions for a frustum.

Return the planes that make up the polyhedron.

Public Types

enum
_Anonymous_ {  EdgeCount = 12
}
enum
_Anonymous_ {
  PlaneLeft 
  PlaneRight 
  PlaneNear 
  PlaneFar 
  PlaneTop 
  PlaneBottom 
  PlaneCount 
}

Indices for the planes in a frustum.

enum
_Anonymous_ {
  PlaneMaskLeft = ( 1 << PlaneLeft )
  PlaneMaskRight = ( 1 << PlaneRight )
  PlaneMaskTop = ( 1 << PlaneTop )
  PlaneMaskBottom = ( 1 << PlaneBottom )
  PlaneMaskNear = ( 1 << PlaneNear )
  PlaneMaskFar = ( 1 << PlaneFar )
  PlaneMaskAll = 0xFFFFFFFF
}

Used to mask out planes for testing.

enum
CornerPoints {
  NearTopLeft 
  NearTopRight 
  NearBottomLeft 
  NearBottomRight 
  FarTopLeft 
  FarTopRight 
  FarBottomLeft 
  FarBottomRight 
  CornerPointCount 
}

Indices for the corner points of the frustum.

enum
PlaneCenters {
  PlaneLeftCenter 
  PlaneRightCenter 
  PlaneTopCenter 
  PlaneBottomCenter 
  PlaneNearCenter 
  PlaneFarCenter 
}

Indices for the center points of the frustum planes.

Protected Attributes

bool

Whether the frustum is inverted, i.e.

bool

Determines whether this Frustum is orthographic or perspective.

The size of the near plane used to generate the frustum points and planes.

Camera position extracted from tarnsform.

Used to transform the frustum points from camera space into the desired clipping space.

Protected Static Attributes

Static edge list.

Protected Functions

Update the point and plane data from the current frustum settings.

Public Functions

Detailed Description

Polyhedron data for use by frustums.

Uses fixed-size vectors and a static vector for the edge list as that never changes between frustums.

Lazily Updated Data

bool mDirty 

When true, points, planes and bounds must be re-calculated before use.

PlaneListType mPlanes 
PointListType mPoints 
Point3F mPlaneCenters [PlaneCount]

The center points of the individual faces of the frustum.

Box3F mBounds 

The clipping-space axis-aligned bounding box which contains the extents of the frustum.

Accessors

getNumPlanes()

Return the number of planes that a frustum has.

getNumPoints()

Return the number of corner points that a frustum has.

getNumEdges()

Return the number of edges that a frustum has.

getEdges()

Return the edge definitions for a frustum.

getPlanes()

Return the planes that make up the polyhedron.

note:

The normals of these planes are facing inwards.

getPoints()

Public Types

@113

Enumerator

EdgeCount = 12
@114

Enumerator

PlaneLeft
PlaneRight
PlaneNear
PlaneFar
PlaneTop
PlaneBottom
PlaneCount

The total number of frustum planes.

Indices for the planes in a frustum.

Note the planes are ordered left, right, near, far, top, bottom for getting early rejections from the typical horizontal scene.

@115

Enumerator

PlaneMaskLeft = ( 1 << PlaneLeft )
PlaneMaskRight = ( 1 << PlaneRight )
PlaneMaskTop = ( 1 << PlaneTop )
PlaneMaskBottom = ( 1 << PlaneBottom )
PlaneMaskNear = ( 1 << PlaneNear )
PlaneMaskFar = ( 1 << PlaneFar )
PlaneMaskAll = 0xFFFFFFFF

Used to mask out planes for testing.

CornerPoints

Enumerator

NearTopLeft
NearTopRight
NearBottomLeft
NearBottomRight
FarTopLeft
FarTopRight
FarBottomLeft
FarBottomRight
CornerPointCount

Total number of corner points.

Indices for the corner points of the frustum.

PlaneCenters

Enumerator

PlaneLeftCenter
PlaneRightCenter
PlaneTopCenter
PlaneBottomCenter
PlaneNearCenter
PlaneFarCenter

Indices for the center points of the frustum planes.

typedef FixedSizeVector< Edge, EdgeCount > EdgeListType 
typedef FixedSizeVector< PlaneF, PlaneCount > PlaneListType 
typedef FixedSizeVector< Point3F, CornerPointCount > PointListType 

Protected Attributes

F32 mFarDist 
bool mIsInverted 

Whether the frustum is inverted, i.e.

whether the planes are facing outwards rather than inwards.

bool mIsOrtho 

Determines whether this Frustum is orthographic or perspective.

F32 mNearBottom 
F32 mNearDist 
F32 mNearLeft 

The size of the near plane used to generate the frustum points and planes.

F32 mNearRight 
F32 mNearTop 
Point3F mPosition 

Camera position extracted from tarnsform.

MatrixF mTransform 

Used to transform the frustum points from camera space into the desired clipping space.

Protected Static Attributes

EdgeListType smEdges 

Static edge list.

Shared by all frustum polyhedrons since they are always constructed the same way.

Protected Functions

FrustumData()

_update()

Update the point and plane data from the current frustum settings.

Public Functions

operator AnyPolyhedron()