#include <CCollisionAABBBox.h>
Public Member Functions | |
cCollisionAABBBox () | |
Default constructor of cCollisionAABBBox. | |
cCollisionAABBBox (const cVector3d &a_min, const cVector3d &a_max) | |
Constructor of cCollisionAABBBox. | |
virtual | ~cCollisionAABBBox () |
Destructor of cCollisionAABBBox. | |
cVector3d | getCenter () const |
Return the center of the bounding box. | |
cVector3d | getExtent () const |
Return the extent (half the width) of the bounding box. | |
void | setCenter (const cVector3d &a_center) |
Set the center of the bounding box. | |
void | setExtent (const cVector3d &a_extent) |
Set the extent (half the width) of the bounding box. | |
void | setValue (const cVector3d &a_min, const cVector3d &a_max) |
Set the center and extent of the box based on two points. | |
bool | contains (const cVector3d &a_p) const |
void | enclose (const cCollisionAABBBox &a_boxA, const cCollisionAABBBox &a_boxB) |
void | enclose (const cVector3d &a_point) |
void | enclose (const cCollisionAABBBox &a_box) |
Modify the bounding box to bound another box. | |
void | setEmpty () |
Initialize a bounding box to center at origin and infinite extent. | |
double | getLowerX () const |
Return the smallest coordinate along X axis. | |
double | getUpperX () const |
Return the largest coordinate along X axis. | |
double | getLowerY () const |
Return the smallest coordinate along Y axis. | |
double | getUpperY () const |
Return the largest coordinate along Y axis. | |
double | getLowerZ () const |
Return the smallest coordinate along Z axis. | |
double | getUpperZ () const |
Return the largest coordinate along Z axis. | |
double | size () const |
Return the length of the longest axis of the bounding box. | |
int | longestAxis () const |
void | render () |
Draw the edges of the bounding box. | |
Public Attributes | |
cVector3d | m_center |
The center of the bounding box. | |
cVector3d | m_extent |
The extent (half the width) of the bounding box. | |
cVector3d | m_min |
The minimum point (along each axis) of the bounding box. | |
cVector3d | m_max |
The maximum point (along each axis) of the bounding box. |
bool cCollisionAABBBox::contains | ( | const cVector3d & | a_p | ) | const [inline] |
Test whether this box contains the given point.
void cCollisionAABBBox::enclose | ( | const cVector3d & | a_point | ) | [inline] |
Modify the bounding box as needed to bound the given point.
a_point | The point to be bounded. |
void cCollisionAABBBox::enclose | ( | const cCollisionAABBBox & | a_boxA, | |
const cCollisionAABBBox & | a_boxB | |||
) | [inline] |
Set the bounding box to bound the two given bounding boxes.
a_boxA | The first bounding box to be enclosed. | |
a_boxB | The other bounding box to be enclosed. |
int cCollisionAABBBox::longestAxis | ( | ) | const [inline] |
Return the index of the longest axis of the bounding box.