Class OGLTimeSensor
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLChildNodeType
,VRMLNodeType
,VRMLSensorNodeType
,VRMLTimeControlledNodeType
,VRMLTimeDependentNodeType
,VRMLTimeListener
,VRMLWorldRootChildNodeType
,OGLVRMLNode
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.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.time.BaseTimeSensor
FIELD_CYCLE_INTERVAL, FIELD_CYCLE_TIME, FIELD_ENABLED, FIELD_FRACTION, FIELD_IS_ACTIVE, FIELD_IS_PAUSED, FIELD_TIME, LAST_TIME_SENSOR_INDEX, NUM_FIELDS, vfCycleInterval, vfCycleTime, vfEnabled, vfFraction, vfIsActive, vfIsPaused, vfTime
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTimeControlledNode
FIELD_ELAPSED_TIME, FIELD_LOOP, FIELD_PAUSE_TIME, FIELD_RESUME_TIME, FIELD_START_TIME, FIELD_STOP_TIME, LAST_TIME_INDEX, vfElapsedTime, vfLoop, vfPauseTime, vfResumeTime, vfStartTime, vfStopTime
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTimeDependentNode
vrmlClock
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new time sensor objectOGLTimeSensor
(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.Methods inherited from class org.web3d.vrml.renderer.common.nodes.time.BaseTimeSensor
allEventsComplete, getCycleInterval, getCycleTime, getEnabled, getFieldDeclaration, getFieldIndex, getFieldValue, getFraction, getIsActive, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getTime, sendRoute, setCycleInterval, setEnabled, setLoop, setPauseTime, setResumeTime, setStartTime, setStopTime, setupFinished, setValue, setValue, setVRMLClock, timeClick
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTimeControlledNode
copy, getLoop, getStartTime, getStopTime
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLTimeSensor
public OGLTimeSensor()Construct a new time sensor object -
OGLTimeSensor
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the same type
-
-
Method Details
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-