"L. Spiro Engine"
|
A frustum. More...
#include <LSMFrustum.h>
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) |
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.
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.
_mMatrix | The projection matrix of a camera. |
_bNormalizePlanes | If 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.
_fpPlane0 | The plane facing towards the viewer. |
_fpPlane1 | A plane neighboring _fpPlane0. |
_fpRet | An 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.
_fpPlane | The plane for which to locate neighbors. |
_fpRet | Holds 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.
_ui32Index | Index of the plane to obtain. |
LSE_INLINE CPlane3 &LSE_FCALL lsm::CFrustum::operator[] | ( | LSUINT32 | _ui32Index | ) | [protected] |
Provide array access. For the sake of speed, the index is not checked.
_ui32Index | Index of the plane to obtain. |
LSE_INLINE LSBOOL LSE_FCALL lsm::CFrustum::TestPoint | ( | const CVector3 & | _vPoint | ) | const |
Determine of the given point is entirely inside the frustum or not.
_vPoint | The point to test. |
Bottom plane.
Far plane.
Left plane.
Near plane.
Right plane.
Top plane.