Flight Club


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)
           
 
Method Summary
 void addObserver(ClockObserver observer)
           
 int getFrameRate()
          Gets the current frame rate.
 float getTime()
           
 void removeObserver(ClockObserver observer)
           
 void run()
           
 void start()
           
 void stop()
           
 void synchTime(float t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clock

public Clock(float modelTime)
Method Detail

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.


Dan Burton <danb@dircon.co.uk> | latest update: 20 Sep 2002;