Changeset 6612 in orxonox.OLD for trunk/src/lib/particles/particle_system.cc
- Timestamp:
- Jan 19, 2006, 1:50:39 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/particles/particle_system.cc
r6512 r6612 31 31 32 32 #include "parser/tinyxml/tinyxml.h" 33 #include <algorithm> 34 33 35 34 36 CREATE_FACTORY(ParticleSystem, CL_PARTICLE_SYSTEM); … … 107 109 this->setType(PARTICLE_DEFAULT_TYPE, 1); 108 110 ParticleEngine::getInstance()->addSystem(this); 111 112 this->toList(OM_ENVIRON); 109 113 } 110 114 … … 132 136 133 137 LoadParam(root, "texture", this, ParticleSystem, setMaterialTexture); 138 LoadParamXML(root, "emitter", this, ParticleSystem, addEmitterXML); 134 139 135 140 LOAD_PARAM_START_CYCLE(root, element); … … 147 152 } 148 153 LOAD_PARAM_END_CYCLE(element); 149 150 154 } 151 155 … … 288 292 this->colorAnim[2].changeEntry(lifeCycleTime, blue); 289 293 this->colorAnim[3].changeEntry(lifeCycleTime, alpha); 294 } 295 296 297 void ParticleSystem::addEmitter(ParticleEmitter* emitter) 298 { 299 this->emitters.push_back(emitter); 300 } 301 302 void ParticleSystem::addEmitterXML(const TiXmlElement* emitterRoot) 303 { 304 ParticleEmitter* emitter = new ParticleEmitter(emitterRoot); 305 this->addEmitter(emitter); 306 } 307 308 309 void ParticleSystem::removeEmitter(ParticleEmitter* emitter) 310 { 311 std::list<ParticleEmitter*>::iterator it = std::find(this->emitters.begin(), this->emitters.end(), emitter); 312 if (it != this->emitters.end()) 313 this->emitters.erase(it); 290 314 } 291 315 … … 357 381 } 358 382 } 383 384 std::list<ParticleEmitter*>::iterator emitter; 385 for (emitter = this->emitters.begin(); emitter != this->emitters.end(); emitter++) 386 (*emitter)->tick(dt, this); 359 387 } 360 388
Note: See TracChangeset
for help on using the changeset viewer.