Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 14, 2008, 7:20:00 PM (16 years ago)
Author:
landauf
Message:
  • added thruster flares
  • used new particle effects
  • enemies with less health emit smoke and fire

!!!! MEDIA UPDATE !!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/ParticleSpawner.cc

    r1563 r1602  
    4141    {
    4242        RegisterObject(ParticleSpawner);
     43        this->particle_ = 0;
    4344    }
    4445
     
    4647    {
    4748        RegisterObject(ParticleSpawner);
     49        this->setParticle(templateName, detaillevel, lifetime, delay, direction);
     50    }
    4851
     52    void ParticleSpawner::setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay, const Vector3& direction)
     53    {
    4954        ExecutorMember<ParticleSpawner>* executor = createExecutor(createFunctor(&ParticleSpawner::createParticleSpawner));
    5055        executor->setDefaultValues(lifetime);
     
    6166    ParticleSpawner::~ParticleSpawner()
    6267    {
    63         if (this->isInitialized())
     68        if (this->isInitialized() && this->particle_)
    6469        {
    6570            this->particle_->detachFromSceneNode();
     
    7075    void ParticleSpawner::createParticleSpawner(float lifetime)
    7176    {
    72         this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
    7377        this->particle_->setEnabled(true);
     78        if (lifetime != 0)
     79            this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
    7480    }
    7581
     
    7884        delete this;
    7985    }
     86
     87    void ParticleSpawner::setVisible(bool visible)
     88    {
     89        if (this->particle_)
     90            this->particle_->setEnabled(visible);
     91    }
    8092}
Note: See TracChangeset for help on using the changeset viewer.