Changeset 3376 in orxonox.OLD for orxonox/branches
- Timestamp:
- Jan 8, 2005, 6:32:39 PM (20 years ago)
- Location:
- orxonox/branches/trackManager/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager/src/curve.cc
r3375 r3376 94 94 Vector Curve::getNode(unsigned int nodeToFind) 95 95 { 96 if (nodeToFind > this->nodeCount )96 if (nodeToFind > this->nodeCount || nodeToFind < 0) 97 97 return Vector(0,0,0); 98 98 PathNode* tmpNode = this->firstNode; -
orxonox/branches/trackManager/src/track_manager.cc
r3375 r3376 152 152 { 153 153 this->currentTrackElem->childCount = childCount; 154 this->currentTrackElem->mainJoin = true; 154 155 this->currentTrackElem->children = new TrackElement*[childCount]; 155 156 for (int i=0; i<childCount; i++) … … 159 160 this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime; 160 161 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]); 161 this->addPoint((this->currentTrackElem->children[i]->curve->getNode(0) *2) - this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()-1), this->currentTrackElem->children[i]);162 162 } 163 163 } … … 380 380 TrackElement* firstJoint = this->currentTrackElem; 381 381 Vector tmpEndPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()); 382 Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1); 382 Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1); 383 Vector tmpc2Point = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-2); 383 384 firstJoint->isJoined = true; 384 firstJoint->mainJoin = true;385 // firstJoint->mainJoin = true; 385 386 if(!firstJoint->isHotPoint) 386 387 this->setSavePoint(); … … 401 402 else 402 403 { 404 this->addPoint(tmpc2Point, tmpJoinElem); 403 405 this->addPoint(tmpTangentPoint, tmpJoinElem); 404 406 this->addPoint(tmpEndPoint, tmpJoinElem); … … 421 423 this->workOn(tmpCurrentWorkingID); 422 424 } 425 426 /** 427 \brief finalizes the TrackSystem. after this it will not be editable anymore 428 */ 429 void TrackManager::finalize(void) 430 { 431 for (int i = 1; i<= trackElemCount ;i++) 432 { 433 TrackElement* tmpElem = findTrackElementByID(i); 434 if (tmpElem->childCount>0 && tmpElem->mainJoin) 435 { 436 for (int j = 0; j < tmpElem->childCount; j++) 437 { 438 439 // c1-continuity 440 tmpElem->children[j]->curve->addNode(tmpElem->children[j]->curve->getNode(0) + 441 ((tmpElem->children[j]->curve->getNode(0) - 442 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) 443 ),2); 444 tmpElem->children[j]->nodeCount++; 445 // c2-continuity 446 tmpElem->children[j]->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())- 447 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) * 4 + 448 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-2), 3); 449 tmpElem->children[j]->nodeCount++; 450 printf("accelerations: %d-in: count: %d, %f, %f, %f\n %d-out: count: %d %f, %f, %f\n", 451 tmpElem->ID, tmpElem->nodeCount, 452 tmpElem->curve->calcAcc(0.999).x, tmpElem->curve->calcAcc(0.999).y, tmpElem->curve->calcAcc(0.999).z, 453 tmpElem->children[j]->ID, tmpElem->children[j]->nodeCount, 454 tmpElem->children[j]->curve->calcAcc(0).x, tmpElem->children[j]->curve->calcAcc(0).y, tmpElem->children[j]->curve->calcAcc(0).z); 455 } 456 } 457 } 458 } 459 423 460 424 461 // RUNTIME // -
orxonox/branches/trackManager/src/track_manager.h
r3373 r3376 129 129 void join(unsigned int count, ...); 130 130 void joinV(unsigned int count, int* trackIDs); 131 void finalize(void); 131 132 132 133 // Methods to calculate the position on the Path (runtime) -
orxonox/branches/trackManager/src/world.cc
r3375 r3376 139 139 void World::destroy() 140 140 { 141 delete trackManager; 141 142 } 142 143 … … 228 229 trackManager->workOn(10); 229 230 trackManager->addPoint(Vector(250,-10,5)); 231 trackManager->addPoint(Vector(260,-10,5)); 232 trackManager->finalize(); 230 233 231 234 /*
Note: See TracChangeset
for help on using the changeset viewer.