Drake
Drake C++ Documentation
Aabb Class Reference

Detailed Description

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 bv_M = ...; // A bounding volume for mesh_M 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. More...
 

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. More...
 
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. More...
 
const Vector3< double > & half_width () const
 Returns the half_width. More...
 
Vector3< doublelower () const
 The point on the axis-aligned box with the smallest measures along the Bx-, By-, and Bz-directions. More...
 
Vector3< doubleupper () const
 The point on the axis-aligned box with the largest measures along the Bx-, By-, and Bz-directions. More...
 
math::RigidTransformd pose () const
 Returns the pose X_HB of the box frame B in the hierarchy frame H. More...
 
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. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Aabb (const Aabb &)=default
 
Aabboperator= (const Aabb &)=default
 
 Aabb (Aabb &&)=default
 
Aabboperator= (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. More...
 
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. More...
 

Friends

template<typename >
class internal::BvhUpdater
 

Member Typedef Documentation

◆ Maker

using Maker = AabbMaker<MeshType>

The class used for various creation operations on this bounding volume.

Constructor & Destructor Documentation

◆ Aabb() [1/3]

Aabb ( const Aabb )
default

◆ Aabb() [2/3]

Aabb ( Aabb &&  )
default

◆ Aabb() [3/3]

Aabb ( const Vector3< double > &  p_HoBo,
const Vector3< double > &  half_width 
)

Constructs an axis-aligned bounding box measured and expressed in frame H.

Parameters
p_HoBoThe 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_widthThe 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.)
Precondition
half_width.x(), half_width.y(), half_width.z() are not negative.

Member Function Documentation

◆ CalcVolume()

double CalcVolume ( ) const
Returns
Volume of the bounding box.

◆ center()

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.

◆ Equal()

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.

◆ half_width()

const Vector3<double>& half_width ( ) const

Returns the half_width.

◆ HasOverlap() [1/2]

static bool HasOverlap ( const Aabb a_G,
const Aabb b_H,
const math::RigidTransformd &  X_GH 
)
static

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.

Parameters
a_GThe first axis-aligned box.
b_HThe second axis-aligned box.
X_GHThe relative pose between hierarchy frame G and hierarchy frame H.
Returns
true if the boxes intersect.

◆ HasOverlap() [2/2]

static bool HasOverlap ( const Aabb aabb_G,
const Obb obb_H,
const math::RigidTransformd &  X_GH 
)
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.

Parameters
aabb_GThe axis-aligned box.
obb_HThe oriented box.
X_GHThe relative pose between the aabb hierarchy frame G and the obb hierarchy frame H.
Returns
true if the boxes intersect.

◆ lower()

Vector3<double> lower ( ) const

The point on the axis-aligned box with the smallest measures along the Bx-, By-, and Bz-directions.

◆ operator=() [1/2]

Aabb& operator= ( Aabb &&  )
default

◆ operator=() [2/2]

Aabb& operator= ( const Aabb )
default

◆ pose()

math::RigidTransformd pose ( ) const

Returns the pose X_HB of the box frame B in the hierarchy frame H.

◆ upper()

Vector3<double> upper ( ) const

The point on the axis-aligned box with the largest measures along the Bx-, By-, and Bz-directions.

Friends And Related Function Documentation

◆ internal::BvhUpdater

friend class internal::BvhUpdater
friend

The documentation for this class was generated from the following file: