Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Firing Echo fix on WM

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.