Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 5:41:29 AM (15 years ago)
Author:
landauf
Message:
  • some changes, maybe fixed a crash, not sure
  • fixed strange camera behavior
File:
1 edited

Legend:

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

    r2493 r2497  
    3333#include <OgreParticleEmitter.h>
    3434
    35 #include "../../worldentities/pawns/SpaceShip.h"
     35#include "core/Core.h"
    3636#include "core/CoreIncludes.h"
    3737#include "core/ConfigValueIncludes.h"
     
    4646        RegisterObject(ParticleProjectile);
    4747
    48         this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
    49         this->attachOgreObject(this->particles_->getParticleSystem());
    50         this->particles_->setKeepParticlesInLocalSpace(0);
     48        if (Core::showsGraphics())
     49        {
     50            this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
     51            this->attachOgreObject(this->particles_->getParticleSystem());
     52            this->particles_->setKeepParticlesInLocalSpace(0);
    5153
    52         this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
    53         /*
    54         if (this->owner_)
    55         {
     54            this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
    5655        }
    57 //        else
    58 //        {
    59 //            this->particles_ = 0;
    60 //        }
    61         */
    62 
    63         this->setConfigValues();
     56        else
     57            this->particles_ = 0;
    6458    }
    6559
     
    7367    }
    7468
    75     void ParticleProjectile::setConfigValues()
    76     {
    77         //SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
    78     }
    79 
    8069    void ParticleProjectile::changedVisibility()
    8170    {
    8271        SUPER(ParticleProjectile, changedVisibility);
    83         this->particles_->setEnabled(this->isVisible());
     72
     73        if (this->particles_)
     74            this->particles_->setEnabled(this->isVisible());
    8475    }
    8576}
Note: See TracChangeset for help on using the changeset viewer.