Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2005, 10:19:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: small efficiency update

File:
1 edited

Legend:

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

    r4378 r4385  
    242242    {
    243243      // applying force to the System.
    244       tickPart->velocity += tickPart->extForce * tickPart->mass;
     244      if (likely (tickPart->mass > 0.0))
     245        tickPart->velocity += tickPart->extForce / tickPart->mass;
    245246
    246247      // rendering new position.
     
    271272        tickPart->velocity = tickPart->velocity * this->conserve;
    272273      // find out if we have to delete tickPart
    273       if ((tickPart->lifeCycle += dt/tickPart->lifeTime) >= 1.0)
     274      if (unlikely((tickPart->lifeCycle += dt/tickPart->lifeTime) >= 1.0))
    274275        {
    275276          // remove the particle from the list
Note: See TracChangeset for help on using the changeset viewer.