update method
Advances every live particle by dt seconds.
Implementation
@override
void update(ParticleStorage storage, double dt) {
final count = frameCount.toDouble();
final fps = framesPerSecond;
final n = storage.aliveCount;
for (var i = 0; i < n; i++) {
var frame = 0.0;
if (fps == null) {
final life = storage.lifetime[i];
final nAge = life > 0.0 ? storage.age[i] / life : 0.0;
// Clamp shy of the end so the last cell holds instead of wrapping.
frame = nAge * count;
if (frame > count - 1.0) frame = count - 1.0;
} else {
frame = storage.age[i] * fps;
}
if (randomStartFrame) {
frame += storage.randomFor(i, _saltFlipbookStart) * count;
}
storage.frame[i] = frame % count;
}
}