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
boundaryBottom :Vector2
- Description:
- Gets the bottom boundary of the AABB.
- Source:
Gets the bottom boundary of the AABB.
Type:
boundaryBottomLeft :Vector2
- Description:
- Gets the bottom-left boundary of the AABB.
- Source:
Gets the bottom-left boundary of the AABB.
Type:
boundaryBottomRight :Vector2
- Description:
- Gets the bottom-right boundary of the AABB.
- Source:
Gets the bottom-right boundary of the AABB.
Type:
boundaryLeft :Vector2
- Description:
- Gets the left boundary of the AABB.
- Source:
Gets the left boundary of the AABB.
Type:
boundaryRight :Vector2
- Description:
- Gets the right boundary of the AABB.
- Source:
Gets the right boundary of the AABB.
Type:
boundaryTop :Vector2
- Description:
- Gets the top boundary of the AABB.
- Source:
Gets the top boundary of the AABB.
Type:
boundaryTopLeft :Vector2
- Description:
- Gets the top-left boundary of the AABB.
- Source:
Gets the top-left boundary of the AABB.
Type:
boundaryTopRight :Vector2
- Description:
- Gets the top-right boundary of the AABB.
- Source:
Gets the top-right boundary of the AABB.
Type:
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
equal($aabb) → {boolean}
- Description:
- Checks the equality with the given AABB.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$aabb |
AABB | The AABB to check with. |
Returns:
- Type
- boolean
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 the two given 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 the two given 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 the two given 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) fromSize($size) → {AABB}
- Description:
- Creates a new AABB from the given size.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
$size |
Vector2 | The given size. |
Returns:
- Type
- AABB
(static) overlapX($a, $b) → {number}
- Description:
- Gets the delta penetration between the two given 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 the two given 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