Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2015, 3:44:31 PM (9 years ago)
Author:
holzerj
Message:

Added Mine, ice particle, rocketfire, psygun

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  
    77  IceMunition.cc
    88  SplitMunition.cc
     9  MineMunition.cc
    910)
  • code/branches/particleEffectsHS15/src/modules/weapons/projectiles/CMakeLists.txt

    r10629 r10836  
    1212  GravityBomb.cc
    1313  GravityBombField.cc
     14  MineProjectile.cc
    1415)
  • code/branches/particleEffectsHS15/src/modules/weapons/projectiles/IceGunProjectile.cc

    r10629 r10836  
    3434#include "IceGunProjectile.h"
    3535
     36#include <OgreSceneManager.h>
     37#include <OgreSceneNode.h>
     38
    3639#include "core/CoreIncludes.h"
    3740#include "graphics/Model.h"
     41#include "graphics/ParticleSpawner.h"
     42#include "Scene.h"
     43#include "core/command/Executor.h"
     44#include "tools/ParticleInterface.h"
    3845
    3946namespace orxonox
     
    5562        this->attach(model);
    5663        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        }
    5787    }
    5888
  • code/branches/particleEffectsHS15/src/modules/weapons/projectiles/IceGunProjectile.h

    r10629 r10836  
    5656        public:
    5757            IceGunProjectile(Context* context);
    58             virtual ~IceGunProjectile() {}
     58            virtual ~IceGunProjectile();
    5959
    6060            virtual void setFreezeTime(float freezeTime);
     
    6363        protected:
    6464            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    65         private:         
     65        private:
     66            ParticleEmitter* emitter_;
    6667            float freezeTime_; //The duration of the freezing effect on a target
    6768            float freezeFactor_; //The strength of the freezing effect
  • code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes/CMakeLists.txt

    r10629 r10836  
    1111  SimpleRocketFire.cc
    1212  GravityBombFire.cc
     13  MineGun.cc
    1314)
Note: See TracChangeset for help on using the changeset viewer.