#include <AxisAlignedBoundingBox.h>
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. |
It is generally used to find the extents of some object.
For example:
AxisAlignedBoundingBox box; btVector3 vertex; ... box |= vertex;
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.
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.
void Track::AxisAlignedBoundingBox::add_border | ( | btScalar | size | ) |
Add some padding around each side of the box.
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 |
btScalar Track::AxisAlignedBoundingBox::get_max_y | ( | ) | const |
btScalar Track::AxisAlignedBoundingBox::get_max_z | ( | ) | const |
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 |
btScalar Track::AxisAlignedBoundingBox::get_min_y | ( | ) | const |
btScalar Track::AxisAlignedBoundingBox::get_min_z | ( | ) | const |
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.
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.
Definition at line 52 of file AxisAlignedBoundingBox.cpp.
btVector3 Track::AxisAlignedBoundingBox::max [protected] |
btVector3 Track::AxisAlignedBoundingBox::min [protected] |
Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.