torque.alignToField
Swing onto the field's line like a compass needle.
torque.alignToField(layout: OrientationLayout): AgentTorque
Import sim from shaders/std and use sim.agentForces.torque.alignToField.
Parameters
| Name | Type | Notes |
|---|---|---|
layout | OrientationLayout |
Example
torques: [torque.alignToField(simLayout), torque.rest(simLayout)]
See also
torque.rest— A weak swing back to each agent's rest angle, felt only where the field is faint.field.dipoleOrRadial— The field of a magnet at the cursor: a bar magnet along its travel, or a single pole.