Constructor
Members
vec3
maxTransformedBounds
Maximum bounds (with transformation applied)
vec3
minTransformedBounds
Minimum bounds (with transformation applied)
Methods
applyMatrix(matrix) → {Box}
Apply a transformation matrix to know absolute position
Parameters:
Name | Type | Description |
---|---|---|
matrix |
mat4 | A matrix |
A reference to the instance
compute(positions) → {boolean}
Compute bounds
Parameters:
Name | Type | Description |
---|---|---|
positions |
Float32Array | A continious array with vertices positions |
False is the given array is invalid
boolean
intersectBox(box) → {boolean}
Check if box intersect/collide with the another box
Parameters:
Name | Type | Description |
---|---|---|
box |
Box | A Box instance |
True if boxes intersects
boolean
intersectRay(ray, outPositionnullable) → {boolean}
Check if box intersect/collide with the given ray
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ray |
Ray | A Ray instance | |
outPosition |
Array.<number> |
<nullable> |
An array to stock intersection position |
True if box intersect with the ray
boolean