Drake
Drake C++ Documentation
Obb Class Reference

#include <drake/geometry/proximity/obb.h>

Public Types

template<typename MeshType >
using Maker = ObbMaker< MeshType >
 The class used for various creation operations on this bounding volume. More...
 

Public Member Functions

 Obb (const math::RigidTransformd &X_HB, const Vector3< double > &half_width)
 Constructs an oriented 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 – equivalent to the position vector from the box's center Bo to the box's first octant (+,+,+) corner U expressed in the box's frame B: p_BoU_B. More...
 
const 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 Obb &other) const
 Compares the values of the two Obb instances for exact equality down to the last bit. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Obb (const Obb &)=default
 
Obboperator= (const Obb &)=default
 
 Obb (Obb &&)=default
 
Obboperator= (Obb &&)=default
 

Static Public Member Functions

static bool HasOverlap (const Obb &a_G, const Obb &b_H, const math::RigidTransformd &X_GH)
 Reports whether the two oriented bounding boxes a_G and b_H intersect. More...
 
static bool HasOverlap (const Obb &obb_G, const Aabb &aabb_H, const math::RigidTransformd &X_GH)
 Reports whether oriented bounding box obb_G intersects the given axis-aligned bounding box aabb_H. More...
 
static bool HasOverlap (const Obb &bv_H, const internal::Plane< double > &plane_P, const math::RigidTransformd &X_PH)
 (Internal use only) Checks whether bounding volume bv intersects the given plane. More...
 
static bool HasOverlap (const Obb &bv_H, const HalfSpace &hs_C, const math::RigidTransformd &X_CH)
 Checks whether bounding volume bv intersects the given half space. More...
 

Friends

class ObbTester
 

Member Typedef Documentation

◆ Maker

using Maker = ObbMaker<MeshType>

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

Constructor & Destructor Documentation

◆ Obb() [1/3]

Obb ( const Obb )
default

◆ Obb() [2/3]

Obb ( Obb &&  )
default

◆ Obb() [3/3]

Obb ( const math::RigidTransformd &  X_HB,
const Vector3< double > &  half_width 
)

Constructs an oriented bounding box measured and expressed in frame H.

Parameters
X_HBThe pose of the box in the hierarchy 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.
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 Obb other) const

Compares the values of the two Obb 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 – equivalent to the position vector from the box's center Bo to the box's first octant (+,+,+) corner U expressed in the box's frame B: p_BoU_B.

◆ HasOverlap() [1/4]

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

Reports whether the two oriented 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 oriented box.
b_HThe second oriented box.
X_GHThe relative pose between hierarchy frame G and hierarchy frame H.
Returns
true if the boxes intersect.

◆ HasOverlap() [2/4]

static bool HasOverlap ( const Obb obb_G,
const Aabb aabb_H,
const math::RigidTransformd &  X_GH 
)
static

Reports whether oriented bounding box obb_G intersects the given axis-aligned bounding box aabb_H.

The poses of obb_G and aabb_H are defined in their corresponding hierarchy frames G and H, respectively.

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

◆ HasOverlap() [3/4]

static bool HasOverlap ( const Obb bv_H,
const internal::Plane< double > &  plane_P,
const math::RigidTransformd &  X_PH 
)
static

(Internal use only) Checks whether bounding volume bv intersects the given plane.

The bounding volume is centered on its canonical frame B, and B is posed in the corresponding hierarchy frame H. The plane is defined in frame P.

The box and plane intersect if any point within the bounding volume has zero height (see CalcHeight()).

Parameters
bv_HThe bounding box to test.
plane_PThe plane to test against the bv. The plane is expressed in frame P, therefore, to evaluate the height of a point with respect to it, that point must be measured and expressed in P.
X_PHThe relative pose between the hierarchy frame H and the plane frame P.
Returns
true if the plane intersects the box.

◆ HasOverlap() [4/4]

static bool HasOverlap ( const Obb 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).

Parameters
bv_HThe bounding box to test.
hs_CThe 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_CHThe relative pose between the hierarchy frame H and the half space canonical frame C.
Returns
true if the half space intersects the box.

◆ operator=() [1/2]

Obb& operator= ( Obb &&  )
default

◆ operator=() [2/2]

Obb& operator= ( const Obb )
default

◆ pose()

const math::RigidTransformd& pose ( ) const

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

Friends And Related Function Documentation

◆ ObbTester

friend class ObbTester
friend

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