OBBox

Inherited: None

Description

An arbitrarily oriented bounded volume in space in the form of a rectangular parallelepiped (Bounding Box). Unlike AABB, OBB rotates with the object and does not change its size. Collision testing with OBB is somewhat more complicated and slower than AABB, but more often it is more preferable. Oriented Bounding Box represented by center of box, size and rotation quaternion.

Public Methods

OBBox (const Vector3 & center, const Vector3 & size, const Quaternion & rotation)

OBBox (const Vector3 & center, const Vector3 & size)

OBBox ()

void

box (Vector3 & min, Vector3 & max) const

void

setBox (const Vector3 & min, const Vector3 & max)

const OBBox

operator* (areal factor) const

const OBBox

operator* (const Vector3 & vector) const

Static Methods

None

Methods Description

OBBox::OBBox (Vector3 & center, Vector3 & size, Quaternion & rotation)

Constructs a bounding box with center, size and rotation.


OBBox::OBBox (Vector3 & center, Vector3 & size)

Constructs a bounding box with center, size and identity rotation.


OBBox::OBBox ()

Constructs an bounding box with center (0, 0, 0), size (1, 1, 1) and identity rotation.


void OBBox::box (Vector3 & min, Vector3 & max) const

Returns min and max points of bounding box as output arguments.

See also setBox().


void OBBox::setBox (Vector3 & min, Vector3 & max)

Set curent bounding box by min and max points.

See also box().


const OBBox OBBox::operator* (areal factor) const

Returns a copy of this vector, multiplied by the given factor.

const OBBox OBBox::operator* (Vector3 & vector) const

Returns a copy of this vector, multiplied by the given vector.