nodes(for:)
Returns the group of nodes corresponding to an obstacle in the graph.
Declaration
func nodes(for obstacle: GKPolygonObstacle) -> [NodeType]Parameters
- obstacle:
An obstacle in the graph.
Return Value
An array of nodes representing the navigable points nearest to each of the obstacle’s vertices.
Discussion
Adding obstacles to a graph creates additional graph nodes corresponding to the navigable points nearest to each of the obstacle’s vertices. The GKObstacleGraph class automatically creates, removes, or rearranges these nodes where necessary, and automatically connects or disconnects other nodes so that no path between nodes passes through an obstacle.