Members
height :number
Height of the AABB.
Type:
- number
maxX :number
Type:
- number
maxY :number
Type:
- number
minX :number
Type:
- number
minY :number
Type:
- number
width :number
With of the AABB.
Type:
- number
Methods
containsPoint(point) → {boolean}
Check if the AABB contains a point.
Parameters:
Name | Type | Description |
---|---|---|
point |
Vertex | The point to check. |
Returns:
- True if the AABB contains the point, false otherwise.
- Type
- boolean
containsPoints(points) → {boolean}
Check if the AABB contains every point in an array of points.
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<Vertex> | The points to check. |
Returns:
- True if the AABB contains all the points, false otherwise.
- Type
- boolean
(protected) expand(point)
Expand the AABB with a point.
Parameters:
Name | Type | Description |
---|---|---|
point |
Vertex | The point to expand the AABB. |
(protected) expands(points)
Expand the AABB with an array of points.
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<Vertex> | The points to expand the AABB. |
intersects(aabb) → {boolean}
Check if the AABB intersects with another AABB.
Parameters:
Name | Type | Description |
---|---|---|
aabb |
AABB | The AABB to check. |
Returns:
- True if the AABB intersects with the other AABB, false otherwise.
- Type
- boolean
(protected) reset()
Reset the AABB.
size() → {object}
Get the size of the AABB.
Returns:
- The size of the AABB, with width and height properties.
- Type
- object