[MRTK3] Adding support for unbounded tracking mode #11750
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The
Microsoft.MixedReality.OpenXR.EyeLevelSceneOrigin
component in Microsoft's MR OpenXR plugin will soon be deprecated (so to avoid having mono behaviours within this plugin). Also, Unity doesn't have UI to set the tracking mode toTrackingOriginModeFlags.Unbounded
on theXRInputSubsystem
.So, to replace
Microsoft.MixedReality.OpenXR.EyeLevelSceneOrigin
, anUnboundedTrackingMode
MonoBehaviour has been added to MRTK3. This behavior has been applied to MRTK's XR Rig and will force HL2 into unbounded mode if Unity'sXROrigin.RequestedTrackingOriginMode
is set to "Not Specified". If the platform does not support unbounded mode, the new behavior does nothing.Unbounded mode is preferred on HL2 (the only device currently supporting this mode).
For more information on unbounded mode, see the Microsoft OpenXR extension XR_MSFT_unbounded_reference_space @ https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_unbounded_reference_space.
Additional Note
You may ask "why is this using
XRLoader.GetLoadedSubsystem
and notSubsystemManager.GetInstance
to find the input subsystem?" Well... Holographic App Remoting (HAR) apparently connects later than the physical device. So, on HAR the subsystem manager doesn't have input system handy by the timeUnboundedTrackingMode
is loaded and when it needs to listen for input events.While all on the other hand,
XRLoader
has the input system handy at start.It looks like
XROrigin
worked around this by re-querying for the input system every frame, until it finds one. However, since MR Plugin is already requiringUnityEngine.XR.Management
and this method has been tested and used by the MR Plugin, I'm going to stick withXRLoader
for now. The dependency on UnityEngine.XR.Management is not mandatory for MRTK Input, so this usage shouldn't break other platforms.Changes
Microsoft.MixedReality.OpenXR.EyeLevelSceneOrigin
to MRTK3, as the MR Plugin version will soon be deprecated and Unity doesn't have UI for setting Unbounded Space #11749Verification