diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-20 11:58:27 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-20 11:58:27 +0000 |
commit | 844712beaf13127ab7e54cff1a00d87ae260d522 (patch) | |
tree | 0d3f47a4608f62d31bc118782a32e23b1ffd024b /src/render/particlesystem.cc | |
parent | 55f9c240525d77686d00d43f627db7892f27e1de (diff) |
Make thrust triggered particle ejectors set output particle speed depending on the current entity thrust value.
Diffstat (limited to 'src/render/particlesystem.cc')
-rw-r--r-- | src/render/particlesystem.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/render/particlesystem.cc b/src/render/particlesystem.cc index c085d5d..c29243c 100644 --- a/src/render/particlesystem.cc +++ b/src/render/particlesystem.cc @@ -156,8 +156,13 @@ void ParticleSystem::draw(const float seconds) ParticleEjector *ejector = (*it); if (entity()) { + float thrust_factor = 1.0f; bool ejector_active = true; + if (ejector->thrust()) { + thrust_factor = 0.0f; + } + if (ejector->impulse() || ejector->thrust() || ejector->explosion()) { ejector_active = false; } @@ -170,6 +175,7 @@ void ParticleSystem::draw(const float seconds) case core::Entity::ImpulseInitiate: if (ejector->impulse()) { ejector_active = true; + thrust_factor = 1.0f; } break; @@ -177,6 +183,7 @@ void ParticleSystem::draw(const float seconds) if (ejector->thrust()) { if (controlable->thrust() > 0.0f) { ejector_active = true; + thrust_factor = controlable->thrust(); } } break; @@ -223,10 +230,10 @@ void ParticleSystem::draw(const float seconds) } } ejector->enable(ejector_active); + + (*it)->frame(seconds, current_location, current_axis * ejector->axis(), thrust_factor); } - (*it)->frame(seconds, current_location, current_axis * ejector->axis()); - } } |