diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-10-26 01:46:40 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-10-26 01:46:40 +0000 |
commit | 56410d9ff28448a73be7a7d115d54c1ee578972c (patch) | |
tree | b9a7b56222610d08215eaf29cb921635b9e3081b /src/particleemitter.h | |
parent | c650e2b6338cf4b18b0968623d12ef95a7b820fc (diff) | |
download | mana-client-56410d9ff28448a73be7a7d115d54c1ee578972c.tar.gz mana-client-56410d9ff28448a73be7a7d115d54c1ee578972c.tar.bz2 mana-client-56410d9ff28448a73be7a7d115d54c1ee578972c.tar.xz mana-client-56410d9ff28448a73be7a7d115d54c1ee578972c.zip |
Implemented particle emitters with properties which change over time according to wave functions.
Diffstat (limited to 'src/particleemitter.h')
-rw-r--r-- | src/particleemitter.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/particleemitter.h b/src/particleemitter.h index 5cf3fd46..4ef088f6 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -27,10 +27,11 @@ #include <list> #include "utils/xml.h" -#include "utils/minmax.h" #include "resources/animation.h" +#include "particleemitterprop.h" + class Image; class Map; class Particle; @@ -66,7 +67,7 @@ class ParticleEmitter * Spawns new particles * @return: a list of created particles */ - std::list<Particle *> createParticles(); + std::list<Particle *> createParticles(int tick); /** * Sets the target of the particles that are created @@ -76,50 +77,50 @@ class ParticleEmitter { mParticleTarget = target; }; private: - template <typename T> MinMax<T> readMinMax(xmlNodePtr propertyNode, T def); + template <typename T> ParticleEmitterProp<T> readParticleEmitterProp(xmlNodePtr propertyNode, T def); /** * initial position of particles: */ - MinMax<float> mParticlePosX, mParticlePosY, mParticlePosZ; + ParticleEmitterProp<float> mParticlePosX, mParticlePosY, mParticlePosZ; /** * initial vector of particles: */ - MinMax<float> mParticleAngleHorizontal, mParticleAngleVertical; + ParticleEmitterProp<float> mParticleAngleHorizontal, mParticleAngleVertical; /** * Initial velocity of particles */ - MinMax<float> mParticlePower; + ParticleEmitterProp<float> mParticlePower; /* * Vector changing of particles: */ - MinMax<float> mParticleGravity; - MinMax<int> mParticleRandomness; - MinMax<float> mParticleBounce; + ParticleEmitterProp<float> mParticleGravity; + ParticleEmitterProp<int> mParticleRandomness; + ParticleEmitterProp<float> mParticleBounce; bool mParticleFollow; /* * Properties of targeting particles: */ Particle *mParticleTarget; - MinMax<float> mParticleAcceleration; - MinMax<float> mParticleDieDistance; - MinMax<float> mParticleMomentum; + ParticleEmitterProp<float> mParticleAcceleration; + ParticleEmitterProp<float> mParticleDieDistance; + ParticleEmitterProp<float> mParticleMomentum; /* * Behavior over time of the particles: */ - MinMax<int> mParticleLifetime; - MinMax<int> mParticleFadeOut; - MinMax<int> mParticleFadeIn; + ParticleEmitterProp<int> mParticleLifetime; + ParticleEmitterProp<int> mParticleFadeOut; + ParticleEmitterProp<int> mParticleFadeIn; Map *mMap; /**< Map the particles are spawned on */ - MinMax<int> mOutput; /**< Number of particles spawned per update */ - MinMax<int> mOutputPause; /**< Pause in frames between two spawns */ + ParticleEmitterProp<int> mOutput; /**< Number of particles spawned per update */ + ParticleEmitterProp<int> mOutputPause; /**< Pause in frames between two spawns */ int mOutputPauseLeft; /* @@ -127,7 +128,7 @@ class ParticleEmitter */ Image *mParticleImage; /**< Particle image, if used */ Animation mParticleAnimation; /**< Filename of particle animation file */ - MinMax<float> mParticleAlpha; /**< Opacity of the graphical representation of the particles */ + ParticleEmitterProp<float> mParticleAlpha; /**< Opacity of the graphical representation of the particles */ /** List of emitters the spawned particles are equipped with */ std::list<ParticleEmitter> mParticleChildEmitters; |