Class OBB

Class Documentation

class OBB

Represents an oriented bounding box.

Public Functions

OBB()

Initialize an oriented bounding box at position 0, with 0 extents and identity orientation.

OBB(const OBB &other)
OBB(const Eigen::Isometry3d &pose, const Eigen::Vector3d &extents)
virtual ~OBB()
OBB &operator=(const OBB &other)
void setPoseAndExtents(const Eigen::Isometry3d &pose, const Eigen::Vector3d &extents)

Set both the pose and extents of the OBB.

Parameters:
  • pose[in] New pose of the OBB.

  • extents[in] New extents of the OBB.

Eigen::Vector3d getExtents() const

Get the extents of the OBB.

Returns:

The extents.

void getExtents(Eigen::Vector3d &extents) const

Get the extents of the OBB.

Parameters:

extents – [out] The extents.

Eigen::Isometry3d getPose() const

Get the pose of the OBB.

Returns:

The pose.

void getPose(Eigen::Isometry3d &pose) const

Get The pose of the OBB.

Parameters:

pose – The pose.

AABB toAABB() const

Convert this OBB to an axis-aligned BB.

Returns:

The AABB.

void toAABB(AABB &aabb) const

Convert this OBB to an axis-aligned BB.

Parameters:

aabb – The AABB.

OBB *extendApprox(const OBB &box)

Add the other OBB to this one and compute an approximate enclosing OBB.

Parameters:

box – The other box to add.

Returns:

Pointer to this OBB after the update.

bool contains(const Eigen::Vector3d &point) const

Check if this OBB contains the given point.

Parameters:

point – The point to check.

Returns:

Whether the point is inside or not.

bool overlaps(const OBB &other) const

Check whether this and the given OBBs have nonempty intersection.

Parameters:

other – The other OBB to check.

Returns:

Whether the OBBs overlap.

bool contains(const OBB &obb) const

Check if this OBB contains whole other OBB.

Parameters:

point – The point to check.

Returns:

Whether the point is inside or not.

EigenSTL::vector_Vector3d computeVertices() const

Compute coordinates of the 8 vertices of this OBB.

Returns:

The vertices.

Protected Attributes

std::unique_ptr<OBBPrivate> obb_

PIMPL pointer.