Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 24, 2005, 4:29:29 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: guided_missiles rock

File:
1 edited

Legend:

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

    r5761 r5764  
    4242
    4343  float modelSize = .3;
    44   this->loadModel("models/projectiles/orx-guided_missile.obj", .3);
     44  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4545
    4646  this->energyMin = 1;
     
    4848  this->remove();
    4949  this->lifeSpan = 5;
    50   this->agility = 1;
     50  this->agility = 5;
    5151
    5252  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
     
    8282ParticleSystem* GuidedMissile::explosionParticles = NULL;
    8383
    84 
    85 void GuidedMissile::setTarget(PNode* target)
    86 {
    87 
    88   this->target.setParent(target);
    89 
    90 }
    9184
    9285
     
    158151  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    159152  float speed = velocity.len();
    160   velocity += ((target.getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
    161   velocity *= speed/velocity.len();
     153  if (target != NULL)
     154   {
     155     velocity += ((target->getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
     156     velocity *= speed/velocity.len();
     157   }
    162158  Vector v = this->velocity * (time);
    163159  this->shiftCoor(v);
Note: See TracChangeset for help on using the changeset viewer.