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

the camera view culling frustum More...

#include <CameraFrustum.h>

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

Public Member Functions

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...
 
float GetViewDepth ()
 
bool TestBox_sphere_far_plane (const CShapeAABB *box) const
 this is the same as the TestBox, except that the far plane is treated as a sphere plane whose radius is m_fViewDepth. More...
 
int TestBoxInsideFarPlane (const CShapeAABB *box) const
 this is the same as TestBox, except that the box must be completely inside the far plane. More...
 
- Public Member Functions inherited from ParaEngine::CShapeFrustum
 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...
 
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
 

Public Attributes

float m_fViewDepth
 the distance between the near plane and far plane in world coordinate. More...
 
Vector3 m_vEyeOrigin
 the eye origin
 
Vector2 v2DCircleCenter
 2D circle center. More...
 
float v2DCircleRadius
 the radius of the 2D circle. More...
 
CShapeSphere m_boundingSphere
 bounding sphere
 
- Public Attributes inherited from ParaEngine::CShapeFrustum
Vector3 vecFrustum [8]
 corners of the view frustum
 
Plane planeFrustum [6]
 planes of the view frustum
 
int nVertexLUT [6]
 

Additional Inherited Members

- Static Public Member Functions inherited from ParaEngine::CShapeFrustum
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
 

Detailed Description

the camera view culling frustum

Member Function Documentation

§ TestBox_sphere_far_plane()

bool ParaEngine::CCameraFrustum::TestBox_sphere_far_plane ( const CShapeAABB box) const

this is the same as the TestBox, except that the far plane is treated as a sphere plane whose radius is m_fViewDepth.

this is currently used by terrain view frustum

§ TestBoxInsideFarPlane()

int ParaEngine::CCameraFrustum::TestBoxInsideFarPlane ( const CShapeAABB box) const

this is the same as TestBox, except that the box must be completely inside the far plane.

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 ParaEngine::CCameraFrustum::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 from ParaEngine::CShapeFrustum.

Member Data Documentation

§ m_fViewDepth

float ParaEngine::CCameraFrustum::m_fViewDepth

the distance between the near plane and far plane in world coordinate.

§ v2DCircleCenter

Vector2 ParaEngine::CCameraFrustum::v2DCircleCenter

2D circle center.

It is the center of the smallest circle on the y=0 plane, which contains the Frustum projection on to the 2D plane. The information is used for rough object-level culling.

§ v2DCircleRadius

float ParaEngine::CCameraFrustum::v2DCircleRadius

the radius of the 2D circle.

v2DCircleCenter


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