HTML Encoding and Default Values⤴
<TimeSensor
cycleInterval='1'
cycleTime='0'
elapsedTime='0'
enabled='true'
first='true'
firstCycle='0.0'
fraction_changed='0'
isActive='false'
isPaused='false'
loop='false'
metadata='X3DMetadataObject'
pauseTime='0'
resumeTime='0'
startTime='0'
stopTime='0'
time='0'
></TimeSensor>
Inheritance⤴
- X3DNode(18)
- X3DChildNode(12)
- X3DSensorNode(3)
- TimeSensor
Constructor⤴
-
TimeSensor(ctx)⤴
-
Constructor for TimeSensor
Parameters:
Name Type Argument Default Description ctx
Object <optional>
null context object, containing initial settings like namespace
Fields⤴
These are the X3D / X3DOM fields of this node. Values should usually be received / set as strings via
DOM functions (i.e., using
setAttribute("myFieldName", "myFieldValue")
and
getAttribute("myFieldName")
).
Name | Type | Default Value | Range | Inheritance | Standard | Description |
---|---|---|---|---|---|---|
cycleInterval | SFTime | 1 | [0, inf] | The "cycle" of a TimeSensor node lasts for cycleInterval seconds. The value of cycleInterval shall be greater than zero. | ||
cycleTime | SFTime | 0 | A cycleTime outputOnly field can be used for synchronization purposes such as sound with animation. The value of a cycleTime event will be equal to the time at the beginning of the current cycle. A cycleTime event is generated at the beginning of every cycle, including the cycle starting at startTime. The first cycleTime event for a TimeSensor node can be used as an alarm (single pulse at a specified time). | |||
elapsedTime | SFTime | 0 | The elapsedTime outputOnly field delivers the current elapsed time since the TimeSensor was activated and running, cumulative in seconds and not counting any time while in a paused state. | |||
enabled | SFBool | true | X3DSensorNode | Specifies whether this sensor is enabled. A disabled sensor does not produce any output. | ||
first | SFBool | true | ||||
firstCycle | SFFloat | 0.0 | ||||
fraction_changed | SFFloat | 0 | fraction_changed events output a floating point value in the closed interval [0, 1]. At startTime the value of fraction_changed is 0. After startTime, the value of fraction_changed in any cycle will progress through the range (0.0, 1.0]. | |||
isActive | SFBool | false | Outputs whether the timer is active. | |||
isPaused | SFBool | false | Outputs whether the timer is paused. | |||
loop | SFBool | false | Specifies whether the timer cycle loops. | |||
metadata | SFNode | X3DMetadataObject | X3DNode | Field to add metadata information | ||
pauseTime | SFTime | 0 | Sets a time for the timer to pause. | |||
resumeTime | SFTime | 0 | Sets a time for the timer to resume from pause. | |||
startTime | SFTime | 0 | Sets the startTime for the cycle. | |||
stopTime | SFTime | 0 | Sets a time for the timer to stop. | |||
time | SFTime | 0 | The time event sends the absolute time for a given tick of the TimeSensor node. |