BoundingBox

BoundingBox

BoundingBox defines an axis-aligned cube that defines a container for a group of vertices of a
particular piece of geometry. This box defines a center and extents from that center along the x, y and z axis.



A typical usage is to allow the class define the center and radius by calling either containAABB or
averagePoints. A call to computeFramePoint in turn calls containAABB.

Constructor

new BoundingBox(centeropt, xExtentopt, yExtentopt, zExtentopt)

Parameters:
Name Type Attributes Default Description
center Vector3 <optional>
(0, 0, 0)
xExtent number <optional>
1
yExtent number <optional>
1
zExtent number <optional>
1

Methods

clone() → {BoundingBox}

Returns a clone of this bounding box

containsBox(bb) → {boolean}

Method to test whether a bounding box is fully inside this bounding box.

Parameters:
Name Type Description
bb BoundingBox

containsPoint(point) → {boolean}

Method to test whether a point is inside the bounding box or not

Parameters:
Name Type Description
point Vector3

copy(source) → {BoundingBox}

Copies data from another bounding box

Parameters:
Name Type Description
source BoundingBox

bounding box to copy from