Changeset 3371 in orxonox.OLD for orxonox/branches/trackManager/src
- Timestamp:
- Jan 7, 2005, 3:07:12 AM (20 years ago)
- Location:
- orxonox/branches/trackManager/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager/src/p_node.cc
r3369 r3371 226 226 */ 227 227 void PNode::setAbsDir (Quaternion* absDir) 228 {} 228 { 229 this->bAbsDirChanged = true; 230 this->absDirection = *absDir; 231 } 229 232 230 233 -
orxonox/branches/trackManager/src/track_manager.cc
r3369 r3371 19 19 #include "track_manager.h" 20 20 #include <stdarg.h> 21 21 #include "p_node.h" 22 22 23 23 using namespace std; … … 111 111 this->maxTime = 0; 112 112 this->trackElemCount = 1; 113 this->bindSlave = NULL; 113 114 } 114 115 … … 440 441 void TrackManager::tick(float dt) 441 442 { 443 dt /= 1000; 444 printf("LocalTime is: %f, timestep is: %f\n", this->localTime, dt); 442 445 if (this->localTime <= this->firstTrackElem->duration) 443 446 this->jumpTo(this->localTime); 447 printf("LocalTime is: %f, timestep is: %f\n", this->localTime, dt); 444 448 this->localTime += dt; 445 449 if (this->localTime > this->currentTrackElem->startingTime + this->currentTrackElem->duration && this->currentTrackElem->childCount > 0) 446 450 this->currentTrackElem = this->currentTrackElem->children[0]; 451 if (this->bindSlave) 452 { 453 Vector tmp = this->calcPos(); 454 Quaternion quat = Quaternion(this->calcDir(), Vector(0,1,0)); 455 this->bindSlave->setAbsCoor(&tmp); 456 this->bindSlave->setAbsDir(&quat); 457 } 447 458 } 448 459 … … 471 482 } 472 483 484 /** 485 \brief Sets the PNode, that should be moved along the Tack 486 \param bindSlave the PNode to set 487 */ 488 void TrackManager::setBindSlave(PNode* bindSlave) 489 { 490 if (!this->bindSlave) 491 this->bindSlave = bindSlave; 492 } 473 493 474 494 -
orxonox/branches/trackManager/src/track_manager.h
r3369 r3371 14 14 #include "stdincl.h" 15 15 16 class PNode; 16 17 17 18 //! condition for choosing a certain Path. \todo implement a useful way. … … 104 105 float maxTime; //!< The maximal time the track has. 105 106 int trackElemCount; //!< The count of TrackElements that exist. 107 PNode* bindSlave; 106 108 107 109 void initChildren(unsigned int childCount); … … 134 136 void choosePath(int graphID); 135 137 138 void setBindSlave(PNode* bindSlave); 139 136 140 // DEBUG // 137 141 void drawGraph(float dt) const; -
orxonox/branches/trackManager/src/world.cc
r3369 r3371 175 175 trackManager->addPoint(Vector(30,0,5)); 176 176 trackManager->addPoint(Vector(40,0,5)); 177 trackManager->setDuration( .5);177 trackManager->setDuration(2); 178 178 trackManager->setSavePoint(); 179 179 trackManager->addPoint(Vector(50,10,10)); … … 182 182 trackManager->addPoint(Vector(80,0,-10)); 183 183 trackManager->addPoint(Vector(90,0,-10)); 184 trackManager->setDuration( .5);184 trackManager->setDuration(5); 185 185 trackManager->setSavePoint(); 186 186 trackManager->addPoint(Vector(110,0,5)); … … 189 189 trackManager->addPoint(Vector(140,0,-10)); 190 190 trackManager->addPoint(Vector(150,0,-10)); 191 trackManager->setDuration( .5);191 trackManager->setDuration(3); 192 192 int fork11, fork12, fork13, fork14; 193 193 trackManager->fork(4, &fork11, &fork12, &fork13, &fork14); … … 195 195 trackManager->addPoint(Vector(170, 0, -15)); 196 196 trackManager->addPoint(Vector(180, 0, -15)); 197 trackManager->setDuration(3); 197 198 trackManager->workOn(fork12); 198 199 trackManager->addPoint(Vector(170, 0, 10)); … … 200 201 trackManager->addPoint(Vector(190,2,5)); 201 202 trackManager->addPoint(Vector(200,2,5)); 203 trackManager->setDuration(7); 202 204 int fork21, fork22; 203 205 trackManager->fork(2, &fork21, &fork22); … … 208 210 trackManager->addPoint(Vector(250, 0, 0)); 209 211 trackManager->addPoint(Vector(260, 0, 5)); 212 trackManager->setDuration(3); 210 213 trackManager->join(2, fork12, fork11); 211 214 trackManager->workOn(fork22); … … 214 217 trackManager->addPoint(Vector(240, 0, 10)); 215 218 trackManager->addPoint(Vector(250, 0, 5)); 219 trackManager->setDuration(6); 216 220 trackManager->workOn(fork13); 217 221 trackManager->addPoint(Vector(200,-10,5)); 218 222 trackManager->addPoint(Vector(250,-10,5)); 219 printf("fork14: %d\n", fork14);223 trackManager->setDuration(3); 220 224 trackManager->workOn(fork14); 221 225 trackManager->addPoint(Vector(200,15,0)); 222 226 trackManager->addPoint(Vector(210,0,10)); 223 227 trackManager->setDuration(1); 224 228 225 229 … … 273 277 this->spawn (myPlayer); 274 278 this->localPlayer = myPlayer; 275 276 279 // bind input 277 280 Orxonox *orx = Orxonox::getInstance (); … … 290 293 env->setName ("env"); 291 294 this->spawn(env, es, qs); 292 295 trackManager->setBindSlave(env); 293 296 294 297 break; … … 541 544 trackManager->drawGraph(.01); 542 545 trackManager->debug(2); 543 delete trackManager;544 546 545 547 /* … … 651 653 t = loc->part; 652 654 653 if( t >= trac klen )655 if( t >= traclen ) 654 656 { 655 657 printf("An entity is out of the game area\n"); … … 882 884 this->update (); 883 885 this->localCamera->timeSlice(dt); 886 this->trackManager->tick(dt); 884 887 } 885 888 this->lastFrame = currentFrame;
Note: See TracChangeset
for help on using the changeset viewer.