
A 3D box shape.
Kind: global class
BoxBoxBoxBoxBoxBoxBoxBooleanVector3Vector3BoxBoxBoxBooleanBooleanBooleanBooleanBooleanVector3NumberBoxBoxBoxBooleanCreate the 3d box.
| Param | Type | Description |
|---|---|---|
| min | Vector3 |
Box min vector. |
| max | Vector3 |
Box max vector. |
BoxSet 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. |
BoxSet box values from array.
Kind: instance method of Box
Returns: Box - Self.
| Param | Type | Description |
|---|---|---|
| array | Array.<Number> |
Array of values to load from. |
BoxSet box from array of points.
Kind: instance method of Box
Returns: Box - Self.
| Param | Type | Description |
|---|---|---|
| points | Array.<Vector3> |
Points to set box from. |
BoxSet box from center and size.
Kind: instance method of Box
Returns: Box - Self.
| Param | Type | Description |
|---|---|---|
| center | Vector3 |
Center position. |
| size | Vector3 |
Box size. |
BoxClone this box.
Kind: instance method of Box
Returns: Box - Cloned box.
BoxCopy values from another box.
Kind: instance method of Box
Returns: Box - Self.
| Param | Type | Description |
|---|---|---|
| box | Box |
Box to copy. |
BoxTurn this box into empty state.
Kind: instance method of Box
Returns: Box - Self.
BooleanCheck if this box is empty.
Kind: instance method of Box
Returns: Boolean - True if empty.
Vector3Get center position.
Kind: instance method of Box
Returns: Vector3 - Center position.
Vector3Get box size.
Kind: instance method of Box
Returns: Vector3 - Box size.
BoxExpand 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. |
BoxExpand 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. |
BoxExpand 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. |
BooleanCheck 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. |
BooleanCheck 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. |
BooleanCheck 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. |
BooleanCheck 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. |
BooleanCheck 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. |
Vector3Clamp a given vector inside this box.
Kind: instance method of Box
Returns: Vector3 - Vector clammped.
| Param | Type | Description |
|---|---|---|
| point | Vector3 |
Vector to clamp. |
NumberGet 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. |
BoxComputes 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. |
BoxComputes 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. |
BoxMove this box.
Kind: instance method of Box
Returns: Box - Self.
| Param | Type | Description |
|---|---|---|
| offset | Vector3 |
Offset to move box by. |
BooleanCheck 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. |