Changeset 3331 in orxonox.OLD for orxonox/branches/parenting/src/track_manager.cc
- Timestamp:
- Jan 4, 2005, 1:39:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/track_manager.cc
r3330 r3331 22 22 using namespace std; 23 23 24 /** 25 \brief initializes a TrackElement (sets the default values) 26 */ 27 TrackElement::TrackElement(void) 28 { 29 this->isSavePoint = false; 30 this->isFork = false; 31 this->isJoined = false; 32 this->cond; //!< todo think!! 33 this->ID = -1; 34 this->length =0; 35 this->curveType = BEZIERCURVE; 36 this->nodeCount = 0; 37 childCount = 0; 38 this->curve = NULL; 39 this->children = NULL; 40 } 41 42 /** 43 \destroys all alocated memory) 44 \todo eventually when deleting a TrackElement you would not like to delete all its preceding TrackElements 45 */ 46 TrackElement::~TrackElement(void) 47 { 48 if (this->curve) 49 delete this->curve; 50 if (this->childCount > 0) 51 { 52 for (int i=0; i < this->childCount; i++) 53 delete this->children[i]; 54 } 55 } 56 57 58 24 59 25 60 /** … … 30 65 TrackManager::TrackManager () 31 66 { 32 this->setClassName ("TrackManager"); 33 } 34 35 36 /** 37 \brief standard deconstructor 67 this->setClassName ("TrackManager"); 68 69 PRINTF(3)("Initializing the TrackManager\n"); 70 this->firstTrackElem = NULL; 71 this->currentTrackElem = firstTrackElem; 72 this->localTime = 0; 73 this->maxTime = 0; 74 this->trackElemCount = 0; 75 } 76 77 78 /** 79 \brief standard destructor 38 80 39 81 \todo this deconstructor is not jet implemented - do it … … 41 83 TrackManager::~TrackManager () 42 84 { 43 85 PRINTF(3)("Destruct TrackManager\n"); 86 87 PRINTF(3)("Deleting all the TrackElements\n"); 88 delete this->firstTrackElem; 89 // we do not have a TrackManager anymore 90 singletonRef = NULL; 91 } 92 93 TrackManager* TrackManager::singletonRef = NULL; 94 95 /** 96 \returns The reference on the TrackManager. 97 98 If the TrackManager does not exist, it will be created. 99 */ 100 TrackManager* TrackManager::getInstance(void) 101 { 102 if (singletonRef) 103 return singletonRef; 104 else 105 return singletonRef = new TrackManager(); 44 106 } 45 107 … … 201 263 202 264 /** 265 \brief Jumps to a certain point on the Track. 266 \param time The time on the Track to jump to. 267 268 This should be used to Jump backwards on a Track, because moving forward means to change between the Path. (it then tries to choose the default.) 269 Max is trackLengthMax. 270 */ 271 void TrackManager::jumpTo(float time) 272 { 273 274 } 275 276 /** 203 277 \brief a Function that decides which Path we should follow. 204 278 \param graphID The Path to choose.
Note: See TracChangeset
for help on using the changeset viewer.