Class: AABB

(protected) AABB()

The 2D AABB (Axis-Aligned Bounding Box) class.

Constructor

(protected) new AABB()

Create a new AABB.
Source:

Members

height :number

Height of the AABB.
Type:
  • number
Source:

maxX :number

Type:
  • number
Source:

maxY :number

Type:
  • number
Source:

minX :number

Type:
  • number
Source:

minY :number

Type:
  • number
Source:

width :number

With of the AABB.
Type:
  • number
Source:

Methods

containsPoint(point) → {boolean}

Check if the AABB contains a point.
Parameters:
Name Type Description
point Vertex The point to check.
Source:
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.
Source:
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.
Source:

(protected) expands(points)

Expand the AABB with an array of points.
Parameters:
Name Type Description
points Array.<Vertex> The points to expand the AABB.
Source:

intersects(aabb) → {boolean}

Check if the AABB intersects with another AABB.
Parameters:
Name Type Description
aabb AABB The AABB to check.
Source:
Returns:
- True if the AABB intersects with the other AABB, false otherwise.
Type
boolean

(protected) reset()

Reset the AABB.
Source:

size() → {object}

Get the size of the AABB.
Source:
Returns:
- The size of the AABB, with width and height properties.
Type
object