[name]

Represents a boundary box in 3d space.

Constructor

[name]([page:Vector3 min], [page:Vector3 max])

min -- Lower (x, y, z) boundary of the box.
max -- Upper (x, y, z) boundary of the box.
Creates a box bounded by min and max

Properties

.[page:Vector3 max]

Upper (x, y, z) boundary of this box.

.[page:Vector3 min]

Lower (x, y, z) boundary of this box.

Methods

.set([page:Vector3 min], [page:Vector3 max]) [page:Box3 this]

min -- Upper (x, y, z) boundary of this box.
max -- Lower (x, y, z) boundary of this box.
Sets the lower and upper (x, y, z) boundaries of this box.

.applyMatrix4([page:Matrix4 matrix]) [page:Box3 this]

matrix -- [page:Matrix4].
Transform the box with a Matrix4.

.expandByPoint([page:Vector3 point]) [page:Box3 this]

Expands the box outwards by the point. It takes the min and max values of the box.

.clampPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]

point -- [page:Vector3]
optionalTarget -- [page:Vector3] An optional target point.
Clamp a point within the min and max boundaries of the box. Returns either a new point or the modified passed target.

.isIntersectionBox([page:Box3 box]) [page:Boolean]

box -- [page:Box3]
Return whether or not the passed box intersects with this Box3.

.setFromPoints([page:Array points])

points -- [page:Array] of [page:Vector3] points
Sets this box to the min value and max value of all the points in the array. If the array is empty, then it sets the box as empty.

.size([page:Vector3 optionalTarget]) [page:Vector3]

optionalTarget -- [page:Vector3] (optional)
Returns either a new Vector3 or the target Vector3 that represents the size of the box from the min point to max point.

.union([page:Box3 box]) [page:Box3 this]

box -- [page:Box3]
Sets the box's min and max boundaries to union of the two boxes.

.getParameter([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]

point -- [page:Vector3]
optionalTarget -- [page:Vector3]
Returns a point as a proportion of this box's width, height, and depth. If the point is contained by the box the x, y, and z of the returned vector will be between 0 and 1.

.expandByScalar([page:Float scalar]) [page:Box3 this]

scalar -- [page:Float] representing the distance to expand
Expands or contracts the box by adding the scalar value to the box's min and max vectors.

.intersect([page:Box3 box]) [page:Box3 this]

box -- [page:Box3]
Returns the intersection of the two boxes, setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds.

.containsBox([page:Box3 box]) [page:Boolean]

box -- [page:Box3]
Returns true if this box includes the entirety of box. If this and box overlap exactly, this function also returns true.

.translate([page:Vector3 offset]) [page:Box3 this]

offset -- [page:Vector3]
Translates the box the distance of the offset.

.empty() [page:Boolean]

Checks to see if the box is empty. If the lower and upper bounds of the box are equal, this function still returns false as the box would still contain one point.

.clone() [page:Box3]

Returns a copy of this box.

.equals([page:Box3 box]) [page:Boolean]

box -- [page:Box3]
Returns true if the boes share the same lower and upper bounds.

.expandByVector([page:Vector3 vector]) [page:Box3 this]

vector -- [page:Vector3] representing the amount to expand this box in each dimension.
Adds the passed vector to the upper boundary, and subtracts it from the lower boundary.

.copy([page:Box3 box]) [page:Box3 this]

box -- [page:Box3] to copy.
Copies the values of the passed box to this box.

.makeEmpty() [page:Box3 this]

Makes this box empty so that it cannot contain any points.

.center([page:Vector3 optionalTarget]) [page:Vector3]

optionalTarget -- [page:Vector3] If specified, the result will be copied here.
Returns the center point of this box.

.getBoundingSphere([page:Sphere optionalTarget]) [page:Sphere]

optionalTarget -- [page:Sphere]
Returns a bounding sphere.

.distanceToPoint([page:Vector3 point]) [page:Float]

point -- [page:Vector3]
Returns the distance from any edge of this box to the specified point. If the point lies inside of this box, the distance will be 0.

.containsPoint([page:Vector3 point]) [page:Boolean]

point -- [page:Vector3]
Returns true if the specified point lies within the boundaries of this box.

.setFromCenterAndSize([page:Vector3 center], [page:Vector3 size]) [page:Box3 this]

center -- [page:Vector3] representing the center position.
size -- [page:Vector3] representing the dimensions of the box.
Sets this box based on a center vector, and width, height, and depth vector.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]