00001 /************************************************************************/ 00002 /* Ex Nihlo Engine by Hermanns Christophe */ 00003 /************************************************************************/ 00004 /* This program is free software; you can redistribute it and/or */ 00005 /* modify it under the terms of the GNU General Public License */ 00006 /* as published by the Free Software Foundation; either version 2 */ 00007 /* of the License, or (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. */ 00012 /* */ 00013 /* See the GNU General Public License for more details. */ 00014 /* */ 00015 /* You should have received a copy of the GNU General Public License */ 00016 /* along with this program; if not, write to the Free Software */ 00017 /* Foundation, Inc., 59 Temple Place - Suite 330, */ 00018 /* Boston, MA 02111-1307, USA. */ 00019 /* */ 00020 /* If you use a important part of this code please send me a mail */ 00021 /* I just want to see where my code go thks :) */ 00022 /************************************************************************/ 00023 00024 /************************************************************************/ 00025 /* Contact */ 00026 /************************************************************************/ 00027 /* ExNihilo Website :www.ploksoftware.org */ 00028 /* */ 00029 /* Hermanns Christophe ExNihilo creator and main programmer */ 00030 /* */ 00031 /* Mail : Data@ploksoftware.org */ 00032 /* ICQ : 8030901 */ 00033 /* MSN Messenger : Data_7@hotmail.com */ 00034 /* */ 00035 /* */ 00036 /************************************************************************/ 00037 00038 /************************************************************************/ 00039 /* File Description */ 00040 /************************************************************************/ 00041 /* File Name :ExCParticule.h */ 00042 /* */ 00043 /* Start Date :06/20/2003 */ 00044 /* */ 00045 /* Last Update :06/20/2003 */ 00046 /* */ 00047 /* File Description : */ 00048 /* */ 00049 /* For update of this file check : www.ploksoftware.org */ 00050 /************************************************************************/ 00051 00052 #ifndef __EXCPARTICULE_H__ 00053 #define __EXCPARTICULE_H__ 00054 //------------------------------------------------------------------------ 00055 //Includes 00056 //------------------------------------------------------------------------ 00057 #include "ExDefine.h" 00058 //------------------------------------------------------------------------ 00059 #include "Math/ExMath.h" 00060 //------------------------------------------------------------------------ 00061 #include "Object/Object3D/ExCObject3D.h" 00062 //------------------------------------------------------------------------ 00063 #include "Object/Object3D/Gizmo/ExCGizmoSphere.h" 00064 //------------------------------------------------------------------------ 00065 #include "Manager/ExManagerCollision.h" 00066 //------------------------------------------------------------------------ 00067 #define PARTICULE_POINT 1 00068 #define PARTICULE_LINE 2 00069 #define PARTICULE_TEXTURE 3 00070 #define PARTICULE_TEXTURE_NV 4 00071 //------------------------------------------------------------------------ 00072 class ExCParticule : public ExCObject3D 00073 { 00074 protected: 00075 ExManagerCollision *ManagerCollision; 00076 //------------------------------------------------------------------------ 00077 // Variable 00078 //------------------------------------------------------------------------ 00079 ExCVec3D m_Position; 00080 ExCVec3D m_Velocity; 00081 ExCVec3D m_Acceleration; 00082 ExCVec3D m_Gravity; 00083 float m_Size; 00084 float m_Mass; 00085 float m_Growth; 00086 int m_LifeSpan; 00087 int m_TotalLife; 00088 int m_Weight; 00089 int m_Type; 00090 int m_ColorR; 00091 int m_ColorG; 00092 int m_ColorB; 00093 int m_Blending; 00094 GLint m_Texture; 00095 std::vector<ExCVec3D> m_VecPosition; 00096 std::vector<ExCVec3D>::iterator m_ItVecPosition; 00097 ExCGizmoSphere m_CollisionSphere; 00098 00099 PFNGLPOINTPARAMETERFEXTPROC glPointParameterfEXT ; 00100 PFNGLPOINTPARAMETERFVEXTPROC glPointParameterfvEXT ; 00101 00102 PFNGLPOINTPARAMETERINVPROC glPointParameteriNV ; 00103 PFNGLPOINTPARAMETERIVNVPROC glPointParameterivNV ; 00104 00105 float m_Rotation; 00106 public: 00107 //------------------------------------------------------------------------ 00108 // Constructor // Destructor 00109 //------------------------------------------------------------------------ 00110 ExCParticule(void); 00111 //ExCParticule(const ExCParticule &Particule); 00112 ~ExCParticule(void); 00113 //------------------------------------------------------------------------ 00114 // Methode 00115 //------------------------------------------------------------------------ 00116 00117 inline void SetManagerCollision(ExManagerCollision * Collision){ManagerCollision = Collision;} 00118 00119 void PrecalculeParticuleTrajectory(int start,int end); 00120 void ApplyForceToParitcule(ExCVec3D force); 00121 00122 void Draw(void); 00123 void SetParticuleType(int type); 00124 inline int GetParticuleType(void){return m_Type;} 00125 00126 inline void SetParticuleTexture(GLint texture){m_Texture=texture;} 00127 00128 inline void SetParticuleSize(float Size) {m_Size=Size;} 00129 inline float GetParticuleSize(void) {return m_Size;} 00130 00131 inline void SetParticuleGrowth(float Growth) {m_Growth=Growth;} 00132 inline float GetParticuleGrowth(void) {return m_Growth;} 00133 00134 inline void SetParticuleMass(float Mass) {m_Mass=Mass;} 00135 inline float GetParticuleMass(void) {return m_Mass;} 00136 00137 inline void SetParticuleLife(int life) {m_LifeSpan=life;m_TotalLife=life;} 00138 inline int GetParticuleLife(void) {return m_LifeSpan;} 00139 00140 inline void SetParticuleWeight(int Weight) {m_Weight=Weight; 00141 m_CollisionSphere.m_Radius=m_Weight; 00142 } 00143 inline int GetParticuleWeight(void) {return m_Weight;} 00144 00145 inline void SetParticuleColorR(int ColorR) {m_ColorR=ColorR;} 00146 inline int GetParticuleColorR(void) {return m_ColorR;} 00147 00148 inline void SetParticuleColorG(int ColorG) {m_ColorG=ColorG;} 00149 inline int GetParticuleColorG(void) {return m_ColorG;} 00150 00151 inline void SetParticuleColorB(int ColorB) {m_ColorB=ColorB;} 00152 inline int GetParticuleColorB(void) {return m_ColorB;} 00153 00154 inline void SetParticuleBlending(int Blending) {m_Blending=Blending;} 00155 inline int GetParticuleBlending(void) {return m_Blending;} 00156 00157 inline void SetParticuleVelocity(ExCVec3D Velocity) {m_Velocity=Velocity;} 00158 inline ExCVec3D GetParticuleVelocity(void) {return m_Velocity;} 00159 00160 inline void SetParticuleAcceleration(ExCVec3D Acceleration) {m_Acceleration=Acceleration;} 00161 inline ExCVec3D GetParticuleAcceleration(void) {return m_Acceleration;} 00162 00163 inline void SetParticuleGravity(ExCVec3D Gravity){m_Gravity=Gravity;} 00164 inline ExCVec3D GetParticuleGravity(void) {return m_Gravity;} 00165 00166 inline void SetParticulePosition(ExCVec3D Position){m_Position=Position;} 00167 inline ExCVec3D GetParticulePosition(void) {return m_Position;} 00168 00169 inline void DecreaseLifeSpan(void){m_LifeSpan--;} 00170 00171 ExCVec3D GetPositionNow(void); 00172 }; 00173 //------------------------------------------------------------------------ 00174 #endif //__EXCPARTICULE_H__ 00175