FUBoundingBox Class Reference
[Utility Classes.]

An axis-aligned bounding box. More...

#include <FUBoundingBox.h>

List of all members.

Public Member Functions

 FUBoundingBox ()
 Empty constructor.
 FUBoundingBox (const FMVector3 &minimum, const FMVector3 &maximum)
 Constructor.
 FUBoundingBox (const FUBoundingBox &copy)
 Copy constructor.
 ~FUBoundingBox ()
 Destructor.
void Reset ()
 Resets the bounding box.
bool IsValid () const
 Retrieves whether the bounding box contains valid information.
const FMVector3GetMin () const
 Retrieves the minimum bounds of the bounding box.
const FMVector3GetMax () const
 Retrieves the maximum bounds of the bounding box.
void SetMin (const FMVector3 &_min)
 Sets the minimum bounds of the bounding box.
void SetMax (const FMVector3 &_max)
 Sets the maximum bounds of the bounding box.
FMVector3 GetCenter () const
 Retrieves the center of the bounding box.
bool Contains (const FMVector3 &point) const
 Retrieves whether the bounding box contains a given 3D coordinate.
bool Overlaps (const FUBoundingBox &boundingBox, FMVector3 *overlapCenter=NULL) const
 Retrieves whether this bounding box overlaps a given bounding box.
bool Overlaps (const FUBoundingSphere &boundingSphere, FMVector3 *overlapCenter=NULL) const
 Retrieves whether this bounding box overlaps a given bounding sphere.
void Include (const FMVector3 &point)
 Extends the bounding box to include the given 3D coordinate.
void Include (const FUBoundingBox &boundingBox)
 Extends the bounding box to include another bounding box.
FUBoundingBox Transform (const FMMatrix44 &transform) const
 Transform the bounding box into another space basis.
bool Equals (const FUBoundingBox &right) const
 Evaluates if this bounding box is equal to the one at the RHS.

Static Public Attributes

static const FUBoundingBox Infinity
 Represents an infinite bounding box, including all space.


Detailed Description

An axis-aligned bounding box.


Constructor & Destructor Documentation

FUBoundingBox::FUBoundingBox  ) 
 

Empty constructor.

The minimum and maximum bounds are set at the largest and most impossible values.

FUBoundingBox::FUBoundingBox const FMVector3 minimum,
const FMVector3 maximum
 

Constructor.

Parameters:
minimum The minimum bounds of the bounding box.
maximum The maximum bounds of the bounding box.

FUBoundingBox::FUBoundingBox const FUBoundingBox copy  ) 
 

Copy constructor.

Parameters:
copy The bounding box to duplicate.


Member Function Documentation

bool FUBoundingBox::Contains const FMVector3 point  )  const
 

Retrieves whether the bounding box contains a given 3D coordinate.

Parameters:
point A 3D coordinate.
Returns:
Whether the coordinate is contained by the bounding box.

bool FUBoundingBox::Equals const FUBoundingBox right  )  const
 

Evaluates if this bounding box is equal to the one at the RHS.

Parameters:
right The bounding box to test against.
Returns:
True if the two boxes are equivalent.

FMVector3 FUBoundingBox::GetCenter  )  const [inline]
 

Retrieves the center of the bounding box.

Returns:
The center of the bounding box.

const FMVector3& FUBoundingBox::GetMax  )  const [inline]
 

Retrieves the maximum bounds of the bounding box.

Returns:
The maximum bounds.

const FMVector3& FUBoundingBox::GetMin  )  const [inline]
 

Retrieves the minimum bounds of the bounding box.

Returns:
The minimum bounds.

void FUBoundingBox::Include const FUBoundingBox boundingBox  ) 
 

Extends the bounding box to include another bounding box.

Parameters:
boundingBox A bounding box to include in this bounding box.

void FUBoundingBox::Include const FMVector3 point  ) 
 

Extends the bounding box to include the given 3D coordinate.

Parameters:
point A 3D coordinate to include in the bounding box.

bool FUBoundingBox::IsValid  )  const
 

Retrieves whether the bounding box contains valid information.

An invalid bounding box has a minimum value that is greater than the maximum value. Reseting the bounding box and the empty constructor generate invalid bounding boxes on purpose.

Returns:
The validity state of the bounding box.

bool FUBoundingBox::Overlaps const FUBoundingSphere boundingSphere,
FMVector3 overlapCenter = NULL
const
 

Retrieves whether this bounding box overlaps a given bounding sphere.

Parameters:
boundingSphere A bounding sphere.
overlapCenter An optional pointer to retrieve the center of the overlap region. For this particular case, there is no guarantee that this is the exact center of the overlap region.
Returns:
Whether this bounding box overlaps the bounding sphere.

bool FUBoundingBox::Overlaps const FUBoundingBox boundingBox,
FMVector3 overlapCenter = NULL
const
 

Retrieves whether this bounding box overlaps a given bounding box.

Parameters:
boundingBox A bounding box.
overlapCenter An optional pointer to retrieve the center of the overlap region.
Returns:
Whether the two bounding boxes overlap.

void FUBoundingBox::Reset  ) 
 

Resets the bounding box.

The minimum and maximum bounds are set at the largest and most impossible values. Including a freshly reset bounding box to a valid bounding box will have no effect.

void FUBoundingBox::SetMax const FMVector3 _max  )  [inline]
 

Sets the maximum bounds of the bounding box.

Parameters:
_max The new maximum bounds of the bounding box.

void FUBoundingBox::SetMin const FMVector3 _min  )  [inline]
 

Sets the minimum bounds of the bounding box.

Parameters:
_min The new minimum bounds of the bounding box.

FUBoundingBox FUBoundingBox::Transform const FMMatrix44 transform  )  const
 

Transform the bounding box into another space basis.

Parameters:
transform The transformation matrix to go into the other space basis.
Returns:
The transformed bounding box.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:40 2008 for FCollada by  doxygen 1.4.6-NO