flightclub.framework3d
Class Clock
java.lang.Object
|
+--flightclub.framework3d.Clock
- All Implemented Interfaces:
- java.lang.Runnable
- public class Clock
- extends java.lang.Object
- implements java.lang.Runnable
This class implements the clock that manages model time. The clock
runs on its own thread and maintains a list of observers. Each time
round the run loop it calls the tick method of each of its
observers. The frame rate starts out as 25 but it may go up or down
depending on how long it takes to execute all the observer's tick
methods. The clock keeps track of the *model* time.
|
Constructor Summary |
Clock(float modelTime)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Clock
public Clock(float modelTime)
addObserver
public void addObserver(ClockObserver observer)
removeObserver
public void removeObserver(ClockObserver observer)
start
public void start()
stop
public void stop()
run
public void run()
- Specified by:
run in interface java.lang.Runnable
getTime
public final float getTime()
synchTime
public void synchTime(float t)
getFrameRate
public final int getFrameRate()
- Gets the current frame rate.