B.Math.AABox()

Represents an axis-aligned box.

To create the object use B.Math.makeAABox().

PROPERTIES:

{B.Math.Vector3} min

Minimum point.

{B.Math.Vector3} max

Maximum point.

METHODS:

clone()

Clones this box to a new box.

RETURNS:

{B.Math.AABox}

this

copy(aabox)

Copies a given box into this box.

PARAMETERS:

{B.Math.AABox} aabox

RETURNS:

{B.Math.AABox}

this

set(min, max)

Sets this box from minimum and maximum points.

PARAMETERS:

RETURNS:

{B.Math.AABox}

this

fromArray(array, offset)

Sets this box from a part of array.

PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

RETURNS:

{number}

new offset

toArray(array, offset)

Sets this box to a part of array.

PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

RETURNS:

{number}

new offset

fromCenterSize(center, size)

Sets this box from a center and a size.

PARAMETERS:

{B.Math.Vector3} center

{B.Math.Vector3} size

RETURNS:

{B.Math.AABox}

this

fromPoints(points)

Sets this box from an array of points.

PARAMETERS:

{Array.<B.Math.Vector3>} points

RETURNS:

{B.Math.AABox}

this

fromSphere(sphere)

Sets this box from a sphere.

PARAMETERS:

{B.Math.Sphere} sphere

RETURNS:

{B.Math.AABox}

this

reset()

Resets this box to the initial state.

RETURNS:

{B.Math.AABox}

this

empty()

Check this box for zero volume.

RETURNS:

{boolean}

center(result)

Returns the center of this box.

PARAMETERS:

{B.Math.Vector3} [result]

omit if you want to return newly created vector

RETURNS:

size(result)

Returns the size of this box.

PARAMETERS:

{B.Math.Vector3} [result]

omit if you want to return newly created vector

RETURNS:

cornerPoints(result)

Returns corner points of this box.

PARAMETERS:

{Array.<B.Math.Vector3>} [result]

omit if you want to return newly created array

RETURNS:

{Array.<B.Math.Vector3>}

translate(offset)

Translates this box by a given offset.

PARAMETERS:

{B.Math.Vector3} offset

RETURNS:

{B.Math.AABox}

this

transform(matrix)

Transforms this box by a 4x4 matrix.

PARAMETERS:

{B.Math.Matrix4} matrix

RETURNS:

{B.Math.AABox}

this

merge(object)

Merges this box with an object.

PARAMETERS:

RETURNS:

{B.Math.AABox}

this

THROWS:

{Error}

if the object argument has unsupported type.

equal(aabox)

Checks for strict equality of this box and another box.

PARAMETERS:

{B.Math.AABox} aabox

RETURNS:

{boolean}

PROPERTIES:

METHODS: