Changeset 10642 in orxonox.OLD for branches/vs-enhencements/src/util/track
- Timestamp:
- Apr 27, 2007, 12:03:26 AM (18 years ago)
- Location:
- branches/vs-enhencements/src/util/track
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/util/track/track.cc
r10641 r10642 29 29 30 30 #include "debug.h" 31 #include "action_box.h" 31 32 32 33 ObjectListDefinition(Track); … … 74 75 this->localTime = 0; 75 76 this->pause = false; 77 78 this->actionBox = NULL; 76 79 } 77 80 … … 97 100 } 98 101 LOAD_PARAM_END_CYCLE(element); 102 103 LoadParam(root, "ActionBox", this, Track, addActionBox ); 99 104 } 100 105 … … 335 340 } 336 341 337 void Track::drawBox() const 338 { 339 glMatrixMode(GL_MODELVIEW); 340 glPushMatrix(); 341 342 glPushAttrib(GL_ENABLE_BIT); 343 344 glDisable(GL_LIGHTING); 345 glDisable(GL_TEXTURE_2D); 346 glDisable(GL_BLEND); 347 glLineWidth(2.0); 348 349 glTranslatef (trackNode->getAbsCoor ().x, 350 trackNode->getAbsCoor ().y, 351 trackNode->getAbsCoor ().z); 352 Vector tmpRot = trackNode->getAbsDir().getSpacialAxis(); 353 glRotatef (trackNode->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 354 355 356 glColor3f(1.0, 1.0, 0.0); 357 glBegin(GL_LINE_STRIP); 358 glVertex3f(0, height, width); 359 glVertex3f(0, -height, width); 360 glVertex3f(0, -height, -width); 361 glVertex3f(0, height, -width); 362 glVertex3f(0, height, width); 363 glEnd(); 364 365 glBegin(GL_LINE_STRIP); 366 glVertex3f(depth, height * stretch, width * stretch); 367 glVertex3f(depth, -height * stretch, width * stretch); 368 glVertex3f(depth, -height * stretch, -width * stretch); 369 glVertex3f(depth, height * stretch, -width * stretch); 370 glVertex3f(depth, height * stretch, width * stretch); 371 glEnd(); 372 373 glBegin(GL_LINE_STRIP); 374 glVertex3f(depth, height * stretch, width * stretch); 375 glVertex3f(0, height, width); 376 glVertex3f(0, -height, width); 377 glVertex3f(depth, -height * stretch, width * stretch); 378 glEnd(); 379 380 glBegin(GL_LINE_STRIP); 381 glVertex3f(depth, height * stretch, -width * stretch); 382 glVertex3f(0, height, -width); 383 glVertex3f(0, -height, -width); 384 glVertex3f(depth, -height * stretch, -width * stretch); 385 glEnd(); 386 387 glPopMatrix(); 388 } 342 /** 343 * creates new action box and assignes it to this track 344 * @param width_2 width/2 of near end 345 * @param height_2 height/2 of near end 346 * @param depth depth 347 * @param stretch far end will be stretched with this factor 348 */ 349 void Track::addActionBox( float width_2, float height_2, float depth, float stretch ) 350 { 351 actionBox = new ActionBox( this, width_2, height_2, depth, stretch ); 352 } 353 354 355 -
branches/vs-enhencements/src/util/track/track.h
r10641 r10642 12 12 class PNode; 13 13 class TiXmlElement; 14 class ActionBox; 14 15 15 16 class Track : public BaseObject … … 37 38 38 39 void drawGraph(float dt = 0.01) const; 39 void drawBox() const;40 40 41 41 //float startingTime; //!< The time at which this Track begins. … … 53 53 private: 54 54 void init(); 55 56 55 57 56 private: 58 57 CurveType curveType; //!< The CurveType the entire TrackSystem will have. … … 61 60 int mode; //!< Defines the behaviour of the Track. 62 61 bool pause; //!< Defines if the track runs (false) or not (true) 62 63 ActionBox* actionBox; 64 65 void addActionBox( float width_2, float height_2, float depth, float stretch ); 66 67 63 68 }; 64 69
Note: See TracChangeset
for help on using the changeset viewer.