docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XrStationaryReferenceSpaceFeature

    Allows creation, management, and usage of the stationary reference space on supported XR runtimes.

    Inheritance
    object
    Object
    ScriptableObject
    OpenXRFeature
    XrStationaryReferenceSpaceFeature
    Inherited Members
    OpenXRFeature.enabled
    OpenXRFeature.ShouldUseExtension(string)
    OpenXRFeature.GetExtensions()
    OpenXRFeature.xrGetInstanceProcAddr
    OpenXRFeature.HookGetInstanceProcAddr(IntPtr)
    OpenXRFeature.OnSubsystemCreate()
    OpenXRFeature.OnSubsystemStart()
    OpenXRFeature.OnSubsystemStop()
    OpenXRFeature.OnSubsystemDestroy()
    OpenXRFeature.OnExtensionsReady(ulong)
    OpenXRFeature.OnSystemChange(ulong)
    OpenXRFeature.OnSessionCreate(ulong)
    OpenXRFeature.OnAppSpaceChange(ulong)
    OpenXRFeature.OnSessionStateChange(int, int)
    OpenXRFeature.OnSessionBegin(ulong)
    OpenXRFeature.OnSessionEnd(ulong)
    OpenXRFeature.OnSessionExiting(ulong)
    OpenXRFeature.OnSessionDestroy(ulong)
    OpenXRFeature.OnInstanceDestroy(ulong)
    OpenXRFeature.OnSessionLossPending(ulong)
    OpenXRFeature.OnInstanceLossPending(ulong)
    OpenXRFeature.OnFormFactorChange(int)
    OpenXRFeature.OnViewConfigurationTypeChange(int)
    OpenXRFeature.OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)
    OpenXRFeature.OnEnabledChange()
    OpenXRFeature.PathToString(ulong)
    OpenXRFeature.StringToPath(string)
    OpenXRFeature.GetCurrentInteractionProfile(ulong)
    OpenXRFeature.GetCurrentInteractionProfile(string)
    OpenXRFeature.GetCurrentAppSpace()
    OpenXRFeature.GetViewConfigurationTypeForRenderPass(int)
    OpenXRFeature.SetEnvironmentBlendMode(XrEnvironmentBlendMode)
    OpenXRFeature.GetEnvironmentBlendMode()
    OpenXRFeature.GetValidationChecks(List<OpenXRFeature.ValidationRule>, 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.GetAction(InputDevice, InputFeatureUsage)
    OpenXRFeature.GetAction(InputDevice, string)
    OpenXRFeature.RegisterStatsDescriptor(string, OpenXRFeature.StatFlags)
    OpenXRFeature.SetStatAsFloat(ulong, float)
    OpenXRFeature.SetStatAsUInt(ulong, uint)
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetEntityId()
    Object.MemberwiseClone()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectsByType(Type)
    Object.FindObjectsByType(Type, FindObjectsInactive)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsByType<T>()
    Object.FindObjectsByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.Features.Extensions.StationaryReferenceSpace
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public class XrStationaryReferenceSpaceFeature : OpenXRFeature

    Fields

    extensionString

    Name of the OpenXR extension for stationary reference space.

    Declaration
    public const string extensionString = "XR_EXT_stationary_reference_space"
    Field Value
    Type Description
    string

    featureId

    The feature id string for stationary reference space.

    Declaration
    public const string featureId = "com.unity.openxr.feature.extension.stationary_reference_space"
    Field Value
    Type Description
    string

    Methods

    DestroyStationaryReferenceSpace()

    Destroys the stationary reference space, if one is currently valid.

    Declaration
    public void DestroyStationaryReferenceSpace()

    GetStationarySpaceGenerationId(out XrUuid)

    Attempts to get the generation ID of the current stationary reference space. The XR runtime assigns a new generation ID when it can't relocate the previous stationary reference space origin and starts a new one. Recentering doesn't change the generation ID.

    Declaration
    public OpenXRResultStatus GetStationarySpaceGenerationId(out XrUuid generationId)
    Parameters
    Type Name Description
    XrUuid generationId

    The generation ID of the stationary reference space if successful. empty otherwise.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if and only if the generation ID was retrieved successfully.

    statusCode values:

    • UnqualifiedSuccess if the generation ID was retrieved successfully.
    • Unsupported if the runtime does not support querying the generation ID.
    • ProviderUninitialized if the session has not yet started.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.

    InitializeStationaryReferenceSpace()

    Initializes a stationary reference space with the identity pose in space's own coordinate system.

    Declaration
    public OpenXRResultStatus InitializeStationaryReferenceSpace()
    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if and only if the space was created.

    statusCode values:

    • UnqualifiedSuccess if the space was created.
    • ProviderUninitialized if the session has not yet started.
    • Unsupported if the runtime does not offer the stationary reference space.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    If a stationary reference space already exists, it's destroyed first.

    InitializeStationaryReferenceSpace(Pose)

    Initializes a stationary reference space with the specified pose offset in space's own coordinate system.

    Declaration
    public OpenXRResultStatus InitializeStationaryReferenceSpace(Pose poseOffset)
    Parameters
    Type Name Description
    Pose poseOffset

    The pose offset, in the stationary reference space's own coordinate system.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if and only if the space was created.

    statusCode values:

    • UnqualifiedSuccess if the space was created.
    • ProviderUninitialized if the session has not yet started.
    • Unsupported if the runtime does not offer the stationary reference space.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    If a stationary reference space already exists, it's destroyed first.

    IsStationarySpaceValid()

    Checks whether the stationary reference space is currently valid.

    Declaration
    public bool IsStationarySpaceValid()
    Returns
    Type Description
    bool

    True if and only if the stationary reference space is valid, false otherwise.

    LocateAppSpaceInStationarySpace(out Pose, out XrSpaceLocationFlags)

    Locates the current application input tracking space in the stationary reference space.

    Declaration
    public OpenXRResultStatus LocateAppSpaceInStationarySpace(out Pose appSpaceInStationarySpace, out XrSpaceLocationFlags locationFlags)
    Parameters
    Type Name Description
    Pose appSpaceInStationarySpace

    The pose of application space relative to stationary space.

    XrSpaceLocationFlags locationFlags

    Which parts of the pose are valid and tracked. None if the call failed.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if the runtime call succeeded, even when the space isn't located. Check locationFlags before using the pose.

    statusCode values:

    • UnqualifiedSuccess if the runtime call succeeded.
    • ProviderUninitialized if the session has not yet started.
    • ValidationFailure if the stationary reference space hasn't been created, or the other space handle is null.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    While the runtime relocates the stationary reference space, the call can succeed with some location flags cleared. The position or orientation is identity while its valid flag is cleared.

    LocateStationarySpaceInAppSpace(out Pose, out XrSpaceLocationFlags)

    Locates the stationary reference space in the current application input tracking space.

    Declaration
    public OpenXRResultStatus LocateStationarySpaceInAppSpace(out Pose stationarySpaceInAppSpace, out XrSpaceLocationFlags locationFlags)
    Parameters
    Type Name Description
    Pose stationarySpaceInAppSpace

    The pose of stationary space relative to application space.

    XrSpaceLocationFlags locationFlags

    Which parts of the pose are valid and tracked. None if the call failed.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if the runtime call succeeded, even when the space isn't located. Check locationFlags before using the pose.

    statusCode values:

    • UnqualifiedSuccess if the runtime call succeeded.
    • ProviderUninitialized if the session has not yet started.
    • ValidationFailure if the stationary reference space hasn't been created, or the other space handle is null.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    While the runtime relocates the stationary reference space, the call can succeed with some location flags cleared. The position or orientation is identity while its valid flag is cleared.

    LocateStationarySpaceInBaseSpace(ulong, out Pose, out XrSpaceLocationFlags)

    Attempts to locate stationary space relative to the given base space.

    Declaration
    public OpenXRResultStatus LocateStationarySpaceInBaseSpace(ulong baseSpace, out Pose stationarySpaceInBaseSpace, out XrSpaceLocationFlags locationFlags)
    Parameters
    Type Name Description
    ulong baseSpace

    The XrSpace handle to locate stationary space relative to, as a ulong.

    Pose stationarySpaceInBaseSpace

    The pose of stationary space relative to the given base space.

    XrSpaceLocationFlags locationFlags

    Which parts of the pose are valid and tracked. None if the call failed.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if the runtime call succeeded, even when the space isn't located. Check locationFlags before using the pose.

    statusCode values:

    • UnqualifiedSuccess if the runtime call succeeded.
    • ProviderUninitialized if the session has not yet started.
    • ValidationFailure if the stationary reference space hasn't been created, or the other space handle is null.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    While the runtime relocates the stationary reference space, the call can succeed with some location flags cleared. The position or orientation is identity while its valid flag is cleared.

    LocateTargetSpaceInStationarySpace(ulong, out Pose, out XrSpaceLocationFlags)

    Attempts to locate a target space in the stationary reference space.

    Declaration
    public OpenXRResultStatus LocateTargetSpaceInStationarySpace(ulong targetSpace, out Pose targetSpaceInStationarySpace, out XrSpaceLocationFlags locationFlags)
    Parameters
    Type Name Description
    ulong targetSpace

    The XrSpace handle of the space to locate in Stationary Space.

    Pose targetSpaceInStationarySpace

    The pose of the target space relative to stationary space.

    XrSpaceLocationFlags locationFlags

    Which parts of the pose are valid and tracked. None if the call failed.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation. Implicitly converts to true if the runtime call succeeded, even when the space isn't located. Check locationFlags before using the pose.

    statusCode values:

    • UnqualifiedSuccess if the runtime call succeeded.
    • ProviderUninitialized if the session has not yet started.
    • ValidationFailure if the stationary reference space hasn't been created, or the other space handle is null.
    • PlatformError if the runtime call failed. See nativeStatusCode for the runtime's XrResult.
    Remarks

    While the runtime relocates the stationary reference space, the call can succeed with some location flags cleared. The position or orientation is identity while its valid flag is cleared.

    OnInstanceCreate(ulong)

    Called after xrCreateInstance. Override this method to validate that any necessary OpenXR extensions were successfully enabled (OpenXRRuntime.IsExtensionEnabled) and that any required system properties are supported. If this method returns false, the feature's enabled property is set to false.

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

    Handle of the native xrInstance.

    Returns
    Type Description
    bool

    true if this feature successfully initialized. Otherwise, false.

    Overrides
    OpenXRFeature.OnInstanceCreate(ulong)
    Remarks

    If this feature is a required feature of an enabled feature set, returning false here causes the OpenXRLoader to fail, and XR Plug-in Management will fall back to another loader if enabled.

    See Also
    Enabling OpenXR spec extension strings

    OnReferenceSpaceChanged(ulong, Pose?)

    Called when a reference space changes. When the reference space and the app space are changed on the same frame, this is called before UnityEngine.XR.XRInputSubsystem.trackingOriginUpdated.

    Declaration
    protected override void OnReferenceSpaceChanged(ulong referenceSpaceType, Pose? poseInPreviousSpace)
    Parameters
    Type Name Description
    ulong referenceSpaceType

    The reference space type that is changing.

    Pose? poseInPreviousSpace

    Pose in the previous space, if available. Null if not available.

    Overrides
    OpenXRFeature.OnReferenceSpaceChanged(ulong, Pose?)

    Events

    stationarySpaceChanged

    This Action is invoked when the underlying OpenXR runtime sends a space change event for stationary space. This is invoked on the first frame when the associated event's XrTime has passed. When stationary space and the app space are changed on the same frame, stationary space's event will be invoked before UnityEngine.XR.XRInputSubsystem.trackingOriginUpdated.

    Declaration
    public event Action<XrStationaryReferenceSpaceFeature.StationarySpaceChangedEventArgs> stationarySpaceChanged
    Event Type
    Type Description
    Action<XrStationaryReferenceSpaceFeature.StationarySpaceChangedEventArgs>
    In This Article
    Back to top
    Copyright © 2026 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)