My Project
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ParaEngine::CShapeFrustum Class Reference

a general view frustum class. More...

#include <ShapeFrustum.h>

Inheritance diagram for ParaEngine::CShapeFrustum:
ParaEngine::CCameraFrustum

Public Member Functions

 CShapeFrustum (const Matrix4 *matrix)
 build a frustum from a camera (projection, or viewProjection) matrix
 
bool TestSphere (const CShapeSphere *sphere) const
 
bool TestSweptSphere (const CShapeSphere *sphere, const Vector3 *sweepDir) const
 
int TestBox (const CShapeAABB *box) const
 Tests if an AABB is inside/intersecting the view frustum. More...
 
virtual void UpdateFrustum (const Matrix4 *matViewProj, bool bInversedMatrix=false, float fNearPlane=0.f, float fFarPlane=1.f)
 build a frustum from a camera (projection, or viewProjection) matrix More...
 
PlaneGetPlane (int nIndex)
 Get a given frustum plane. More...
 
bool CullPointWithPlane (int iPlane, const Vector3 *vPos)
 whether the point is inside a given plane. More...
 
bool CullPointsWithFrustum (Vector3 *pVecBounds, int nCount)
 return true if any of the point is inside the frustum
 

Static Public Member Functions

static bool SweptSpherePlaneIntersect (float &t0, float &t1, const Plane *plane, const CShapeSphere *sphere, const Vector3 *sweepDir)
 this function tests if the projection of a bounding sphere along the light direction intersects the view frustum
 

Public Attributes

Vector3 vecFrustum [8]
 corners of the view frustum
 
Plane planeFrustum [6]
 planes of the view frustum
 
int nVertexLUT [6]
 

Detailed Description

a general view frustum class.

Member Function Documentation

§ CullPointWithPlane()

bool ParaEngine::CShapeFrustum::CullPointWithPlane ( int  iPlane,
const Vector3 vPos 
)

whether the point is inside a given plane.

Parameters
iPlane0 is near plane, 1 is far plane, 2-5 is left, right, top, bottom.

§ GetPlane()

Plane& ParaEngine::CShapeFrustum::GetPlane ( int  nIndex)
inline

Get a given frustum plane.

Parameters
nIndex0 is near plane, 1 is far plane, 2-5 is left, right, top, bottom.

§ TestBox()

int CShapeFrustum::TestBox ( const CShapeAABB box) const

Tests if an AABB is inside/intersecting the view frustum.

Returns
: 2 requires more testing(meaning either intersecting) 1 is fast accept(meaning the box is fully inside the frustum) 0 is fast reject,

§ UpdateFrustum()

void CShapeFrustum::UpdateFrustum ( const Matrix4 matViewProj,
bool  bInversedMatrix = false,
float  fNearPlane = 0.f,
float  fFarPlane = 1.f 
)
virtual

build a frustum from a camera (projection, or viewProjection) matrix

Parameters
matViewProjthe view projection matrix.
bInversedMatrixif this is true, matViewProj is the inverse of standard matViewProj
fNearPlanethe near plane in viewProjection coordinate, default to 0.f
fFarPlanethe far plane in viewProjection coordinate, default to 1.f

Reimplemented in ParaEngine::CCameraFrustum.


The documentation for this class was generated from the following files: