Skip to content

wallFollowing

wallFollowing(pos, vel, walls, params, maxSpeed): Vec2

Defined in: src/modules/steering/steering.ts:284

Follow the nearest wall within params.range, keeping desiredDistance from it. Blends a tangential term (move along the wall in the direction the agent is already travelling) with a normal correction that restores the preferred gap. Returns the zero vector when no wall is in range, or when the agent sits exactly on the wall (no side to pick).

Vec2

Vec2

readonly Segment[]

WallFollowParams

number

Vec2