Changeset 4001 in orxonox.OLD
- Timestamp:
- Apr 28, 2005, 12:04:34 AM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src/lib/graphics/particles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
r3974 r4001 124 124 // saving the time 125 125 float count = (dt+this->saveTime) * this->emissionRate; 126 this->saveTime = modff(count, &count); 127 this->saveTime /= this->emissionRate; 126 this->saveTime = modff(count, &count) / this->emissionRate; 128 127 PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime); 129 128 … … 137 136 randDir.normalize(); 138 137 randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction); 139 randDir = randDir.getNormalized()*velocity + inheritVelocity;138 Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity; 140 139 141 system->addParticle(this->getAbsCoor(), randDir);140 system->addParticle(this->getAbsCoor(), velocityV); 142 141 } 143 142 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
r3952 r4001 229 229 glMatrixMode(GL_MODELVIEW); 230 230 // glDisable(GL_LIGHTING); 231 material->select(); 232 233 231 material->select(); 232 glDisable(GL_DEPTH_TEST); 233 Particle* drawPart = particles; 234 234 if (likely(drawPart != NULL)) 235 235 { 236 glBegin(GL_POINTS); 236 //draw in DOT mode 237 // glBegin(GL_POINTS); 237 238 while (likely(drawPart != NULL)) 238 239 { 239 // draw in DOT mode240 240 glPushMatrix(); 241 241 glTranslatef(drawPart->position.x, drawPart->position.y, drawPart->position.z); … … 243 243 glCallList(*this->glID); 244 244 245 // 245 //glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z); 246 246 drawPart = drawPart->next; 247 247 glPopMatrix(); 248 248 } 249 glEnd();249 // glEnd(); 250 250 } 251 // glEnable(GL_LIGHTING); 252 glEnable(GL_DEPTH_TEST); 251 253 } 252 254 … … 288 290 } 289 291 else 290 PRINTF( 4)("maximum count of particles reached not adding any more\n");292 PRINTF(5)("maximum count of particles reached not adding any more\n"); 291 293 } 292 294 -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h
r3956 r4001 10 10 #include "vector.h" 11 11 12 #define PARTICLE_DOT_MASK 0x00001 13 #define PARTICLE_SPRITE_MASK 0x00010 14 #define PARTICLE_MODEL_MASK 0x00100 15 #define PARTICLE_WORDL_ENTITY_MASK 0x01000 16 #define PARTICLE_MULTI_MASK 0x10000 12 #define PARTICLE_DOT_MASK 0x000001 13 #define PARTICLE_SPARK_MASK 0x000010 14 #define PARTICLE_SPRITE_MASK 0x000100 15 #define PARTICLE_MODEL_MASK 0x001000 16 #define PARTICLE_WORDL_ENTITY_MASK 0x010000 17 #define PARTICLE_MULTI_MASK 0x100000 17 18 18 19 //! An enumerator for the different types of particles. 19 20 typedef enum PARTICLE_TYPE {PARTICLE_DOT = PARTICLE_DOT_MASK, 21 PARTICLE_SPARK = PARTICLE_SPARK_MASK, 20 22 PARTICLE_SPRITE = PARTICLE_SPRITE_MASK, 21 23 PARTICLE_MULTI_SPRITE = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK, … … 41 43 float radius; //!< The current size of this particle. 42 44 float radiusIt; //!< The difference of the Size per second. 45 46 PARTICLE_TYPE type; 43 47 44 48 Particle* next; //!< pointer to the next particle in the List. (NULL if no preceding one)
Note: See TracChangeset
for help on using the changeset viewer.