Track::AxisAlignedBoundingBox Class Reference

A three dimensional volume that can be expressed as a cuboid, where each face is perpendicular to an axis. More...

#include <AxisAlignedBoundingBox.h>

List of all members.

Public Member Functions

 AxisAlignedBoundingBox ()
 Create a new bounding box.
virtual ~AxisAlignedBoundingBox ()
void operator|= (const btVector3 &point)
 Include a point in the bounding box, expanding as necessary.
void operator|= (const AxisAlignedBoundingBox &other)
 include another axis aligned bounding box.
void add_border (btScalar size)
 Add some padding around each side of the box.
bool valid () const
 Check if the bounding box contains at least one point.
btScalar get_max_x () const
 The largest x coordinate in the volume.
btScalar get_max_y () const
 The largest y coordinate in the volume.
btScalar get_max_z () const
 The largest z coordinate in the volume.
btScalar get_min_x () const
 The minimum x coordinate in the volume.
btScalar get_min_y () const
 The minimum y coordinate in the volume.
btScalar get_min_z () const
 The minimum z coordinate in the volume.
btVector3 get_min () const
 Get all the minimum coordinates in the volume.
btVector3 get_max () const
 Get all the maximum coordinates in the volume.
btVector3 get_extent () const
 Get the length of the bounding box in each direction.
AxisAlignedBoundingBox transform (btTransform transform) const
 Find the minimum axis aligned bounding box of a transformed bounding box.

Protected Attributes

btVector3 min
 All the minimum coordinates.
btVector3 max
 All the maximum coordinates.


Detailed Description

A three dimensional volume that can be expressed as a cuboid, where each face is perpendicular to an axis.

It is generally used to find the extents of some object.

For example:

 AxisAlignedBoundingBox box;
btVector3 vertex;
...
box |= vertex; 
Then box is expanded to include vertex. If all vertices were added this way, then box would be the bounding volume.

You can take a newly created bounding box and operator&= all the vertices of your object to find its bounding volume.

Definition at line 38 of file AxisAlignedBoundingBox.h.


Constructor & Destructor Documentation

Track::AxisAlignedBoundingBox::AxisAlignedBoundingBox (  ) 

Create a new bounding box.

It is empty until you add vertices into it.

Definition at line 20 of file AxisAlignedBoundingBox.cpp.

Track::AxisAlignedBoundingBox::~AxisAlignedBoundingBox (  )  [virtual]

Definition at line 28 of file AxisAlignedBoundingBox.cpp.


Member Function Documentation

void Track::AxisAlignedBoundingBox::add_border ( btScalar  size  ) 

Add some padding around each side of the box.

Parameters:
size the width to add around the edge of the box.

Definition at line 45 of file AxisAlignedBoundingBox.cpp.

btVector3 Track::AxisAlignedBoundingBox::get_extent (  )  const

Get the length of the bounding box in each direction.

Definition at line 100 of file AxisAlignedBoundingBox.cpp.

btVector3 Track::AxisAlignedBoundingBox::get_max (  )  const

Get all the maximum coordinates in the volume.

Definition at line 95 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_max_x (  )  const

The largest x coordinate in the volume.

Definition at line 60 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_max_y (  )  const

The largest y coordinate in the volume.

Definition at line 65 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_max_z (  )  const

The largest z coordinate in the volume.

Definition at line 70 of file AxisAlignedBoundingBox.cpp.

btVector3 Track::AxisAlignedBoundingBox::get_min (  )  const

Get all the minimum coordinates in the volume.

Definition at line 90 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_min_x (  )  const

The minimum x coordinate in the volume.

Definition at line 75 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_min_y (  )  const

The minimum y coordinate in the volume.

Definition at line 80 of file AxisAlignedBoundingBox.cpp.

btScalar Track::AxisAlignedBoundingBox::get_min_z (  )  const

The minimum z coordinate in the volume.

Definition at line 85 of file AxisAlignedBoundingBox.cpp.

void Track::AxisAlignedBoundingBox::operator|= ( const AxisAlignedBoundingBox other  ) 

include another axis aligned bounding box.

Definition at line 39 of file AxisAlignedBoundingBox.cpp.

void Track::AxisAlignedBoundingBox::operator|= ( const btVector3 &  point  ) 

Include a point in the bounding box, expanding as necessary.

Parameters:
point point to include in the box.

Definition at line 33 of file AxisAlignedBoundingBox.cpp.

AxisAlignedBoundingBox Track::AxisAlignedBoundingBox::transform ( btTransform  transform  )  const

Find the minimum axis aligned bounding box of a transformed bounding box.

The box may not be minimal for it's original contents, because the details inside the box are lost. Chaining transformations of Axis aligned bounding boxes together will make the box increasingly large. It is recommended to use this only on an original object aligned bounding box to transform it to world space.

Definition at line 105 of file AxisAlignedBoundingBox.cpp.

bool Track::AxisAlignedBoundingBox::valid (  )  const

Check if the bounding box contains at least one point.

Returns:
true if the bouding box contains at least one point, false if it has been created without adding any points, or a negative border has been applied that inverses the volume.

Definition at line 52 of file AxisAlignedBoundingBox.cpp.


Member Data Documentation

btVector3 Track::AxisAlignedBoundingBox::max [protected]

All the maximum coordinates.

Definition at line 101 of file AxisAlignedBoundingBox.h.

btVector3 Track::AxisAlignedBoundingBox::min [protected]

All the minimum coordinates.

Definition at line 99 of file AxisAlignedBoundingBox.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.