|
OOFEM 3.0
|
Axis-aligned bounding box. More...
#include <aabb.h>
Public Member Functions | |
| AABB ()=default | |
| Default constructor. | |
| AABB (const Vector &min, const Vector &max) | |
| Constructs an axis-aligned bounding box from corner coordinates. | |
| bool | contains (const Vector &v) |
| Checks whether a point is contained within the bounding box. | |
| bool | contains (double x, double y, double z) |
| void | merge (const Vector &v) |
| Expands the bounding box to include a given point. | |
| void | merge (double x, double y, double z) |
| Expands the bounding box to include a given point. | |
Public Attributes | |
| Vector | min |
| Vector | max |
Axis-aligned bounding box.
The AABB class represents an axis-aligned bounding box defined in global coordinates. It is primarily used in contact detection and spatial search algorithms to efficiently test for spatial proximity and overlap between geometric entities.
An AABB is characterized by its minimum and maximum corner coordinates aligned with the global coordinate axes. This alignment enables fast intersection tests and simple updates as objects move or deform.
The class provides basic operations for initializing, updating, and querying bounding boxes, and serves as a lightweight geometric utility within the contact and search infrastructure.
|
default |
Constructs an axis-aligned bounding box from corner coordinates.
Initializes the bounding box using the given minimum and maximum corner coordinates in global space.
| minCorner | Vector of minimum coordinates along each axis. |
| maxCorner | Vector of maximum coordinates along each axis. |
| bool oofem::AABB::contains | ( | const Vector & | v | ) |
Checks whether a point is contained within the bounding box.
Tests if the given point lies inside or on the boundary of this axis-aligned bounding box. The check is performed independently along each coordinate axis.
| v | Vector in global coordinates. |
Definition at line 63 of file aabb.C.
References min, oofem::Vector::x, oofem::Vector::y, and oofem::Vector::z.
| bool oofem::AABB::contains | ( | double | x, |
| double | y, | ||
| double | z ) |
Definition at line 81 of file aabb.C.
References contains().
| void oofem::AABB::merge | ( | const Vector & | v | ) |
Expands the bounding box to include a given point.
Updates the minimum and maximum corner coordinates of the bounding box such that the point v is contained within the box. For each coordinate direction, the bounds are enlarged only if the point lies outside the current extent.
| v | Point in global coordinates to be merged into the bounding box. |
Definition at line 93 of file aabb.C.
References max, min, oofem::Vector::x, oofem::Vector::y, and oofem::Vector::z.
Referenced by oofem::ContactElement::computeAABB(), and merge().
| void oofem::AABB::merge | ( | double | x, |
| double | y, | ||
| double | z ) |
Expands the bounding box to include a given point.
Updates the minimum and maximum corner coordinates of the bounding box such that the point v is contained within the box. For each coordinate direction, the bounds are enlarged only if the point lies outside the current extent.
| x | X-coordinate of the point. |
| y | Y-coordinate of the point. |
| z | Z-coordinate of the point. |
Definition at line 87 of file aabb.C.
References merge().
| Vector oofem::AABB::max |
| Vector oofem::AABB::min |
Definition at line 67 of file aabb.h.
Referenced by AABB(), AABB(), oofem::ContactPair::computeSlaveAABB(), contains(), and merge().