Box
-
class
Box() Represents an axis-aligned bounding box. A box is represented by a minimum and maximum point which describe the extents of the box.
Constructors
Properties
Methods
-
Box.addBox() - addBox(box:
Box): voidExpands the extents of the box so that it will contain another box.
Parameters
box:
BoxThe box to add.Returns: void
-
Box.addPoint() - addPoint(point:
Point3): voidExpands the extents of the box so that it will contain a particular point.
Parameters
point:
Point3The point to add.Returns: void
-
Box.center() - center():
Point3Gets the center point for the box.
Returns:
Point3The center point of this box.
-
Box.containsPoint() - containsPoint(point:
Point3): booleanReturns whether a point is contained within the box
Parameters
point:Point3Returns: boolean
whether a point is contained within the box
-
Box.equals() - equals(box:
Box): booleanStrictly compares this box with another box.
Parameters
box:
BoxBox to compare with.Returns: boolean
True if the values of this box equals the other. False otherwise.
-
Box.extents() - extents():
Point3Gets the extents of the box.
Returns:
Point3A point with members set to extent values for each corresponding axis.
-
Box.getCorners() - getCorners():
Point3[]Gets all eight corner points for the box.
Returns:
Point3[]The corner points of this box.
-
Box.isDegenerate() - isDegenerate(): boolean
Returns whether or not the box is degenerate.
Returns: boolean
whether or not the box is degenerate.
-
Box.toJson() - toJson(): object
Creates an object ready for JSON serialization.
Returns: object
The prepared object.