# cCollisionAABBBox Class Reference
[Collision Detection]

cCollisionAABBox contains the properties and methods of an axis-aligned bounding box, as used in the AABB collision detection algorithm. More...

`#include <CCollisionAABBBox.h>`

List of all members.

## 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.

## Detailed Description

cCollisionAABBox contains the properties and methods of an axis-aligned bounding box, as used in the AABB collision detection algorithm.

## Member Function Documentation

bool cCollisionAABBBox::contains | ( | const cVector3d & | a_p | ) | const`[inline]`

Test whether this box contains the given point.

Returns:
  Returns whether this box contains this point

void cCollisionAABBBox::enclose | ( | const cVector3d & | a_point | ) | `[inline]`

Modify the bounding box as needed to bound the given point.

Parameters:

  | 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.

Parameters:

  | 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.

Returns:
  Return the index of the longest axis of the box.

The documentation for this class was generated from the following file:

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/collisions/CCollisionAABBBox.h

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.