Class OpenXRHelper
Inherited Members
Namespace: VIVE.OpenXR
Assembly: VIVE.OpenXR.dll
Syntax
public static class OpenXRHelper
Fields
XR_INFINITE_DURATION
A special value that may be used to indicate that the timeout never occurs.
Declaration
public static XrDuration XR_INFINITE_DURATION
Field Value
Type | Description |
---|---|
XrDuration |
XR_MIN_COMPOSITION_LAYERS_SUPPORTED
Defines the minimum number of composition layers that a conformant runtime must support.
Declaration
public static uint XR_MIN_COMPOSITION_LAYERS_SUPPORTED
Field Value
Type | Description |
---|---|
uint |
XR_NO_DURATION
For the case of timeout durations, XR_NO_DURATION may be used to indicate that the timeout is immediate.
Declaration
public static XrDuration XR_NO_DURATION
Field Value
Type | Description |
---|---|
XrDuration |
XR_NULL_PATH
The only XrPath value defined to be constant across all instances is the invalid path XR_NULL_PATH. No well-formed path string is associated with XR_NULL_PATH. Unless explicitly permitted, it should not be passed to API calls or used as a structure attribute when a valid XrPath is required.
Declaration
public static ulong XR_NULL_PATH
Field Value
Type | Description |
---|---|
ulong |
XR_NULL_SYSTEM_ID
XrSystemId value 0 indicates an invalid system.
Declaration
public static ulong XR_NULL_SYSTEM_ID
Field Value
Type | Description |
---|---|
ulong |
Methods
GetAnalog(InputAction, out float, out string)
Retrieves the float value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetAnalog(InputAction action, out float value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
float | value | The float value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetAnalog(InputActionReference, out float, out string)
Declaration
public static bool GetAnalog(InputActionReference actionReference, out float value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
float | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetButton(InputAction, out bool, out string)
Retrieves the boolean value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetButton(InputAction action, out bool value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
bool | value | The boolean value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetButton(InputActionReference, out bool, out string)
Declaration
public static bool GetButton(InputActionReference actionReference, out bool value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
bool | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetInputSourceName(xrGetInputSourceLocalizedNameDelegate, XrSession, ref XrInputSourceLocalizedNameGetInfo, out string)
Retrieves the information of an XrPath according to the XrInputSourceLocalizedNameFlags.
Declaration
public static XrResult GetInputSourceName(OpenXRHelper.xrGetInputSourceLocalizedNameDelegate xrGetInputSourceLocalizedName, XrSession session, ref XrInputSourceLocalizedNameGetInfo nameInfo, out string sourceName)
Parameters
Type | Name | Description |
---|---|---|
OpenXRHelper.xrGetInputSourceLocalizedNameDelegate | xrGetInputSourceLocalizedName | The function delegate of xrGetInputSourceLocalizedName. |
XrSession | session | An XrSession of an UnityEngine.XR.OpenXR.Features.OpenXRFeature. |
XrInputSourceLocalizedNameGetInfo | nameInfo | An XrInputSourceLocalizedNameGetInfo structure provides the query info and XrInputSourceLocalizedNameFlags type. |
string | sourceName | Output information. |
Returns
Type | Description |
---|---|
XrResult | XR_SUCCESS for success. |
GetInteger(InputAction, out InputTrackingState, out string)
Retrieves the integer value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetInteger(InputAction action, out InputTrackingState value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
InputTrackingState | value | The integer value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetInteger(InputActionReference, out InputTrackingState, out string)
Declaration
public static bool GetInteger(InputActionReference actionReference, out InputTrackingState value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
InputTrackingState | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetPoseIsTracked(InputActionReference, out bool, out string)
Declaration
public static bool GetPoseIsTracked(InputActionReference actionReference, out bool value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
bool | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetPosePosition(InputActionReference, out Vector3, out string)
Declaration
public static bool GetPosePosition(InputActionReference actionReference, out Vector3 value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
Vector3 | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetPoseRotation(InputActionReference, out Quaternion, out string)
Declaration
public static bool GetPoseRotation(InputActionReference actionReference, out Quaternion value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
Quaternion | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetPoseTrackingState(InputActionReference, out InputTrackingState, out string)
Declaration
public static bool GetPoseTrackingState(InputActionReference actionReference, out InputTrackingState value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
InputTrackingState | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetQuaternion(InputAction, out Quaternion, out string)
Retrieves the Quaternion value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetQuaternion(InputAction action, out Quaternion value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
Quaternion | value | The Quaternion value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetQuaternion(InputActionReference, out Quaternion, out string)
Declaration
public static bool GetQuaternion(InputActionReference actionReference, out Quaternion value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
Quaternion | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetVector2(InputAction, out Vector2, out string)
Retrieves the Vector2 value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetVector2(InputAction action, out Vector2 value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
Vector2 | value | The Vector2 value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetVector2(InputActionReference, out Vector2, out string)
Declaration
public static bool GetVector2(InputActionReference actionReference, out Vector2 value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
Vector2 | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetVector3(InputAction, out Vector3, out string)
Retrieves the Vector3 value of UnityEngine.InputSystem.InputAction.
Declaration
public static bool GetVector3(InputAction action, out Vector3 value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action | The UnityEngine.InputSystem.InputAction input. |
Vector3 | value | The Vector3 value. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |
GetVector3(InputActionReference, out Vector3, out string)
Declaration
public static bool GetVector3(InputActionReference actionReference, out Vector3 value, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
Vector3 | value | |
string | msg |
Returns
Type | Description |
---|---|
bool |
GetXrFunctionDelegate<Type>(xrGetInstanceProcAddrDelegate, XrInstance, string, out Type)
Help call xrGetInstanceProcAddr and convert the result to delegate.
For example, "OpenXRHelper.GetXrFunctionDelegate(GetAddr, xrInstance, "xrGetSystemProperties", out XrGetSystemProperties);"
Declaration
public static bool GetXrFunctionDelegate<Type>(OpenXRHelper.xrGetInstanceProcAddrDelegate XrGetInstanceProcAddr, XrInstance xrInstance, string name, out Type func)
Parameters
Type | Name | Description |
---|---|---|
OpenXRHelper.xrGetInstanceProcAddrDelegate | XrGetInstanceProcAddr | Your xrGetInstanceProcAddr delegate instance. |
XrInstance | xrInstance | Your xrInstance |
string | name | The function name |
Type | func | The output delegate instance. |
Returns
Type | Description |
---|---|
bool | If return false, the outout delegate instance will be default. Should not use it. |
Type Parameters
Name | Description |
---|---|
Type | The function's delegate. |
GetXrSessionState(int)
Transfers an UInt64 value to XrSessionState.
Declaration
public static XrSessionState GetXrSessionState(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value |
Returns
Type | Description |
---|---|
XrSessionState |
IsExtensionSupported(xrEnumerateInstanceExtensionPropertiesDelegate, string)
Use xrEnumerateInstanceExtensionProperties to check if an extension is supported by OpenXR Runtime.
Declaration
public static XrResult IsExtensionSupported(OpenXRHelper.xrEnumerateInstanceExtensionPropertiesDelegate xrEnumerateInstanceExtensionProperties, string extension)
Parameters
Type | Name | Description |
---|---|---|
OpenXRHelper.xrEnumerateInstanceExtensionPropertiesDelegate | xrEnumerateInstanceExtensionProperties | Function pointer of xrEnumerateInstanceExtensionProperties. |
string | extension | An OpenXR extension. |
Returns
Type | Description |
---|---|
XrResult | XR_SUCCESS for supported. |
PerformHaptic(InputActionReference, out string)
Declaration
public static bool PerformHaptic(InputActionReference actionReference, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | |
string | msg |
Returns
Type | Description |
---|---|
bool |
ToOpenXRQuaternion(Quaternion, bool)
Transforms an Unity UnityEngine.Quaternion to an OpenXR XrQuaternionf.
Declaration
public static XrQuaternionf ToOpenXRQuaternion(this Quaternion unityQuat, bool convertFromUntiyToOpenXR = true)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | unityQuat | An Unity UnityEngine.Quaternion. |
bool | convertFromUntiyToOpenXR | True for transforming. |
Returns
Type | Description |
---|---|
XrQuaternionf | XrQuaternionf in OpenXR coordinates. |
ToOpenXRQuaternion(XrQuaternionf, bool)
Transforms an XrQuaternionf in Unity coordinates to OpenXR coordinates.
Declaration
public static XrQuaternionf ToOpenXRQuaternion(this XrQuaternionf unityQuat, bool convertFromUntiyToOpenXR = true)
Parameters
Type | Name | Description |
---|---|---|
XrQuaternionf | unityQuat | XrQuaternionf in Unity coordinates. |
bool | convertFromUntiyToOpenXR | True for transforming. |
Returns
Type | Description |
---|---|
XrQuaternionf | XrQuaternionf in OpenXR coordinates. |
ToOpenXRVector(Vector3, bool)
Transforms an Unity UnityEngine.Vector3 to an OpenXR XrVector3f.
Declaration
public static XrVector3f ToOpenXRVector(this Vector3 unityVec, bool convertFromUntiyToOpenXR = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | unityVec | An Unity UnityEngine.Vector3. |
bool | convertFromUntiyToOpenXR | True for transforming. |
Returns
Type | Description |
---|---|
XrVector3f | XrVector3f in OpenXR coordinates. |
ToOpenXRVector(XrVector3f, bool)
Transforms an XrVector3f in Unity coordinates to OpenXR coordinates.
Declaration
public static XrVector3f ToOpenXRVector(this XrVector3f unityVec, bool convertFromUntiyToOpenXR = true)
Parameters
Type | Name | Description |
---|---|---|
XrVector3f | unityVec | XrVector3f in Unity coordinates. |
bool | convertFromUntiyToOpenXR | True for transforming. |
Returns
Type | Description |
---|---|
XrVector3f | XrVector3f in OpenXR coordinates. |
ToUnityQuaternion(Quaternion)
Transforms an Qauternaion in OpenXR coordinates to Unity coordinates.
Declaration
public static Quaternion ToUnityQuaternion(this Quaternion xrQuat)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | xrQuat | Quaternion in OpenXR coordinates. |
Returns
Type | Description |
---|---|
Quaternion | Quaternion in Unity coordinates. |
ToUnityQuaternion(XrQuaternionf)
Transforms an OpenXR XrQuaternionf to an Unity UnityEngine.Quaternion.
Declaration
public static Quaternion ToUnityQuaternion(this XrQuaternionf xrQuat)
Parameters
Type | Name | Description |
---|---|---|
XrQuaternionf | xrQuat | XrQuaternionf in OpenXR coordinates. |
Returns
Type | Description |
---|---|
Quaternion | Quaternion in Unity coordinates. |
ToUnityVector(Vector3)
Transforms an UnityEngine.Vector3 in OpenXR coordinates to Unity coordinates.
Declaration
public static Vector3 ToUnityVector(this Vector3 xrVec)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | xrVec | Vector3 in OpenXR coordinates. |
Returns
Type | Description |
---|---|
Vector3 | Vector3 in Unity coordinates. |
ToUnityVector(XrVector3f)
Transforms an OpenXR XrVector3f to an Unity UnityEngine.Vector3.
Declaration
public static Vector3 ToUnityVector(this XrVector3f xrVec)
Parameters
Type | Name | Description |
---|---|---|
XrVector3f | xrVec | XrVector3f in OpenXR coordinates. |
Returns
Type | Description |
---|---|
Vector3 | Vector3 in Unity coordinates. |
VALIDATE(InputActionReference, out string)
Validates if the InputActionReference is valid.
Declaration
public static bool VALIDATE(InputActionReference actionReference, out string msg)
Parameters
Type | Name | Description |
---|---|---|
InputActionReference | actionReference | The InputActionReference input. |
string | msg | The result output. |
Returns
Type | Description |
---|---|
bool | True for valid. |