Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

salt::Frustum Class Reference

This class implements a frustum, which is an arbitrary volume in space (possibly infinite) defined by a set of planes. More...

#include <frustum.h>

Collaboration diagram for salt::Frustum:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ePlaneID {
  PI_NEAR = 0, PI_LEFT = 1, PI_RIGHT = 2, PI_FAR = 3,
  PI_BOTTOM = 4, PI_TOP = 5
}
 plane ids used as an index into mPlanes More...
enum  eFrustumSide { FS_INSIDE = 0, FS_OUTSIDE = 1, FS_SPLIT = 2 }
 constants describing the result of an intersection test More...

Public Member Functions

void Dump () const
 a debug helper method, printing the plane normals
void Set (const Matrix &worldTransform, float fov=60.0f, float zNear=0.1f, float zFar=2000.0f, float aspect=0.75f)
 constructs a frustum
eFrustumSide Intersects (const AABB3 &bb) const
 returns the relation that hold between between the axis aligned bounding boxx bb and this frustum as an eFrustumSide value

Public Attributes

Vector3f mBasePos
 the position from where the frustum is cast
Plane mPlanes [6]
 the 6 plane equations

Detailed Description

This class implements a frustum, which is an arbitrary volume in space (possibly infinite) defined by a set of planes.

This class also provides some 'special' frustra construction methods.

Definition at line 50 of file frustum.h.


Member Enumeration Documentation

enum salt::Frustum::eFrustumSide
 

constants describing the result of an intersection test

Enumerator:
FS_INSIDE 
FS_OUTSIDE 
FS_SPLIT 

Definition at line 66 of file frustum.h.

enum salt::Frustum::ePlaneID
 

plane ids used as an index into mPlanes

Enumerator:
PI_NEAR 
PI_LEFT 
PI_RIGHT 
PI_FAR 
PI_BOTTOM 
PI_TOP 

Definition at line 55 of file frustum.h.


Member Function Documentation

void Frustum::Dump  )  const
 

a debug helper method, printing the plane normals

Definition at line 28 of file frustum.cpp.

References salt::Plane::d, mPlanes, salt::Plane::normal, salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

Frustum::eFrustumSide Frustum::Intersects const AABB3 bb  )  const
 

returns the relation that hold between between the axis aligned bounding boxx bb and this frustum as an eFrustumSide value

Definition at line 91 of file frustum.cpp.

References salt::Plane::ClassifyBox(), FS_INSIDE, FS_OUTSIDE, FS_SPLIT, mPlanes, salt::PLANESIDE_BACK, and salt::PLANESIDE_SPLIT.

Referenced by kerosin::RenderServer::Render().

Here is the call graph for this function:

void Frustum::Set const Matrix worldTransform,
float  fov = 60.0f,
float  zNear = 0.1f,
float  zFar = 2000.0f,
float  aspect = 0.75f
 

constructs a frustum

Parameters:
worldTransform is the world transform matrix
fov is the field of view, the angle between the casted planes
zNear is the distance to the near plane
zFar is the distance to the far plane
aspect is the aspect ratio

Definition at line 36 of file frustum.cpp.

References salt::Plane::d, salt::gDegToRad(), salt::Matrix::Identity(), salt::Matrix::InvertRotationMatrix(), salt::Matrix::m, mPlanes, salt::Plane::normal, salt::Plane::Normalize(), PI_BOTTOM, PI_FAR, PI_LEFT, PI_NEAR, PI_RIGHT, PI_TOP, and salt::TVector3< DATATYPE, TYPE >::Set().

Here is the call graph for this function:


Member Data Documentation

Vector3f salt::Frustum::mBasePos
 

the position from where the frustum is cast

Definition at line 74 of file frustum.h.

Referenced by oxygen::Camera::DescribeFrustum().

Plane salt::Frustum::mPlanes[6]
 

the 6 plane equations

Definition at line 77 of file frustum.h.

Referenced by oxygen::Camera::DescribeFrustum(), Dump(), Intersects(), and Set().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:48:57 2006 for rcssserver3d by  doxygen 1.4.4