Methods
collides(other) → {boolean}
Test if box collides with another box.
Parameters:
Name | Type | Description |
---|---|---|
other |
Box3 |
- Source:
Returns:
- Type
- boolean
line() → {Line3}
Get the Line3 running between the corners of the box.
- Source:
Returns:
- Type
- Line3
map(f) → {Box3}
Apply function f to the corners of the box. Constructs a new Box3.
Parameters:
Name | Type | Description |
---|---|---|
f |
function | a function that accepts a {Vector3} and returns the modified {Vector3}. |
- Source:
Returns:
- Type
- Box3
scale(scalar) → {Box3}
Scale both vectors in the box by a scalar.
Parameters:
Name | Type | Description |
---|---|---|
scalar |
number |
- Source:
Returns:
- Type
- Box3
(static) fromOffset(start, offset) → {Box3}
Construct a new Box3 by adding an offset to the first corner.
Parameters:
Name | Type | Description |
---|---|---|
start |
Vector3 | the first corner of the box |
offset |
Vector3 | the offset added to the first corner to form the second corner |
- Source:
Returns:
- Type
- Box3
(static) fromRadius(center, radius) → {Box3}
Construct a new square Box3 with a central vector and a "radius" that is added and subtracted from every coordinate of that vector to form opposite corners of the box.
Parameters:
Name | Type | Description |
---|---|---|
center |
Vector3 | |
radius |
number |
- Source:
Returns:
- Type
- Box3