Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10132 in orxonox.OLD for branches/playability/src/world_entities


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
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/effects/trail.cc

    r10107 r10132  
    100100  for( int i = 1; i < sections; i++)
    101101  {
    102     this->nodeList[i] = (this->getAbsCoor() - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));
     102    this->nodeList[i] = (this->getAbsCoor());// - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));
    103103    //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z);
    104104  }
     
    133133{
    134134  // Update node positions
     135  float len = 0;
    135136  float secLen  = this->maxLength / this->sections;
    136   this->nodeList[0] = (this->getAbsCoor());
    137   for(int i = 1; i < this->sections; i++)
    138   {
    139     this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*secLen;
    140   }
    141   /*
    142   this->length  = this->maxLength / (this->getAbsCoor() - this->nodeList[this->sections-1]).len();
    143   if (!likely(this->length == 1.0))
    144     for(int i = 1; i < this->sections; i++)
    145       this->nodeList[i] = this->getAbsCoor()- (this->getAbsCoor() - this->nodeList[i])*this->length;
    146   */
    147   /*PRINTF(0)("TRAIL POS ");
    148   for( int i=0; i < this->sections; i++)
    149   {
    150     PRINTF(0)("N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z);
    151   }
    152   PRINTF(0)("\n");*/
     137  this->nodeList[0] = this->getAbsCoor();
     138  this->nodeList[1] = this->getAbsCoor() - ((this->getParent()->getAbsDir().apply(Vector(1,0,0))).getNormalized() *  this->maxLength / sections);
     139  for(int i = 2; i < this->sections; i++)
     140  {
     141    len = (this->nodeList[i-1] - this->nodeList[i]).len();
     142    if( secLen < len) len = secLen;
     143    this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*len;
     144  }
    153145}
    154146
  • 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
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10121 r10132  
    343343
    344344 
    345   this->trail = new Trail( 10, 10, .2, this);
     345  this->trail = new Trail( 30, 100, .2, this);
    346346  //this->trail->setParent( this);
    347347  this->trail->setTexture( "maps/engine.png");
    348348
    349   this->trailL = new Trail( 10, 10, .2, this);
     349  this->trailL = new Trail( 30, 100, .2, this);
    350350  //this->trailL->setParent( this);
    351351  this->trailL->setTexture( "maps/engine.png");
    352352
    353   this->trailR = new Trail( 10, 10, .2, this);
     353  this->trailR = new Trail( 30, 100, .2, this);
    354354  //this->trailR->setParent( this);
    355355  this->trailR->setTexture( "maps/engine.png");
  • branches/playability/src/world_entities/weapons/medium_blaster.cc

    r10121 r10132  
    5656
    5757  this->setStateDuration(WS_RELOADING, 0);
    58   this->setStateDuration(WS_ACTIVATING, 0); //.5);
    59   this->setStateDuration(WS_DEACTIVATING, 0); // 1);
     58  this->setStateDuration(WS_ACTIVATING, .5); //.5);
     59  this->setStateDuration(WS_DEACTIVATING, 1); // 1);
    6060
    6161  this->setEnergyMax(500);
  • branches/playability/src/world_entities/weapons/weapon_manager.cc

    r10121 r10132  
    435435  {
    436436          firingWeapon = this->currentSlotConfig[i].currentWeapon;
     437      if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue;
    437438          if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
    438439  }
Note: See TracChangeset for help on using the changeset viewer.