Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2005, 12:04:34 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleSystem: minor fixes. code is nicer now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc

    r3974 r4001  
    124124    // saving the time
    125125    float count = (dt+this->saveTime) * this->emissionRate;
    126     this->saveTime = modff(count, &count);
    127     this->saveTime /= this->emissionRate;
     126    this->saveTime = modff(count, &count) / this->emissionRate;
    128127    PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime);
    129128   
     
    137136            randDir.normalize();
    138137            randDir = (this->getAbsDir()*Quaternion(angle + randomAngle *((float)random()/RAND_MAX -.5), randDir)).apply(this->direction);
    139             randDir = randDir.getNormalized()*velocity + inheritVelocity;
     138            Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity;
    140139           
    141             system->addParticle(this->getAbsCoor(), randDir);
     140            system->addParticle(this->getAbsCoor(), velocityV);
    142141          }
    143142      }
Note: See TracChangeset for help on using the changeset viewer.