diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-24 12:29:33 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-24 12:29:33 +0000 |
commit | bea93daec3ad4e3345c701e5dcce250c44d128f2 (patch) | |
tree | b8056f0d9ec3f634cf21c21e86a06094a43eb6fa /src/particleemitter.cpp | |
parent | 5f391618757e93c010141380583ff487848286da (diff) | |
download | mana-client-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.gz mana-client-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.bz2 mana-client-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.xz mana-client-bea93daec3ad4e3345c701e5dcce250c44d128f2.zip |
Added particle property "follow-parent" which makes the particle move when its parent particle is moved.
Diffstat (limited to 'src/particleemitter.cpp')
-rw-r--r-- | src/particleemitter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 8f46c32b..631ca228 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -54,6 +54,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * mParticleGravity.set(0.0f); mParticleRandomnes.set(0); mParticleBounce.set(0.0f); + mParticleFollow = false; mParticleAcceleration.set(0.0f); mParticleDieDistance.set(-1.0f); mParticleMomentum.set(1.0f); @@ -158,6 +159,10 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * { mParticleAlpha = readMinMax(propertyNode, 1.0f); } + else if (name == "follow-parent") + { + mParticleFollow = true; + } else { logger->log("Particle Engine: Warning, unknown emitter property \"%s\"", @@ -258,6 +263,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mParticleGravity = o.mParticleGravity; mParticleRandomnes = o.mParticleRandomnes; mParticleBounce = o.mParticleBounce; + mParticleFollow = o.mParticleFollow; mParticleTarget = o.mParticleTarget; mParticleAcceleration = o.mParticleAcceleration; mParticleDieDistance = o.mParticleDieDistance; @@ -339,6 +345,7 @@ ParticleEmitter::createParticles() newParticle->setRandomnes(mParticleRandomnes.value()); newParticle->setGravity(mParticleGravity.value()); newParticle->setBounce(mParticleBounce.value()); + newParticle->setFollow(mParticleFollow); newParticle->setDestination(mParticleTarget, mParticleAcceleration.value(), |