Changeset 10385 in orxonox.OLD for trunk/src/util/track/track.cc
- Timestamp:
- Jan 26, 2007, 6:06:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/track/track.cc
r10368 r10385 91 91 LoadParam_CYCLE(element, "speed", this, Track, setSpeed) 92 92 .describe("Sets speed of traveling"); 93 LoadParam_CYCLE(element, "mode", this, Track, setMode) 94 .describe("Sets mode of track behavior"); 93 95 94 96 } … … 132 134 this->duration = this->duration/speed; 133 135 136 } 137 138 /** 139 * Sets the mode of the track. 0 means wait at the end. 1 means rerun track 140 */ 141 void Track::setMode(int newMode) 142 { 143 this->mode = newMode; 134 144 } 135 145 … … 197 207 // this->jumpTo(this->localTime); 198 208 // if (this->localTime <= this->maxTime) 199 this->localTime += dt; 200 if(this->localTime >= this->duration) 201 this->localTime = 0; 209 if(this->mode == 0) 210 { 211 if(this->localTime >= this->duration) 212 this->localTime += dt; 213 } 214 else 215 { 216 this->localTime += dt; 217 if(this->localTime >= this->duration) 218 this->localTime = 0; 219 } 220 202 221 // if (this->localTime > this->currentTrackElem->endTime 203 222 // && this->currentTrackElem->children)
Note: See TracChangeset
for help on using the changeset viewer.