Changeset 3974 in orxonox.OLD for orxonox/branches/particleEngine/src/lib
- Timestamp:
- Apr 26, 2005, 1:56:50 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
r3958 r3974 128 128 PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime); 129 129 130 for (int i = 0; i < count; i++) 131 // emmits from EMITTER_DOT, 130 if (likely(count > 0)) 132 131 { 133 Vector randDir = Vector(random()-RAND_MAX/2, random()-RAND_MAX/2, random()-RAND_MAX/2); 134 randDir.normalize(); 135 randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction); 136 randDir = randDir.getNormalized()*velocity + (this->getVelocity() * system->inheritSpeed); 137 138 system->addParticle(this->getAbsCoor(), randDir); 132 Vector inheritVelocity = this->getVelocity() * system->inheritSpeed; 133 for (int i = 0; i < count; i++) 134 // emmits from EMITTER_DOT, 135 { 136 Vector randDir = Vector(random()-RAND_MAX/2, random()-RAND_MAX/2, random()-RAND_MAX/2); 137 randDir.normalize(); 138 randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction); 139 randDir = randDir.getNormalized()*velocity + inheritVelocity; 140 141 system->addParticle(this->getAbsCoor(), randDir); 142 } 139 143 } 140 144 }
Note: See TracChangeset
for help on using the changeset viewer.