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.
#include <drake/geometry/proximity/aabb.h>
Public Types | |
| template<typename MeshType> | |
| using | Maker = AabbMaker<MeshType> |
| The class used for various creation operations on this bounding volume. | |
Public Member Functions | |
| 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. | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| Aabb (const Aabb &)=default | |
| Aabb & | operator= (const Aabb &)=default |
| Aabb (Aabb &&)=default | |
| Aabb & | operator= (Aabb &&)=default |
Static Public Member Functions | |
| 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. | |
Friends | |
| template<typename> | |
| class | internal::BvhUpdater |
The class used for various creation operations on this bounding volume.
Constructs an axis-aligned bounding box measured and expressed in frame H.
| p_HoBo | The position vector from the hierarchy frame's origin to the box's canonical origin, expressed in frame H. The box is centered on Bo and aligned with Bx, By, and Bz. |
| half_width | The half measures of the box in each of the Bx, By, and Bz directions. (Also the half measures in the Hx, Hy, and Hz directions because R_HB = I.) |
| double CalcVolume | ( | ) | 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.
| bool Equal | ( | const Aabb & | other | ) | const |
Compares the values of the two Aabb instances for exact equality down to the last bit.
Assumes that the quantities are measured and expressed in the same frame.
Reports whether the two axis-aligned bounding boxes a_G and b_H intersect.
The poses of a_G and b_H are defined in their corresponding hierarchy frames G and H, respectively.
| a_G | The first axis-aligned box. |
| b_H | The second axis-aligned box. |
| X_GH | The relative pose between hierarchy frame G and hierarchy frame H. |
|
static |
Reports whether axis-aligned bounding box aabb_G intersects the given oriented bounding box obb_H.
The poses of aabb_G and obb_H are defined in their corresponding hierarchy frames G and H, respectively.
| aabb_G | The axis-aligned box. |
| obb_H | The oriented box. |
| X_GH | The relative pose between the aabb hierarchy frame G and the obb hierarchy frame H. |
The point on the axis-aligned box with the smallest 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.
The point on the axis-aligned box with the largest measures along the Bx-, By-, and Bz-directions.
|
friend |