Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2005, 2:10:47 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: inheritSpeed now property of particle_emitter. system not friend emitter anymore

File:
1 edited

Legend:

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

    r4478 r4493  
    3737  this->emitterSize = 1.0;
    3838  this->direction = direction;
     39  this->setInheritSpeed(0);
    3940  this->setSpread(angle);
    4041  this->setEmissionRate(emissionRate);
     
    157158  else
    158159    this->emissionRate = 0.0;
     160}
     161
     162/**
     163   \brief how much of the speed from the ParticleEmitter should flow onto the ParticleSystem
     164   \param value a Value between zero and one
     165
     166   if you want to change the value of this variable during emission time (to make it more dynamic)
     167   you may want to use the animation class
     168*/
     169void ParticleEmitter::setInheritSpeed(float value)
     170{
     171  if (unlikely(value > 1.0))
     172    this->inheritSpeed = 1;
     173  else if (unlikely(value < 0.0))
     174    this->inheritSpeed = 0;
     175  else
     176    this->inheritSpeed = value;
    159177}
    160178
     
    207225    if (likely(count > 0))
    208226      {
    209         Vector inheritVelocity = this->getVelocity() * system->inheritSpeed;
     227        Vector inheritVelocity = this->getVelocity() * this->inheritSpeed;
    210228        for (int i = 0; i < count; i++)
    211229          // emmits from EMITTER_DOT,
     
    242260void ParticleEmitter::debug(void)
    243261{
    244 
    245 }
     262  PRINT(0)(" Emitter %s\n", this->getName());
     263}
Note: See TracChangeset for help on using the changeset viewer.