Changeset 1602 for code/trunk/src/orxonox/objects/ParticleSpawner.cc
- Timestamp:
- Jun 14, 2008, 7:20:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/ParticleSpawner.cc
r1563 r1602 41 41 { 42 42 RegisterObject(ParticleSpawner); 43 this->particle_ = 0; 43 44 } 44 45 … … 46 47 { 47 48 RegisterObject(ParticleSpawner); 49 this->setParticle(templateName, detaillevel, lifetime, delay, direction); 50 } 48 51 52 void ParticleSpawner::setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay, const Vector3& direction) 53 { 49 54 ExecutorMember<ParticleSpawner>* executor = createExecutor(createFunctor(&ParticleSpawner::createParticleSpawner)); 50 55 executor->setDefaultValues(lifetime); … … 61 66 ParticleSpawner::~ParticleSpawner() 62 67 { 63 if (this->isInitialized() )68 if (this->isInitialized() && this->particle_) 64 69 { 65 70 this->particle_->detachFromSceneNode(); … … 70 75 void ParticleSpawner::createParticleSpawner(float lifetime) 71 76 { 72 this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));73 77 this->particle_->setEnabled(true); 78 if (lifetime != 0) 79 this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner))); 74 80 } 75 81 … … 78 84 delete this; 79 85 } 86 87 void ParticleSpawner::setVisible(bool visible) 88 { 89 if (this->particle_) 90 this->particle_->setEnabled(visible); 91 } 80 92 }
Note: See TracChangeset
for help on using the changeset viewer.