Box
- class Communicator.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
Methods
Constructors
constructor
- Communicator.Box.constructor(min, max)
Creates a new box.
- Arguments
min (
Communicator.Point3()
) –max (
Communicator.Point3()
) –
- Return type
Communicator.Box
Properties
- Communicator.Box.max
The point of maximum extent for the box.
- Communicator.Box.min
The point of minimum extent for the box.
Methods
addBox
- Communicator.Box.addBox(box)
Expands the extents of the box so that it will contain another box.
- Arguments
box (
Communicator.Box()
) – The box to add.
- Return type
void
addPoint
- Communicator.Box.addPoint(point)
Expands the extents of the box so that it will contain a particular point.
- Arguments
point (
Communicator.Point3()
) – The point to add.
- Return type
void
center
- Communicator.Box.center()
Gets the center point for the box.
- Return type
Communicator.Point3
- Returns
The center point of this box.
copy
- Communicator.Box.copy()
Creates a copy of the box.
- Return type
Communicator.Box
- Returns
A copy of this box.
equals
- Communicator.Box.equals(box)
Strictly compares this box with another box.
- Arguments
box (
Communicator.Box()
) – Box to compare with.
- Return type
boolean
- Returns
True if the values of this box equals the other. False otherwise.
extents
- Communicator.Box.extents()
Gets the extents of the box.
- Return type
Communicator.Point3
- Returns
A point with members set to extent values for each corresponding axis.
forJson
- Communicator.Box.forJson()
Note
forJson is deprecated: Use
toJson
instead.- Return type
Object
getCorners
- Communicator.Box.getCorners()
Gets all eight corner points for the box.
- Return type
[Communicator.Point3]
- Returns
The corner points of this box.
isDegenerate
- Communicator.Box.isDegenerate()
Returns whether or not the box is degenerate.
- Return type
boolean
- Returns
whether or not the box is degenerate.
toJson
- Communicator.Box.toJson()
Creates an object ready for JSON serialization.
- Return type
Object
- Returns
The prepared object.
construct
- Communicator.Box.construct(obj)
Note
construct is deprecated: Use
fromJson
instead.- Arguments
obj (
any()
) –
- Return type
Communicator.Box