ReferenceBehaviorsType
BehaviorUpdate
Updates a particle by one simulation step.
type BehaviorUpdate = (particle: Particle, ctx: BehaviorUpdateContext) => void;A function that updates a particle by a single simulation step.
Called for every particle on every step, in the order that the behaviors are listed in.
Any “per-second” changes should be scaled by ctx.dt to make the behavior independent of the step size.
Parameters
Section titled “Parameters”particleParticleThe particle to be updated.
ctxBehaviorUpdateContextThe context supplied to the update, including the random number generator and the time step.