- Timestamp:
- Jan 6, 2005, 4:40:08 AM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/track_manager.cc
r3349 r3350 226 226 this->currentTrackElem->isFresh = false; 227 227 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 } 231 232 } 232 233 this->currentTrackElem->curve->addNode(newPoint); … … 409 410 } 410 411 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 */ 423 void 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 443 void 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 } -
orxonox/branches/parenting/src/track_manager.h
r3349 r3350 106 106 107 107 TrackElement* findTrackElementByID(unsigned int trackID) const; 108 108 109 109 public: 110 110 ~TrackManager(void); … … 131 131 void choosePath(int graphID); 132 132 133 // DEBUG // 134 void drawGraph(float dt) const; 135 void debug(unsigned int level) const; 133 136 }; 134 137 -
orxonox/branches/parenting/src/world.cc
r3348 r3350 236 236 trackManager->addPoint(Vector(80,0,-10)); 237 237 trackManager->addPoint(Vector(90,0,-10)); 238 trackManager->setDuration(.5); 239 trackManager->setSavePoint(); 240 trackManager->addPoint(Vector(110,0,5)); 241 trackManager->addPoint(Vector(120,0, 10)); 242 trackManager->addPoint(Vector(130,0, 10)); 243 trackManager->addPoint(Vector(140,0,-10)); 244 trackManager->addPoint(Vector(150,0,-10)); 238 245 trackManager->setDuration(.5); 239 246 … … 548 555 } 549 556 glEnd(); 557 558 trackManager->drawGraph(.01); 559 trackManager->debug(2); 560 /* 561 glBegin(GL_LINES); 550 562 float i; 551 glBegin(GL_LINES);552 for(i = 0.0; i<1; i+=.01)553 {554 trackManager->tick (.01);555 printf("%f, %f, %f\n",trackManager->calcPos().x, trackManager->calcPos().y, trackManager->calcPos().z);556 glVertex3f(trackManager->calcPos().x, trackManager->calcPos().y, trackManager->calcPos().z);557 }558 /*559 563 for(i = 0.0; i<1; i+=.01) 560 564 {
Note: See TracChangeset
for help on using the changeset viewer.