Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRTK3] Adding support for unbounded tracking mode #11750

Merged

Conversation

AMollis
Copy link
Member

@AMollis AMollis commented Jul 28, 2023

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 to TrackingOriginModeFlags.Unbounded on the XRInputSubsystem.

So, to replace Microsoft.MixedReality.OpenXR.EyeLevelSceneOrigin, an UnboundedTrackingMode 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's XROrigin.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 not SubsystemManager.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 time UnboundedTrackingMode 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 requiring UnityEngine.XR.Management and this method has been tested and used by the MR Plugin, I'm going to stick with XRLoader for now. The dependency on UnityEngine.XR.Management is not mandatory for MRTK Input, so this usage shouldn't break other platforms.

Changes

Verification

This optional section is a place where you can detail the specific type of verification
you want from reviewers. For example, if you want reviewers to checkout the PR locally
and validate the functionality of specific scenarios, provide instructions
on the specific scenarios and what you want verified.

If there are specific areas of concern or question feel free to highlight them here so
that reviewers can watch out for those issues.

As a reviewer, it is possible to check out this change locally by using the following
commands (substituting {PR_ID} with the ID of this pull request):

git fetch origin pull/{PR_ID}/head:name_of_local_branch

git checkout name_of_local_branch

@github-actions github-actions bot added the MRTK3 label Jul 28, 2023
@AMollis AMollis changed the title User/amollis/mrtk3/add unbounded component [MRTK3] Adding support for unbounded tracking mode Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants