Methods
(static) sweepAgainstObstacles(movingBox, dx, dy, staticObstacles) → {Object}
Cast moving box against multiple obstacles and find the earliest impact.
Parameters:
| Name | Type | Description |
|---|---|---|
movingBox | Object | |
dx | number | |
dy | number | |
staticObstacles | Array.<Object> |
- Source
Returns:
- Type:
- Object
(static) sweepBoxAgainstBox(movingBox, dx, dy, staticBox) → {Object}
Compute swept AABB collision between a moving box and a static target box. Uses Minkowski sum raycast against the expanded target box.
Parameters:
| Name | Type | Description |
|---|---|---|
movingBox | Object | Moving entity bounds { left, right, top, bottom } |
dx | number | Displacement in X |
dy | number | Displacement in Y |
staticBox | Object | Obstacle bounds { left, right, top, bottom } |
- Source
Returns:
{ hit: boolean, toi: number, normal: {x: number, y: number}, contactPoint: {x: number, y: number} }
- Type:
- Object