collides(group, callback, callbackContext, shape)
Adds the given CollisionGroup, or array of CollisionGroups, to the list of groups that this body will collide with and updates the collision masks.
Parameters
Name | Type | Argument | Description |
---|---|---|---|
group | Phaser.Physics.CollisionGroup | array | The Collision Group or Array of Collision Groups that this Bodies shapes will collide with. | |
callback | function | <optional> | Optional callback that will be triggered when this Body impacts with the given Group. |
callbackContext | object | <optional> | The context under which the callback will be called. |
shape | p2.Shape | <optional> | An optional Shape. If not provided the collision mask will be added to all Shapes in this Body. |
- Source code: physics/p2/Body.js (Line 435)
Please login to continue.