Class BaseTimeSensor

java.lang.Object
All Implemented Interfaces:
VRMLNode, FrameStateListener, VRMLChildNodeType, VRMLNodeType, VRMLSensorNodeType, VRMLTimeControlledNodeType, VRMLTimeDependentNodeType, VRMLTimeListener, VRMLWorldRootChildNodeType
Direct Known Subclasses:
NRTimeSensor, OGLTimeSensor

public class BaseTimeSensor extends BaseTimeControlledNode implements VRMLTimeListener, VRMLSensorNodeType
Common implementation of a TimeSensor node.

The implementation uses the standard VRML time clock to send and retrieve time information. As an efficiency measure, if the time sensor is disabled it will remove itself as a listener to the global clock. When it becomes re-enabled that listener will be added back again.

When setting values we always set the variable first and then set the flag indicating that the field has changed. This is so that we don't end up with a multi-threaded access thinking that a value has changed when it really hasn't (yet) and then ignoring the value. As we desperately try to avoid synchronized access internally, we try to set the real value first so that if someone does check and find it's changed, we can then give them the real value as soon as they ask for it.

Version:
$Revision: 1.41 $
Author:
Justin Couch, Alan Hudson