pathFollowing
pathFollowing(
pos,vel,path,maxSpeed,predictDistance):Vec2
Defined in: src/modules/steering/steering.ts:332
Reynolds path following: predict where the agent is heading, and if that
point strays outside the path corridor (path.radius), seek back toward a
target nudged forward along the nearest segment. Returns the zero vector
while the agent stays within the corridor. Stateless — it re-derives the
nearest segment each call, so no waypoint index is threaded through.
Keeps the agent on the path; it does not stop at the final point. Compose
with arrive for the last-leg approach.
Parameters
Section titled “Parameters”maxSpeed
Section titled “maxSpeed”number
predictDistance
Section titled “predictDistance”number