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