Struct OBB

Struct Documentation

struct OBB

Oriented bounding box class.

Public Functions

inline OBB()
inline bool operator==(const OBB &other) const

Equality operator.

inline bool operator!=(const OBB &other) const

Difference operator.

bool contain(const Vec3s &p) const

Check whether the OBB contains a point.

bool overlap(const OBB &other) const

Check collision between two OBB

Returns:

true if collision happens.

bool overlap(const OBB &other, const CollisionRequest &request, CoalScalar &sqrDistLowerBound) const

Check collision between two OBB

Return values:

sqrDistLowerBound – squared lower bound on distance between boxes if they do not overlap.

Returns:

true if collision happens.

CoalScalar distance(const OBB &other, Vec3s *P = NULL, Vec3s *Q = NULL) const

Distance between two OBBs, not implemented.

OBB &operator+=(const Vec3s &p)

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

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

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

OBB operator+(const OBB &other) const

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

inline CoalScalar size() const

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

inline const Vec3s &center() const

Center of the OBB.

inline CoalScalar width() const

Width of the OBB.

inline CoalScalar height() const

Height of the OBB.

inline CoalScalar depth() const

Depth of the OBB.

inline CoalScalar volume() const

Volume of the OBB.

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Matrix3s 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.

Vec3s To

Center of OBB.

Vec3s extent

Half dimensions of OBB.