Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2006, 11:18:22 AM (18 years ago)
Author:
marcscha
Message:

velocity fix

Location:
branches/playability/src/world_entities/effects
Files:
2 edited

Legend:

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

    r10083 r10095  
    4343 *
    4444 */
    45 Trail::Trail (float maxLength, int sections, float radius)
     45Trail::Trail (float maxLength, int sections, float radius, PNode* parent)
    4646{
    4747  this->maxLength = maxLength;
     
    4949  this->sections  = sections;
    5050  this->radius    = radius;
     51  this->setParent( parent);
    5152
    5253  this->nodeList  = new Vector[sections];
     
    9697  for( int i = 1; i < sections; i++)
    9798  {
    98     this->nodeList[i] = (this->getAbsCoor() - ((Vector(1,0,0) * (i * this->maxLength / sections))));
     99    this->nodeList[i] = (this->getAbsCoor() - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));
    99100    //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z);
    100101  }
     
    277278    Q[3]  = now + Vector(0,-radone,0) ;
    278279
    279         glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z);
    280         glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
     280        glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z+0.0001f);
     281        glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z+0.0001f);
    281282
    282283    if( i == 1)
     
    284285        Q[1]  = later + Vector(0,radzero,0) ;
    285286        Q[2]  = later + Vector(0,-radzero,0) ;
    286                 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
    287                 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
     287                glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z+0.0001f);
     288                glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z+0.0001f);
    288289        }
    289290
     
    340341    Q[3]  = now + targ.cross(Vector(0,-radone,0)) ;
    341342
    342         glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
    343         glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z);
     343        glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x+0.0001f,Q[0].y,Q[0].z);
     344        glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x+0.0001f,Q[3].y,Q[3].z);
    344345
    345346    if( i == 1)
     
    347348        Q[1]  = later + targ.cross(Vector(0,radzero,0)) ;
    348349        Q[2]  = later + targ.cross(Vector(0,-radzero,0)) ;
    349                 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
    350                 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
     350                glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x+0.0001f,Q[1].y,Q[1].z);
     351                glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x+0.0001f,Q[2].y,Q[2].z);
    351352        }
    352353
  • branches/playability/src/world_entities/effects/trail.h

    r10081 r10095  
    1616  ObjectListDeclaration(Trail);
    1717  public:
    18     Trail(float maxLength, int sections, float radius);
     18    Trail(float maxLength, int sections, float radius, PNode* parent);
    1919    Trail(const TiXmlElement* root = NULL);
    2020    virtual ~Trail();
Note: See TracChangeset for help on using the changeset viewer.