Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6056 in orxonox.OLD for trunk/src/world_entities/weapons/laser.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/laser.cc

    r5994 r6056  
    100100//  GarbageCollector::getInstance()->collect(this);
    101101  State::getWorldEntityList()->remove(this);
     102  this->removeNode();
    102103  Laser::fastFactory->kill(this);
    103104}
     
    113114/**
    114115 *  signal tick, time dependent things will be handled here
    115  * @param time since last tick
     116 * @param dt time since last tick
    116117*/
    117 void Laser::tick (float time)
     118void Laser::tick (float dt)
    118119{
    119120  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    120   Vector v = this->velocity * (time);
     121  Vector v = this->velocity * dt;
    121122  this->shiftCoor(v);
    122123
    123   this->lifeCycle += time/this->lifeSpan;
    124   if( this->lifeCycle >= 1.0)
    125     {
    126       PRINTF(5)("FINALIZE==========================\n");
    127       PRINTF(5)("current life cycle is: %f\n", this->lifeCycle);
    128       PRINTF(5)("FINALIZE===========================\n");
    129 
    130       this->deactivate();
    131     }
     124  if (this->tickLifeCycle(dt))
     125    this->deactivate();
    132126}
    133127
Note: See TracChangeset for help on using the changeset viewer.