Force fields that affect particles in an area.
Usage:
const field = new ForceField({ type: 'attractor', x: 400, y: 300, strength: 500, radius: 200 });// In particle update:field.apply(particle, delta); Copy
const field = new ForceField({ type: 'attractor', x: 400, y: 300, strength: 500, radius: 200 });// In particle update:field.apply(particle, delta);
Apply force to a single target. Mutates vx/vy.
Apply force to many targets
Move the force field
Force fields that affect particles in an area.
Usage: