Skip to content

wander

wander(vel, state, params, maxSpeed): Vec2

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

Reynolds wander: jitter an angle each tick, project a point on a circle ahead of the agent’s heading, and steer toward it. Produces smooth, meandering motion instead of the twitchy path of pure random velocity. Mutates state.angle in place.

Vec2

WanderState

WanderParams

number

Vec2