Class OpenXRUtility
OpenXR Utility Class contains helper methods that any script can use.
Inherited Members
Namespace: UnityEngine.XR.OpenXR
Assembly: Unity.XR.OpenXR.dll
Syntax
public static class OpenXRUtility
Properties
IsSessionFocused
Returns if the current session is in the focused state. See XR_SESSION_STATE_FOCUSED. for reference.
Declaration
public static bool IsSessionFocused { get; }
Property Value
Type | Description |
---|---|
bool |
IsUserPresent
Returns the change of user presence, such as when the user has taken off or put on an XR headset. If the system does not support user presence sensing, runtime assumes that the user is always present and IsUserPresent always returns True. If the system supports the sensing of user presence, returns true when detected the presence of a user and returns false when detected the absence of a user. See XR_EXT_user_presence. for reference.
Declaration
public static bool IsUserPresent { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ComputePoseToWorldSpace(Transform, Camera)
Recalculate object position and rotation from tracking-space to world-space, for use cases like teleporting.
Declaration
public static Pose ComputePoseToWorldSpace(Transform t, Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Transform | t | original transform of the object in the scene, typically obtained by gameObject.transform |
Camera | camera | camera the calculation is based on, normally it is the main camera |
Returns
Type | Description |
---|---|
Pose | the recalculated pose Pose in world-space. |