Overview
This documentation states that MRTK provides already marshalled types for getting the SpatialCoordinateSystem through the WindowsMixedRealityUtilities class. However, this class does not seem to contain those members.
With Windows XRSDK, I obtained the origin SpatialCoordinateSystem like this:
IntPtr WorldOriginPtr =
UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem;
SpatialCoordinateSystem unityWorldOrigin = System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(
WorldOriginPtr) as SpatialCoordinateSystem;
But with the new OpenXR SDK, this is not working anymore. I tried to access the SpatialCoordinateSystem using IWindowsMixedRealityUtilitiesProvider interface:
IntPtr WorldOriginPtrMRTK =
MRTK.WindowsMixedReality.WindowsMixedRealityUtilities.UtilitiesProvider.ISpatialCoordinateSystemPtr;
but this throws an exception.
Expected behavior
The underlying SpatialCoordinateSystem can be accessed like
SpatialCoordinateSystem unityWorldOrigin =
Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityUtilities.SpatialCoordinateSystem
Actual behavior
Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityUtilities does not contain a definition for SpatialCoordinateSystem, and other methods do not work with OpenXR SDK.
Unity editor version
Unity 2020.3.13f1
Mixed Reality Toolkit release version
MRTK 2.7.2
Overview
This documentation states that MRTK provides already marshalled types for getting the
SpatialCoordinateSystemthrough theWindowsMixedRealityUtilitiesclass. However, this class does not seem to contain those members.With Windows XRSDK, I obtained the origin
SpatialCoordinateSystemlike this:But with the new OpenXR SDK, this is not working anymore. I tried to access the
SpatialCoordinateSystemusingIWindowsMixedRealityUtilitiesProviderinterface:but this throws an exception.
Expected behavior
The underlying SpatialCoordinateSystem can be accessed like
Actual behavior
Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityUtilitiesdoes not contain a definition forSpatialCoordinateSystem, and other methods do not work with OpenXR SDK.Unity editor version
Unity 2020.3.13f1
Mixed Reality Toolkit release version
MRTK 2.7.2