diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-26 13:16:15 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-26 13:16:15 -0600 |
commit | 7e09b5c2efae58399621a938de26b9675b8ba621 (patch) | |
tree | de2c9535e1f4c48ae91910492d298eba1d593fd5 /tdescreensaver/kdesavers/firesaverparticle.h | |
parent | 159f7e147ac33c924b3ce9050c8f03cbc54916ee (diff) | |
download | tdeartwork-7e09b5c2efae58399621a938de26b9675b8ba621.tar.gz tdeartwork-7e09b5c2efae58399621a938de26b9675b8ba621.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'tdescreensaver/kdesavers/firesaverparticle.h')
-rw-r--r-- | tdescreensaver/kdesavers/firesaverparticle.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/tdescreensaver/kdesavers/firesaverparticle.h b/tdescreensaver/kdesavers/firesaverparticle.h new file mode 100644 index 00000000..e539adec --- /dev/null +++ b/tdescreensaver/kdesavers/firesaverparticle.h @@ -0,0 +1,105 @@ +// This file is part of KFireSaver3D. + +// KFireSaver3D is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. + +// KFireSaver3D is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with KFireSaver3D; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +// Author: Enrico Ros, based on the great work of David Sansome (kfiresaver) +// Email: asy@libero.it + +#ifndef KFIRESAVER_PARTICLE_H +#define KFIRESAVER_PARTICLE_H + +#include <tqgl.h> + +#define FLICKER_FRAMES_DELAY 8 +#define DRAND ((float)rand() / (float)RAND_MAX) /*random float between 0 and 1*/ + +/* -- Particle class. + * Sets initial parameters and takes care of updating physics for a single + * fireworks particle. The physics model is the Newtonian one. + */ +class Particle +{ + public: + //enum definitions for type of particle + enum ParticleType + { + FireParticle, + FireWorkLeaderParticle, + FireWorkDebrisParticle, + LogoParticle, + StarParticle + }; + + Particle( ParticleType pT ); + + //public methods for initializing default parameters and update them + virtual void initializeValues ( + int color_scheme = 0, + Particle* leader = 0L, + GLfloat powermin = 5.0, + GLfloat powermax = 10.0, + bool flickers = false, + GLfloat *displace = 0L ); + + virtual void updateParameters ( float timeGap ); + + //public accessible variables of the class + ParticleType particleType; + int explosionsDepth; + unsigned int texture; + + GLfloat xpos, ypos, zpos, + xspeed, yspeed, zspeed, + zacc; + + GLfloat colour[4], + life, startLife, + pixelSize; + + bool useLife; + int flicker; + + private: + Particle(); +}; + + +/* -- TurningParticle class. + * Randomize initial parameters similar to a standard 'spherical' particle + * and takes care of updating physics. The physics model is a funny 'bees' + * (vectorial-product) one. + */ +class TurningParticle : public Particle +{ + public: + TurningParticle( ParticleType pT ); + + virtual void initializeValues ( + int color_scheme = 0, + Particle* leader = 0L, + GLfloat powermin = 5.0, + GLfloat powermax = 10.0, + bool flickers = false, + GLfloat *displace = 0L ); + + virtual void updateParameters ( float dT ); + + private: + float wx, wy, wz; + TurningParticle(); +}; + +#endif |