Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2008, 2:17:18 PM (15 years ago)
Author:
polakma
Message:

pojectile compiles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc

    r2232 r2272  
    4040#include "objects/worldentities/Model.h"
    4141#include "objects/worldentities/ParticleSpawner.h"
    42 #include "Settings.h"
     42#include "core/Core.h"
    4343
    4444namespace orxonox
    4545{
    46     float Projectile::speed_s = 5000;
    47 
    48     Projectile::Projectile(BaseObject* creator, Weapon* owner) : MovableEntity(creator), owner_(owner)
     46    Projectile::Projectile(BaseObject* creator) : MovableEntity(creator)
    4947    {
    5048        RegisterObject(Projectile);
     
    5755        this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
    5856
     57        /*
    5958        if (this->owner_)
    6059        {
     
    6362            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
    6463        }
     64        */
    6565
    66         if(!orxonox::Settings::isClient()) //only if not on client
     66        if(!Core::isClient()) //only if not on client
    6767          this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
    6868    }
     
    7676        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
    7777        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
    78         SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(this, &Projectile::speedChanged);
    7978    }
    8079
    81     void Projectile::speedChanged()
    82     {
    83         Projectile::speed_s = this->speed_;
    84         if (this->owner_)
    85             this->setVelocity(this->owner_->getInitialDir() * this->speed_);
    86     }
    8780
    8881    void Projectile::tick(float dt)
     
    10396                {
    10497                    // hit
    105                     ParticleSpawner* explosion = new ParticleSpawner(this->explosionTemplateName_, LODParticle::low, 2.0);
     98                    ParticleSpawner* explosion = new ParticleSpawner(this);
     99                    explosion->setSource(this->explosionTemplateName_);
     100                    explosion->setLOD(LODParticle::low);
     101                    explosion->configure(2.0);
    106102                    explosion->setPosition(this->getPosition());
    107103                    explosion->create();
    108                     ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 2.0, 0.0);
     104                    ParticleSpawner* smoke = new ParticleSpawner(this);
     105                    smoke->setSource(this->smokeTemplateName_);
     106                    smoke->setLOD(LODParticle::normal);
     107                    smoke->configure(2.0, 0.0);
    109108                    smoke->setPosition(this->getPosition());
    110109//                    smoke->getParticleInterface()->setSpeedFactor(3.0);
Note: See TracChangeset for help on using the changeset viewer.