threejs-worldgen
    Preparing search index...

    Class EmitterClock

    Deterministic spawn scheduling for a fixed-capacity ring buffer: fractional particles carry over between frames, so the same sequence of dt always spawns the same particles with the same serial numbers (and therefore the same random numbers), whatever the frame rate splits look like.

    Index
    capacity: number

    Pool size.

    head: number = 0

    Ring slot of the next particle.

    spawned: number = 0

    Particles spawned since the last reset; the serial of the next one.

    • Spawns rate × dt particles (plus the carried fraction), at most maxPerFrame.

      Parameters

      • rate: number
      • dt: number
      • maxPerFrame: number = Infinity

      Returns SpawnBatch