- Timestamp:
- Jan 26, 2007, 6:06:04 PM (18 years ago)
- Location:
- trunk/src/util/track
- Files:
-
- 2 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) -
trunk/src/util/track/track.h
r10368 r10385 26 26 void addPointV(Vector newPoint); 27 27 void setSpeed(float speed); 28 void setMode(int newMode); 28 29 29 30 //void finalize(); … … 52 53 float localTime; //!< The time that has been passed since the traveling the Track. 53 54 PNode* trackNode; //!< The node that is slave to the Track. This node will be moved while update the Track, and must NOT move itself. 55 int mode; //!< Defines the behaviour of the Track. 54 56 }; 55 57
Note: See TracChangeset
for help on using the changeset viewer.