Package org.web3d.vrml.renderer
Class TimeScheduler
java.lang.Object
org.web3d.vrml.renderer.TimeScheduler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a time listener to this clock.doublegetTime()Request the current time from the system clock.longRequest the time in wall-clock coordinates.voidInitialise the behavior to start running.voidProcess the event that builds the current time.voidRemove a time listener to this clock.voidReset the clock to the current time as time zero.
-
Constructor Details
-
TimeScheduler
public TimeScheduler()Create a new time scheduler behaviour
-
-
Method Details
-
initialize
public void initialize()Initialise the behavior to start running. This will register the first criteria. Don't wake until we have arrived in the activation area of the viewpoint and then run every frame. -
processStimulus
Process the event that builds the current time.- Parameters:
why- The list of conditions why this was woken
-
getTime
-
getWallTime
public long getWallTime()Request the time in wall-clock coordinates. This is standard Unix epoch time.- Specified by:
getWallTimein interfaceVRMLClock- Returns:
- The current wall-clock time
-
resetTimeZero
public void resetTimeZero()Reset the clock to the current time as time zero. This can only be called when the timer is not enabled. The last wall clock time is set to now so that fraction information will be correctly oriented for the next time it is enabled. So, ideally it should be called just before setEnabled to get the right time setups working.- Specified by:
resetTimeZeroin interfaceVRMLClock
-
addTimeListener
Add a time listener to this clock. Only one instance of each listener will be registered and null references are ignored.- Specified by:
addTimeListenerin interfaceVRMLClock- Parameters:
l- The listener instance to add
-
removeTimeListener
Remove a time listener to this clock. If the listener is not known to this implementation, it is silently ignored.- Specified by:
removeTimeListenerin interfaceVRMLClock- Parameters:
l- The listener instance to add
-