Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

pojectile compiles.

Location:
code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles
Files:
6 edited

Legend:

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

    r2232 r2272  
    3838    CreateFactory(BillboardProjectile);
    3939
    40     BillboardProjectile::BillboardProjectile(BaseObject* creator, Weapon* owner) : Projectile(creator, owner)
     40    BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
    4141    {
    4242        RegisterObject(BillboardProjectile);
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.h

    r2232 r2272  
    4141    {
    4242        public:
    43             BillboardProjectile(BaseObject* creator, Weapon* owner = 0);
     43            BillboardProjectile(BaseObject* creator);
    4444            virtual ~BillboardProjectile();
    4545
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc

    r2232 r2272  
    3838    CreateFactory(ParticleProjectile);
    3939
    40     ParticleProjectile::ParticleProjectile(BaseObject* creator, Weapon* owner) : BillboardProjectile(creator, owner)
     40    ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
    4141    {
    4242        RegisterObject(ParticleProjectile);
     
    4545        this->particles_->addToSceneNode(this->getNode());
    4646        this->particles_->setKeepParticlesInLocalSpace(true);
     47
     48        /*
    4749        if (this->owner_)
    4850        {
     
    5254//            this->particles_ = 0;
    5355//        }
     56        */
    5457
    5558        this->setConfigValues();
     
    6467    void ParticleProjectile::setConfigValues()
    6568    {
    66         SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
     69        //SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
    6770    }
    6871
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.h

    r2099 r2272  
    4141    {
    4242        public:
    43             ParticleProjectile(BaseObject* creator, Weapon* owner = 0);
     43            ParticleProjectile(BaseObject* creator);
    4444            virtual ~ParticleProjectile();
    4545            virtual void changedVisibility();
  • 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);
  • code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/Projectile.h

    r2099 r2272  
    4242            virtual ~Projectile();
    4343            void setConfigValues();
    44             void speedChanged();
    4544            void destroyObject();
    4645            virtual void tick(float dt);
     
    4847            virtual bool create();
    4948
    50             static float getSpeed()
    51                 { return Projectile::speed_s; }
    52 
    5349        protected:
    54             Projectile(BaseObject* creator, Weapon* owner = 0);
    55             SpaceShip* owner_;
     50            Projectile(BaseObject* creator);
    5651
    5752        private:
     
    5954            std::string smokeTemplateName_;
    6055        protected:
    61             static float speed_s;
    6256            float speed_;
    6357        private:
Note: See TracChangeset for help on using the changeset viewer.