diff options
Diffstat (limited to 'src/render/particleejector.cc')
-rw-r--r-- | src/render/particleejector.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/render/particleejector.cc b/src/render/particleejector.cc index 92b8d8f..9ee9cc8 100644 --- a/src/render/particleejector.cc +++ b/src/render/particleejector.cc @@ -47,12 +47,11 @@ void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_locat it = particles().rbegin(); } + ejector_last_eject += (unsigned long) (1000.0f * seconds); + // add new particles if (ejector_enabled) { - // FIXME currently, only one particle per frame is ejected - // particle ejection rate should be independent of framerate, but we run into issues - // of the particle systems not rendered - if (ejector_last_eject + interval() <= now) { + while (ejector_last_eject > interval()) { math::Vector3f particle_location; math::Axis particle_axis; if (!attached()) { @@ -75,9 +74,9 @@ void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_locat particle->set_radius(radius_vec()[0]); particle->set_alpha(alpha_vec()[0]); particle->set_rotation(math::randomf(2.0f * M_PI)); - particle->set_speed(speed()); + particle->set_speed(math::randomf(speed_vec()[0], speed_vec()[1])); particles().push_front(particle); - ejector_last_eject = now; + ejector_last_eject -= interval(); } } else { ejector_last_eject = 0; |