AABB

AABB

Creates AABBs.

Constructor

new AABB($minimum, $maximum)

Description:
  • Creates a new AABB.
Source:
Example
const aabb = new AABB(new Vector2(-1, -1), new Vector2(1, 1));
Parameters:
Name Type Description
$minimum Vector2 The minimum values of the AABB to create.
$maximum Vector2 The maximum values of the AABB to create.

Members

center :Vector2

Description:
  • Gets the center of the AABB.
Source:
Gets the center of the AABB.
Type:

halfSize :Vector2

Description:
  • Gets the half-size of the AABB.
Source:
Gets the half-size of the AABB.
Type:

maximum :Vector2

Description:
  • Gets the maximum values of the AABB.
Source:
Gets the maximum values of the AABB.
Type:

minimum :Vector2

Description:
  • Gets the minimum values of the AABB.
Source:
Gets the minimum values of the AABB.
Type:

size :Vector2

Description:
  • Gets the size of the AABB.
Source:
Gets the size of the AABB.
Type:

Methods

clone() → {AABB}

Description:
  • Clones the AABB.
Source:
Returns:
Type
AABB

translate($vector) → {this}

Description:
  • Translates the AABB in the world space from a third person point of view.
Source:
Parameters:
Name Type Description
$vector Vector2 The translation to apply.
Returns:
Type
this

(static) distanceManhattan($a, $b) → {number}

Description:
  • Gets the manhattan distance between two AABBs.
Source:
Parameters:
Name Type Description
$a AABB The first AABB to compare.
$b AABB The second AABB to compare.
Returns:
Type
number

(static) distanceX($a, $b) → {number}

Description:
  • Gets the distance between two AABBs on the x-axis.
Source:
Parameters:
Name Type Description
$a AABB The first AABB to compare.
$b AABB The second AABB to compare.
Returns:
Type
number

(static) distanceY($a, $b) → {number}

Description:
  • Gets the distance between two AABBs on the y-axis.
Source:
Parameters:
Name Type Description
$a AABB The first AABB to compare.
$b AABB The second AABB to compare.
Returns:
Type
number

(static) from($aabb) → {AABB}

Description:
  • Creates a new AABB from the given AABB.
Source:
Parameters:
Name Type Description
$aabb AABB The given AABB.
Returns:
Type
AABB

(static) overlapX($a, $b) → {number}

Description:
  • Gets the delta penetration between two AABBs strictly overlaping with each other on the x-axis (the common area).
Source:
Parameters:
Name Type Description
$a AABB The first AABB to compare.
$b AABB The second AABB to compare.
Returns:
Type
number

(static) overlapY($a, $b) → {number}

Description:
  • Gets the delta penetration between two AABBs strictly overlaping with each other on the y-axis (the common area).
Source:
Parameters:
Name Type Description
$a AABB The first AABB to compare.
$b AABB The second AABB to compare.
Returns:
Type
number