five-on-it / packages/ai/src/pathfinding / smoothLayeredPath
Function: smoothLayeredPath()
smoothLayeredPath(
layers,nodes):Waypoint[]
Defined in: packages/ai/src/pathfinding.ts:439
Pulls the string of a path over a layered navigation: on flat ground as smoothGridPath does, the floors' nodes and the slopes' (stairs, ramps) kept as they are (a straight line over the ground says nothing of a floor's edges, nor of the side of a flight of stairs), so a walk goes to the foot of the stairs, up their length and along the deck they reach. A step that takes a link (up a ladder, onto a lift, off a roof's edge) keeps both its ends as waypoints, the second marked with its link, and no string is pulled across it.
Parameters
layers
nodes
readonly number[]
Returns
Waypoint[]