integrator.drift2d
Motes that glide on a built-in drift plus a fading gust, wrapping around the canvas.
integrator.drift2d(layout: DriftLayout, cfg: {
drift: AgentDrift
gust: (pos: d.v2f) => d.v2f
name: string
}): (i: number) => void
Import sim from shaders/std and use sim.agentForces.integrator.drift2d.
Parameters
| Name | Type | Notes |
|---|---|---|
layout | DriftLayout | |
cfg | `{ |
drift: AgentDrift
gust: (pos: d.v2f) => d.v2f
name: string
}` | |
Example
integrator.drift2d(simLayout, {drift: drift.variedHeading(simLayout), gust: force.cursorGust(simLayout), name: 'motesUpdate'})
See also
drift.variedHeading— One shared heading and speed, each varied a little per mote.force.cursorGust— A puff from the cursor on drifting motes, zero while the force slider sits at 0.