doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
idFrustum Class Reference

#include <Frustum.h>

Public Member Functions

 idFrustum (void)
 
void SetOrigin (const idVec3 &origin)
 
void SetAxis (const idMat3 &axis)
 
void SetSize (float dNear, float dFar, float dLeft, float dUp)
 
void SetPyramid (float dNear, float dFar)
 
void MoveNearDistance (float dNear)
 
void MoveFarDistance (float dFar)
 
const idVec3GetOrigin (void) const
 
const idMat3GetAxis (void) const
 
idVec3 GetCenter (void) const
 
bool IsValid (void) const
 
float GetNearDistance (void) const
 
float GetFarDistance (void) const
 
float GetLeft (void) const
 
float GetUp (void) const
 
idFrustum Expand (const float d) const
 
idFrustumExpandSelf (const float d)
 
idFrustum Translate (const idVec3 &translation) const
 
idFrustumTranslateSelf (const idVec3 &translation)
 
idFrustum Rotate (const idMat3 &rotation) const
 
idFrustumRotateSelf (const idMat3 &rotation)
 
float PlaneDistance (const idPlane &plane) const
 
int PlaneSide (const idPlane &plane, const float epsilon=ON_EPSILON) const
 
bool CullPoint (const idVec3 &point) const
 
bool CullBounds (const idBounds &bounds) const
 
bool CullBox (const idBox &box) const
 
bool CullSphere (const idSphere &sphere) const
 
bool CullFrustum (const idFrustum &frustum) const
 
bool CullWinding (const class idWinding &winding) const
 
bool ContainsPoint (const idVec3 &point) const
 
bool IntersectsBounds (const idBounds &bounds) const
 
bool IntersectsBox (const idBox &box) const
 
bool IntersectsSphere (const idSphere &sphere) const
 
bool IntersectsFrustum (const idFrustum &frustum) const
 
bool IntersectsWinding (const idWinding &winding) const
 
bool LineIntersection (const idVec3 &start, const idVec3 &end) const
 
bool RayIntersection (const idVec3 &start, const idVec3 &dir, float &scale1, float &scale2) const
 
bool FromProjection (const idBounds &bounds, const idVec3 &projectionOrigin, const float dFar)
 
bool FromProjection (const idBox &box, const idVec3 &projectionOrigin, const float dFar)
 
bool FromProjection (const idSphere &sphere, const idVec3 &projectionOrigin, const float dFar)
 
bool ConstrainToBounds (const idBounds &bounds)
 
bool ConstrainToBox (const idBox &box)
 
bool ConstrainToSphere (const idSphere &sphere)
 
bool ConstrainToFrustum (const idFrustum &frustum)
 
void ToPlanes (idPlane planes[6]) const
 
void ToPoints (idVec3 points[8]) const
 
void AxisProjection (const idVec3 &dir, float &min, float &max) const
 
void AxisProjection (const idMat3 &ax, idBounds &bounds) const
 
bool ProjectionBounds (const idBounds &bounds, idBounds &projectionBounds) const
 
bool ProjectionBounds (const idBox &box, idBounds &projectionBounds) const
 
bool ProjectionBounds (const idSphere &sphere, idBounds &projectionBounds) const
 
bool ProjectionBounds (const idFrustum &frustum, idBounds &projectionBounds) const
 
bool ProjectionBounds (const idWinding &winding, idBounds &projectionBounds) const
 
bool ClippedProjectionBounds (const idFrustum &frustum, const idBox &clipBox, idBounds &projectionBounds) const
 

Private Member Functions

bool CullLocalBox (const idVec3 &localOrigin, const idVec3 &extents, const idMat3 &localAxis) const
 
bool CullLocalFrustum (const idFrustum &localFrustum, const idVec3 indexPoints[8], const idVec3 cornerVecs[4]) const
 
bool CullLocalWinding (const idVec3 *points, const int numPoints, int *pointCull) const
 
bool BoundsCullLocalFrustum (const idBounds &bounds, const idFrustum &localFrustum, const idVec3 indexPoints[8], const idVec3 cornerVecs[4]) const
 
bool LocalLineIntersection (const idVec3 &start, const idVec3 &end) const
 
bool LocalRayIntersection (const idVec3 &start, const idVec3 &dir, float &scale1, float &scale2) const
 
bool LocalFrustumIntersectsFrustum (const idVec3 points[8], const bool testFirstSide) const
 
