summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/particle.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 93fc7893..3d6b723d 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -96,26 +96,7 @@ Particle::update()
if (mAlive)
{
- // Update child emitters
- if (mLifetimePast%Particle::emitterSkip == 0)
- {
- for ( EmitterIterator e = mChildEmitters.begin();
- e != mChildEmitters.end();
- e++
- )
- {
- Particles newParticles = (*e)->createParticles();
- for ( ParticleIterator p = newParticles.begin();
- p != newParticles.end();
- p++
- )
- {
- (*p)->moveBy(mPos.x, mPos.y, mPos.z);
- mChildParticles.push_back (*p);
- }
- }
- }
-
+ //calculate particle movement
if (mMomentum != 1.0f)
{
mVelocity *= mMomentum;
@@ -187,6 +168,26 @@ Particle::update()
mAlive = false;
}
}
+
+ // Update child emitters
+ if (mLifetimePast%Particle::emitterSkip == 0)
+ {
+ for ( EmitterIterator e = mChildEmitters.begin();
+ e != mChildEmitters.end();
+ e++
+ )
+ {
+ Particles newParticles = (*e)->createParticles();
+ for ( ParticleIterator p = newParticles.begin();
+ p != newParticles.end();
+ p++
+ )
+ {
+ (*p)->moveBy(mPos.x, mPos.y, mPos.z);
+ mChildParticles.push_back (*p);
+ }
+ }
+ }
}
// Update child particles