Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 23, 2005, 12:42:09 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: the first particles are being drawn :)

File:
1 edited

Legend:

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

    r3931 r3932  
    1818#include "particle_emitter.h"
    1919
     20#include "particle_system.h"
     21
    2022using namespace std;
    2123
     
    3234   this->emissionRate = emissionRate;
    3335   this->velocity = velocity;
     36
     37   this->saveTime = 0.0;
    3438}
    3539
     
    104108*/
    105109
     110void ParticleEmitter::tick(float dt, ParticleSystem* system)
     111{
     112  // saving the time
     113  float countF = (dt+this->saveTime) / emissionRate;
     114  int count = (int)round(countF);
     115  this->saveTime = countF - (float)count;
     116
     117  for (int i = 0; i <= count; i++)
     118    // emmits from EMITTER_DOT,
     119    system->addParticle(this->getAbsCoor(), direction * velocity );
     120}
Note: See TracChangeset for help on using the changeset viewer.