23inline u32 burstsDue(
const std::vector<ScheduledBurst>& schedule,
f32 prev,
f32 cur,
f32 duration,
bool looping) {
25 const bool cycles = looping && duration > 0.0f;
26 const int first = cycles ?
static_cast<int>(std::floor(std::max(prev, 0.0f) / duration)) : 0;
27 const int last = cycles ?
static_cast<int>(std::floor(cur / duration)) : 0;
29 for (
int k = first; k <= last; ++k) {
30 const f32 at = b.time +
static_cast<f32>(k) * duration;
31 if (prev < at && at <= cur) total += b.count;
u32 burstsDue(const std::vector< ScheduledBurst > &schedule, f32 prev, f32 cur, f32 duration, bool looping)
How many particles the schedule releases while the emitter's clock goes from prev to cur.
One burst of a schedule: count particles at time seconds after the emitter starts emitting.