Changeset 4129 in orxonox.OLD for orxonox/branches/particleEngine/src
- Timestamp:
- May 9, 2005, 4:41:53 PM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
r4017 r4129 137 137 randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)rand()/RAND_MAX -.5), randDir)).apply(this->direction); 138 138 Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity; 139 140 system->addParticle(this->getAbsCoor(), velocityV); 139 140 // this should spread the Particles evenly. if the Emitter is moved around quickly 141 Vector equalSpread = this->getVelocity() * random()/RAND_MAX * dt; 142 equalSpread.debug(); 143 144 system->addParticle(this->getAbsCoor() - equalSpread, velocityV); 141 145 } 142 146 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc
r3966 r4129 228 228 void ParticleEngine::tick(float dt) 229 229 { 230 // add new Particles to each System connected to an Emitter.231 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();232 ParticleConnection* tmpConnection = tmpConIt->nextElement();233 while(tmpConnection)234 {235 tmpConnection->emitter->tick(dt, tmpConnection->system);236 tmpConnection = tmpConIt->nextElement();237 }238 delete tmpConIt;239 240 241 230 // ticks all the ParticleSystems 242 231 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); … … 248 237 } 249 238 delete tmpIt; 239 240 // add new Particles to each System connected to an Emitter. 241 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 242 ParticleConnection* tmpConnection = tmpConIt->nextElement(); 243 while(tmpConnection) 244 { 245 tmpConnection->emitter->tick(dt, tmpConnection->system); 246 tmpConnection = tmpConIt->nextElement(); 247 } 248 delete tmpConIt; 250 249 } 251 250 -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
r4125 r4129 291 291 } 292 292 else 293 this->particles = new Particle; 293 { 294 PRINTF(5)("Generating new Particle\n"); 295 this->particles = new Particle; 296 } 294 297 this->particles->next = NULL; 295 298 } … … 304 307 } 305 308 else 306 tmpPart = new Particle; 309 { 310 PRINTF(5)("Generating new Particle\n"); 311 tmpPart = new Particle; 312 } 307 313 tmpPart->next = this->particles; 308 314 this->particles = tmpPart; -
orxonox/branches/particleEngine/src/story_entities/world.cc
r4128 r4129 496 496 system->setLifeSpan(1); 497 497 system->setRadius(2, 0, 2, 0); 498 ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), 0, 500);498 ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), 0, 1000, 0); 499 499 emitter->setParent(this->localPlayer); 500 500
Note: See TracChangeset
for help on using the changeset viewer.