Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2005, 2:02:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: applying force works for particle-systems again

File:
1 edited

Legend:

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

    r4377 r4378  
    5656  this->setType(type, 1);
    5757  this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);
     58  this->setMass(1.0, 0.0);
    5859  ParticleEngine::getInstance()->addSystem(this);
    5960}
     
    182183
    183184/**
     185   \brief sets the initial mass of any particle
     186*/
     187void ParticleSystem::setMass(float mass, float randomMass)
     188{
     189  this->initialMass = mass;
     190  this->randomInitialMass = randomMass;
     191}
     192
     193/**
    184194   \brief sets the conserve Factor of newly created particles
    185195*/
     
    231241  while (likely(tickPart != NULL))
    232242    {
     243      // applying force to the System.
     244      tickPart->velocity += tickPart->extForce * tickPart->mass;
     245
     246      // rendering new position.
    233247      tickPart->position = tickPart->position + tickPart->velocity * dt;
    234248      tickPart->radius += tickPart->radiusIt * dt;
    235 
    236       // applying force to the System.
    237       tickPart->velocity += tickPart->extForce * tickPart->mass;
     249     
    238250      tickPart->extForce = Vector(0,0,0);
    239251
Note: See TracChangeset for help on using the changeset viewer.