summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-02-12 14:00:22 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-02-12 14:00:22 +0000
commit34e9c3e9125ef800ef47e2594cf23853deddccfb (patch)
tree8267b404c63e056a174a69a820ba3f62a2a2fa17 /src
parent73b5bce7e4144cd9b6ce1748439e6cf7517351bc (diff)
downloadmana-34e9c3e9125ef800ef47e2594cf23853deddccfb.tar.gz
mana-34e9c3e9125ef800ef47e2594cf23853deddccfb.tar.bz2
mana-34e9c3e9125ef800ef47e2594cf23853deddccfb.tar.xz
mana-34e9c3e9125ef800ef47e2594cf23853deddccfb.zip
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)
Diffstat (limited to 'src')
-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