#include <ExCParticule.h>
|
Definition at line 26 of file ExCParticule.cpp. References ExCParticule(), Guard, m_Acceleration, m_ColorB, m_ColorG, m_ColorR, m_Gravity, m_LifeSpan, m_Mass, m_Position, m_Size, m_Type, m_Velocity, m_Weight, PARTICULE_LINE, ExCVec3D::SetValue(), and UnGuard. Referenced by ExCParticule(), and ~ExCParticule().
00027 { 00028 Guard(ExCParticule::ExCParticule(void)) 00029 m_LifeSpan=1000; 00030 m_Size=0.2; 00031 m_Weight=1; 00032 m_Mass=1; 00033 m_Type=PARTICULE_LINE; 00034 m_ColorR=255; 00035 m_ColorG=255; 00036 m_ColorB=255; 00037 m_Velocity.SetValue(0.0f,0.1f,0.0f); 00038 m_Position.SetValue(0.0f,0.0f,0.0f); 00039 m_Acceleration.SetValue(1.0f,1.0f,1.0f); 00040 m_Gravity.SetValue(0.0f,0.0f,0.0f); 00041 UnGuard 00042 } |
|
Definition at line 44 of file ExCParticule.cpp. References ExCParticule(), Guard, and UnGuard.
00045 { 00046 Guard(ExCParticule::~ExCParticule(void)) 00047 UnGuard 00048 } |
|
Definition at line 216 of file ExCParticule.cpp. References ApplyForceToParitcule(), Guard, and UnGuard. Referenced by ApplyForceToParitcule().
00217 { 00218 Guard(void ExCParticule::ApplyForceToParitcule(ExCVec3D force)) 00219 00220 UnGuard 00221 } |
|
Definition at line 119 of file ExCParticule.h. References m_LifeSpan.
00119 {m_LifeSpan--;} |
|
Definition at line 67 of file ExCParticule.cpp. References Draw(), Guard, m_Blending, m_ColorB, m_ColorG, m_ColorR, m_Gravity, m_LifeSpan, m_Position, m_Size, m_Texture, m_TotalLife, m_VecPosition, ExCVec3D::m_Vector, m_Velocity, PARTICULE_LINE, PARTICULE_POINT, PARTICULE_TEXTURE, ExCVec3D::SetValue(), and UnGuard. Referenced by Draw().
00068 { 00069 Guard(void ExCParticule::Draw(void)) 00070 00071 float x,y,z,x1,y1,z1; 00072 float GravityX,GravityY,GravityZ; 00073 int TimeNow=(m_TotalLife-m_LifeSpan); 00074 00075 GLfloat no_mat[] = {0.0f,0.0f,0.0f,1.0f}; 00076 GLfloat mat_ambient[] = {0.7f,0.7f,0.7f,1.0f}; 00077 GLfloat mat_ambient_color[] = {0.8f,0.8f,0.2f,1.0f}; 00078 GLfloat mat_diffuse[] = {0.1f,0.5f,0.8f,1.0f}; 00079 GLfloat mat_specular[] = {1.0f,1.0f,1.0f,1.0f}; 00080 GLfloat no_shininess[] = {0.0f}; 00081 GLfloat low_shininess[] = {5.0f}; 00082 GLfloat high_shininess[] = {100.0f}; 00083 GLfloat mat_emission[] = {0.3f,0.2f,0.2f,0.0f}; 00084 00085 switch(m_Type) 00086 { 00087 case PARTICULE_POINT: 00088 00089 glPushMatrix(); 00090 00091 glTranslatef(m_Position.m_Vector[0], 00092 m_Position.m_Vector[1], 00093 m_Position.m_Vector[2]); 00094 m_Position=m_Position+m_Velocity; 00095 00096 glColor4ub(m_ColorR,m_ColorG,m_ColorB,m_Blending); 00097 glBegin(GL_POINT); 00098 glVertex3fv(m_Position.m_Vector); 00099 glEnd(); 00100 glPopMatrix(); 00101 break; 00102 00103 case PARTICULE_LINE: 00104 glPushMatrix(); 00105 00106 GravityX=((TimeNow*TimeNow)*(m_Gravity.m_Vector[0])/20); 00107 GravityY=((TimeNow*TimeNow)*(m_Gravity.m_Vector[1])/20); 00108 GravityZ=((TimeNow*TimeNow)*(m_Gravity.m_Vector[2])/20); 00109 00110 x=m_Position.m_Vector[0]+(m_Velocity.m_Vector[0]*TimeNow)-GravityX; 00111 y=m_Position.m_Vector[1]+(m_Velocity.m_Vector[1]*TimeNow)-GravityY; 00112 z=m_Position.m_Vector[2]+(m_Velocity.m_Vector[2]*TimeNow)-GravityZ; 00113 00114 x1=m_Position.m_Vector[0]+(m_Velocity.m_Vector[0]*(TimeNow+m_Size))-GravityX; 00115 y1=m_Position.m_Vector[1]+(m_Velocity.m_Vector[1]*(TimeNow+m_Size))-GravityY; 00116 z1=m_Position.m_Vector[2]+(m_Velocity.m_Vector[2]*(TimeNow+m_Size))-GravityZ; 00117 00118 glTranslatef(x,y,z); 00119 glColor4ub(m_ColorR,m_ColorG,m_ColorB,m_Blending); 00120 00121 glEnable(GL_BLEND); 00122 glEnable(GL_ALPHA); 00123 glBlendFunc(GL_ONE,GL_ONE); 00124 glEnable(GL_ALPHA_TEST); 00125 glAlphaFunc(GL_GREATER,0); 00126 glLineWidth(2.0f); 00127 //glEnable(GL_LIGHTING); 00128 00129 glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,no_mat); 00130 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,mat_diffuse); 00131 glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,mat_specular); 00132 glMaterialfv(GL_FRONT_AND_BACK,GL_SHININESS,high_shininess); 00133 glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,no_mat); 00134 00135 glBegin(GL_LINES); 00136 glVertex3f(x,y,z); 00137 glVertex3f(x1,y1,z1); 00138 glEnd(); 00139 glDisable(GL_LIGHTING); 00140 glDisable(GL_BLEND); 00141 glDisable(GL_ALPHA); 00142 glLineWidth(1.5); 00143 glPopMatrix(); 00144 break; 00145 00146 case PARTICULE_TEXTURE: 00147 glPushMatrix(); 00148 ExCVec3D position; 00149 if(TimeNow<m_TotalLife) 00150 { 00151 position=m_VecPosition.at(TimeNow); 00152 glTranslatef(position.m_Vector[0],position.m_Vector[1],position.m_Vector[2]); 00153 // Orienation of particule 00154 GLfloat viewMatrix[16]; 00155 glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix); 00156 ExCVec3D right; 00157 ExCVec3D up; 00158 00159 right.SetValue(viewMatrix[0],viewMatrix[4],viewMatrix[8]); 00160 up.SetValue(viewMatrix[1],viewMatrix[5],viewMatrix[9]); 00161 00162 ExCVec3D v1,v2,v3,v4; 00163 v1=m_Position+(right+up)*-m_Size; 00164 v2=m_Position+(right-up)*m_Size; 00165 v3=m_Position+(right+up)*m_Size; 00166 v4=m_Position+(up-right)*m_Size; 00167 00168 00169 //DRAW PARTICULE 00170 glColor4ub(m_ColorR,m_ColorG,m_ColorB,m_Blending); 00171 glEnable(GL_BLEND); 00172 glEnable(GL_ALPHA); 00173 glEnable(GL_TEXTURE_2D); 00174 glBlendFunc(GL_ONE,GL_ONE); 00175 glEnable(GL_ALPHA_TEST); 00176 glAlphaFunc(GL_GREATER,0); 00177 glDisable(GL_LIGHTING); 00178 glBindTexture(GL_TEXTURE_2D,m_Texture); 00179 glBegin(GL_QUADS); 00180 glTexCoord2f(0.0f, 0.0f); glVertex3fv(v1.m_Vector); 00181 glTexCoord2f(1.0f, 0.0f); glVertex3fv(v2.m_Vector); 00182 glTexCoord2f(1.0f, 1.0f); glVertex3fv(v3.m_Vector); 00183 glTexCoord2f(0.0f, 1.0f); glVertex3fv(v4.m_Vector); 00184 glEnd(); 00185 glDisable(GL_TEXTURE_2D); 00186 glDisable(GL_BLEND); 00187 glDisable(GL_ALPHA); 00188 glEnable(GL_LIGHTING); 00189 } 00190 glPopMatrix(); 00191 break; 00192 } 00193 00194 UnGuard 00195 } |
|
Definition at line 105 of file ExCParticule.h. References m_Blending.
00105 {return m_Blending;} |
|
Definition at line 102 of file ExCParticule.h. References m_ColorB.
00102 {return m_ColorB;} |
|
Definition at line 99 of file ExCParticule.h. References m_ColorG.
00099 {return m_ColorG;} |
|
Definition at line 96 of file ExCParticule.h. References m_ColorR.
00096 {return m_ColorR;} |
|
Definition at line 90 of file ExCParticule.h. References m_LifeSpan. Referenced by ExCSystemeParticule::Draw().
00090 {return m_LifeSpan;} |
|
Definition at line 87 of file ExCParticule.h. References m_Mass.
00087 {return m_Mass;} |
|
Definition at line 84 of file ExCParticule.h. References m_Size.
00084 {return m_Size;} |
|
Definition at line 93 of file ExCParticule.h. References m_Weight.
00093 {return m_Weight;} |
|
Definition at line 197 of file ExCParticule.cpp. References Guard, m_Gravity, m_Position, m_VecPosition, ExCVec3D::m_Vector, m_Velocity, PrecalculeParticuleTrajectory(), and UnGuard. Referenced by ExCSystemeParticule::Draw(), and PrecalculeParticuleTrajectory().
00198 { 00199 Guard(void ExCParticule::PrecalculeParticuleTrajectory(int start,int end)) 00200 float GravityX,GravityY,GravityZ; 00201 ExCVec3D Position; 00202 for(int i=start;i<end;i++) 00203 { 00204 GravityX=((i*i)*(m_Gravity.m_Vector[0])/2000); 00205 GravityY=((i*i)*(m_Gravity.m_Vector[1])/2000); 00206 GravityZ=((i*i)*(m_Gravity.m_Vector[2])/2000); 00207 00208 Position.m_Vector[0]=m_Position.m_Vector[0]+(m_Velocity.m_Vector[0]*i)-GravityX; 00209 Position.m_Vector[1]=m_Position.m_Vector[1]+(m_Velocity.m_Vector[1]*i)-GravityY; 00210 Position.m_Vector[2]=m_Position.m_Vector[2]+(m_Velocity.m_Vector[2]*i)-GravityZ; 00211 m_VecPosition.push_back(Position); 00212 } 00213 UnGuard 00214 } |
|
Definition at line 81 of file ExCParticule.h.
00081 {ManagerTexture = Texture;} |
|
Definition at line 110 of file ExCParticule.h. Referenced by ExCSystemeParticule::Draw().
00110 {m_Acceleration=Acceleration;} |
|
Definition at line 104 of file ExCParticule.h. References m_Blending. Referenced by ExCSystemeParticule::Draw().
00104 {m_Blending=Blending;} |
|
Definition at line 101 of file ExCParticule.h. References m_ColorB. Referenced by ExCSystemeParticule::Draw().
00101 {m_ColorB=ColorB;} |
|
Definition at line 98 of file ExCParticule.h. References m_ColorG. Referenced by ExCSystemeParticule::Draw().
00098 {m_ColorG=ColorG;} |
|
Definition at line 95 of file ExCParticule.h. References m_ColorR. Referenced by ExCSystemeParticule::Draw().
00095 {m_ColorR=ColorR;} |
|
Definition at line 113 of file ExCParticule.h. Referenced by ExCSystemeParticule::Draw().
00113 {m_Gravity=Gravity;} |
|
Definition at line 89 of file ExCParticule.h. References m_LifeSpan, and m_TotalLife. Referenced by ExCSystemeParticule::Draw().
00089 {m_LifeSpan=life;m_TotalLife=life;} |
|
Definition at line 86 of file ExCParticule.h. References m_Mass. Referenced by ExCSystemeParticule::Draw().
00086 {m_Mass=Mass;} |
|
Definition at line 116 of file ExCParticule.h. Referenced by ExCSystemeParticule::Draw().
00116 {m_Position=Position;} |
|
Definition at line 83 of file ExCParticule.h. References m_Size.
00083 {m_Size=Size;} |
|
Definition at line 59 of file ExCParticule.cpp. References Guard, m_Texture, SetParticuleTexture(), and UnGuard. Referenced by ExCSystemeParticule::Draw(), ExCSystemeParticule::SetParticuleTexture(), and SetParticuleTexture().
00060 { 00061 Guard(void ExCParticule::SetParticuleTexture(int texture)) 00062 m_Texture=texture; 00063 UnGuard 00064 } |
|
Definition at line 51 of file ExCParticule.cpp. References Guard, m_Type, SetParticuleType(), and UnGuard. Referenced by ExCSystemeParticule::Draw(), ExCSystemeParticule::SetParticuleType(), and SetParticuleType().
|
|
Definition at line 107 of file ExCParticule.h. Referenced by ExCSystemeParticule::Draw().
00107 {m_Velocity=Velocity;} |
|
Definition at line 92 of file ExCParticule.h. References m_Weight. Referenced by ExCSystemeParticule::Draw().
00092 {m_Weight=Weight;} |
|
Definition at line 111 of file ExCParticule.h.
00111 {return m_Acceleration;} |
|
Definition at line 114 of file ExCParticule.h.
00114 {return m_Gravity;} |
|
Definition at line 117 of file ExCParticule.h.
00117 {return m_Position;} |
|
Definition at line 108 of file ExCParticule.h.
00108 {return m_Velocity;} |
|
Definition at line 46 of file ExCParticule.h. Referenced by ExCParticule(). |
|
Definition at line 57 of file ExCParticule.h. Referenced by Draw(), GetParticuleBlending(), and SetParticuleBlending(). |
|
Definition at line 56 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), GetParticuleColorB(), and SetParticuleColorB(). |
|
Definition at line 55 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), GetParticuleColorG(), and SetParticuleColorG(). |
|
Definition at line 54 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), GetParticuleColorR(), and SetParticuleColorR(). |
|
Definition at line 47 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), and PrecalculeParticuleTrajectory(). |
|
Definition at line 61 of file ExCParticule.h. |
|
Definition at line 50 of file ExCParticule.h. Referenced by DecreaseLifeSpan(), Draw(), ExCParticule(), GetParticuleLife(), and SetParticuleLife(). |
|
Definition at line 49 of file ExCParticule.h. Referenced by ExCParticule(), GetParticuleMass(), and SetParticuleMass(). |
|
Definition at line 44 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), and PrecalculeParticuleTrajectory(). |
|
Definition at line 48 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), GetParticuleSize(), and SetParticuleSize(). |
|
Definition at line 58 of file ExCParticule.h. Referenced by Draw(), and SetParticuleTexture(). |
|
Definition at line 51 of file ExCParticule.h. Referenced by Draw(), and SetParticuleLife(). |
|
Definition at line 53 of file ExCParticule.h. Referenced by ExCParticule(), and SetParticuleType(). |
|
Definition at line 60 of file ExCParticule.h. Referenced by Draw(), and PrecalculeParticuleTrajectory(). |
|
Definition at line 45 of file ExCParticule.h. Referenced by Draw(), ExCParticule(), and PrecalculeParticuleTrajectory(). |
|
Definition at line 52 of file ExCParticule.h. Referenced by ExCParticule(), GetParticuleWeight(), and SetParticuleWeight(). |
|
Definition at line 63 of file ExCParticule.h. |