Changeset 10836 for code/branches/particleEffectsHS15/src
- Timestamp:
- Nov 23, 2015, 3:44:31 PM (9 years ago)
- Location:
- code/branches/particleEffectsHS15/src/modules/weapons
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/particleEffectsHS15/src/modules/weapons/munitions/CMakeLists.txt
r10629 r10836 7 7 IceMunition.cc 8 8 SplitMunition.cc 9 MineMunition.cc 9 10 ) -
code/branches/particleEffectsHS15/src/modules/weapons/projectiles/CMakeLists.txt
r10629 r10836 12 12 GravityBomb.cc 13 13 GravityBombField.cc 14 MineProjectile.cc 14 15 ) -
code/branches/particleEffectsHS15/src/modules/weapons/projectiles/IceGunProjectile.cc
r10629 r10836 34 34 #include "IceGunProjectile.h" 35 35 36 #include <OgreSceneManager.h> 37 #include <OgreSceneNode.h> 38 36 39 #include "core/CoreIncludes.h" 37 40 #include "graphics/Model.h" 41 #include "graphics/ParticleSpawner.h" 42 #include "Scene.h" 43 #include "core/command/Executor.h" 44 #include "tools/ParticleInterface.h" 38 45 39 46 namespace orxonox … … 55 62 this->attach(model); 56 63 model->setPosition(Vector3(0,0,0)); 64 65 // Add effect. 66 emitter_ = new ParticleEmitter(this->getContext()); 67 this->attach(emitter_); 68 emitter_->setOrientation(this->getOrientation()); 69 emitter_->setSource("Orxonox/ice"); 70 } 71 72 IceGunProjectile::~IceGunProjectile() 73 { 74 if (this->isInitialized()) 75 { 76 const Vector3& pos = emitter_->getWorldPosition(); 77 const Quaternion& rot = emitter_->getWorldOrientation(); 78 this->detach(emitter_); 79 emitter_->setPosition(pos); 80 emitter_->setOrientation(rot); 81 emitter_->getParticleInterface()->setEnabled(false); 82 this->getScene()->getRootSceneNode()->addChild(const_cast<Ogre::SceneNode*>(emitter_->getNode())); 83 84 const ExecutorPtr& executor = createExecutor(createFunctor(&ParticleEmitter::destroy, emitter_)); 85 new Timer(15, false, executor, true); 86 } 57 87 } 58 88 -
code/branches/particleEffectsHS15/src/modules/weapons/projectiles/IceGunProjectile.h
r10629 r10836 56 56 public: 57 57 IceGunProjectile(Context* context); 58 virtual ~IceGunProjectile() {}58 virtual ~IceGunProjectile(); 59 59 60 60 virtual void setFreezeTime(float freezeTime); … … 63 63 protected: 64 64 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint); 65 private: 65 private: 66 ParticleEmitter* emitter_; 66 67 float freezeTime_; //The duration of the freezing effect on a target 67 68 float freezeFactor_; //The strength of the freezing effect -
code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes/CMakeLists.txt
r10629 r10836 11 11 SimpleRocketFire.cc 12 12 GravityBombFire.cc 13 MineGun.cc 13 14 )
Note: See TracChangeset
for help on using the changeset viewer.