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

salt::AABB2 Class Reference

AABB2 provides an axis aligned two dimensional bounding box. More...

#include <bounds.h>

Collaboration diagram for salt::AABB2:

Collaboration graph
[legend]
List of all members.

Public Member Functions

f_inline AABB2 ()
 constructs an empty bounding box
f_inline AABB2 (const Vector2f &mn, const Vector2f &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 Vector2f &v)
 encapsulates the Vector v, growing the box if necessary
f_inline void Encapsulate (const AABB2 &box)
 encapsulates another box, growing the box if necessary
f_inline void Widen (float delta)
 grows the box evenly with delta along both axis
f_inline void Translate (const Vector2f &v)
 moves the box along the vector v
f_inline bool Contains (const Vector2f &v) const
 returns true if he box contains the vector v
f_inline bool Contains (const AABB2 &b) const
 returns true if the box contains the box b
f_inline bool Intersects (const AABB2 &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 Vector2f 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.

Public Attributes

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

Detailed Description

AABB2 provides an axis aligned two dimensional bounding box.

Definition at line 149 of file bounds.h.


Constructor & Destructor Documentation

f_inline salt::AABB2::AABB2  )  [inline]
 

constructs an empty bounding box

Definition at line 155 of file bounds.h.

References Init().

Here is the call graph for this function:

f_inline salt::AABB2::AABB2 const Vector2f mn,
const Vector2f mx
[inline]
 

constructs a bounding box encapsulating mn and mx

Definition at line 159 of file bounds.h.

References Encapsulate(), and Init().

Here is the call graph for this function:


Member Function Documentation

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

returns true if the box contains the box b

Definition at line 192 of file bounds.h.

References Contains(), maxVec, and minVec.

Here is the call graph for this function:

f_inline bool salt::AABB2::Contains const Vector2f v  )  const [inline]
 

returns true if he box contains the vector v

Definition at line 188 of file bounds.h.

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

Referenced by SoccerRuleAspect::ClearPlayers(), Contains(), SoccerRuleAspect::DropBall(), CatchEffector::Realize(), and SoccerRuleAspect::UpdateGoalKick().

Here is the call graph for this function:

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

encapsulates another box, growing the box if necessary

Definition at line 176 of file bounds.h.

References Encapsulate(), maxVec, and minVec.

Here is the call graph for this function:

f_inline void salt::AABB2::Encapsulate const Vector2f v  )  [inline]
 

encapsulates the Vector v, growing the box if necessary

Definition at line 169 of file bounds.h.

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

Referenced by AABB2(), and Encapsulate().

Here is the call graph for this function:

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

calculates the current height of the box

Definition at line 209 of file bounds.h.

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

Here is the call graph for this function:

f_inline Vector2f salt::AABB2::GetMiddle  )  const [inline]
 

calculates the center point of the box

Definition at line 214 of file bounds.h.

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

Here is the call graph for this function:

f_inline float salt::AABB2::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 220 of file bounds.h.

References maxVec, and minVec.

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

calculates the current width of the box

Definition at line 204 of file bounds.h.

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

Here is the call graph for this function:

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

sets minVec and maxVec to describe an empty bounding box

Definition at line 165 of file bounds.h.

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

Referenced by AABB2().

Here is the call graph for this function:

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

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

Definition at line 196 of file bounds.h.

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

Here is the call graph for this function:

f_inline void salt::AABB2::Translate const Vector2f v  )  [inline]
 

moves the box along the vector v

Definition at line 184 of file bounds.h.

References maxVec, and minVec.

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

grows the box evenly with delta along both axis

Definition at line 180 of file bounds.h.

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

Here is the call graph for this function:


Member Data Documentation

Vector2f salt::AABB2::maxVec
 

a vector describing the higher corner of the box

Definition at line 229 of file bounds.h.

Referenced by SoccerRuleAspect::ClearPlayers(), Contains(), SoccerRuleAspect::DropBall(), Encapsulate(), GetHeight(), GetMiddle(), GetRadius(), GetWidth(), Init(), Intersects(), Translate(), and Widen().

Vector2f salt::AABB2::minVec
 

a vector describing the lower corner of the box

Definition at line 226 of file bounds.h.

Referenced by SoccerRuleAspect::ClearPlayers(), Contains(), SoccerRuleAspect::DropBall(), Encapsulate(), GetHeight(), GetMiddle(), GetRadius(), GetWidth(), Init(), Intersects(), Translate(), and Widen().


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