- Timestamp:
- Jan 3, 2016, 9:46:11 PM (9 years ago)
- Location:
- code/branches/presentationHS15/src/modules/weapons/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15/src/modules/weapons/projectiles/IceGunProjectile.cc
r11026 r11031 66 66 67 67 // Add effect. 68 emitter_ = new ParticleEmitter(this->getContext()); 69 this->attach(emitter_); 70 emitter_->setOrientation(this->getOrientation()); 71 emitter_->setSource("Orxonox/ice"); 72 emitter_->setDeleteWithParent(false); 68 spawner_ = new ParticleSpawner(this->getContext()); 69 this->attach(spawner_); 70 spawner_->setOrientation(this->getOrientation()); 71 spawner_->setSource("Orxonox/ice"); 72 spawner_->setDeleteWithParent(false); 73 spawner_->setDestroydelay(particleDestructionDelay_); 73 74 } 74 75 … … 77 78 if (this->isInitialized()) 78 79 { 79 const Vector3& pos = emitter_->getWorldPosition(); 80 const Quaternion& rot = emitter_->getWorldOrientation(); 81 this->detach(emitter_); 82 emitter_->setPosition(pos); 83 emitter_->setOrientation(rot); 84 emitter_->getParticleInterface()->setEnabled(false); 85 this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(emitter_->getNode())); 86 87 const ExecutorPtr& executor = createExecutor(createFunctor(&ParticleEmitter::destroy, emitter_)); 88 new Timer(particleDestructionDelay_, false, executor, true); 80 const Vector3& pos = spawner_->getWorldPosition(); 81 const Quaternion& rot = spawner_->getWorldOrientation(); 82 this->detach(spawner_); 83 spawner_->setPosition(pos); 84 spawner_->setOrientation(rot); 85 this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(spawner_->getNode())); 86 this->spawner_->stop(true); 89 87 } 90 88 } -
code/branches/presentationHS15/src/modules/weapons/projectiles/IceGunProjectile.h
r11026 r11031 65 65 static const float particleDestructionDelay_; 66 66 private: 67 Particle Emitter* emitter_;67 ParticleSpawner* spawner_; 68 68 float freezeTime_; //The duration of the freezing effect on a target 69 69 float freezeFactor_; //The strength of the freezing effect
Note: See TracChangeset
for help on using the changeset viewer.