Public Member Functions | Public Attributes | List of all members
fcl::OBB Class Reference

Oriented bounding box class. More...

#include <hpp/fcl/BV/OBB.h>

Public Member Functions

bool overlap (const OBB &other) const
 Check collision between two OBB. More...
 
bool overlap (const OBB &other, FCL_REAL &sqrDistLowerBound) const
 Check collision between two OBB. More...
 
bool overlap (const OBB &other, OBB &) const
 Check collision between two OBB and return the overlap part. For OBB, the overlap_part return value is NOT used as the overlap part of two obbs usually is not an obb. More...
 
bool contain (const Vec3f &p) const
 Check whether the OBB contains a point. More...
 
OBBoperator+= (const Vec3f &p)
 A simple way to merge the OBB and a point (the result is not compact). More...
 
OBBoperator+= (const OBB &other)
 Merge the OBB and another OBB (the result is not compact). More...
 
OBB operator+ (const OBB &other) const
 Return the merged OBB of current OBB and the other one (the result is not compact). More...
 
FCL_REAL width () const
 Width of the OBB. More...
 
FCL_REAL height () const
 Height of the OBB. More...
 
FCL_REAL depth () const
 Depth of the OBB. More...
 
FCL_REAL volume () const
 Volume of the OBB. More...
 
FCL_REAL size () const
 Size of the OBB (used in BV_Splitter to order two OBBs) More...
 
const Vec3fcenter () const
 Center of the OBB. More...
 
FCL_REAL distance (const OBB &other, Vec3f *P=NULL, Vec3f *Q=NULL) const
 Distance between two OBBs, not implemented. More...
 

Public Attributes

Matrix3f axes
 Orientation of OBB. More...
 
Vec3f To
 Center of OBB. More...
 
Vec3f extent
 Half dimensions of OBB. More...
 

Detailed Description

Oriented bounding box class.

Member Function Documentation

◆ center()

const Vec3f& fcl::OBB::center ( ) const
inline

Center of the OBB.

References distance(), fcl::obbDisjoint(), overlap(), To, and fcl::translate().

Referenced by fcl::OBBRSS::center().

◆ contain()

bool fcl::OBB::contain ( const Vec3f p) const

Check whether the OBB contains a point.

Referenced by fcl::OBBRSS::contain(), and overlap().

◆ depth()

FCL_REAL fcl::OBB::depth ( ) const
inline

Depth of the OBB.

Referenced by fcl::OBBRSS::depth(), and volume().

◆ distance()

FCL_REAL fcl::OBB::distance ( const OBB other,
Vec3f P = NULL,
Vec3f Q = NULL 
) const

Distance between two OBBs, not implemented.

Referenced by center().

◆ height()

FCL_REAL fcl::OBB::height ( ) const
inline

Height of the OBB.

Referenced by fcl::OBBRSS::height(), and volume().

◆ operator+()

OBB fcl::OBB::operator+ ( const OBB other) const

Return the merged OBB of current OBB and the other one (the result is not compact).

Referenced by operator+=().

◆ operator+=() [1/2]

OBB& fcl::OBB::operator+= ( const Vec3f p)

A simple way to merge the OBB and a point (the result is not compact).

Referenced by overlap().

◆ operator+=() [2/2]

OBB& fcl::OBB::operator+= ( const OBB other)
inline

Merge the OBB and another OBB (the result is not compact).

References operator+().

◆ overlap() [1/3]

bool fcl::OBB::overlap ( const OBB other) const

Check collision between two OBB.

Returns
true if collision happens.

Referenced by center(), fcl::OBBRSS::overlap(), overlap(), and fcl::OcTreeSolver< NarrowPhaseSolver >::ShapeOcTreeDistance().

◆ overlap() [2/3]

bool fcl::OBB::overlap ( const OBB other,
FCL_REAL sqrDistLowerBound 
) const

Check collision between two OBB.

Returns
true if collision happens.
Return values
sqrDistLowerBoundsquared lower bound on distance between boxes if they do not overlap.

◆ overlap() [3/3]

bool fcl::OBB::overlap ( const OBB other,
OBB  
) const
inline

Check collision between two OBB and return the overlap part. For OBB, the overlap_part return value is NOT used as the overlap part of two obbs usually is not an obb.

References contain(), operator+=(), and overlap().

◆ size()

FCL_REAL fcl::OBB::size ( ) const
inline

Size of the OBB (used in BV_Splitter to order two OBBs)

Referenced by fcl::OBBRSS::size().

◆ volume()

FCL_REAL fcl::OBB::volume ( ) const
inline

Volume of the OBB.

References depth(), height(), and width().

Referenced by fcl::OBBRSS::volume().

◆ width()

FCL_REAL fcl::OBB::width ( ) const
inline

Width of the OBB.

Referenced by volume(), and fcl::OBBRSS::width().

Member Data Documentation

◆ axes

Matrix3f fcl::OBB::axes

Orientation of OBB.

axis[i] is the ith column of the orientation matrix for the box; it is also the i-th principle direction of the box. We assume that axis[0] corresponds to the axis with the longest box edge, axis[1] corresponds to the shorter one and axis[2] corresponds to the shortest one.

◆ extent

Vec3f fcl::OBB::extent

Half dimensions of OBB.

◆ To

Vec3f fcl::OBB::To

Center of OBB.

Referenced by center().