Skip to content

1681-engine / index / dueParticles

Function: dueParticles() ​

ts
function dueParticles(
   rate, 
   dt, 
   carry
): number;

Defined in: src/particles/particleSampling.ts:20

Whole particles due after dt seconds at rate a second, given the fraction carry left over from before. Kept as a fraction rather than rounded each frame, or 30 a second at 144 fps (0.21 a frame) would emit none at all. Returns the count in the integer part and the new carry in the fraction: n = Math.floor(v), carry = v - n.

Parameters ​

ParameterType
ratenumber
dtnumber
carrynumber

Returns ​

number

Released under the MIT License.