From 34e9c3e9125ef800ef47e2594cf23853deddccfb Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Tue, 12 Feb 2008 14:00:22 +0000 Subject: Particle emitters are now activated after the parent particle has moved instead of before (small change which allows a little trick to create polar emitters) --- src/particle.cpp | 41 +++++++++++++++++++++-------------------- 1 file 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 -- cgit v1.2.3-60-g2f50