docs.unity3d.com
    Show / Hide Table of Contents

    Class ARSessionFeature

    Enables AR Foundation session support via OpenXR for Meta Quest devices.

    Inheritance
    Object
    OpenXRFeature
    ARSessionFeature
    Inherited Members
    OpenXRFeature.OnSubsystemStart()
    OpenXRFeature.OnSubsystemStop()
    OpenXRFeature.OnSessionBegin(UInt64)
    OpenXRFeature.OnSessionEnd(UInt64)
    OpenXRFeature.OnSessionExiting(UInt64)
    OpenXRFeature.OnSessionLossPending(UInt64)
    OpenXRFeature.OnInstanceLossPending(UInt64)
    OpenXRFeature.OnFormFactorChange(Int32)
    OpenXRFeature.OnViewConfigurationTypeChange(Int32)
    OpenXRFeature.OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)
    OpenXRFeature.OnEnabledChange()
    OpenXRFeature.PathToString(UInt64)
    OpenXRFeature.StringToPath(String)
    OpenXRFeature.GetCurrentInteractionProfile(UInt64)
    OpenXRFeature.GetCurrentInteractionProfile(String)
    OpenXRFeature.GetCurrentAppSpace()
    OpenXRFeature.GetViewConfigurationTypeForRenderPass(Int32)
    OpenXRFeature.SetEnvironmentBlendMode(XrEnvironmentBlendMode)
    OpenXRFeature.GetEnvironmentBlendMode()
    UnityEngine.XR.OpenXR.Features.OpenXRFeature.GetValidationChecks(System.Collections.Generic.List<UnityEngine.XR.OpenXR.Features.OpenXRFeature.ValidationRule>, UnityEditor.BuildTargetGroup)
    OpenXRFeature.CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor>, String)
    OpenXRFeature.StartSubsystem<T>()
    OpenXRFeature.StopSubsystem<T>()
    OpenXRFeature.DestroySubsystem<T>()
    OpenXRFeature.OnEnable()
    OpenXRFeature.OnDisable()
    OpenXRFeature.Awake()
    OpenXRFeature.GetAction(InputAction)
    OpenXRFeature.enabled
    OpenXRFeature.xrGetInstanceProcAddr
    Namespace: UnityEngine.XR.OpenXR.Features.Meta
    Syntax
    public class ARSessionFeature : OpenXRFeature

    Fields

    featureId

    The feature id string. This is used to give the feature a well known id for reference.

    Declaration
    public const string featureId = "com.unity.openxr.feature.arfoundation-meta-session"
    Field Value
    Type Description
    String

    Methods

    HookGetInstanceProcAddr(IntPtr)

    Called to hook xrGetInstanceProcAddr. Returning a different function pointer allows intercepting any OpenXR method.

    Declaration
    protected override IntPtr HookGetInstanceProcAddr(IntPtr func)
    Parameters
    Type Name Description
    IntPtr func

    xrGetInstanceProcAddr native function pointer

    Returns
    Type Description
    IntPtr

    Function pointer that Unity will use to look up OpenXR native functions.

    Overrides
    OpenXRFeature.HookGetInstanceProcAddr(IntPtr)

    OnAppSpaceChange(UInt64)

    Called when the reference xrSpace for the app changes.

    Declaration
    protected override void OnAppSpaceChange(ulong xrSpace)
    Parameters
    Type Name Description
    UInt64 xrSpace

    Handle of the xrSpace

    Overrides
    OpenXRFeature.OnAppSpaceChange(UInt64)

    OnInstanceCreate(UInt64)

    Called after xrCreateInstance.

    Declaration
    protected override bool OnInstanceCreate(ulong xrInstance)
    Parameters
    Type Name Description
    UInt64 xrInstance

    Handle of the xrInstance

    Returns
    Type Description
    Boolean
    Overrides
    OpenXRFeature.OnInstanceCreate(UInt64)

    OnInstanceDestroy(UInt64)

    Called before xrDestroyInstance

    Declaration
    protected override void OnInstanceDestroy(ulong xrInstance)
    Parameters
    Type Name Description
    UInt64 xrInstance

    Handle of the xrInstance

    Overrides
    OpenXRFeature.OnInstanceDestroy(UInt64)

    OnSessionCreate(UInt64)

    Called after xrCreateSession.

    Declaration
    protected override void OnSessionCreate(ulong xrSession)
    Parameters
    Type Name Description
    UInt64 xrSession

    Handle of the xrSession

    Overrides
    OpenXRFeature.OnSessionCreate(UInt64)

    OnSessionDestroy(UInt64)

    Called before xrDestroySession.

    Declaration
    protected override void OnSessionDestroy(ulong xrSession)
    Parameters
    Type Name Description
    UInt64 xrSession

    Handle of the xrSession

    Overrides
    OpenXRFeature.OnSessionDestroy(UInt64)

    OnSessionStateChange(Int32, Int32)

    Called when the OpenXR loader receives the XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED event from the runtime signaling that the XrSessionState has changed.

    Declaration
    protected override void OnSessionStateChange(int oldState, int newState)
    Parameters
    Type Name Description
    Int32 oldState

    Previous state

    Int32 newState

    New state

    Overrides
    OpenXRFeature.OnSessionStateChange(Int32, Int32)

    OnSubsystemCreate()

    Instantiates Meta OpenXR Session subsystem instance, but does not start it. (Start/Stop is typically handled by AR Foundation managers.)

    Declaration
    protected override void OnSubsystemCreate()
    Overrides
    OpenXRFeature.OnSubsystemCreate()

    OnSubsystemDestroy()

    Destroys the session subsystem.

    Declaration
    protected override void OnSubsystemDestroy()
    Overrides
    OpenXRFeature.OnSubsystemDestroy()

    OnSystemChange(UInt64)

    Called after xrGetSystem.

    Declaration
    protected override void OnSystemChange(ulong xrSystem)
    Parameters
    Type Name Description
    UInt64 xrSystem

    Handle of the xrSystemId

    Overrides
    OpenXRFeature.OnSystemChange(UInt64)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023