Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 2:10:11 AM (15 years ago)
Author:
landauf
Message:

merged weapon2 branch to presentation

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc

    r2099 r2493  
    3030#include "ParticleProjectile.h"
    3131
    32 #include "SpaceShip.h"
     32#include <OgreParticleSystem.h>
     33#include <OgreParticleEmitter.h>
     34
     35#include "../../worldentities/pawns/SpaceShip.h"
    3336#include "core/CoreIncludes.h"
    3437#include "core/ConfigValueIncludes.h"
     38#include "objects/Scene.h"
    3539
    3640namespace orxonox
     
    3842    CreateFactory(ParticleProjectile);
    3943
    40     ParticleProjectile::ParticleProjectile(BaseObject* creator, Weapon* owner) : BillboardProjectile(creator, owner)
     44    ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
    4145    {
    4246        RegisterObject(ParticleProjectile);
    4347
    44         this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);
    45         this->particles_->addToSceneNode(this->getNode());
    46         this->particles_->setKeepParticlesInLocalSpace(true);
     48        this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
     49        this->attachOgreObject(this->particles_->getParticleSystem());
     50        this->particles_->setKeepParticlesInLocalSpace(0);
     51
     52        this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
     53        /*
    4754        if (this->owner_)
    4855        {
     
    5259//            this->particles_ = 0;
    5360//        }
     61        */
    5462
    5563        this->setConfigValues();
     
    5967    {
    6068        if (this->isInitialized() && this->particles_)
     69        {
     70            this->detachOgreObject(this->particles_->getParticleSystem());
    6171            delete this->particles_;
     72        }
    6273    }
    6374
    6475    void ParticleProjectile::setConfigValues()
    6576    {
    66         SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
     77        //SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
    6778    }
    6879
     
    7283        this->particles_->setEnabled(this->isVisible());
    7384    }
    74 
    75     bool ParticleProjectile::create(){
    76       if(!Projectile::create())
    77         return false;
    78       this->particles_->getAllEmitters()->setDirection(-this->getOrientation()*Vector3(1,0,0));
    79       return true;
    80     }
    8185}
Note: See TracChangeset for help on using the changeset viewer.