Creates an instance of Phaser2NavMesh.
The plugin that owns this mesh.
The key the mesh is stored under within the plugin.
Array where each element is an array of point-like objects that defines a polygon.
Clear the debug graphics.
Visualize the polygons in the navmesh by drawing them to the debug graphics.
Visualize a path (array of points) on the debug graphics.
Array of point-like objects in the form {x, y}
Destroy the mesh, kill the debug graphic and unregister itself with the plugin.
Hide the debug graphics, but don't destroy it.
Enable the debug drawing graphics. If no graphics object is provided, a new instance will be created.
An optional graphics object for the mesh to use for debug drawing. Note, the mesh will destroy this graphics object when the mesh is destroyed.
The graphics object this mesh uses.
See {@link NavMesh#findPath}. This implements the same functionality, except that the returned path is converted to Phaser-compatible points.
A point-like object in the form {x, y}
A point-like object in the form {x, y}
The point class to use to represent points in the path.
An array of points if a path is found, or null if no path
Returns true if the debug graphics object is enabled and visible.
Find if the given point is within any of the polygons in the mesh.
Generated using TypeDoc
A wrapper around NavMesh for Phaser 2 / Phaser CE. Create instances of this class from Phaser2NavMeshPlugin. This is the workhorse that represents a navigation mesh built from a series of polygons. Once built, the mesh can be asked for a path from one point to another point.
Compared to NavMesh, this adds visual debugging capabilities and converts paths to Phaser-compatible point instances.