This structure implements the boundary nodes of an axis-aligned bounding box.
More...
#include <CCollisionAABBBox.h>
This structure implements the data variables and methods necessary to model an axis-aligned bounding box. These methods are used by the general AABB collision detection algorithm (See class cCollisionAABB).
chai3d::cCollisionAABBBox::cCollisionAABBBox |
( |
| ) |
|
|
inline |
chai3d::cCollisionAABBBox::cCollisionAABBBox |
( |
const cVector3d & |
a_min, |
|
|
const cVector3d & |
a_max |
|
) |
| |
|
inline |
virtual chai3d::cCollisionAABBBox::~cCollisionAABBBox |
( |
| ) |
|
|
inlinevirtual |
cVector3d chai3d::cCollisionAABBBox::getCenter |
( |
| ) |
const |
|
inline |
This method returns the center of the boundary box.
- Returns
- Center of boundary box.
cVector3d chai3d::cCollisionAABBBox::getExtent |
( |
| ) |
const |
|
inline |
This method returns the extent (half the width) of the boundary box.
- Returns
- Extent of boundary box
void chai3d::cCollisionAABBBox::setCenter |
( |
const cVector3d & |
a_center | ) |
|
|
inline |
This method sets the center of the boundary box.
- Parameters
-
a_center | Center of boundary box. |
void chai3d::cCollisionAABBBox::setExtent |
( |
const cVector3d & |
a_extent | ) |
|
|
inline |
This method sets the extent (half the width) of the boundary box.
- Parameters
-
a_extent | Boundary box extent. |
void chai3d::cCollisionAABBBox::setValue |
( |
const cVector3d & |
a_min, |
|
|
const cVector3d & |
a_max |
|
) |
| |
|
inline |
This method initializes the boundary box by passing a minimum and maximum point passed as arguments.
- Parameters
-
a_min | Minimum point of boundary box. |
a_max | Maximum point of boundary box. |
This method determines whether this box and an input box passed as argument intersect each other.
- Parameters
-
- Returns
- true if the input box overlaps this box, false otherwise.
bool chai3d::cCollisionAABBBox::intersect |
( |
const cVector3d & |
a_segmentPointA, |
|
|
const cVector3d & |
a_segmentPointB |
|
) |
| const |
|
inline |
This method determines whether the given ray intersects the boundary box. Based on code by Andrew Woo from "Graphics Gems", Academic Press, 1990.
- Parameters
-
a_segmentPointA | Initial point of segment. |
a_segmentPointB | End point of segment. |
- Returns
- true if line segment intersects the boundary box, false otherwise.
bool chai3d::cCollisionAABBBox::contains |
( |
const cVector3d & |
a_point | ) |
const |
|
inline |
This method tests whether this box contains a point a_point
passed as argument.
- Parameters
-
a_point | Point to be tested. |
- Returns
- true if this box contains this point, false otherwise.
This method initializes the boundary box to bound two given boundary boxes passed as argument.
- Parameters
-
a_boxA | The first boundary box to be enclosed. |
a_boxB | The second boundary box to be enclosed. |
void chai3d::cCollisionAABBBox::enclose |
( |
const cVector3d & |
a_point | ) |
|
|
inline |
This method resizes the boundary box to bound a new point a_point
passed as argument.
- Parameters
-
a_point | Point to be enclosed. |
This method resizes the boundary box to bound a new point passed as argument.
- Parameters
-
a_box | Box to be enclosed in this boundary box. |
void chai3d::cCollisionAABBBox::setEmpty |
( |
| ) |
|
|
inline |
This method empties this boundary box.
double chai3d::cCollisionAABBBox::getLowerX |
( |
| ) |
const |
|
inline |
This method returns the smallest coordinate along X axis.
- Returns
- Smallest coordinate along X axis.
double chai3d::cCollisionAABBBox::getUpperX |
( |
| ) |
const |
|
inline |
This method returns the largest coordinate along X axis.
- Returns
- Largest coordinate along X axis.
double chai3d::cCollisionAABBBox::getLowerY |
( |
| ) |
const |
|
inline |
This method returns the smallest coordinate along Y axis.
- Returns
- Smallest coordinate along Y axis.
double chai3d::cCollisionAABBBox::getUpperY |
( |
| ) |
const |
|
inline |
This method returns the largest coordinate along Y axis.
- Returns
- Largest coordinate along Y axis.
double chai3d::cCollisionAABBBox::getLowerZ |
( |
| ) |
const |
|
inline |
This returns the smallest coordinate along Z axis.
- Returns
- Smallest coordinate along Z axis.
double chai3d::cCollisionAABBBox::getUpperZ |
( |
| ) |
const |
|
inline |
This method return the largest coordinate along Z axis.
- Returns
- Largest coordinate along Z axis.
int chai3d::cCollisionAABBBox::getLongestAxis |
( |
| ) |
const |
|
inline |
This method returns the index of the longest axis of the boundary box.
- Returns
- Index of the longest axis of the box.
void chai3d::cCollisionAABBBox::render |
( |
| ) |
|
|
inline |
This method renders graphically using OpenGL the edges of the boundary box.
cVector3d chai3d::cCollisionAABBBox::m_center |
cVector3d chai3d::cCollisionAABBBox::m_extent |
The documentation for this class was generated from the following file: