Main Page Namespace List Class Hierarchy Alphabetical List Data Structures File List Namespace Members Data Fields Globals

# ExCSystemeParticule.h

Go to the documentation of this file.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  * $Id: ExCSystemeParticule.h,v 1.18 2002/12/08 17:57:04 data Exp $
    00021  *
    00022  */
    00023
    00024 #ifndef __EXSYSTEMEPARTICULE_H__
    00025 #define __EXSYSTEMEPARTICULE_H__
    00026 //--------------------------------
    00027 // File to include
    00028 //--------------------------------
    00029 #include "ExDefine.h"
    00030 #include "ExMath.h"
    00031 #include "ExCObject3D.h"
    00032 #include "ExCParticule.h"
    00033 #include "ExCRandomNumber.h"
    00034 #include "ExManagerTexture.h"
    00035 //--------------------------------
    00036
    00037 //--------------------------------
    00038 //Emmeteur type
    00039 //--------------------------------
    00040 #define EMMETEUR_POINT                  1
    00041 #define EMMETEUR_LIGNE                  2
    00042 #define EMMETEUR_RECTANGLE              3
    00043 #define EMMETEUR_CUBE                   4
    00044 #define EMMETEUR_CERCLE                 5
    00045 #define EMMETEUR_SPIRAL                 6
    00046 #define EMMETEUR_DISQUE                 7
    00047 //--------------------------------
    00048
    00049 class ExCSystemeParticule : public ExCObject3D
    00050 {
    00051 protected:
    00052         //--------------------------------
    00053         // Variable
    00054         //--------------------------------
    00055         std::vector<ExCParticule>                       m_VecParticule;
    00056         std::vector<ExCParticule>::iterator m_ItVecParticule;
    00057
    00058
    00059         bool                            m_State;
    00060         bool                            m_Pause;
    00061
    00062         float                           m_TimeLastParticule;
    00063         char                            *m_ParticuleSystemeName;
    00064
    00065         //Param for emmeteur
    00066         float                           m_EmissionRate;
    00067         int                                     m_MaxParticule;
    00068         int                                     m_TypeEmmeteur;
    00069         ExCVec3D                        m_P1;//use for point
    00070         ExCVec3D                        m_P2;//use for line
    00071         float                           m_rayon;
    00072         int                                     m_angle;
    00073         int                                     m_vitesseangle;
    00074         //Max and min value for particule
    00075         int                             m_Type;
    00076         std::string             m_TextureName;
    00077         int                             m_MaxLifeSpan;
    00078         int                             m_MinLifeSpan;
    00079         float                           m_MaxGrowth;
    00080         float                           m_MinGrowth;
    00081         float                   m_MaxSize;
    00082         float                   m_MinSize;
    00083         int                             m_MaxWeight;
    00084         int                             m_MinWeight;
    00085         int                             m_MaxColorR;
    00086         int                             m_MinColorR;
    00087         int                             m_MaxColorG;
    00088         int                             m_MinColorG;
    00089         int                             m_MaxColorB;
    00090         int                             m_MinColorB;
    00091         int                             m_MaxBlending;
    00092         int                             m_MinBlending;
    00093         ExCVec3D                m_MaxVelocity;
    00094         ExCVec3D                m_MinVelocity;
    00095         ExCVec3D                m_MaxAcceleration;
    00096         ExCVec3D                m_MinAcceleration;
    00097         ExCVec3D                m_MaxGravity;
    00098         ExCVec3D                m_MinGravity;
    00099
    00100         ExCVec3D                m_CurrentEmitPosition;
    00101
    00102         void CalculateEmitPosition(void);
    00103         void CreateNewParticle(void);
    00104
    00105 public:
    00106         //struct for bmp
    00107         GLuint                          m_TextureID;
    00108         ExManagerTexture        *ManagerTexture;
    00109         std::ostrstream *Consol;
    00110         //--------------------------------
    00111         // Constructor // Destructor
    00112         //--------------------------------
    00113         ExCSystemeParticule(void);
    00114         ~ExCSystemeParticule(void);
    00115         //--------------------------------
    00116         // Methode
    00117         //--------------------------------
    00118
    00119         inline void SetEmitterType(int value){m_TypeEmmeteur=value;}
    00120         inline void SetMaxParticule(int value){m_MaxParticule=value;}
    00121         inline void SetRange(float value){m_rayon=value;}
    00122         inline void SetSpeedAngle(int value){m_vitesseangle=value;}
    00123         inline void SetRate(int value){m_EmissionRate=value;}
    00124
    00125         inline int GetEmitterType(void){return m_TypeEmmeteur;}
    00126         inline int GetMaxParticule(void){return m_MaxParticule;}
    00127         inline float GetRange(void){return m_rayon;}
    00128         inline int GetSpeedAngle(void){return m_vitesseangle;}
    00129         inline int GetRate(void){return m_EmissionRate;}
    00130
    00131         void Draw(void);
    00132         void Start(void);
    00133         void Pause(void);
    00134         void Stop(void);
    00135
    00136         bool Load(std::string FileName);
    00137         bool Save(std::string  FileName);
    00138
    00139         inline char * GetParticuleSystemeName(void){return m_ParticuleSystemeName;}
    00140         void SetParticuleSystemeName(char * name);
    00141
    00142         inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture = Texture;}
    00143         inline bool GetParticuleSystemeState(void){return m_State;}
    00144         inline void SetParticuleSystemeState(bool state){m_State=state;}
    00145
    00146         void SetParticuleType(int type);
    00147         inline int GetParticuleType(void){return m_Type;}
    00148
    00149         void SetParticuleTexture(std::string Name);
    00150         void SetParticuleTextureName(std::string Name){m_TextureName=Name;}
    00151         inline std::string GetParticuleTexture(void){return m_TextureName;}
    00152
    00153         inline void SetParticuleMaxLife(int life) {m_MaxLifeSpan=life;}
    00154         inline int      GetParticuleMaxLife(void)       {return m_MaxLifeSpan;}
    00155         inline void SetParticuleMinLife(int life) {m_MinLifeSpan=life;}
    00156         inline int      GetParticuleMinLife(void)       {return m_MinLifeSpan;}
    00157
    00158         inline void SetParticuleMaxGrowth(float Growth) {m_MaxGrowth =Growth;}
    00159         inline float    GetParticuleMaxGrowth(void)     {return m_MaxGrowth ;}
    00160         inline void SetParticuleMinGrowth(float Growth) {m_MinGrowth =Growth;}
    00161         inline float    GetParticuleMinGrowth(void)     {return m_MinGrowth ;}
    00162
    00163         inline void SetParticuleMaxSize(float Size) {m_MaxSize=Size;}
    00164         inline float    GetParticuleMaxSize(void)       {return m_MaxSize;}
    00165         inline void SetParticuleMinSize(float Size) {m_MinSize=Size;}
    00166         inline float    GetParticuleMinSize(void)       {return m_MinSize;}
    00167
    00168
    00169         inline void SetParticuleMaxWeight(int Weight) {m_MaxWeight=Weight;}
    00170         inline int      GetParticuleMaxWeight(void)     {return m_MaxWeight;}
    00171         inline void SetParticuleMinWeight(int Weight) {m_MinWeight=Weight;}
    00172         inline int      GetParticuleMinWeight(void)     {return m_MinWeight;}
    00173
    00174         inline void SetParticuleMaxColorR(int ColorR) {m_MaxColorR=ColorR;}
    00175         inline int      GetParticuleMaxColorR(void)     {return m_MaxColorR;}
    00176         inline void SetParticuleMinColorR(int ColorR) {m_MinColorR=ColorR;}
    00177         inline int      GetParticuleMinColorR(void)     {return m_MinColorR;}
    00178
    00179         inline void SetParticuleMaxColorG(int ColorG) {m_MaxColorG=ColorG;}
    00180         inline int      GetParticuleMaxColorG(void)     {return m_MaxColorG;}
    00181         inline void SetParticuleMinColorG(int ColorG) {m_MinColorG=ColorG;}
    00182         inline int      GetParticuleMinColorG(void)     {return m_MinColorG;}
    00183
    00184         inline void SetParticuleMaxColorB(int ColorB) {m_MaxColorB=ColorB;}
    00185         inline int      GetParticuleMaxColorB(void)     {return m_MaxColorB;}
    00186         inline void SetParticuleMinColorB(int ColorB) {m_MinColorB=ColorB;}
    00187         inline int      GetParticuleMinColorB(void)     {return m_MinColorB;}
    00188
    00189         inline void SetParticuleMaxBlending(int Blending) {m_MaxBlending=Blending;}
    00190         inline int      GetParticuleMaxBlending(void)   {return m_MaxBlending;}
    00191         inline void SetParticuleMinBlending(int Blending) {m_MinBlending=Blending;}
    00192         inline int      GetParticuleMinBlending(void)   {return m_MinBlending;}
    00193
    00194         inline void SetParticuleMaxVelocity(ExCVec3D Velocity) {m_MaxVelocity=Velocity;}
    00195         inline ExCVec3D GetParticuleMaxVelocity(void)   {return m_MaxVelocity;}
    00196         inline void SetParticuleMinVelocity(ExCVec3D Velocity) {m_MinVelocity=Velocity;}
    00197         inline ExCVec3D GetParticuleMinVelocity(void)   {return m_MinVelocity;}
    00198
    00199         inline void SetParticuleMaxAcceleration(ExCVec3D Acceleration) {m_MaxAcceleration=Acceleration;}
    00200         inline ExCVec3D GetParticuleMaxAcceleration(void)       {return m_MaxAcceleration;}
    00201         inline void SetParticuleMinAcceleration(ExCVec3D Acceleration) {m_MinAcceleration=Acceleration;}
    00202         inline ExCVec3D GetParticuleMinAcceleration(void)       {return m_MinAcceleration;}
    00203
    00204         //-------------------------------------------------------
    00205         inline void             SetEmitterP1X(float P1) {m_P1.SetX(P1);}
    00206         inline float    GetEmitterP1X(void)             {return m_P1.GetX();}
    00207         inline void             SetEmitterP1Y(float P1) {m_P1.SetY(P1);}
    00208         inline float    GetEmitterP1Y(void)             {return m_P1.GetY();}
    00209         inline void             SetEmitterP1Z(float P1) {m_P1.SetZ(P1);}
    00210         inline float    GetEmitterP1Z(void)             {return m_P1.GetZ();}
    00211
    00212         inline void             SetEmitterP2X(float P2) {m_P2.SetX(P2);}
    00213         inline float    GetEmitterP2X(void)             {return m_P2.GetX();}
    00214         inline void             SetEmitterP2Y(float P2) {m_P2.SetY(P2);}
    00215         inline float    GetEmitterP2Y(void)             {return m_P2.GetY();}
    00216         inline void             SetEmitterP2Z(float P2) {m_P2.SetZ(P2);}
    00217         inline float    GetEmitterP2Z(void)             {return m_P2.GetZ();}
    00218         //-------------------------------------------------------
    00219         inline void             SetEmitterMaxGravityX(float MaxGravity) {m_MaxGravity.SetX(MaxGravity);}
    00220         inline float    GetEmitterMaxGravityX(void)             {return m_MaxGravity.GetX();}
    00221         inline void             SetEmitterMaxGravityY(float MaxGravity) {m_MaxGravity.SetY(MaxGravity);}
    00222         inline float    GetEmitterMaxGravityY(void)             {return m_MaxGravity.GetY();}
    00223         inline void             SetEmitterMaxGravityZ(float MaxGravity) {m_MaxGravity.SetZ(MaxGravity);}
    00224         inline float    GetEmitterMaxGravityZ(void)             {return m_MaxGravity.GetZ();}
    00225
    00226         inline void             SetEmitterMinGravityX(float MinGravity) {m_MinGravity.SetX(MinGravity);}
    00227         inline float    GetEmitterMinGravityX(void)             {return m_MinGravity.GetX();}
    00228         inline void             SetEmitterMinGravityY(float MinGravity) {m_MinGravity.SetY(MinGravity);}
    00229         inline float    GetEmitterMinGravityY(void)             {return m_MinGravity.GetY();}
    00230         inline void             SetEmitterMinGravityZ(float MinGravity) {m_MinGravity.SetZ(MinGravity);}
    00231         inline float    GetEmitterMinGravityZ(void)             {return m_MinGravity.GetZ();}
    00232         //-------------------------------------------------------
    00233         inline void             SetEmitterMaxAccelerationX(float MaxAcceleration)       {m_MaxAcceleration.SetX(MaxAcceleration);}
    00234         inline float    GetEmitterMaxAccelerationX(void)                {return m_MaxAcceleration.GetX();}
    00235         inline void             SetEmitterMaxAccelerationY(float MaxAcceleration)       {m_MaxAcceleration.SetY(MaxAcceleration);}
    00236         inline float    GetEmitterMaxAccelerationY(void)                {return m_MaxAcceleration.GetY();}
    00237         inline void             SetEmitterMaxAccelerationZ(float MaxAcceleration)       {m_MaxAcceleration.SetZ(MaxAcceleration);}
    00238         inline float    GetEmitterMaxAccelerationZ(void)                {return m_MaxAcceleration.GetZ();}
    00239
    00240         inline void             SetEmitterMinAccelerationX(float MinAcceleration)       {m_MinAcceleration.SetX(MinAcceleration);}
    00241         inline float    GetEmitterMinAccelerationX(void)                {return m_MinAcceleration.GetX();}
    00242         inline void             SetEmitterMinAccelerationY(float MinAcceleration)       {m_MinAcceleration.SetY(MinAcceleration);}
    00243         inline float    GetEmitterMinAccelerationY(void)                {return m_MinAcceleration.GetY();}
    00244         inline void             SetEmitterMinAccelerationZ(float MinAcceleration)       {m_MinAcceleration.SetZ(MinAcceleration);}
    00245         inline float    GetEmitterMinAccelerationZ(void)                {return m_MinAcceleration.GetZ();}
    00246         //-------------------------------------------------------
    00247         inline void             SetEmitterMaxVelocityX(float MaxVelocity)       {m_MaxVelocity.SetX(MaxVelocity);}
    00248         inline float    GetEmitterMaxVelocityX(void)            {return m_MaxVelocity.GetX();}
    00249         inline void             SetEmitterMaxVelocityY(float MaxVelocity)       {m_MaxVelocity.SetY(MaxVelocity);}
    00250         inline float    GetEmitterMaxVelocityY(void)            {return m_MaxVelocity.GetY();}
    00251         inline void             SetEmitterMaxVelocityZ(float MaxVelocity)       {m_MaxVelocity.SetZ(MaxVelocity);}
    00252         inline float    GetEmitterMaxVelocityZ(void)            {return m_MaxVelocity.GetZ();}
    00253
    00254         inline void             SetEmitterMinVelocityX(float MinVelocity)       {m_MinVelocity.SetX(MinVelocity);}
    00255         inline float    GetEmitterMinVelocityX(void)            {return m_MinVelocity.GetX();}
    00256         inline void             SetEmitterMinVelocityY(float MinVelocity)       {m_MinVelocity.SetY(MinVelocity);}
    00257         inline float    GetEmitterMinVelocityY(void)            {return m_MinVelocity.GetY();}
    00258         inline void             SetEmitterMinVelocityZ(float MinVelocity)       {m_MinVelocity.SetZ(MinVelocity);}
    00259         inline float    GetEmitterMinVelocityZ(void)            {return m_MinVelocity.GetZ();}
    00260         //-------------------------------------------------------
    00261 };
    00262
    00263 #endif // __EXSYSTEMEPARTICULE_H__
    00264