AABB Class
Axis aligned bounding box class.
Constructor
AABB
(
-
[options]
Parameters:
-
[options]
Object optional-
[upperBound]
Array optional -
[lowerBound]
Array optional
-
Item Index
Properties
Methods
containsPoint
(
Boolean
-
point
Parameters:
-
point
Array
Returns:
Boolean:
overlaps
(
Boolean
-
aabb
Returns true if the given AABB overlaps this AABB.
Parameters:
-
aabb
AABB
Returns:
Boolean:
overlapsRay
(
Number
-
ray
Check if the AABB is hit by a ray.
Parameters:
-
ray
Ray
Returns:
Number:
-1 if no hit, a number between 0 and 1 if hit.
setFromPoints
(
-
points
-
position
-
angle
-
skinSize
Set the AABB bounds from a set of points, transformed by the given position and angle.
Parameters:
-
points
ArrayAn array of vec2's.
-
position
Array -
angle
Number -
skinSize
NumberSome margin to be added to the AABB.
Properties
lowerBound
Array
The lower bound of the bounding box.
upperBound
Array
The upper bound of the bounding box.