force.cursorXY
The cursor as a magnet on a 3D swarm, pushing away (or pulling in when the force is negative).
force.cursorXY(layout: VolumeSwarmLayout): AgentForce3
Import sim from shaders/std and use sim.agentForces.force.cursorXY.
Parameters
| Name | Type | Notes |
|---|---|---|
layout | VolumeSwarmLayout |
Example
forces: [pressure.force, force.cursorXY(simLayout), force.gravity(simLayout)]
See also
force.gravity— A constant pull on a 3D swarm in the direction ofparams.gravX, gravY.force.turbulence— A per-agent jitter that keeps a 3D swarm alive, scaled byparams.agitation.