Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5760 in orxonox.OLD for branches


Ignore:
Timestamp:
Nov 24, 2005, 3:28:38 PM (19 years ago)
Author:
snellen
Message:

guided_missile updated

Location:
branches/guidedmissile/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/guidedmissile/src/world_entities/weapons/guided_missile.cc

    r5759 r5760  
    4747  this->energyMax = 10;
    4848  this->remove();
    49   this->lifeSpan = 2;
     49  this->lifeSpan = 5;
     50  this->agility = 1;
    5051
    5152  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
     
    8081ParticleSystem* GuidedMissile::trailParticles = NULL;
    8182ParticleSystem* GuidedMissile::explosionParticles = NULL;
     83
     84
     85void GuidedMissile::setTarget(PNode* target)
     86{
     87
     88  this->target.setParent(target);
     89
     90}
     91
    8292
    8393void GuidedMissile::activate()
     
    147157{
    148158  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
     159  velocity += ((target.getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
    149160  Vector v = this->velocity * (time);
    150161  this->shiftCoor(v);
  • branches/guidedmissile/src/world_entities/weapons/guided_missile.h

    r5759 r5760  
    4040
    4141    ParticleEmitter*                  emitter;
    42     Aim*                              target;
     42    PNode                             target;
     43    float                             agility;
    4344
    4445    WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset for help on using the changeset viewer.