Methods
(static) getAABBContact(boundsA, boundsB) → {Object|null}
Compute AABB intersection and separation normal/depth between box A and box B.
Parameters:
| Name | Type | Description |
|---|---|---|
boundsA | Object | { left, right, top, bottom } |
boundsB | Object | { left, right, top, bottom } |
- Source
Returns:
Collision contact or null if no overlap
- Type:
- Object |
null
(static) resolveOverlappingSpawn(actorBounds, obstacleBoundsList, maxIterationsopt) → {Object}
Separate an actor overlapping one or more static solid obstacles (e.g. overlapping spawn).
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
actorBounds | Object | { left, right, top, bottom } | ||
obstacleBoundsList | Array.<Object> | Array of { left, right, top, bottom } | ||
maxIterations | number | <optional> | 8 |
Returns:
{ x: number, y: number, resolved: boolean } Displacements applied
- Type:
- Object
(static) slideAlongNormal(vx, vy, normalX, normalY) → {Object}
Slide movement against a contact surface normal (corner / wall sliding).
Parameters:
| Name | Type | Description |
|---|---|---|
vx | number | |
vy | number | |
normalX | number | |
normalY | number |
Returns:
{ vx: number, vy: number }
- Type:
- Object