Body
Indirect Subclass:
The base class for bodies used to detect collisions
Static Method Summary
| Static Public Methods | ||
| public static |
Creates a Result used to collect the detailed results of a collision test |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(x: Number, y: Number, padding: Number) |
|
Member Summary
| Public Members | ||
| public |
The amount to pad the bounding volume when testing for potential collisions |
|
| public |
The X coordinate of the body |
|
| public |
The Y coordinate of the body |
|
Method Summary
| Public Methods | ||
| public |
Determines if the body is colliding with another body |
|
| public |
Creates a Result used to collect the detailed results of a collision test |
|
| public |
potentials(): Array<Body> Returns a list of potential collisions |
|
| public |
remove() Removes the body from its current collision system |
|
Static Public Methods
public static createResult() source
Creates a Result used to collect the detailed results of a collision test
Public Members
Public Methods
public collides(target: Circle | Polygon | Point, result: Result, aabb: Boolean): Boolean source
Determines if the body is colliding with another body
Params:
| Name | Type | Attribute | Description |
| target | Circle | Polygon | Point | The target body to test against |
|
| result | Result |
|
A Result object on which to store information about the collision |
| aabb | Boolean |
|
Set to false to skip the AABB test (useful if you use your own potential collision heuristic) |
