Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   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.14 2002/07/08 23:14:46 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 "ExCObject.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 ExCObject 
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         //pram 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 
00072         float                           m_rayon;
00073         int                                     m_angle;
00074         int                                     m_vitesseangle;
00075 
00076         
00077         
00078         //struct for bmp
00079         GLuint                          m_Texture;
00080         struct Image {
00081                 unsigned long sizeX;
00082                 unsigned long sizeY;
00083                 char *data;
00084         };
00085         //Max and min value for particule
00086         int                             m_Type;
00087         int                             m_MaxLifeSpan;
00088         int                             m_MinLifeSpan;
00089         float                   m_MaxSize;
00090         float                   m_MinSize;
00091         int                             m_MaxWeight;
00092         int                             m_MinWeight;
00093         int                             m_MaxColorR;
00094         int                             m_MinColorR;
00095         int                             m_MaxColorG;
00096         int                             m_MinColorG;
00097         int                             m_MaxColorB;
00098         int                             m_MinColorB;
00099         int                             m_MaxBlending;
00100         int                             m_MinBlending;
00101         ExCVec3D                m_MaxVelocity;
00102         ExCVec3D                m_MinVelocity;
00103         ExCVec3D                m_MaxAcceleration;
00104         ExCVec3D                m_MinAcceleration;
00105         ExCVec3D                m_MaxGravity;
00106         ExCVec3D                m_MinGravity;
00107         
00108 public:
00109         ExManagerTexture        *ManagerTexture;
00110         void (*WriteToConsol)(const char *Label);
00111         //--------------------------------
00112         // Constructor // Destructor
00113         //--------------------------------
00114         ExCSystemeParticule(void);
00115         ~ExCSystemeParticule(void);
00116         //--------------------------------
00117         // Methode
00118         //--------------------------------
00119         void Draw(void);
00120         void Start(void);
00121         void Pause(void);
00122         void Stop(void);
00123 
00124         bool LoadParticuleSysteme(const char * FileName);
00125         bool SaveParticuleSysteme(const char * FileName);
00126         bool LoadTexture(const char * name);
00127 
00128         inline char * GetParticuleSystemeName(void){return m_ParticuleSystemeName;}
00129         void SetParticuleSystemeName(char * name);
00130 
00131         inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture = Texture;}
00132         inline bool GetParticuleSystemeState(void){return m_State;}
00133         inline void SetParticuleSystemeState(bool state){m_State=state;}
00134         
00135         void SetParticuleType(int type);
00136         void SetParticuleTexture(char *texture);
00137 
00138         inline void SetParticuleMaxLife(int life) {m_MaxLifeSpan=life;}
00139         inline int      GetParticuleMaxLife(void)       {return m_MaxLifeSpan;}
00140         inline void SetParticuleMinLife(int life) {m_MinLifeSpan=life;}
00141         inline int      GetParticuleMinLife(void)       {return m_MinLifeSpan;}
00142 
00143         inline void SetParticuleMaxSize(float Size) {m_MaxSize=Size;}
00144         inline float    GetParticuleMaxSize(void)       {return m_MaxSize;}
00145         inline void SetParticuleMinSize(float Size) {m_MinSize=Size;}
00146         inline float    GetParticuleMinSize(void)       {return m_MinSize;}
00147 
00148         inline void SetParticuleMaxWeight(int Weight) {m_MaxWeight=Weight;}
00149         inline int      GetParticuleMaxWeight(void)     {return m_MaxWeight;}
00150         inline void SetParticuleMinWeight(int Weight) {m_MinWeight=Weight;}
00151         inline int      GetParticuleMinWeight(void)     {return m_MinWeight;}
00152         
00153         inline void SetParticuleMaxColorR(int ColorR) {m_MaxColorR=ColorR;}
00154         inline int      GetParticuleMaxColorR(void)     {return m_MaxColorR;}
00155         inline void SetParticuleMinColorR(int ColorR) {m_MinColorR=ColorR;}
00156         inline int      GetParticuleMinColorR(void)     {return m_MinColorR;}
00157 
00158         inline void SetParticuleMaxColorG(int ColorG) {m_MaxColorG=ColorG;}
00159         inline int      GetParticuleMaxColorG(void)     {return m_MaxColorG;}
00160         inline void SetParticuleMinColorG(int ColorG) {m_MinColorG=ColorG;}
00161         inline int      GetParticuleMinColorG(void)     {return m_MinColorG;}
00162 
00163         inline void SetParticuleMaxColorB(int ColorB) {m_MaxColorB=ColorB;}
00164         inline int      GetParticuleMaxColorB(void)     {return m_MaxColorB;}
00165         inline void SetParticuleMinColorB(int ColorB) {m_MinColorB=ColorB;}
00166         inline int      GetParticuleMinColorB(void)     {return m_MinColorB;}
00167 
00168         inline void SetParticuleMaxBlending(int Blending) {m_MaxBlending=Blending;}
00169         inline int      GetParticuleMaxBlending(void)   {return m_MaxBlending;}
00170         inline void SetParticuleMinBlending(int Blending) {m_MinBlending=Blending;}
00171         inline int      GetParticuleMinBlending(void)   {return m_MinBlending;}
00172 
00173         inline void SetParticuleMaxVelocity(ExCVec3D Velocity) {m_MaxVelocity=Velocity;}
00174         inline ExCVec3D GetParticuleMaxVelocity(void)   {return m_MaxVelocity;}
00175         inline void SetParticuleMinVelocity(ExCVec3D Velocity) {m_MinVelocity=Velocity;}
00176         inline ExCVec3D GetParticuleMinVelocity(void)   {return m_MinVelocity;}
00177 
00178         inline void SetParticuleMaxAcceleration(ExCVec3D Acceleration) {m_MaxAcceleration=Acceleration;}
00179         inline ExCVec3D GetParticuleMaxAcceleration(void)       {return m_MaxAcceleration;}
00180         inline void SetParticuleMinAcceleration(ExCVec3D Acceleration) {m_MinAcceleration=Acceleration;}
00181         inline ExCVec3D GetParticuleMinAcceleration(void)       {return m_MinAcceleration;}
00182 
00183 };
00184 
00185 #endif // __EXSYSTEMEPARTICULE_H__
00186 

Generated on Tue Aug 6 20:27:10 2002 for ExNihilo by doxygen1.2.17