Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6056 in orxonox.OLD for trunk/src/world_entities/weapons/rocket.cc


Ignore:
Timestamp:
Dec 11, 2005, 10:47:01 PM (18 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/rocket.cc

    r5994 r6056  
    143143 * @param time since last tick
    144144*/
    145 void Rocket::tick (float time)
     145void Rocket::tick (float dt)
    146146{
    147147  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    148   Vector v = this->velocity * (time);
     148  Vector v = this->velocity * (dt);
    149149  this->shiftCoor(v);
    150150
    151   this->lifeCycle += time/this->lifeSpan;
    152   if( this->lifeCycle >= 1.0)
    153     {
    154       PRINTF(5)("FINALIZE==========================\n");
    155       PRINTF(5)("current life cycle is: %f\n", this->lifeCycle);
    156       PRINTF(5)("FINALIZE===========================\n");
    157 
    158       this->deactivate();
    159     }
     151  if(this->tickLifeCycle(dt))
     152    this->deactivate();
    160153}
    161154
Note: See TracChangeset for help on using the changeset viewer.