Constructor
new AABB(x, y, width, height)
Create an AABB using centre position, width, and height.
Parameters:
Name | Type | Description |
---|---|---|
x | * | The x value of the centre. |
y | * | The y value of the centre. |
width | * | The width measured from the centre. |
height | * | The height measured from the centre. |
Classes
Methods
contains(point) → {boolean}
Check if this AABB contains a Vector.
Parameters:
Name | Type | Description |
---|---|---|
point | Vector | The vector to check. |
Returns:
- Type:
- boolean
intersects(range) → {boolean}
Check if this aabb intersects another AABB.
Parameters:
Name | Type | Description |
---|---|---|
range | AABB | The target AABB to check. |
Returns:
- Type:
- boolean
lines() → {Array.<Line>}
Create an array of Lines containing a line for each side of the AABB.
(static) fromCorners(topLeft, topRight, bottomRight, bottomLeft) → {AABB}
Create an AABB from four corner Vectors.
Returns:
- A new AABB object.
- Type:
- AABB