bool LocalFrustumIntersectsBounds (const idVec3 points[8], const idBounds &bounds) const
 
void ToClippedPoints (const float fractions[4], idVec3 points[8]) const
 
void ToIndexPoints (idVec3 indexPoints[8]) const
 
void ToIndexPointsAndCornerVecs (idVec3 indexPoints[8], idVec3 cornerVecs[4]) const
 
void AxisProjection (const idVec3 indexPoints[8], const idVec3 cornerVecs[4], const idVec3 &dir, float &min, float &max) const
 
void AddLocalLineToProjectionBoundsSetCull (const idVec3 &start, const idVec3 &end, int &startCull, int &endCull, idBounds &bounds) const
 
void AddLocalLineToProjectionBoundsUseCull (const idVec3 &start, const idVec3 &end, int startCull, int endCull, idBounds &bounds) const
 
bool AddLocalCapsToProjectionBounds (const idVec3 endPoints[4], const int endPointCull[4], const idVec3 &point, int pointCull, int pointClip, idBounds &projectionBounds) const
 
bool BoundsRayIntersection (const idBounds &bounds, const idVec3 &start, const idVec3 &dir, float &scale1, float &scale2) const
 
void ClipFrustumToBox (const idBox &box, float clipFractions[4], int clipPlanes[4]) const
 
bool ClipLine (const idVec3 localPoints[8], const idVec3 points[8], int startIndex, int endIndex, idVec3 &start, idVec3 &end, int &startClip, int &endClip) const
 

Private Attributes

idVec3 origin
 
idMat3 axis
 
float dNear
 
float dFar
 
float dLeft
 
float dUp
 
float invFar
 

Detailed Description

Definition at line 40 of file Frustum.h.

Constructor & Destructor Documentation

ID_INLINE idFrustum::idFrustum ( void  )

Definition at line 148 of file Frustum.h.

Member Function Documentation

ID_INLINE bool idFrustum::AddLocalCapsToProjectionBounds ( const idVec3  endPoints[4],
const int  endPointCull[4],
const idVec3 point,
int  pointCull,
int  pointClip,
idBounds projectionBounds 
) const
private

Definition at line 2606 of file Frustum.cpp.

void idFrustum::AddLocalLineToProjectionBoundsSetCull ( const idVec3 start,
const idVec3 end,
int startCull,
int endCull,
idBounds bounds 
) const
private

Definition at line 1712 of file Frustum.cpp.

void idFrustum::AddLocalLineToProjectionBoundsUseCull ( const idVec3 start,
const idVec3 end,
int  startCull,
int  endCull,
idBounds bounds 
) const
private

Definition at line 1851 of file Frustum.cpp.

void idFrustum::AxisProjection ( const idVec3 dir,
float min,
float max 
) const

Definition at line 1684 of file Frustum.cpp.

void idFrustum::AxisProjection ( const idMat3 ax,
idBounds bounds 
) const

Definition at line 1698 of file Frustum.cpp.

void idFrustum::AxisProjection ( const idVec3  indexPoints[8],
const idVec3  cornerVecs[4],
const idVec3 dir,
float min,
float max 
) const
private

Definition at line 1661 of file Frustum.cpp.

bool idFrustum::BoundsCullLocalFrustum ( const idBounds bounds,
const idFrustum localFrustum,
const idVec3  indexPoints[8],
const idVec3  cornerVecs[4] 
) const
private

Definition at line 472 of file Frustum.cpp.

bool idFrustum::BoundsRayIntersection ( const idBounds bounds,
const idVec3 start,
const idVec3 dir,
float scale1,
float scale2 
) const
private

Definition at line 1978 of file Frustum.cpp.

void idFrustum::ClipFrustumToBox ( const idBox box,
float  clipFractions[4],
int  clipPlanes[4] 
) const
private

Definition at line 2405 of file Frustum.cpp.

bool idFrustum::ClipLine ( const idVec3  localPoints[8],
const idVec3  points[8],
int  startIndex,
int  endIndex,
idVec3 start,
idVec3 end,
int startClip,
int endClip 
) const
private

Definition at line 2468 of file Frustum.cpp.

bool idFrustum::ClippedProjectionBounds ( const idFrustum frustum,
const idBox clipBox,
idBounds projectionBounds 
) const

Definition at line 2623 of file Frustum.cpp.

bool idFrustum::ConstrainToBounds ( const idBounds bounds)

Definition at line 1414 of file Frustum.cpp.

bool idFrustum::ConstrainToBox ( const idBox box)

