Phaser API Documentation

  Version: 
intersectBody(body, [bodies])

Description:

Checks the given Matter Body to see if it intersects with any of the given bodies.

If no bodies are provided it will check against all bodies in the Matter World.

Parameters:

name type arguments description
body Phaser.Types.Physics.Matter.MatterBody

The target body.

bodies Array.<Phaser.Types.Physics.Matter.MatterBody> <optional>

An array of bodies to check the target body against. If not provided it will search all bodies in the world.

Returns:
Description:

An array of bodies whos vertices intersect with target body.

Since: 3.22.0