Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 23, 2005, 4:48:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: inherit speed from emitter is now also an option
for this i had to write a new PNode function, getVelocity (patrick: you could also use this one in the shoot-class, maybe).

File:
1 edited

Legend:

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

    r3936 r3938  
    4242   this->setConserve(.8);
    4343   this->setLifeSpan(.1);
     44   this->setInheritSpeed(0);
    4445
    4546   ParticleEngine::getInstance()->addSystem(this);
     
    6263  this->material = material;
    6364}
     65
     66
     67/**
     68   \brief how much of the speed from the ParticleEmitter should flow onto the ParticleSystem
     69   \param value a Value between zero and one
     70
     71   
     72   if you want to change the value of this variable during emission time (to make it more dynamic)
     73   you may want to use the animation class
     74*/
     75void ParticleSystem::setInheritSpeed(float value)
     76{
     77  if (unlikely(value > 1.0))
     78    this->inheritSpeed = 1;
     79  else if (unlikely(value < 0.0))
     80    this->inheritSpeed = 0;
     81  else
     82    this->inheritSpeed = value;
     83}
     84
    6485
    6586void ParticleSystem::setLifeSpan(float lifeSpan, float randomLifeSpan)
Note: See TracChangeset for help on using the changeset viewer.