Definition at line 1434 of file Frustum.cpp.

bool idFrustum::ConstrainToFrustum ( const idFrustum frustum)

Definition at line 1474 of file Frustum.cpp.

bool idFrustum::ConstrainToSphere ( const idSphere sphere)

Definition at line 1454 of file Frustum.cpp.

bool idFrustum::ContainsPoint ( const idVec3 point) const

Definition at line 795 of file Frustum.cpp.

bool idFrustum::CullBounds ( const idBounds bounds) const

Definition at line 218 of file Frustum.cpp.

bool idFrustum::CullBox ( const idBox box) const

Definition at line 242 of file Frustum.cpp.

bool idFrustum::CullFrustum ( const idFrustum frustum) const

Definition at line 395 of file Frustum.cpp.

bool idFrustum::CullLocalBox ( const idVec3 localOrigin,
const idVec3 extents,
const idMat3 localAxis 
) const
private

Definition at line 150 of file Frustum.cpp.

bool idFrustum::CullLocalFrustum ( const idFrustum localFrustum,
const idVec3  indexPoints[8],
const idVec3  cornerVecs[4] 
) const
private

Definition at line 308 of file Frustum.cpp.

bool idFrustum::CullLocalWinding ( const idVec3 points,
const int  numPoints,
int pointCull 
) const
private

Definition at line 414 of file Frustum.cpp.

bool idFrustum::CullPoint ( const idVec3 point) const

Definition at line 120 of file Frustum.cpp.

bool idFrustum::CullSphere ( const idSphere sphere) const

Definition at line 263 of file Frustum.cpp.

bool idFrustum::CullWinding ( const class idWinding winding) const

Definition at line 449 of file Frustum.cpp.

ID_INLINE idFrustum idFrustum::Expand ( const float  d) const

Definition at line 224 of file Frustum.h.

ID_INLINE idFrustum & idFrustum::ExpandSelf ( const float  d)

Definition at line 234 of file Frustum.h.

bool idFrustum::FromProjection ( const idBounds bounds,
const idVec3 projectionOrigin,
const float  dFar 
)

Definition at line 1204 of file Frustum.cpp.

bool idFrustum::FromProjection ( const idBox box,
const idVec3 projectionOrigin,
const float  dFar 
)

Definition at line 1215 of file Frustum.cpp.

bool idFrustum::FromProjection ( const idSphere sphere,
const idVec3 projectionOrigin,
const float  dFar 
)

Definition at line 1376 of file Frustum.cpp.

ID_INLINE const idMat3 & idFrustum::GetAxis ( void  ) const

Definition at line 196 of file Frustum.h.

ID_INLINE idVec3 idFrustum::GetCenter ( void  ) const

Definition at line 200 of file Frustum.h.

ID_INLINE float idFrustum::GetFarDistance ( void  ) const

Definition at line 212 of file Frustum.h.

ID_INLINE float idFrustum::GetLeft ( void  ) const

Definition at line 216 of file Frustum.h.

ID_INLINE float idFrustum::GetNearDistance ( void  ) const

Definition at line 208 of file Frustum.h.

ID_INLINE const idVec3 & idFrustum::GetOrigin ( void  ) const

Definition at line 192 of file Frustum.h.

ID_INLINE float idFrustum::GetUp ( void  ) const

Definition at line 220 of file Frustum.h.

bool idFrustum::IntersectsBounds ( const idBounds bounds) const

Definition at line 864 of file Frustum.cpp.

bool idFrustum::IntersectsBox ( const idBox box) const

Definition at line 907 of file Frustum.cpp.

bool idFrustum::IntersectsFrustum ( const idFrustum frustum) const

Definition at line 1055 of file Frustum.cpp.

bool idFrustum::IntersectsSphere ( const idSphere sphere) const

Definition at line 955 of file Frustum.cpp.

bool idFrustum::IntersectsWinding ( const idWinding winding) const

Definition at line 1102 of file Frustum.cpp.

ID_INLINE bool idFrustum::IsValid ( void  ) const

Definition at line 204 of file Frustum.h.

bool idFrustum::LineIntersection ( const idVec3 start,
const idVec3 end 
) const

Definition at line 1174 of file Frustum.cpp.

bool idFrustum::LocalFrustumIntersectsBounds ( const idVec3  points[8],
const idBounds bounds 
) const
private

Definition at line 834 of file Frustum.cpp.

