From 844712beaf13127ab7e54cff1a00d87ae260d522 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 20 Oct 2013 11:58:27 +0000 Subject: Make thrust triggered particle ejectors set output particle speed depending on the current entity thrust value. --- src/render/particleejector.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/render/particleejector.cc') diff --git a/src/render/particleejector.cc b/src/render/particleejector.cc index 5fae7d1..22ddf2d 100644 --- a/src/render/particleejector.cc +++ b/src/render/particleejector.cc @@ -38,7 +38,7 @@ void ParticleEjector::clear() ejector_last_eject = 0; } -void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_location, const math::Axis & ps_axis) +void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_location, const math::Axis & ps_axis, const float thrust_factor) { unsigned long now = core::application()->timestamp(); @@ -58,7 +58,7 @@ void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_locat if (!ejector_timestamp) { ejector_timestamp = now; } - + if (!timeout() || (ejector_timestamp + timeout() > now)) { while (ejector_last_eject > interval()) { @@ -87,7 +87,7 @@ void ParticleEjector::frame(const float seconds, const math::Vector3f & ps_locat particle->get_color().a = alpha_vec()[0]; particle->set_rotation(math::randomf(2.0f * M_PI)); - particle->set_speed(math::randomf(speed_vec()[0], speed_vec()[1])); + particle->set_speed(math::randomf(speed_vec()[0], speed_vec()[1]) * thrust_factor ); particles().push_front(particle); if (type() == Streak) { -- cgit v1.2.3