Class: OBB

OBB

Oriented bounding box class.

new OBB (x, y, width, height, angle)

Returns an oriented bounding box object.

Name Type Default Description
x Number 0 optional

The X coordinate of the upper-left corner of the obb.

y Number 0 optional

The Y coordinate of the upper-left corner of the obb.

width Number 0 optional

The width of this obb.

height Number 0 optional

The height of this obb.

angle Number 0 optional

The overall height of this obb.

Members

axes

The axes of this obb.

center

The center point of this obb.

heightRange

The overall height range of this obb.

widthRange

The overall width range of this obb.

Methods

aabbCollision (aabb)

Checks whether the aabb object given are contained within this obb.

Name Type Description
aabb AABB

The aabb object of test

obb2aabb ()AABB

Transforms this object into a new AABB object and returns.

Returns:
Type Description
AABB

obb2sphere ()Sphere

Transforms this object into a new Sphere object and returns.

Returns:
Type Description
Sphere

obbCollision (obb)

Checks whether the obb object given are contained within this obb.

Name Type Description
obb OBB

The obb object of test

pointCollision (point)

Checks whether the point object given are contained within this obb.

Name Type Description
point Point

The point object of test.

points ()Array.<Point>

Get an array of point objects that span the four vertices of the obb.

Returns:
Type Description
Array.<Point>

sphereCollision (sphere)

Checks whether the sphere object given are contained within this obb.

Name Type Description
sphere Sphere

The sphere object of test