Checks the given ray segment to see if any vertices of the given bodies intersect with it.
If no bodies are provided it will search all bodies in the Matter World.
The width of the ray can be specified via the rayWidth
parameter.
name | type | arguments | Default | description |
---|---|---|---|---|
x1 | number |
The horizontal coordinate of the start of the ray segment. |
||
y1 | number |
The vertical coordinate of the start of the ray segment. |
||
x2 | number |
The horizontal coordinate of the end of the ray segment. |
||
y2 | number |
The vertical coordinate of the end of the ray segment. |
||
rayWidth | number | <optional> | 1 |
The width of the ray segment. |
bodies | Array.<Phaser.Types.Physics.Matter.MatterBody> | <optional> |
An array of bodies to check. If not provided it will search all bodies in the world. |
An array of bodies whos vertices intersect with the ray segment.