Class: AABB

AABB

Axis-aligned bounding box class.

new AABB (x, y, width, height)

Returns an axis-aligned bounding box object.

Name Type Default Description
x Number 0 optional

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

y Number 0 optional

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

width Number 0 optional

The width of this aabb.

height Number 0 optional

The height of this aabb.

Members

center

The center point of this aabb.

heightRange

The overall height range of this aabb.

widthRange

The overall width range of this aabb.

Methods

aabb2obb ()OBB

Transforms this object into a new OBB object and returns.

Returns:
Type Description
OBB

aabb2sphere ()Sphere

Transforms this object into a new Sphere object and returns.

Returns:
Type Description
Sphere

aabbCollision (aabb)

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

Name Type Description
aabb AABB

The aabb object of test

obbCollision (obb)

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

Name Type Description
obb OBB

The obb object of test

pointCollision (point)

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

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 this aabb.

Returns:
Type Description
Array.<Point>

sphereCollision (sphere)

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

Name Type Description
sphere Sphere

The sphere object of test