Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10410 in orxonox.OLD for trunk/src


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
Files:
4 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).
  • trunk/src/world_entities/camera.cc

    r10403 r10410  
    6666void Camera::init()
    6767{
     68  this->toList( OM_COMMON);
    6869  //this->setName("camera");
    6970  this->target = new CameraTarget();
     
    225226  //iterate(float dt, translate, target)
    226227  target->translate(dt);
     228}
     229
     230
     231void Camera::draw() const
     232{
     233  if( this->entityTrack != NULL)
     234    this->entityTrack->drawGraph();
    227235}
    228236
  • trunk/src/world_entities/camera.h

    r10386 r10410  
    7575  Vector* VectorProd(Vector* v1, Vector* v2);
    7676  void Rotate();
     77  void draw() const;
    7778  void tick(float dt);
    7879  void apply ();
Note: See TracChangeset for help on using the changeset viewer.