Acceleration budget in units per second squared.
Top speed in units per second.
ReadonlypositionWorld position. Owned by the agent; write into it, never replace it.
ReadonlyvelocityWorld velocity in units per second. Owned by the agent.
Adds acceleration · weight to the running sum. acceleration is only
read, so the same scratch vector can be reused for every behaviour.
Clears the weighted sum. Returns this agent.
Writes the weighted sum into out, truncated to maxAcceleration,
and returns out — one write, like every behaviour. The sum is left
intact, so it can be inspected or blended further; beginSteering is
what clears it.
Advances the agent by deltaTime seconds under acceleration, using
semi-implicit Euler with a maxSpeed clamp (see the class note). Returns
this agent.
A mutable SteeringContext with a weighted blender and a one-line integrator — the convenience wrapper plan P8-2 leaves optional.
It exists because every real use of this module repeats the same three things: hold the agent's state, add up several behaviours with weights, and apply the result. None of that belongs inside a behaviour, and all of it is tedious to rewrite.
The blend is a weighted sum truncated once at the end, the simplest of the combination strategies Reynolds describes. Prioritized dithering and truncated running-sum arbitration are deliberately not here: they change which behaviours are evaluated at all, which is an application policy.
integrateis semi-implicit Euler with a speed clamp — the §38 default and the same ruleMotionComponentuses (v += a·dt, clamp,x += v·dt) — so an agent driven by this class and one driven by aMotionComponentmove identically. It is a convenience for standalone agents and headless tests; an agent that is a scene node should be driven byMotionSystem(§39) or a physics body instead, withposition/velocitymirroring the node.The three vectors are owned by the agent and never replaced. Allocation happens only in the constructor.