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:
-
pointArray
Returns:
Boolean:
overlaps
(
Boolean
-
aabb
Returns true if the given AABB overlaps this AABB.
Parameters:
-
aabbAABB
Returns:
Boolean:
overlapsRay
(
Number
-
ray
Check if the AABB is hit by a ray.
Parameters:
-
rayRay
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:
-
pointsArrayAn array of vec2's.
-
positionArray -
angleNumber -
skinSizeNumberSome 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.
