Package org.web3d.vrml.renderer
Class TimeScheduler
java.lang.Object
org.web3d.vrml.renderer.TimeScheduler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a time listener to this clock.double
getTime()
Request the current time from the system clock.long
Request the time in wall-clock coordinates.void
Initialise the behavior to start running.void
Process the event that builds the current time.void
Remove a time listener to this clock.void
Reset 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:
getWallTime
in 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:
resetTimeZero
in 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:
addTimeListener
in 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:
removeTimeListener
in interfaceVRMLClock
- Parameters:
l
- The listener instance to add
-