Changeset 4692 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 24, 2005, 4:26:04 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/particles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_emitter.cc
r4691 r4692 245 245 if (likely(dt > 0.0 && this->emissionRate > 0.0)) 246 246 { 247 // saving the time 247 // saving the time (particles only partly emitted in this timestep) 248 248 float count = (dt+this->saveTime) * this->emissionRate; 249 249 this->saveTime = modff(count, &count) / this->emissionRate; 250 PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime);250 PRINTF(5)("emitting %f particles, saving %f seconds for the next timestep\n", count, this->saveTime); 251 251 252 252 if (likely(count > 0)) … … 254 254 Vector inheritVelocity = this->getVelocity() * this->inheritSpeed; 255 255 for (int i = 0; i < count; i++) 256 // emmits from EMITTER_DOT,257 256 { 258 257 Vector randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2); … … 261 260 Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity; 262 261 263 262 // this should spread the Particles evenly. if the Emitter is moved around quickly 264 263 Vector equalSpread = this->getVelocity() * rand()/RAND_MAX * dt; 265 264 Vector extension; // the Vector for different fields. 266 265 267 if (this->type & 2)266 if (this->type & EMITTER_PLANE) 268 267 { 269 268 extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5)); 270 269 extension = this->getAbsDir().apply(extension); 271 270 } 272 else if (this->type & 8)271 else if (this->type & EMITTER_CUBE) 273 272 { 274 273 extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize; … … 283 282 284 283 system->addParticle(this->getAbsCoor() + extension - equalSpread, velocityV, orient, moment); 285 286 284 } 287 285 } -
orxonox/trunk/src/lib/particles/particle_system.cc
r4691 r4692 265 265 { 266 266 Particle* tickPart = particles; // the particle to Tick 267 Particle* prevPart = NULL; //267 Particle* prevPart = NULL; 268 268 while (likely(tickPart != NULL)) 269 269 {
Note: See TracChangeset
for help on using the changeset viewer.