Box3
A 3D box represents by min and max.
Properties
min( + Infinity, + Infinity, + Infinity ).
Vector3 representing the lower (x, y, z) boundary of the box.
max( - Infinity, - Infinity, - Infinity ).
Vector3 representing the upper (x, y, z) boundary of the box.
planes
An array of Planes represents the six faces of the box.
corners
The position of eight box's vertexes.
is Box3
Check the type whether it belongs to Box3. This value should not be changed by user.
Methods
set
Sets the lower and upper (x, y, z) boundaries of this box.
Please note that this method only copies the values from the given objects.Parameters
Returns Box3
set From Array
Sets the upper and lower bounds of this box to include all of the data in
array.Parameters
- array: ArrayLike<number>
An array of position data that the resulting box will envelop.
Returns Box3
- array: ArrayLike<number>
set From Buffer Attribute
Sets the upper and lower bounds of this box to include all of the data in attribute.
Parameters
- attribute: BufferAttribute
A buffer attribute of position data that the resulting box will envelop.
Returns Box3
- attribute: BufferAttribute
set From Buffer Attribute Range
Sets the upper and lower bounds of this box by a part of attributes.
Parameters
- attribute: BufferAttribute
A buffer attribute of position data that the resulting box will envelop.
- start: number
The start attributes of range.
- count: number
The count of attributes in range.
Returns Box3
- attribute: BufferAttribute
set From Index Buffer Attribute Range
- setFromIndexBufferAttributeRange(
positionAttribute: BufferAttribute,
indexAttribute: BufferAttribute,
start: number,
count: number,
): Box3Sets the upper and lower bounds of this box by a part of vertexes' index.
Parameters
- positionAttribute: BufferAttribute
A buffer of vertex data.
- indexAttribute: BufferAttribute
A buffer of vertex' index.
- start: number
The start indexes of range.
- count: number
The count of indexes in range.
Returns Box3
- positionAttribute: BufferAttribute
set From Points
set From Center And Size
set From Object
clone
copy
make Empty
Makes this box empty.
Returns Box3
is Empty
Returns true if this box includes zero points within its bounds. Note that a box with equal lower and upper bounds still includes one point, the one both bounds share.
Returns boolean
get Center
get Center Unsafe
get Size
get Corners
Return the position of eight box's vertexes.
Returns Vector3[]
get Planes
Return an array of planes of eight box's surface.
Returns Plane[]
expand By Point
expand By Vector
Expands this box equilaterally by vector. The width of this box will be expanded by the x component of vector in both directions. The height of this box will be expanded by the y component of vector in both directions. The depth of this box will be expanded by the z component of vector in both directions.
Returns Box3
expand By Scalar
Expands each dimension of the box by scalar. If negative, the dimensions of the box will be contracted.
Parameters
- scalar: number
Distance to expand the box by.
Returns Box3
- scalar: number
expand By Object
intersects Triangle
Parameters
- triangle: Triangle
Triangle| Triangle to check for intersection against. Determines whether or not this box intersects Triangle| triangle.
Returns boolean
- triangle: Triangle
contains Point
contains Box
get Parameter
intersects Box
intersects Sphere
intersects Plane
clamp Point
distance To Point
get Bounding Sphere
intersect
union
has Nan
If NaN exists in three values of min and max, return true.
Returns boolean
union Safe
apply Matrix4
translate
equals
to Box2
Return the Bounding on plane XY.
Parameters
- box2: Box2
Returns Box2
A 3D box represents by min and max.