Changeset 3431 in orxonox.OLD for orxonox/branches/trackManager/src
- Timestamp:
- Mar 1, 2005, 10:49:43 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified orxonox/branches/trackManager/src/track_manager.cc ¶
r3430 r3431 158 158 this->currentTrackElem->children[i] = new TrackElement(); 159 159 this->currentTrackElem->children[i]->ID = ++trackElemCount; 160 this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime ;160 this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime; 161 161 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]); 162 162 } … … 371 371 void TrackManager::joinV(unsigned int count, int* trackIDs) 372 372 { 373 printf("Joining %d tracks to Track %d\n", count, trackIDs[0]);373 printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]); 374 374 375 375 // chanching work-on to temporary value. going back at the end. 376 376 int tmpCurrentWorkingID = this->currentTrackElem->ID; 377 377 this->workOn(trackIDs[0]); 378 float tmpLatestTime = 0;379 380 378 TrackElement* firstJoint = this->currentTrackElem; 379 float tmpLatestTime = firstJoint->endTime; 380 381 381 Vector tmpEndPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()); 382 382 Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1); … … 394 394 tmpLatestTime = tmpJoinElem->endTime; 395 395 } 396 // time the main Join. 397 firstJoint->jumpTime = tmpLatestTime - firstJoint->endTime; 398 396 399 // Joining: 397 400 for (int i = 1; i < count; i++) … … 405 408 this->addPoint(tmpTangentPoint, tmpJoinElem); 406 409 this->addPoint(tmpEndPoint, tmpJoinElem); 410 // time all other Joins 407 411 tmpJoinElem->jumpTime = tmpLatestTime - tmpJoinElem->endTime; 408 412 … … 416 420 } 417 421 } 418 if(currentTrackElem->children) 419 for(int i = 0; i > currentTrackElem->childCount; i++) 420 currentTrackElem->children[i]->startingTime = tmpLatestTime; 422 if(firstJoint->childCount > 0) 423 for(int i = 0; i < firstJoint->childCount; i++) 424 { 425 printf("Setting startingTime of %d to %f.\n", firstJoint->children[i]->ID, tmpLatestTime); 426 firstJoint->children[i]->startingTime = tmpLatestTime; 427 firstJoint->children[i]->endTime = tmpLatestTime+firstJoint->children[i]->duration; 428 } 421 429 422 430 // returning to the TrackElement we were working on. … … 426 434 /** 427 435 \brief finalizes the TrackSystem. after this it will not be editable anymore 436 437 \todo check for any inconsistencies, output errors 428 438 */ 429 439 void TrackManager::finalize(void) … … 571 581 } 572 582 583 /** 584 \brief outputs debug information about the trackManager 585 \param level how much debug 586 */ 573 587 void TrackManager::debug(unsigned int level) const 574 588 { … … 607 621 if(tmpElem->isFork) 608 622 { 609 printf(" is A Fork with with %d children. ", tmpElem->childCount);623 printf(" is A Fork with with %d children.\n", tmpElem->childCount); 610 624 } 611 625 if(tmpElem->isJoined)
Note: See TracChangeset
for help on using the changeset viewer.