ParticleEmitter.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(__INCLUDE_ParticleEmitterh_INCLUDE__)
00022 #define __INCLUDE_ParticleEmitterh_INCLUDE__
00023 
00024 #include <graph/ParticleEngine.h>
00025 #include <GLEXT/GLTextureSet.h>
00026 #include <common/OptionsTransient.h>
00027 
00028 class ParticleEmitter
00029 {
00030 public:
00031         ParticleEmitter();
00032         virtual ~ParticleEmitter();
00033 
00034         float life1_, life2_;
00035         float mass1_, mass2_;
00036         float friction1_, friction2_;
00037 
00038         float startAlpha1_, startAlpha2_;
00039         float endAlpha1_, endAlpha2_;
00040         Vector velocity1_, velocity2_;
00041         Vector startColor1_, startColor2_;
00042         Vector endColor1_, endColor2_;
00043         Vector startSize1_, startSize2_;
00044         Vector endSize1_, endSize2_;
00045         Vector gravity_;
00046         bool additiveTexture_;
00047         bool windAffect_;
00048 
00049         void createDefaultParticle(Particle &particle);
00050 
00051         void setAttributes(
00052                 float life1, float life2,
00053                 float mass1, float mass2,
00054                 float friction1, float friction2,
00055                 Vector velocity1, Vector velocity2,
00056                 Vector startColor1, float startAlpha1,
00057                 Vector startColor2, float startAlpha2,
00058                 Vector endColor1, float endAlpha1,
00059                 Vector endColor2, float endAlpha2,
00060                 float startX1, float startY1,
00061                 float startX2, float startY2,
00062                 float endX1, float endY1,
00063                 float endX2, float endY2,
00064                 Vector gravity,
00065                 bool additiveTexture,
00066                 bool windAffect);
00067 
00068         void setLife(float life1, float life2);
00069         void setMass(float mass1, float mass2);
00070         void setFriction(float friction1, float friction2);
00071         void setVelocity(Vector velocity1, Vector velocity2);
00072         void setStartColor(
00073                 Vector startColor1, float startAlpha1,
00074                 Vector startColor2, float startAlpha2);
00075         void setEndColor(
00076                 Vector endColor1, float endAlpha1,
00077                 Vector endColor2, float endAlpha2);
00078         void setStartSize(
00079                 float startX1, float startY1,
00080                 float startX2, float startY2);
00081         void setEndSize(
00082                 float endX1, float endY1,
00083                 float endX2, float endY2);
00084         void setGravity(Vector gravity);
00085         void setAdditiveTexture(bool additiveTexture);
00086         void setWindAffect(bool windAffect);
00087 
00088         void emitLinear(int number, 
00089                 Vector &position1, Vector &position2,
00090                 ParticleEngine &engine,
00091                 ParticleRenderer *renderer = 0);
00092         void emitExplosionRing(int number,
00093                 Vector &position,
00094                 ParticleEngine &engine,
00095                 ParticleRenderer *renderer = 0);
00096         void emitDebris(int number,
00097                 Vector &position,
00098                 ParticleEngine &engine);
00099         void emitSmoke(int number,
00100                 Vector &position,
00101                 ParticleEngine &engine);
00102         void emitNapalm(
00103                 Vector &position,
00104                 ParticleEngine &engine,
00105                 GLTextureSet *set);
00106         void emitSpray(
00107                 Vector &position,
00108                 ParticleEngine &engine,
00109                 float width,
00110                 GLTexture *texture);
00111         void emitTalk(
00112                 Vector &position,
00113                 ParticleEngine &engine);
00114         void emitWallHit(
00115                 Vector &position,
00116                 ParticleEngine &engine,
00117                 OptionsTransient::WallSide type);
00118         void emitTransport(
00119                 Vector &position,
00120                 ParticleEngine &engine,
00121                 GLTextureSet *set);
00122         void emitExplosion(
00123                 Vector &position,
00124                 ParticleEngine &engine,
00125                 float width,
00126                 GLTextureSet *set,
00127                 bool animate);
00128         void emitMushroom(
00129                 Vector &position,
00130                 ParticleEngine &engine,
00131                 int number,
00132                 float width);
00133         void emitPrecipitation(
00134                 Vector &position,
00135                 ParticleEngine &engine,
00136                 int number,
00137                 bool rain);
00138 };
00139 
00140 #endif // __INCLUDE_ParticleEmitterh_INCLUDE__
00141 

Generated on Mon Feb 16 15:14:46 2009 for Scorched3D by  doxygen 1.5.3