A 3D box shape.
Kind: global class
Box
Box
Box
Box
Box
Box
Box
Boolean
Vector3
Vector3
Box
Box
Box
Boolean
Boolean
Boolean
Boolean
Boolean
Vector3
Number
Box
Box
Box
Boolean
Create the 3d box.
Param | Type | Description |
---|---|---|
min | Vector3 |
Box min vector. |
max | Vector3 |
Box max vector. |
Box
Set the box min and max corners.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
min | Vector3 |
Box min vector. |
max | Vector3 |
Box max vector. |
Box
Set box values from array.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
array | Array.<Number> |
Array of values to load from. |
Box
Set box from array of points.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
points | Array.<Vector3> |
Points to set box from. |
Box
Set box from center and size.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
center | Vector3 |
Center position. |
size | Vector3 |
Box size. |
Box
Clone this box.
Kind: instance method of Box
Returns: Box
- Cloned box.
Box
Copy values from another box.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
box | Box |
Box to copy. |
Box
Turn this box into empty state.
Kind: instance method of Box
Returns: Box
- Self.
Boolean
Check if this box is empty.
Kind: instance method of Box
Returns: Boolean
- True if empty.
Vector3
Get center position.
Kind: instance method of Box
Returns: Vector3
- Center position.
Vector3
Get box size.
Kind: instance method of Box
Returns: Vector3
- Box size.
Box
Expand this box by a point. This will adjust the box boundaries to contain the point.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
point | Vector3 |
Point to extend box by. |
Box
Expand this box by pushing its boundaries by a vector. This will adjust the box boundaries by pushing them away from the center by the value of the given vector.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
vector | Vector3 |
Vector to expand by. |
Box
Expand this box by pushing its boundaries by a given scalar. This will adjust the box boundaries by pushing them away from the center by the value of the given scalar.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
scalar | Number |
Value to expand by. |
Boolean
Check if this box contains a point.
Kind: instance method of Box
Returns: Boolean
- True if box containing the point.
Param | Type | Description |
---|---|---|
point | Vector3 |
Point to check. |
Boolean
Check if this box contains another box.
Kind: instance method of Box
Returns: Boolean
- True if box containing the box.
Param | Type | Description |
---|---|---|
box | Box |
Box to check. |
Boolean
Check if this box collides with another box.
Kind: instance method of Box
Returns: Boolean
- True if collide, false otherwise.
Param | Type | Description |
---|---|---|
box | Box |
Box to test collidion with. |
Boolean
Check if this box collides with a sphere.
Kind: instance method of Box
Returns: Boolean
- True if collide, false otherwise.
Param | Type | Description |
---|---|---|
sphere | Sphere |
Sphere to test collidion with. |
Boolean
Check if this box collides with a plane.
Kind: instance method of Box
Returns: Boolean
- True if collide, false otherwise.
Param | Type | Description |
---|---|---|
plane | Plane |
Plane to test collidion with. |
Vector3
Clamp a given vector inside this box.
Kind: instance method of Box
Returns: Vector3
- Vector clammped.
Param | Type | Description |
---|---|---|
point | Vector3 |
Vector to clamp. |
Number
Get distance between this box and a given point.
Kind: instance method of Box
Returns: Number
- Distance to point.
Param | Type | Description |
---|---|---|
point | Vector3 |
Point to get distance to. |
Box
Computes the intersection of this box with another box. This will set 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. If there’s no overlap, makes this box empty.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
box | Box |
Box to intersect with. |
Box
Computes the union of this box and box. This will set the upper bound of this box to the greater of the two boxes’ upper bounds and the lower bound of this box to the lesser of the two boxes’ lower bounds.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
box | Box |
Box to union with. |
Box
Move this box.
Kind: instance method of Box
Returns: Box
- Self.
Param | Type | Description |
---|---|---|
offset | Vector3 |
Offset to move box by. |
Boolean
Check if equal to another box.
Kind: instance method of Box
Returns: Boolean
- True if boxes are equal, false otherwise.
Param | Type | Description |
---|---|---|
other | Box |
Other box to compare to. |