Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2005, 10:47:01 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: more small optimisations, and a convenience inline-tick-life-cycle functions for projectiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/projectile.cc

    r6054 r6056  
    110110/**
    111111 * signal tick, time dependent things will be handled here
    112  * @param time since last tick
     112 * @param dt since last tick
    113113*/
    114 void Projectile::tick (float time)
     114void Projectile::tick (float dt)
    115115{
    116   Vector v = this->velocity * (time);
     116  Vector v = this->velocity * (dt);
    117117  this->shiftCoor(v);
    118118
    119   this->lifeCycle += time/this->lifeSpan;
    120   if( this->lifeCycle >= 1)
    121   {
    122     PRINTF(5)("FINALIZE==========================\n");
    123     PRINTF(5)("current life cycle is: %f\n", this->lifeCycle);
    124     PRINTF(5)("FINALIZE===========================\n");
    125     //this->finalize();
    126     GarbageCollector::getInstance()->collect(this);
    127   }
     119  if (this->tickLifeCycle(dt))
     120    this->destroy();
    128121}
    129122
Note: See TracChangeset for help on using the changeset viewer.