OpenXRSensor
- Last UpdatedFeb 19, 2025
- 4 minute read
An OpenXRSensor node can be used only when running an app targeting an OpenXR rendering pipeline. For more information, see Graphics.renderSetupFilePath.
-
This is a singleton node. Only one instance can exist in an application.
-
The templates supporting OpenXR target already contains a definition for the node so user can patch it in their projects or change values at runtime.
-
The OpenXRSensor node contains all the parameters required to handle the OpenXR events and tracking matrices. The parameters relative to OpenXR controllers start with controllerL\ for left controller and controllerR\ for right controller.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Code example
This is a code example for the OpenXRSensor node.
<patch name="openxr" controllerL\pulse="0.1 0.5 1" controllerL\vibrationPulse="0.5" controllerL\vibrationStrength="1" controllerL\vibrationTime="0.1" />
OpenXRSensor fields
These are the fields for OpenXRSensor node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > OpenXRSensor
|
Field |
Type |
Use |
Default |
Description |
|---|---|---|---|---|
|
active |
sbool |
Optional |
true |
|
|
hmd\localMatrix |
smatrix |
Read only |
Constantly updated based on the tracking values with the matrix value of the local space of the player. |
|
|
hmd\model |
sstring |
Read only |
player0_hmd |
Mesh node used to represent the user in multiplayer, automatically assigned. |
|
hmd\worldMatrix |
smatrix |
Read only |
Constantly updated based on the tracking values with the matrix value of the world space. |
|
|
orientation |
svec3 |
Read only |
Constantly updated based on the tracking values with the orientation of the player in radiant yaw, pitch and roll. |
|
|
orthoDistance |
sfloat |
Optional |
0.8 |
The distance from viewer of orthogonal plane for 2D interface. |
|
position |
svec3 |
Read only |
Constantly updated based on the tracking values with the position value of the local space of the player. |
For more information, see Controller Fields.
Controller fields
These are the fields relative to OpenXR Touch controllers start with controllerL\ for left controller and controllerR\ for right controller.
|
Fields |
Type |
Use |
Default |
Description |
|---|---|---|---|---|
|
A |
sbool |
Read only |
Only for controllerR\ It is set to True when the button is pressed and to False when it is released. |
|
|
B |
sbool |
Read only |
Only for controllerR\ It is set to True when the button is pressed and to False when it is released. |
|
|
grip |
sbool |
Read only |
It is set to True when the grip is pressed and to False when it is released. |
|
|
localMatrix |
smatrix |
Read only |
Constantly updated based on the tracking values with the matrix value of the local space of the controller. |
|
|
localOrientation |
svec3 |
Read only |
Constantly updated based on the tracking values with the orientation of the controller in radiant yaw, pitch and roll. |
|
|
localPosition |
svec3 |
Read only |
Constantly updated based on the tracking values with the position value of the local space of the controller. |
|
|
menu |
sbool |
Read only |
Only for controllerL\ It is set to True when the menu button is pressed and to False when it is released. |
|
|
model |
sstring |
Read only |
Depends on configuration |
Models to show where the hands are. The model shown can be configured from cfg_commons.xml under vr.handLeftModel and vr.handRightModel. Available options are hand (anatomic model), oculus (Oculus Touch model), vive (vive controller model), auto (chooses automatically based on rendering pipeline between oculus and vive) and off (no model). |
|
pulse |
svec3 |
Optional |
When set it makes the controller vibrate using the three given values as vibrationTime vibrationPulse. and vibrationStrength. |
|
|
thumbStick |
svec2 |
Read only |
Analogical axis values of the controller thumbstick position in normalized axis (from -1 to 1 on horizontal left to right and vertical bottom to up) |
|
|
thumbStickButton |
sbool |
Read only |
It is set to True when the thumbstick is pressed and to False when it is released. |
|
|
thumbStickState |
senum |
Read only |
It shows simplified thumbstick current position. It can be center, left, right, up and down. |
|
|
trigger |
sbool |
Read only |
It is set to True when the trigger is pressed and to False when it is released. |
|
|
vibrate |
sevent |
Wvent |
When triggered it makes the controller vibrate using the vibrationPulse, vibrationStrength and vibrationTime defined in the corresponding fields. |
|
|
vibrationPulse |
sfloat |
Optional |
0.001 |
Used as a parameter for the vibrate event. |
|
vibrationStrength |
sfloat |
Optional |
0.5 |
Used as a parameter for the vibrate event. It defines the strength of the vibration. |
|
vibrationTime |
sfloat |
Optional |
1 |
Used as a parameter for the vibrate event. It defines the time length in seconds of the vibration. |
|
worldMatrix |
smatrix |
Read only |
Constantly updated based on the tracking values with the matrix value of the world space. |
|
|
worldOrientation |
svec3 |
Read only |
Constantly updated based on the tracking values with the orientation of the world in radiant yaw, pitch and roll. |
|
|
worldPosition |
svec3 |
Read only |
Constantly updated based on the tracking values with the position value of the world of the controller. |
|
|
X |
sbool |
Read only |
Only for controllerL\ It is set to True when the button is pressed and to False when it is released. |
|
|
Y |
sbool |
Read only |
Only for controllerL\ It is set to True when the button is pressed and to False when it is released. |