Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10385 in orxonox.OLD for trunk/src/util/track/track.cc


Ignore:
Timestamp:
Jan 26, 2007, 6:06:04 PM (17 years ago)
Author:
bknecht
Message:

you're now able to set the track's mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/track/track.cc

    r10368 r10385  
    9191           LoadParam_CYCLE(element, "speed", this, Track, setSpeed)
    9292             .describe("Sets speed of traveling");
     93           LoadParam_CYCLE(element, "mode", this, Track, setMode)
     94             .describe("Sets mode of track behavior");
    9395
    9496     }
     
    132134     this->duration = this->duration/speed;
    133135     
     136}
     137
     138/**
     139 * Sets the mode of the track. 0 means wait at the end. 1 means rerun track
     140 */
     141void Track::setMode(int newMode)
     142{
     143     this->mode = newMode;
    134144}
    135145
     
    197207//     this->jumpTo(this->localTime);
    198208//   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     
    202221//   if (this->localTime > this->currentTrackElem->endTime
    203222//       && this->currentTrackElem->children)
Note: See TracChangeset for help on using the changeset viewer.