bool idFrustum::LocalFrustumIntersectsFrustum ( const idVec3  points[8],
const bool  testFirstSide 
) const
private

Definition at line 804 of file Frustum.cpp.

bool idFrustum::LocalLineIntersection ( const idVec3 start,
const idVec3 end 
) const
private

Definition at line 547 of file Frustum.cpp.

bool idFrustum::LocalRayIntersection ( const idVec3 start,
const idVec3 dir,
float scale1,
float scale2 
) const
private

Definition at line 674 of file Frustum.cpp.

ID_INLINE void idFrustum::MoveFarDistance ( float  dFar)

Definition at line 183 of file Frustum.h.

ID_INLINE void idFrustum::MoveNearDistance ( float  dNear)

Definition at line 178 of file Frustum.h.

float idFrustum::PlaneDistance ( const idPlane plane) const

Definition at line 84 of file Frustum.cpp.

int idFrustum::PlaneSide ( const idPlane plane,
const float  epsilon = ON_EPSILON 
) const

Definition at line 102 of file Frustum.cpp.

bool idFrustum::ProjectionBounds ( const idBounds bounds,
idBounds projectionBounds 
) const

Definition at line 2043 of file Frustum.cpp.

bool idFrustum::ProjectionBounds ( const idBox box,
idBounds projectionBounds 
) const

Definition at line 2054 of file Frustum.cpp.

bool idFrustum::ProjectionBounds ( const idSphere sphere,
idBounds projectionBounds 
) const

Definition at line 2169 of file Frustum.cpp.

bool idFrustum::ProjectionBounds ( const idFrustum frustum,
idBounds projectionBounds 
) const

Definition at line 2205 of file Frustum.cpp.

bool idFrustum::ProjectionBounds ( const idWinding winding,
idBounds projectionBounds 
) const

Definition at line 2319 of file Frustum.cpp.

bool idFrustum::RayIntersection ( const idVec3 start,
const idVec3 dir,
float scale1,
float scale2 
) const

Definition at line 1187 of file Frustum.cpp.

ID_INLINE idFrustum idFrustum::Rotate ( const idMat3 rotation) const

Definition at line 254 of file Frustum.h.

ID_INLINE idFrustum & idFrustum::RotateSelf ( const idMat3 rotation)

Definition at line 260 of file Frustum.h.

ID_INLINE void idFrustum::SetAxis ( const idMat3 axis)

Definition at line 156 of file Frustum.h.

ID_INLINE void idFrustum::SetOrigin ( const idVec3 origin)

Definition at line 152 of file Frustum.h.

ID_INLINE void idFrustum::SetPyramid ( float  dNear,
float  dFar 
)

Definition at line 169 of file Frustum.h.

ID_INLINE void idFrustum::SetSize ( float  dNear,
float  dFar,
float  dLeft,
float  dUp 
)

Definition at line 160 of file Frustum.h.

void idFrustum::ToClippedPoints ( const float  fractions[4],
idVec3  points[8] 
) const
private

Definition at line 1554 of file Frustum.cpp.

void idFrustum::ToIndexPoints ( idVec3  indexPoints[8]) const
private

Definition at line 1590 of file Frustum.cpp.

void idFrustum::ToIndexPointsAndCornerVecs ( idVec3  indexPoints[8],
idVec3  cornerVecs[4] 
) const
private

Definition at line 1623 of file Frustum.cpp.

void idFrustum::ToPlanes ( idPlane  planes[6]) const

Definition at line 1494 of file Frustum.cpp.

void idFrustum::ToPoints ( idVec3  points[8]) const

Definition at line 1523 of file Frustum.cpp.

ID_INLINE idFrustum idFrustum::Translate ( const idVec3 translation) const

Definition at line 243 of file Frustum.h.

ID_INLINE idFrustum & idFrustum::TranslateSelf ( const idVec3 translation)

Definition at line 249 of file Frustum.h.

Member Data Documentation

idMat3 idFrustum::axis
private

Definition at line 119 of file Frustum.h.

float idFrustum::dFar
private

Definition at line 121 of file Frustum.h.

float idFrustum::dLeft
private

Definition at line 122 of file Frustum.h.

float idFrustum::dNear
private

Definition at line 120 of file Frustum.h.

float idFrustum::dUp
private

Definition at line 123 of file Frustum.h.

float idFrustum::invFar
private

Definition at line 124 of file Frustum.h.

idVec3 idFrustum::origin
private

Definition at line 118 of file Frustum.h.


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