Box3
An axis-aligned bounding box (AABB) in 3D space.
The box is mutable and not thread-safe; confine an instance (and any object graph holding it) to a single thread, exactly as in three.js. Most methods mutate this and return it for chaining.
The constructor stores the given vectors by reference (it does not copy them). Passing the same vector as both bounds, or sharing a vector with another object, means later mutations are visible through every alias. Use set or clone when you need independent storage.
Constructors
Properties
Functions
Transforms this box by the 4x4 matrix matrix. The transform of an empty box is an empty box.
Returns true if this box fully contains box (an identical box counts as contained).
Returns true if point lies within or on the boundary of this box.
Returns the Euclidean distance from point to the nearest edge of this box (0 if inside). An empty box yields +Infinity.
Expands this box to include point.
Expands this box equilaterally by vector (x on both horizontal sides, y on both vertical sides, z on both depth sides).
Sets this box's bounds from json laid out as [minX, minY, minZ, maxX, maxY, maxZ].
Writes a bounding sphere that encloses this box into target (an empty sphere if this box is empty).
Returns true if box intersects this box (touching edges count).
Returns true if plane intersects this box.
Returns true if sphere intersects this box.
Returns true if triangle intersects this box.
Expands this box to enclose the 3D position data packed in array (x, y, z triples). Fewer than three trailing entries are ignored.
Expands this box to enclose all the given points. An empty sequence leaves the box empty.
Writes this box as [minX, minY, minZ, maxX, maxY, maxZ].