|
| Aabb () |
|
| Aabb (const Vector3 ¢er, const Vector3 &halfSize) |
|
bool | contains (const Aabb &other) const |
| Tests whether another box contained by this box.
|
|
bool | contains (const Vector3 &v) const |
| Tests whether the given point contained by this box.
|
|
Real | distance (const Vector3 &v) const |
| Returns the minimum distance between a given point and any part of the box.
|
|
Vector3 | getMaximum () const |
| Gets the maximum corner of the box.
|
|
Vector3 | getMinimum () const |
| Gets the minimum corner of the box.
|
|
Real | getRadius () const |
| Returns the radius of a sphere enclosing the aabb from the outside at center mCenter.
|
|
Real | getRadiusOrigin () const |
| Returns the radius of a sphere enclosing the aabb from origin as center.
|
|
Vector3 | getSize () const |
| Gets the size of the box.
|
|
Aabb | intersection (const Aabb &b2) const |
| Calculate the area of intersection of this box and another.
|
|
bool | intersects (const Aabb &b2) const |
| Returns whether or not this box intersects another.
|
|
void | merge (const Aabb &rhs) |
| Merges the passed in box into the current box.
|
|
void | merge (const Vector3 &points) |
| Extends the box to encompass the specified point (if needed).
|
|
bool | operator!= (const Aabb &_r) const |
|
bool | operator== (const Aabb &_r) const |
|
void | setExtents (const Vector3 &min, const Vector3 &max) |
| Sets both minimum and maximum extents at once.
|
|
Real | squaredDistance (const Vector3 &v) const |
| Returns the square of the minimum distance between a given point and any part of the box.
|
|
void | transformAffine (const Matrix4 &matrix) |
| Transforms the box according to the matrix supplied.
|
|
Real | volume () const |
| Calculate the volume of this box.
|
|
AoS (array of structures) version of ArrayAabb.
This class also deprecates AxisAlignedBox. It's A 3D box aligned with the x/y/z axes.
- For performance reasons given the mathematical properties, this version stores the box in the form "center + halfSize" instead of the form "minimum, maximum" that is present in AxisAlignedBox:
- Merging is slightly more expensive
- intersects() is much cheaper
- Naturally deals with infinite boxes (no need for branches)
- Transform is cheaper (a common operation)
- This class represents a simple box which is aligned with the axes. Internally it only stores 2 points as the center of the box, and the half of the width, height, and depth. This class is typically used for an axis-aligned bounding box (AABB) for collision and visibility determination.
- Main differences with AxisAlignedBox:
- Aabb doesn't support null boxes as AxisAlignedBox did. Although if the center iszero and half size is set to negative infinity, it may mimic the behavior. Another possibility is to just use NaNs, because they would cause false on all tests. However this would be horrible slow.
- BOX_INFINITE represents a truly infinite box and behaves exactly the same as an infinite AxisAlignedBox. However, setting the latter to infinite still holds information in min & max variables, while aabb destroys all information present.
- Note
- This is a POD data structure.