aabbcc
|
The axis-aligned bounding box object. More...
#include <AABB.h>
Public Member Functions | |
AABB () | |
Constructor. | |
AABB (unsigned int) | |
Constructor. More... | |
AABB (const std::vector< double > &, const std::vector< double > &) | |
Constructor. More... | |
double | computeSurfaceArea () const |
Compute the surface area of the box. | |
double | getSurfaceArea () const |
Get the surface area of the box. | |
void | merge (const AABB &, const AABB &) |
Merge two AABBs into this one. More... | |
bool | contains (const AABB &) const |
Test whether the AABB is contained within this one. More... | |
bool | overlaps (const AABB &) const |
Test whether the AABB overlaps this one. More... | |
std::vector< double > | computeCentre () |
Compute the centre of the AABB. More... | |
void | setDimension (unsigned int) |
Set the dimensionality of the AABB. More... | |
Public Attributes | |
std::vector< double > | lowerBound |
Lower bound of AABB in each dimension. | |
std::vector< double > | upperBound |
Upper bound of AABB in each dimension. | |
std::vector< double > | centre |
The position of the AABB centre. | |
double | surfaceArea |
The AABB's surface area. | |
The axis-aligned bounding box object.
Axis-aligned bounding boxes (AABBs) store information for the minimum orthorhombic bounding-box for an object in two- or three-dimensional space (the bounding box is either a rectangle, or rectangular prism).
Class member functions provide functionality for merging AABB objects and testing overlap with other AABBs.
aabb::AABB::AABB | ( | unsigned int | dimension | ) |
Constructor.
dimension | The dimensionality of the system. |
aabb::AABB::AABB | ( | const std::vector< double > & | lowerBound_, |
const std::vector< double > & | upperBound_ | ||
) |
Constructor.
lowerBound_ | The lower bound in each dimension. |
upperBound_ | The upper bound in each dimension. |
std::vector< double > aabb::AABB::computeCentre | ( | ) |
bool aabb::AABB::contains | ( | const AABB & | aabb | ) | const |
bool aabb::AABB::overlaps | ( | const AABB & | aabb | ) | const |
void aabb::AABB::setDimension | ( | unsigned int | dimension | ) |
Set the dimensionality of the AABB.
dimension | The dimensionality of the system. |