Before Unity 2019.3, one has been able to access the native pointer to the world SpatialCoordinateSystem via UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr().
Switching to Unity 2019 one is able to access the same pointer via UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem using the Windows Mixed Reality XR Plugin.
Can you describe the way of accessing the native SpatialCoordinateSystem using OpenXR?
There are some issues which describe how to access a SpatialCoordinateSystem as a Unity/C# Object (e.g. in the Unity forum or in this repository) with OpenXR, but the solutions do not describe how to get the native pointer (IntPtr) (Allocating a GCHandle from the C# object obviously can not be used as a Windows::Perception::Spatial::ISpatialCoordinateSystem^ in c++).
Is there a way on accessing the native pointer of the origin SpatialCoordinateSystem ?
In c++ we are currently casting the pointer via:
reinterpret_cast<Windows::Perception::Spatial::ISpatialCoordinateSystem ^>(unitySpatialCoordinateSystemIntPtr);
and use it for getting the transform to a specific frame:
unitySpatialCoordinateSystem->TryGetTransformTo(frameCoordinateSystem);
Before Unity 2019.3, one has been able to access the native pointer to the world
SpatialCoordinateSystemviaUnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr().Switching to Unity 2019 one is able to access the same pointer via
UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystemusing theWindows Mixed RealityXR Plugin.Can you describe the way of accessing the native
SpatialCoordinateSystemusing OpenXR?There are some issues which describe how to access a
SpatialCoordinateSystemas a Unity/C# Object (e.g. in the Unity forum or in this repository) with OpenXR, but the solutions do not describe how to get the native pointer (IntPtr) (Allocating aGCHandlefrom the C# object obviously can not be used as aWindows::Perception::Spatial::ISpatialCoordinateSystem^in c++).Is there a way on accessing the native pointer of the origin
SpatialCoordinateSystem?In c++ we are currently casting the pointer via:
reinterpret_cast<Windows::Perception::Spatial::ISpatialCoordinateSystem ^>(unitySpatialCoordinateSystemIntPtr);and use it for getting the transform to a specific frame:
unitySpatialCoordinateSystem->TryGetTransformTo(frameCoordinateSystem);