docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OpenXRUtility

    OpenXR Utility Class contains helper methods that any script can use.

    Inheritance
    object
    OpenXRUtility
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)