Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10410 in orxonox.OLD for trunk/src/util/track


Ignore:
Timestamp:
Jan 27, 2007, 7:30:45 PM (18 years ago)
Author:
patrick
Message:

the track now is been drawn for the camera

Location:
trunk/src/util/track
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/track/track.cc

    r10397 r10410  
    133133{
    134134     this->duration = this->duration/speed;
    135      
     135
    136136}
    137137
     
    218218            this->localTime = 0;
    219219     }
    220      
     220
    221221//   if (this->localTime > this->currentTrackElem->endTime
    222222//       && this->currentTrackElem->children)
     
    238238       Vector tmp = this->calcPos();
    239239       //Quaternion quat = Quaternion(this->calcDir(), Vector(this->curve->calcAcc(this->localTime/this->duration).x,1,this->curve->calcAcc(this->localTime/this->duration).z));
    240        
     240
    241241
    242242       Vector v(0.0, 1.0, 0.0);
     
    267267   eventually this will all be packed into a gl-list.
    268268*/
    269 /*void Track::drawGraph(float dt) const
    270 {
     269void Track::drawGraph(float dt) const
     270{
     271    glMatrixMode(GL_MODELVIEW);
     272    glPushMatrix();
     273
     274    glPushAttrib(GL_ENABLE_BIT);
     275
     276    glDisable(GL_LIGHTING);
     277    glDisable(GL_TEXTURE_2D);
     278    glDisable(GL_BLEND);
     279    glLineWidth(2.0);
     280
     281
     282
     283    PNode* node = PNode::getNullParent();
     284    glTranslatef (node->getAbsCoor ().x,
     285                  node->getAbsCoor ().y,
     286                  node->getAbsCoor ().z);
     287    Vector tmpRot = node->getAbsDir().getSpacialAxis();
     288    glRotatef (node->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     289
    271290      glBegin(GL_LINE_STRIP);
     291        glColor3f(1.0, 1.0, 0.6);
     292
    272293        for(float f = 0.0; f < 1.0; f+=dt)
    273294          {
    274             // PRINTF(4)("drawing",this->calcPos().x, this->calcPos().y, this->calcPos().z);
     295            //PRINTF(0)("drawing",this->calcPos().x, this->calcPos().y, this->calcPos().z);
    275296            Vector tmpVector = this->curve->calcPos(f);
    276297            glVertex3f(tmpVector.x, tmpVector.y, tmpVector.z);
    277298          }
    278299      glEnd();
    279 }*/
     300
     301      glPopAttrib();
     302
     303    glPopMatrix();
     304}
  • trunk/src/util/track/track.h

    r10385 r10410  
    3434
    3535   PNode* getTrackNode();
    36    
    37 //   void drawGraph(float dt) const;
    38      
     36
     37   void drawGraph(float dt = 0.01) const;
     38
    3939   //float                 startingTime;         //!< The time at which this Track begins.
    4040   float                 duration;             //!< The time used to cross this Track (curve).
Note: See TracChangeset for help on using the changeset viewer.