Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of code/doc/Clock


Ignore:
Timestamp:
Sep 4, 2008, 9:30:41 AM (16 years ago)
Author:
rgrieder
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/Clock

    v1 v1  
     1= Clock =
     2
     3The clock class serves as an object that distributes time. It is created in RootGameState at the very beginning of start() which denotes the start of the game. [[br]]
     4The capture() method then saves the current time. It can only be called by RootGameState.[[br]]
     5In Order to get the current time, call getMicroseconds() and you will get the time stored by capture(). If you want to receive the current real time, call getRealMicroseconds(). This doesn't store the time however.[[br]]
     6[[br]]
     7The idea is that the Clock object is handed over to every GameState via constant reference in the tick() method.[br]
     8You should not attempt to use the Clock for the game level time. There is another class for that, which gets ticked too. [[br]]
     9[[br]]
     10
     11|| Method || Description ||
     12||||||
     13|| getMicroseconds || Absolute time since start() in us (stored) ||
     14|| getMilliseconds || Absolute time since start() in ms (stored) ||
     15|| getSeconds      || Absolute time since start() in seconds (rounded, stored) ||
     16|| getSecondsPrecise || Absolute time since start() in seconds as floating point number (stored) ||
     17|| getDeltaTime || Relative time between the last two capture() calls in seconds as floating point number (stored) ||
     18|| getDeltaTimeMicroseconds || Relative time between the last two capture() calls in micro seconds (stored) ||
     19|| getRealMicroseconds || Absolute time since start() in us (not stored) ||