Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Frustum Class Reference

#include <frustum.h>

Inheritance diagram for Frustum:

Inheritance graph
[legend]
Collaboration diagram for Frustum:

Collaboration graph
[legend]
List of all members.

Detailed Description

Basic frustum data container.

This is a basic class holding data for a frustum. Plane normals and distances for all six frustum planes. Vertex signs used in culling octatree (or any bounding boxes).

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  FRUSTUMPLANE
 Frustum planes.


Public Member Functions

 Frustum ()
virtual bool Intersection (const Vector3d &rkPoint)
virtual bool Intersection (const Line &rkLine)
virtual bool Intersection (const Plane &rkPlane)
virtual bool Intersection (const Vector3d &rkV0, const Vector3d &rkV1, const Vector3d &rkV2, const Vector3d &rkNormal=Vector3d::ORIGO)
const Vector3dGetTranslation () const
const QuaternionGetRotation () const
float GetScaling () const
void Translate (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
void TranslateWorld (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
void Rotate (const Quaternion &rkRotation, bool bNotifyUpdate=true)
void RotateWorld (const Quaternion &rkRotation, bool bNotifyUpdate=true)
void Scale (float fScaling, bool bNotifyUpdate=true)
virtual void SetTranslation (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
virtual void SetRotation (const Quaternion &rkRotation, bool bNotifyUpdate=true)
virtual void SetScaling (float fScaling, bool bNotifyUpdate=true)

Public Attributes

unsigned char m_aiPVertexSign [6][3]
unsigned char m_aiNVertexSign [6][3]
Matrix m_kViewMatrix
Plane m_akPlanes [6]
Vector3d m_kDirection
float m_fZNear
float m_fZFar

Protected Attributes

float m_fScaling
Quaternion m_kRotation
Vector3d m_kTranslation


Constructor & Destructor Documentation

Frustum  ) 
 

Resets member data


Member Function Documentation

virtual bool Intersection const Vector3d rkPoint  )  [virtual]
 

Test if point is inside volume

Parameters:
rkPoint Point to check
Returns:
true if inside volume, false otherwise

virtual bool Intersection const Line rkLine  )  [virtual]
 

Test if line intersects with volume

Parameters:
rkLine Line to check
Returns:
true if intersection with volume, false otherwise

virtual bool Intersection const Plane rkPlane  )  [virtual]
 

Test if intersection with plane

Parameters:
rkPlane Plane to check
Returns:
true if intersection, false otherwise

virtual bool Intersection const Vector3d rkV0,
const Vector3d rkV1,
const Vector3d rkV2,
const Vector3d rkNormal = Vector3d::ORIGO
[virtual]
 

Test if intersection with polygon

Parameters:
rkV0 First corner
rkV1 Second corner
rkV2 Third corner
rkNormal Optional precalculated normal
Returns:
true if intersection, false otherwise

const Vector3d& GetTranslation  )  const [inline, inherited]
 

Returns:
Translation of this node

const Quaternion& GetRotation  )  const [inline, inherited]
 

Returns:
Rotation of this node

float GetScaling  )  const [inline, inherited]
 

Returns:
Uniform scaling factor

void Translate const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Translate node from current position, in local (along current rotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkTranslation Translation offset vector
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void TranslateWorld const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Translate node from current position, in world (along unrotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkTranslation Translation offset vector
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void Rotate const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Rotate node in local (current rotation) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkRotation Rotation quaternion
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void RotateWorld const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Rotate node in world (unrotated) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkRotation Rotation quaternion
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void Scale float  fScaling,
bool  bNotifyUpdate = true
[inline, inherited]
 

Scale node by uniform factor. Will use SetScaling for setting new scaling of node, derived classes do not need to overload this method directly. Must be >0, where a value of 1.0f indicates no scaling

Parameters:
fScaling Uniform scaling factor
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

virtual void SetTranslation const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set translation for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later.

Parameters:
rkTranslation New translation for node
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree

Reimplemented in HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.

virtual void SetRotation const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set rotation for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later.

Parameters:
rkRotation New rotation for node
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

Reimplemented in AABB, HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.

virtual void SetScaling float  fScaling,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set uniform scaling for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later. A value of 1.0f indicates no scaling.

Parameters:
fScaling New uniform scaling factor
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

Reimplemented in HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.


Member Data Documentation

unsigned char m_aiPVertexSign[6][3]
 

Vertex signs. These indicate which box corner in the AA box should be used as near and far vertex when culling against frustum during rendering. 6 planes in frustum as first index. Second index is vertex component, 0 = x, 1 = y, 2 = z. A value of 0 is positive and 1 is negative

unsigned char m_aiNVertexSign[6][3]
 

N is inverted P but precalculate to gain speed

Matrix m_kViewMatrix
 

The view matrix corresponding to this frustum

Plane m_akPlanes[6]
 

The equation data (normal and distance) for the 6 frustum planes

Vector3d m_kDirection
 

View vector (which is -zvector of rotation of course)

float m_fZNear
 

Near plane distance along m_kDirection

float m_fZFar
 

Far plane distance along m_kDirection

float m_fScaling [protected, inherited]
 

Uniform scaling factor (must be >0, default 1)

Quaternion m_kRotation [protected, inherited]
 

Rotation

Vector3d m_kTranslation [protected, inherited]
 

Translation


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:11 2004 for NeoEngine by doxygen 1.3.5