Documentation
    Preparing search index...

    Class WanderState

    The per-agent memory wander needs: where the wander target currently sits on the circle.

    Wander is the one behaviour that is not a pure function of the agent's state — "random but not twitchy" means correlating this step's target with the last one, so the correlation has to live somewhere. It lives here, one object per agent, alongside the shape parameters, so the behaviour itself stays a function and two agents can never share a wander phase by accident.

    Index
    angle: number

    Current angle of the wander target on the circle, in radians, measured in the world XY plane from +X. Kept wrapped to [−π, π) by wander and wanderSpherical.

    distance: number

    Distance from the agent to the circle's centre, in units.

    elevation: number

    Current elevation of the wander target, in radians, measured from the heading-aligned equator toward the frame's up. Kept in [−π/2, π/2] by wanderSpherical. wander does not read or write it.

    jitter: number

    Maximum angular jitter, in radians per second.

    radius: number

    Radius of the wander circle, in units.

    • Puts the wander target back at angle / elevation radians (default 0 / 0).

      Parameters

      • Optionalangle: number
      • Optionalelevation: number

      Returns this