Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Firing Echo fix on WM

Location:
branches/playability/src/world_entities/projectiles
Files:
3 edited

Legend:

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

    r10117 r10132  
    7878  this->buildObbTree(4);
    7979 
    80   this->trail = new Trail(6,4,.1, this);
     80  this->trail = new Trail(6, 4, .1, this);
    8181  //this->trail->setParent( this);
    8282  this->trail->setTexture( "maps/laser.png");
     
    124124  this->setHealth(0);
    125125
    126 
    127126  this->emitter->setSpread(0);
    128127  this->emitter->setEmissionRate(10.0);
     
    150149  this->hitEntity = entity;
    151150  dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
    152   this->destroy(this);
     151  //this->destroy(this);
     152  this->deactivate();
    153153 
    154154  return;
    155155
    156   if( entity == NULL || dynamic_cast<SpaceShip*>(entity) == NULL)
    157     return;
    158 
    159   dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
     156  //dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
    160157  //entity->destroy(this);
    161158  //this->deactivate();
  • 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];
  • branches/playability/src/world_entities/projectiles/swarm_projectile.h

    r10087 r10132  
    5050    Vector                            curDir;
    5151    Vector                            lastDir;
     52    Vector                            oldPos;
    5253
    5354    WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset for help on using the changeset viewer.