torque

The turns an agent that spins in place can feel, for integrator.orientation2d.

torque: { alignToField, rest }

Import sim from shaders/std and use sim.agentForces.torque.

Example

torques: [torque.alignToField(simLayout), torque.rest(simLayout)]

Members

  • torque.alignToField — Swing onto the field's line like a compass needle.
  • torque.rest — A weak swing back to each agent's rest angle, felt only where the field is faint.

See also

  • field — What a turning agent samples at its position: the magnetic field at the cursor, and its resting place on a jittered grid.
  • integrator — The update step of an agent simulation: one per kind of agent.