The collision resolver is responsible to implement collision detection between pair of shapes of same or different types.
Kind: global class
CollisionTestResult
CollisionTestResult
Create the resolver.
Set the method used to test collision between two shapes. Note: you don’t need to register the same handler twice for reverse order, its done automatically inside.
Kind: instance method of CollisionResolver
Param | Type | Description |
---|---|---|
firstShapeId | String |
The shape identifier the handler recieves as first argument. |
secondShapeId | String |
The shape identifier the handler recieves as second argument. |
handler | function |
Method to test collision between the shapes. Return false if don’t collide, return either Vector2 with collision position or ‘true’ for collision. |
CollisionTestResult
Check a collision between two shapes.
Kind: instance method of CollisionResolver
Returns: CollisionTestResult
- collision detection result or null if they don’t collide.
Param | Type | Description |
---|---|---|
first | CollisionShape |
First collision shape to test. |
second | CollisionShape |
Second collision shape to test. |
CollisionTestResult
Check a collision between two shapes.
Kind: instance method of CollisionResolver
Returns: CollisionTestResult
- collision detection result or null if they don’t collide.
Param | Type | Description |
---|---|---|
first | CollisionShape |
First collision shape to test. |
second | CollisionShape |
Second collision shape to test. |
handler | function |
Method to test collision between the shapes. |
Get handlers dictionary for a given shape.
Kind: instance method of CollisionResolver