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

salt::AABB3 Class Reference

AABB3 provides an axis aligned three dimensional bounding box. More...

#include <bounds.h>

Collaboration diagram for salt::AABB3:

Collaboration graph
[legend]
List of all members.

Public Member Functions

f_inline AABB3 ()
 constructs an empty bounding box
f_inline AABB3 (const Vector3f &mn, const Vector3f &mx)
 constructs a bounding box encapsulating mn and mx
f_inline void Init ()
 sets minVec and maxVec to describe an empty bounding box
f_inline void Encapsulate (const Vector3f &v)
 encapsulates the Vector v, growing the box if necessary
f_inline void Encapsulate (const float x, const float y, const float z)
 encapsulates the Vector <x,y,z>, growing the box if necessary
f_inline void Encapsulate (const AABB3 &box)
 encapsulates another box, growing the box if necessary
f_inline void Widen (float delta)
 grows the box evenly with delta along all axis
f_inline void Translate (const Vector3f &v)
 moves the box along the vector v
f_inline bool Contains (const Vector3f &v) const
 returns true if he box contains the vector v
f_inline bool Contains (const AABB3 &b) const
 returns true if the box contains the box b
f_inline bool Intersects (const AABB3 &b) const
 returns true if this box and the box b have some space in common
f_inline float GetWidth () const
 calculates the current width of the box
f_inline float GetHeight () const
 calculates the current height of the box
f_inline float GetDepth () const
 calculates the current depth of the box
f_inline Vector3f GetMiddle () const
 calculates the center point of the box
f_inline float GetRadius () const
 calculates the distance from the center point to one of the corners, i.e the radius of the bounding sphere through the center.
void TransformBy (Matrix &matrix)

Public Attributes

Vector3f minVec
 a vector describing the lower corner of the box
Vector3f maxVec
 a vector describing the higher corner of the box

Detailed Description

AABB3 provides an axis aligned three dimensional bounding box.

Definition at line 39 of file bounds.h.


Constructor & Destructor Documentation

f_inline salt::AABB3::AABB3  )  [inline]
 

constructs an empty bounding box

Definition at line 45 of file bounds.h.

References Init().

Here is the call graph for this function:

f_inline salt::AABB3::AABB3 const Vector3f mn,
const Vector3f mx
[inline]
 

constructs a bounding box encapsulating mn and mx

Definition at line 48 of file bounds.h.

References Encapsulate(), and Init().

Here is the call graph for this function:


Member Function Documentation

f_inline bool salt::AABB3::Contains const AABB3 b  )  const [inline]
 

returns true if the box contains the box b

Definition at line 102 of file bounds.h.

References Contains(), maxVec, and minVec.

Here is the call graph for this function:

f_inline bool salt::AABB3::Contains const Vector3f v  )  const [inline]
 

returns true if he box contains the vector v

Definition at line 96 of file bounds.h.

References salt::gInRange(), maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Referenced by Contains().

Here is the call graph for this function:

f_inline void salt::AABB3::Encapsulate const AABB3 box  )  [inline]
 

encapsulates another box, growing the box if necessary

Definition at line 78 of file bounds.h.

References Encapsulate(), maxVec, and minVec.

Here is the call graph for this function:

f_inline void salt::AABB3::Encapsulate const float  x,
const float  y,
const float  z
[inline]
 

encapsulates the Vector <x,y,z>, growing the box if necessary

Definition at line 69 of file bounds.h.

References salt::gMax(), salt::gMin(), maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

f_inline void salt::AABB3::Encapsulate const Vector3f v  )  [inline]
 

encapsulates the Vector v, growing the box if necessary

Definition at line 60 of file bounds.h.

References salt::gMax(), salt::gMin(), maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Referenced by AABB3(), kerosin::StaticMesh::CalcBoundingBox(), Encapsulate(), TransformBy(), and oxygen::BaseNode::UpdateHierarchy().

Here is the call graph for this function:

f_inline float salt::AABB3::GetDepth  )  const [inline]
 

calculates the current depth of the box

Definition at line 120 of file bounds.h.

References salt::gAbs(), maxVec, minVec, and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

f_inline float salt::AABB3::GetHeight  )  const [inline]
 

calculates the current height of the box

Definition at line 116 of file bounds.h.

References salt::gAbs(), maxVec, minVec, and salt::TVector3< DATATYPE, TYPE >::y().

Here is the call graph for this function:

f_inline Vector3f salt::AABB3::GetMiddle  )  const [inline]
 

calculates the center point of the box

Definition at line 124 of file bounds.h.

References maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

f_inline float salt::AABB3::GetRadius  )  const [inline]
 

calculates the distance from the center point to one of the corners, i.e the radius of the bounding sphere through the center.

Definition at line 132 of file bounds.h.

References maxVec, and minVec.

f_inline float salt::AABB3::GetWidth  )  const [inline]
 

calculates the current width of the box

Definition at line 112 of file bounds.h.

References salt::gAbs(), maxVec, minVec, and salt::TVector3< DATATYPE, TYPE >::x().

Here is the call graph for this function:

f_inline void salt::AABB3::Init  )  [inline]
 

sets minVec and maxVec to describe an empty bounding box

Definition at line 54 of file bounds.h.

References maxVec, minVec, and salt::TVector3< DATATYPE, TYPE >::Set().

Referenced by AABB3(), and kerosin::StaticMesh::CalcBoundingBox().

Here is the call graph for this function:

f_inline bool salt::AABB3::Intersects const AABB3 b  )  const [inline]
 

returns true if this box and the box b have some space in common

Definition at line 106 of file bounds.h.

References maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:

void AABB3::TransformBy Matrix matrix  ) 
 

Definition at line 27 of file bounds.cpp.

References Encapsulate(), maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::Set(), salt::Matrix::Transform(), salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Referenced by oxygen::BaseNode::UpdateHierarchy().

Here is the call graph for this function:

f_inline void salt::AABB3::Translate const Vector3f v  )  [inline]
 

moves the box along the vector v

Definition at line 92 of file bounds.h.

References maxVec, and minVec.

f_inline void salt::AABB3::Widen float  delta  )  [inline]
 

grows the box evenly with delta along all axis

Definition at line 82 of file bounds.h.

References maxVec, minVec, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z().

Here is the call graph for this function:


Member Data Documentation

Vector3f salt::AABB3::maxVec
 

a vector describing the higher corner of the box

Definition at line 145 of file bounds.h.

Referenced by salt::Plane::ClassifyBox(), kerosin::Light::ComputeBoundingBox(), oxygen::BaseNode::ComputeBoundingBox(), Contains(), salt::BoundingSphere::Contains(), Encapsulate(), GetDepth(), GetHeight(), GetMiddle(), GetRadius(), GetWidth(), Init(), Intersects(), salt::BoundingSphere::Intersects(), TransformBy(), Translate(), and Widen().

Vector3f salt::AABB3::minVec
 

a vector describing the lower corner of the box

Definition at line 142 of file bounds.h.

Referenced by salt::Plane::ClassifyBox(), kerosin::Light::ComputeBoundingBox(), oxygen::BaseNode::ComputeBoundingBox(), Contains(), salt::BoundingSphere::Contains(), Encapsulate(), GetDepth(), GetHeight(), GetMiddle(), GetRadius(), GetWidth(), Init(), Intersects(), salt::BoundingSphere::Intersects(), TransformBy(), Translate(), and Widen().


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