Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 17, 2006, 2:24:09 AM (18 years ago)
Author:
bknecht
Message:

didn't compile, sorry. working on this branch now as well

File:
1 edited

Legend:

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

    r10081 r10083  
    163163  Vector now, later;
    164164  float fact  = 1.0/this->sections;
    165   float rad0, rad1;
     165  float radzero, radone;
    166166
    167167  //glPushAttrib(GL_ENABLE_BIT);
     
    231231  for( int i = 1; i < this->sections-1; i++)
    232232  {
    233     rad1  = this->radius * (1.0-i*fact);
    234     rad0  = this->radius * (1.0-(i+1)*fact);
     233    radone  = this->radius * (1.0-i*fact);
     234    radzero  = this->radius * (1.0-(i+1)*fact);
    235235
    236236    now   =  this->nodeList[i];
     
    242242
    243243    // horizontal polygon
    244     Q[0]  = now + Vector(0,rad1,0) ;
    245     Q[3]  = now + Vector(0,-rad1,0) ;
     244    Q[0]  = now + Vector(0,radone,0) ;
     245    Q[3]  = now + Vector(0,-radone,0) ;
    246246   
    247247    glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
     
    251251    {
    252252     
    253       Q[1]  = later + Vector(0,rad0,0) ;
    254       Q[2]  = later + Vector(0,-rad0,0) ;
     253      Q[1]  = later + Vector(0,radzero,0) ;
     254      Q[2]  = later + Vector(0,-radzero,0) ;
    255255      glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
    256256      glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
     
    263263  for( int i = this->sections-1; i > 0; i--)
    264264  {
    265     rad1  = this->radius * (1.0-i*fact);
    266     rad0  = this->radius * (1.0-(i-1)*fact);
     265    radone  = this->radius * (1.0-i*fact);
     266    radzero  = this->radius * (1.0-(i-1)*fact);
    267267
    268268    now   =  this->nodeList[i];
     
    274274
    275275    // horizontal polygon
    276     Q[0]  = now + Vector(0,rad1,0) ;
    277     Q[3]  = now + Vector(0,-rad1,0) ;
     276    Q[0]  = now + Vector(0,radone,0) ;
     277    Q[3]  = now + Vector(0,-radone,0) ;
    278278
    279279        glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z);
     
    282282    if( i == 1)
    283283    {
    284         Q[1]  = later + Vector(0,rad0,0) ;
    285         Q[2]  = later + Vector(0,-rad0,0) ;
     284        Q[1]  = later + Vector(0,radzero,0) ;
     285        Q[2]  = later + Vector(0,-radzero,0) ;
    286286                glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
    287287                glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
     
    295295  for( int i = 1; i < this->sections-1; i++)
    296296  {
    297     rad1  = this->radius * (1.0-i*fact);
    298     rad0  = this->radius * (1.0-(i+1)*fact);
     297    radone  = this->radius * (1.0-i*fact);
     298    radzero  = this->radius * (1.0-(i+1)*fact);
    299299
    300300    now   =  this->nodeList[i];
     
    306306
    307307    // horizontal polygon
    308     Q[0]  = now + targ.cross(Vector(0,rad1,0)) ;
    309     Q[3]  = now + targ.cross(Vector(0,-rad1,0)) ;
     308    Q[0]  = now + targ.cross(Vector(0,radone,0)) ;
     309    Q[3]  = now + targ.cross(Vector(0,-radone,0)) ;
    310310   
    311311        glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
     
    314314    if( i == this->sections-1)
    315315    {
    316       Q[1]  = later + targ.cross(Vector(0,rad0,0)) ;
    317       Q[2]  = later + targ.cross(Vector(0,-rad0,0)) ;
     316      Q[1]  = later + targ.cross(Vector(0,radzero,0)) ;
     317      Q[2]  = later + targ.cross(Vector(0,-radzero,0)) ;
    318318      glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
    319319      glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
     
    326326  for( int i = this->sections-1; i > 0; i--)
    327327  {
    328     rad1  = this->radius * (1.0-i*fact);
    329     rad0  = this->radius * (1.0-(i-1)*fact);
     328    radone  = this->radius * (1.0-i*fact);
     329    radzero  = this->radius * (1.0-(i-1)*fact);
    330330
    331331    now   =  this->nodeList[i];
     
    337337
    338338    // horizontal polygon
    339     Q[0]  = now + targ.cross(Vector(0,rad1,0)) ;
    340     Q[3]  = now + targ.cross(Vector(0,-rad1,0)) ;
     339    Q[0]  = now + targ.cross(Vector(0,radone,0)) ;
     340    Q[3]  = now + targ.cross(Vector(0,-radone,0)) ;
    341341
    342342        glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
     
    345345    if( i == 1)
    346346    {
    347         Q[1]  = later + targ.cross(Vector(0,rad0,0)) ;
    348         Q[2]  = later + targ.cross(Vector(0,-rad0,0)) ;
     347        Q[1]  = later + targ.cross(Vector(0,radzero,0)) ;
     348        Q[2]  = later + targ.cross(Vector(0,-radzero,0)) ;
    349349                glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
    350350                glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
Note: See TracChangeset for help on using the changeset viewer.