Changeset 3333 in orxonox.OLD for orxonox/branches/parenting/src/track_manager.cc
- Timestamp:
- Jan 5, 2005, 12:53:42 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/track_manager.cc
r3332 r3333 34 34 this->cond; //!< todo think!! 35 35 this->ID = -1; 36 this->length =0; 36 this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager. 37 this->duration =0; 37 38 this->curveType = BEZIERCURVE; 38 39 this->nodeCount = 0; … … 58 59 delete this->children[i]; 59 60 } 61 if (children) 62 delete children; 63 } 64 65 /** 66 \brief reserves Space for childCount children 67 \param childCount The Count of children to make space for. 68 */ 69 void TrackElement::initChildren(unsigned int childCount) 70 { 71 this->childCount = childCount; 72 this->children = new TrackElement*[childCount]; 73 for (int i=0; i<childCount; i++) 74 this->children[i] = new TrackElement(); 60 75 } 61 76 … … 183 198 184 199 /** 185 \brief Sets the lengthof the current path in seconds.186 \param time The lengthin seconds.187 */ 188 189 void TrackManager::set Length(float time)190 { 191 this->currentTrackElem-> length= time;200 \brief Sets the duration of the current path in seconds. 201 \param time The duration in seconds. 202 */ 203 204 void TrackManager::setDuration(float time) 205 { 206 this->currentTrackElem->duration = time; 192 207 } 193 208 … … 196 211 \param newPoint The point to add. 197 212 */ 198 voidTrackManager::addPoint(Vector newPoint)213 bool TrackManager::addPoint(Vector newPoint) 199 214 { 200 215 if (this->currentTrackElem->isFresh) … … 209 224 \brief adds save/splitpoint. 210 225 \param newPoint The point to add. 211 */ 212 void TrackManager::addHotPoint(Vector newPoint) 226 \returns A Pointer to a newly appended Curve 227 */ 228 int TrackManager::addHotPoint(Vector newPoint) 213 229 { 214 230 if (this->currentTrackElem->isFresh) … … 224 240 /** 225 241 \brief Sets the last HotPoint into a savePoint. 242 \returns A Pointer to a newly appended Curve 226 243 227 244 If no HotPoint was defined the last added Point will be rendered into a savePoint. \n 228 245 If the HotPoint was defined as a fork the Point will \b not be set into a savePoint. 229 246 */ 230 voidTrackManager::setSavePoint(void)247 int TrackManager::setSavePoint(void) 231 248 { 232 249 if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint) 233 return ;250 return this->currentTrackElem->children[1]->ID; 234 251 this->currentTrackElem->isSavePoint = true; 235 252 236 this->currentTrackElem-> children = new TrackElement*[1];253 this->currentTrackElem->initChildren(1); 237 254 } 238 255 … … 273 290 this->currentTrackElem->isFork = true; 274 291 275 this->currentTrackElem-> children = new TrackElement*[count];292 this->currentTrackElem->initChildren(count); 276 293 } 277 294 … … 327 344 Vector TrackManager::calcPos() const 328 345 { 329 346 return this->currentTrackElem->curve->calcPos(this->localTime); 330 347 } 331 348 … … 336 353 Vector TrackManager::calcDir() const 337 354 { 338 355 return this->currentTrackElem->curve->calcDir(this->localTime); 339 356 } 340 357 … … 342 359 \brief Advances the local-time of the Track around dt 343 360 \param dt The time about which to advance. 361 362 This function also checks, if the TrackElement has to be changed. 344 363 */ 345 364 void TrackManager::tick(float dt)
Note: See TracChangeset
for help on using the changeset viewer.