B.Math.Sphere()

Represents a sphere.

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

PROPERTIES:

{B.Math.Vector3} center

Center point of the sphere.

{number} radius

Radius of the sphere.

METHODS:

clone()

Clones this sphere to a new sphere.

RETURNS:

{B.Math.Sphere}

this

copy(sphere)

Copies a given sphere into this sphere.

PARAMETERS:

{B.Math.Sphere} sphere

RETURNS:

{B.Math.Sphere}

this

set(center, radius)

Sets this sphere from a center and a radius.

PARAMETERS:

{B.Math.Vector3} center

{number} radius

RETURNS:

{B.Math.Sphere}

this

fromArray(array, offset)

Sets this shere from a part of array.

PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

RETURNS:

{number}

new offset

toArray(array, offset)

Sets this sphere to a part of array.

PARAMETERS:

{Array.<number>} array

{number} [offset] = 0

RETURNS:

{number}

new offset

fromPoints(points)

Sets this sphere from an array of points.

PARAMETERS:

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

RETURNS:

{B.Math.Sphere}

this

fromAABox(aabox)

Sets this sphere from an axis-aligned box.

PARAMETERS:

{B.Math.AABox} aabox

RETURNS:

{B.Math.Sphere}

this

reset()

Resets this sphere to the initial state.

RETURNS:

{B.Math.Sphere}

this

empty()

Check this sphere for zero volume.

RETURNS:

{boolean}

translate(offset)

Translates this sphere by a given offset.

PARAMETERS:

{B.Math.Vector3} offset

RETURNS:

{B.Math.Sphere}

this

transform(matrix)

Transforms this sphere by a 4x4 matrix.

PARAMETERS:

{B.Math.Matrix4} matrix

RETURNS:

{B.Math.Sphere}

this

merge(object)

Merges this sphere with an object.

PARAMETERS:

RETURNS:

{B.Math.Sphere}

this

THROWS:

{Error}

if the object argument has unsupported type

equal(sphere)

Checks for strict equality of this sphere and another sphere.

PARAMETERS:

{B.Math.Sphere} sphere

RETURNS:

{boolean}

PROPERTIES:

METHODS: