Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4692 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 24, 2005, 4:26:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: momentum

Location:
orxonox/trunk/src/lib/particles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/particle_emitter.cc

    r4691 r4692  
    245245  if (likely(dt > 0.0 && this->emissionRate > 0.0))
    246246  {
    247     // saving the time
     247    // saving the time (particles only partly emitted in this timestep)
    248248    float count = (dt+this->saveTime) * this->emissionRate;
    249249    this->saveTime = modff(count, &count) / this->emissionRate;
    250     PRINTF(5)("emitting %f particles, saving %f seconds for the next round\n", count, this->saveTime);
     250    PRINTF(5)("emitting %f particles, saving %f seconds for the next timestep\n", count, this->saveTime);
    251251
    252252    if (likely(count > 0))
     
    254254      Vector inheritVelocity = this->getVelocity() * this->inheritSpeed;
    255255      for (int i = 0; i < count; i++)
    256           // emmits from EMITTER_DOT,
    257256      {
    258257        Vector randDir = Vector(rand()-RAND_MAX/2, rand()-RAND_MAX/2, rand()-RAND_MAX/2);
     
    261260        Vector velocityV = randDir.getNormalized()*this->velocity + inheritVelocity;
    262261
    263             // this should spread the Particles evenly. if the Emitter is moved around quickly
     262        // this should spread the Particles evenly. if the Emitter is moved around quickly
    264263        Vector equalSpread = this->getVelocity() * rand()/RAND_MAX * dt;
    265264        Vector extension; // the Vector for different fields.
    266265
    267         if (this->type & 2)
     266        if (this->type & EMITTER_PLANE)
    268267        {
    269268          extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5));
    270269          extension = this->getAbsDir().apply(extension);
    271270        }
    272         else if (this->type & 8)
     271        else if (this->type & EMITTER_CUBE)
    273272        {
    274273          extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize;
     
    283282
    284283        system->addParticle(this->getAbsCoor() + extension - equalSpread, velocityV, orient, moment);
    285 
    286284      }
    287285    }
  • orxonox/trunk/src/lib/particles/particle_system.cc

    r4691 r4692  
    265265{
    266266  Particle* tickPart = particles;  // the particle to Tick
    267   Particle* prevPart = NULL;       //
     267  Particle* prevPart = NULL;
    268268  while (likely(tickPart != NULL))
    269269    {
Note: See TracChangeset for help on using the changeset viewer.