Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 6, 2005, 4:40:08 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/parenting: TrackManager: implemented Debug-output:

  1. function draw() to draw the Track in Full
  2. function debug, that Prints information about the state of the TrackManager
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/track_manager.cc

    r3349 r3350  
    226226      this->currentTrackElem->isFresh = false;
    227227      if(this->currentTrackElem != this->firstTrackElem)
    228         this->addPoint(this->currentTrackElem->startPoint);
    229         this->addPoint(this->currentTrackElem->startTangentPoint);
    230      
     228        {
     229          this->addPoint(this->currentTrackElem->startPoint);
     230          this->addPoint(this->currentTrackElem->startTangentPoint);
     231        }
    231232    }
    232233  this->currentTrackElem->curve->addNode(newPoint);
     
    409410}
    410411
     412
     413
     414// DEBUG //
     415
     416/**
     417   \brief Imports a model of the Graph into the OpenGL-environment.
     418   \param dt The Iterator used in seconds for Painting the Graph.
     419
     420   This is for testing facility only. Do this if you want to see the Path inside the Level.
     421   eventually this will all be packed into a gl-list.
     422*/
     423void TrackManager::drawGraph(float dt) const
     424{
     425  glBegin(GL_LINES);
     426  for (int i = 1; i <= trackElemCount; i++)
     427    {
     428      TrackElement* tmpElem = this->findTrackElementByID(i);
     429      printf("Element: %i\n", tmpElem->ID);
     430      if (tmpElem->curve)
     431        for(float f = 0.0; f < 1.0; f+=dt)
     432          {
     433            //      printf("%f, %f, %f\n",trackManager->calcPos().x, trackManager->calcPos().y, trackManager->calcPos().z);
     434            Vector tmpVector = tmpElem->curve->calcPos(f);
     435            glVertex3f(tmpVector.x, tmpVector.y, tmpVector.z);
     436          }
     437    }
     438  glEnd();
     439 
     440 
     441}
     442
     443void TrackManager::debug(unsigned int level) const
     444{
     445  printf("::CLASS TRACKMANAGER::debug information::\n");
     446  //  printf("Status is: %
     447  printf(" Consists of %d elements\n", this->trackElemCount);
     448  printf(" localTime is: %f\n", this->localTime);
     449  if (level >= 2)
     450    {
     451      for (int i = 1; i <= trackElemCount; i++)
     452        {
     453          TrackElement* tmpElem = this->findTrackElementByID(i);
     454          printf("  ::TrackElement:%i::", tmpElem->ID);
     455          if(tmpElem->name)
     456            printf("name:%s::", tmpElem->name);
     457          printf("\n   TimeTable: starting at = %f; ends at = %f; duration = %f\n", tmpElem->startingTime, tmpElem->startingTime+tmpElem->duration, tmpElem->duration);
     458          printf("   consists of %d Points\n", tmpElem->nodeCount);
     459
     460          if(tmpElem->isFresh)
     461            printf("   has not jet eddited in any way\n");
     462          if(tmpElem->isSavePoint)
     463            printf("   is a SavePoint\n");
     464          if(tmpElem->isFork)
     465            printf("   is A Fork with with %d children\n", tmpElem->childCount);
     466          if(tmpElem->isJoined)
     467            printf("   is Joined at the End\n");
     468
     469                   
     470        }
     471    }
     472}
Note: See TracChangeset for help on using the changeset viewer.