integrator.orientation2d

Agents that turn in place under summed torques and drift a little toward the field.

integrator.orientation2d(layout: OrientationLayout, cfg: {
    home: AgentHome2
    fieldAt: AgentFieldAt
    torques: AgentTorque[]
    maxOffset: number
    name: string
}): (i: number) => void

Import sim from shaders/std and use sim.agentForces.integrator.orientation2d.

Parameters

NameTypeNotes
layoutOrientationLayout
cfg`{
home: AgentHome2
fieldAt: AgentFieldAt
torques: AgentTorque[]
maxOffset: number
name: string

}` | |

Example

integrator.orientation2d(simLayout, {home: field.jitteredGridHome(simLayout, {overscan: 0.14}), fieldAt: field.dipoleOrRadial(simLayout), torques: [torque.alignToField(simLayout), torque.rest(simLayout)], maxOffset: 0.12, name: 'filingsUpdate'})

See also

  • torque — The turns an agent that spins in place can feel, for integrator.orientation2d.
  • field — What a turning agent samples at its position: the magnetic field at the cursor, and its resting place on a jittered grid.