five-on-it / packages/ai/src/steer-foot
packages/ai/src/steer-foot
Moving on foot: the chaser's path on the navigation grid (planned within the world's budget and followed waypoint by waypoint), three short rays that steer it around the cars and people the grid knows nothing about, and what it does when it finds itself stuck (a sidestep, then a jump, then a plan around the spot that stuck it). Headings come back in the world's x and z, for the chaser to write into its input; a waypoint reached by a link of the navigation (a ladder, a lift…) is taken by steer-climb.ts, which hands back the whole input while it is at it.
Before any search, the plan asks the navigation's components whether the goal's floor can be reached at all (navReachable): a roof with no way up costs no search, and the walk goes to the nearest way down from it instead (a ladder's foot, a lift's door, where a drop off it lands), or to the nearest spot it reaches below it.