Changeset 10297 in orxonox.OLD for branches/playability/src/util/track
- Timestamp:
- Jan 20, 2007, 9:27:04 PM (18 years ago)
- Location:
- branches/playability/src/util/track
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/track/track.cc
r10284 r10297 65 65 this->curveType = CURVE_BEZIER; 66 66 // this->startingTime = 0; 67 this->duration = 10;68 this->endTime = 10;67 this->duration = 20; 68 this->endTime = 20; 69 69 this->width = 10; 70 70 this->curve = new BezierCurve(); … … 88 88 LoadParam_CYCLE(element, "addPoint", this, Track, addPoint) 89 89 .describe("Adds a new Point to the currently selected TrackElement"); 90 LoadParam_CYCLE(element, "speed", this, Track, setSpeed) 91 .describe("Sets speed of traveling"); 90 92 91 93 } … … 116 118 if( this->nodeCount == 0) this->trackNode->setAbsCoor(newPoint); 117 119 this->nodeCount++; 118 PRINTF(4)("Point added to curve %d\n"); 120 // PRINTF(0)("Point added to curve\n"); 121 } 122 123 /** 124 * This function sets the speed of the trackNode by altering the duration 125 * of the time the trackNode travels on the whole track. This is bad because 126 * the speed depends on the length of the curve. (by getting the curve's length 127 * this function will make a lot more sense) 128 */ 129 void Track::setSpeed(float speed) 130 { 131 this->duration = this->duration/speed; 132 119 133 } 120 134 … … 211 225 this->trackNode->shiftCoor(tmp - this->trackNode->getAbsCoor()); 212 226 // set direction and roll angle of trackNode 213 //this->trackNode->setAbsDir(quat);227 this->trackNode->setAbsDir(quat); 214 228 } 215 229 } … … 230 244 eventually this will all be packed into a gl-list. 231 245 */ 232 void Track::drawGraph(float dt) const246 /*void Track::drawGraph(float dt) const 233 247 { 234 248 glBegin(GL_LINE_STRIP); … … 240 254 } 241 255 glEnd(); 242 } 256 }*/ -
branches/playability/src/util/track/track.h
r10284 r10297 25 25 void addPoint(float x, float y, float z); 26 26 void addPointV(Vector newPoint); 27 void setSpeed(float speed); 27 28 28 29 //void finalize(); … … 33 34 PNode* getTrackNode(); 34 35 35 void drawGraph(float dt) const;36 // void drawGraph(float dt) const; 36 37 37 38 //float startingTime; //!< The time at which this Track begins.
Note: See TracChangeset
for help on using the changeset viewer.