Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2006, 5:36:18 PM (17 years ago)
Author:
marcscha
Message:

Firing Echo fix on WM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/swarm_projectile.cc

    r10117 r10132  
    5555  this->emitter->setSpread(M_PI, M_PI);
    5656
    57   this->turningSpeed = 30;
     57  this->turningSpeed = 10;
    5858
    5959  this->physDamage = 200;
     
    164164//   printf("turning angle: %f\ntemp: %f\n", angle, tmp);
    165165
    166   if( fabsf(angle) >  fabsf(tmp) ) { angle = tmp; }
     166  if( fabsf(angle) >  fabsf(tmp) )
     167    angle = tmp;
     168  else
     169    angle *= tmp/fabsf(tmp);
    167170
    168171  Vector d = curDirection.cross(estTargetDir).cross(curDirection);
    169172  d.normalize();
    170   if( unlikely( angle == 90)) { return d; } //avoid complication
     173  if( unlikely( fabsf(angle) == 90)) { return d; } //avoid complication
    171174
    172175  Vector newDir = curDirection + d *  curDirection.len() * tan (angle);
     
    221224//     else
    222225//       tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity);
    223     Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor());
     226    Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
    224227//     estTargetDir.slerpTo(this->velocity, 1);
    225228    this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time );
     
    275278  glPushMatrix();
    276279
    277   Vector tmpDir = this->curDir *.7 + this->lastDir * .3;
     280  Vector tmpDir = this->curDir; // *.7 + this->lastDir * .3;
     281  tmpDir.slerpTo(this->lastDir, .4);
    278282
    279283  float matrix[4][4];
Note: See TracChangeset for help on using the changeset viewer.