"L. Spiro Engine"
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

lsm::CFrustum Class Reference

A frustum. More...

#include <LSMFrustum.h>

List of all members.

Public Member Functions

const CPlane3 &LSE_FCALL operator[] (LSUINT32 _ui32Index) const
LSVOID LSE_FCALL ExtractFromMatrix (const CMatrix4x4 &_mMatrix, LSBOOL _bNormalizePlanes=false)
LSE_INLINE LSBOOL LSE_FCALL TestPoint (const CVector3 &_vPoint) const

Static Public Member Functions

static LSVOID LSE_CALL GetCornersOfPlanes (LSM_FRUSTUM_PLANES _fpPlane0, LSM_FRUSTUM_PLANES _fpPlane1, LSM_FRUSTUM_POINTS _fpRet[2])
static LSVOID LSE_CALL GetNeighbors (LSM_FRUSTUM_PLANES _fpPlane, LSM_FRUSTUM_PLANES _fpRet[4])

Public Attributes

CPlane3 m_pLeftPlane
CPlane3 m_pRightPlane
CPlane3 m_pTopPlane
CPlane3 m_pBottomPlane
CPlane3 m_pNearPlane
CPlane3 m_pFarPlane

Protected Member Functions

CPlane3 &LSE_FCALL operator[] (LSUINT32 _ui32Index)

Detailed Description

A frustum.

Class CFrustum Description: A frustum is formed of 6 planes representing the near, far, left, right, top, and bottom of a 3D box. It is usually used with cameras to represent the veiwable area of the camera and can be tested against various types of primites (cylinders, spheres, AABB's, etc.) to determine objects that are partially or entirely inside the box. This helps determine which objects should be drawn.


Member Function Documentation

LSVOID LSE_FCALL lsm::CFrustum::ExtractFromMatrix ( const CMatrix4x4 _mMatrix,
LSBOOL  _bNormalizePlanes = false 
)

Uses any projection matrix to create the 6 planes that make up this frustum.

Parameters:
_mMatrixThe projection matrix of a camera.
_bNormalizePlanesIf true, the planes are normalized. This is required for some plane equations, but not all. See your doctor to determine if normalization is right for you.
static LSVOID LSE_CALL lsm::CFrustum::GetCornersOfPlanes ( LSM_FRUSTUM_PLANES  _fpPlane0,
LSM_FRUSTUM_PLANES  _fpPlane1,
LSM_FRUSTUM_POINTS  _fpRet[2] 
) [static]

Given two planes, returns the two points shared by those planes. The points are always returned in counter-clockwise order, assuming the first input plane is facing towards the viewer.

Parameters:
_fpPlane0The plane facing towards the viewer.
_fpPlane1A plane neighboring _fpPlane0.
_fpRetAn array of exactly two elements to be filled with the indices of the points on return.
static LSVOID LSE_CALL lsm::CFrustum::GetNeighbors ( LSM_FRUSTUM_PLANES  _fpPlane,
LSM_FRUSTUM_PLANES  _fpRet[4] 
) [static]

Given a plane, the 4 neighbors of that plane are returned.

Parameters:
_fpPlaneThe plane for which to locate neighbors.
_fpRetHolds the returned neighbors. Must be at least 4 elements in the array.
LSE_INLINE const CPlane3 &LSE_FCALL lsm::CFrustum::operator[] ( LSUINT32  _ui32Index) const

Provide array access. For the sake of speed, the index is not checked.

Parameters:
_ui32IndexIndex of the plane to obtain.
Returns:
Returns the plain at the given index, which should be one of the LSM_FRUSTUM_PLANES enumerated values.
LSE_INLINE CPlane3 &LSE_FCALL lsm::CFrustum::operator[] ( LSUINT32  _ui32Index) [protected]

Provide array access. For the sake of speed, the index is not checked.

Parameters:
_ui32IndexIndex of the plane to obtain.
Returns:
Returns the plain at the given index, which should be one of the LSM_FRUSTUM_PLANES enumerated values.
LSE_INLINE LSBOOL LSE_FCALL lsm::CFrustum::TestPoint ( const CVector3 _vPoint) const

Determine of the given point is entirely inside the frustum or not.

Parameters:
_vPointThe point to test.
Returns:
Returns true if the point is inside the box described by the 6 planes of this frustum.

Member Data Documentation

Bottom plane.

Far plane.

Left plane.

Near plane.

Right plane.

Top plane.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator