A navigation graph for 2D game worlds that creates a space-filling network for smooth pathfinding around obstacles.
- iOS 10.0+
- macOS 10.12+
- tvOS 10.0+
To use a mesh graph for pathfinding, add a collection of
GKObstacle objects representing impassable areas and
GKGraph objects representing points of interest (such as the current position of a game character and the location it needs to find a route to). Then use methods of the superclass
GKGraph to find routes through the graph.
Unlike the related
GKObstacle class, a mesh graph creates a space-filling network of graph nodes, resulting in paths that are smooth but not the most efficient.