Wiserim on GitHub has released Phaser Raycaster v0.9.3, a Phaser 3 plugin which provide raycasting for geometric Game Objects, Sprites and Matter.js bodies. It can be used with Arcade Physics and Matter Physics.
Features:
- Compatible with Arcade and Matter Physics.
- Raycasting in a single direction, 360 degrees circle or in a cone.
- Visibility detection - collision detection with game objects.
- Test rays against mapped Game Objects: Containers, Lines, Rectangles, Polygons, Circles, Sprites, Tilemaps and Matter bodies.
- Provides closest intersection points between rays and tested objects.
- Tests can be made on all mapped objects, selected ones or only ones within detection range.
- Static and Dynamic mapping for individual objects.
- Mapped objects intersections detection.
The plugin comes with full documentation and examples on Codepen.