steerkit Reynolds' steering behaviors, small and engine-agnostic

Obstacle avoidance

The agents go to the pointer through a field of rocks. Each one looks lookAhead seconds ahead, in a corridor as wide as itself (shaded for the highlighted agent): of the rocks it would hit, the nearest makes it turn toward the direction that just clears it, the wider the nearer. Avoidance comes first and weighs 3: with the pointer behind a rock, a weaker one would be cancelled by the pull toward it. Lower its weight to see the agents run into the rocks.

  • velocity
  • desired velocity
  • steering force

TypeScript