ReferenceSamplersFunction
spread()
Picks numbers spread evenly around a center.
function spread(center: number, deviation: number): SamplerFn<number>;Creates a sampler that picks numbers from center - deviation to center + deviation, spread
evenly across each batch of particles.
Within a batch (a group of particles spawned in the same simulation step, such as a burst), the range is divided into one equal slice per particle, and each particle gets a random value within its own slice. A burst therefore will always cover the whole range evenly, without the clumps and gaps that truly independent random values could produce. A particle spawned on its own gets a random value from the whole range.
Parameters
Section titled “Parameters”centernumberThe middle of the range.
deviationnumberHow far values may lie from the center, in either direction.
Returns
Section titled “Returns”SamplerFn<number>