Axis-aligned bounding box.
The box is defined in a canonical frame B such that it is centered on Bo and its extents are aligned with B's axes. However, the box is posed in a hierarchical frame H. Because this is an axis-aligned bounding box, R_HB = I. Therefore the pose of the box is completely captured with p_HoBo_H (see center()).
Because of this, an instance of Aabb is a frame-dependent quantity and should be expressed that way. For example, for a mesh measured and expressed in frame M, the bounding boxes on its triangles will be measured and expressed in the same frame.
auto mesh_M = ...;
Aabb(const Aabb &)=default
|
| | Aabb (const Vector3< double > &p_HoBo, const Vector3< double > &half_width) |
| | Constructs an axis-aligned bounding box measured and expressed in frame H.
|
| const Vector3< double > & | center () const |
| | Returns the center of the box – equivalent to the position vector from the hierarchy frame's origin Ho to this box's origin Bo: p_HoBo_H.
|
| const Vector3< double > & | half_width () const |
| | Returns the half_width.
|
| Vector3< double > | lower () const |
| | The point on the axis-aligned box with the smallest measures along the Bx-, By-, and Bz-directions.
|
| Vector3< double > | upper () const |
| | The point on the axis-aligned box with the largest measures along the Bx-, By-, and Bz-directions.
|
| math::RigidTransformd | pose () const |
| | Returns the pose X_HB of the box frame B in the hierarchy frame H.
|
| double | CalcVolume () const |
| bool | Equal (const Aabb &other) const |
| | Compares the values of the two Aabb instances for exact equality down to the last bit.
|
| | Aabb (const Aabb &)=default |
| Aabb & | operator= (const Aabb &)=default |
| | Aabb (Aabb &&)=default |
| Aabb & | operator= (Aabb &&)=default |
|
| static bool | HasOverlap (const Aabb &a_G, const Aabb &b_H, const math::RigidTransformd &X_GH) |
| | Reports whether the two axis-aligned bounding boxes a_G and b_H intersect.
|
| static bool | HasOverlap (const Aabb &aabb_G, const Obb &obb_H, const math::RigidTransformd &X_GH) |
| | Reports whether axis-aligned bounding box aabb_G intersects the given oriented bounding box obb_H.
|
| static bool | HasOverlap (const Aabb &bv_H, const Plane< double > &plane_P, const math::RigidTransformd &X_PH) |
| | Checks whether bounding volume bv intersects the given plane.
|
| static bool | HasOverlap (const Aabb &bv_H, const HalfSpace &hs_C, const math::RigidTransformd &X_CH) |
| | Checks whether bounding volume bv intersects the given half space.
|
| bool HasOverlap |
( |
const Aabb & | bv_H, |
|
|
const HalfSpace & | hs_C, |
|
|
const math::RigidTransformd & | X_CH ) |
|
static |
Checks whether bounding volume bv intersects the given half space.
The bounding volume is centered on its canonical frame B, and B is posed in the corresponding hierarchy frame H. The half space is defined in its canonical frame C (such that the boundary plane of the half space is perpendicular to Cz and Co lies on the boundary plane).
The box and halfspace intersect if any point within the bounding volume has a height less than or equal to zero.
- Parameters
-
| bv_H | The bounding box to test. |
| hs_C | The half space to test against the bv. The half space is expressed in Frame C, therefore, to evaluate the signed distance of a point with respect to it, that point must be measured and expressed in C. |
| X_CH | The relative pose between the hierarchy halfspace canonical frame C and the box frame B. |
- Returns
- true if the half space intersects the box.