EventSensor
- Last UpdatedFeb 19, 2025
- 3 minute read
This topic is part of Input Device nodes.
EventSensor node
Use the EventSensor node to trigger an SEVENT continuously. You can start and stop the event triggering.
Platform support
This node is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-Portable WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Full support |
Full support |
Full support |
Full support |
|
|
|
|
|
|
Code example
This is a code example for the EventSensor node.
<Eventsensor name="anEventSensor" start="autostart"/>
<route from="anEventSensor.run" to="cmd_logSomething.execute" />
<Command name="cmd_logSomething">
<log text="Elapsed: [@anEventSensor.deltaTime] seconds since last recorded log." />
</Command>
Position
The EventSensor node must be inside a context node, such as Context or Global.
EventSensor fields
These are the fields for EventSensor node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > EventSensor
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
active |
sbool |
Optional |
true |
Use to set whether the sensor is active. Note that active state differs from running state. |
|
cycleTime |
sfloat |
Optional |
0 |
Defines the sensor update time. if set to 0, updates every frame. |
|
deltaTime |
sfloat |
Read only |
Internally calculated |
Time in seconds since the last frame executed in running. If timeMul is not set to 1, displays other scale. It is not affected by the cycleTime, it always refer to the previous frame and not to the previous run. |
|
reset |
sevent |
Optional |
Not set |
Resets the sensor setting its timeFromStart to 0. Resetting does not change the running state. |
|
run |
sevent |
Optional |
Not set |
The output event. When the sensor is running, this event is generated at each step. |
|
speed |
sfloat |
Optional |
1 |
Multiplies the deltaTime to produce slower or faster times. |
|
start |
sevent |
Optional |
Not set |
Triggers this event to tell the sensor to start running. The timeFromStart is set to 0. |
|
stop |
sevent |
Optional |
Not set |
Triggers this event to tell the sensor to stop running. The timeFromStart is not set to 0. If the sensor is started again, the timeFromStart is set to 0 from the start command. |
|
timeFromStart |
sfloat |
Read only |
Internally calculated |
The time, in seconds, since the sensor was set in running state with start command. If timeMul is not set to 1, displays other scale. |
|
timeMul |
sfloat |
Read only |
1 |
Defines the sensor time unit measure. If set to 1, the sensor time values are expressed in seconds. If set to framerate, the scheduler time values are expressed in frames. |