Closed qian256 closed 3 years ago
thanks @qian256 ! I will forward to the correct people
@qian256 thanks for raising this issue! The API coverage is a bit piecemeal, driven by scenario requirements, and we haven't had a need to support SpatialAnchor so far since Unity provides the XRAnchor API for this (or ARAnchor if you're using ARFoundation). Could you provide some additional context and details on your scenario for using the native SpatialAnchor APIs directly?
In our scenario, we don't use Unity ARSubsyustem or ARFoundation. The API that we find in Unity is UnityEngine.XR.WSA.WorldAnchor, which behaves weird on HoloLens. e.g. it does not show up in the anchorstore. So we sticked to the UWP SpatialAnchor API. As a result, it does not work in editor.
Hey @qian256! Can you clarify the Unity version and XR package you're using please?
Unity 2019.3.12f1 and legacy XR
The API that we find in Unity is UnityEngine.XR.WSA.WorldAnchor, which behaves weird on HoloLens. e.g. it does not show up in the anchorstore.
This would be very surprising and a definite regression. Were you using the WorldAnchorStore API to save it in the anchor store?
Could I email you for further discussion? Our usecase is probably rare. The WorldAnchor works in almost all cases.
Please reopen the issue if you are still encountering it.
Describe the problem
The DotNetWinRT package is said to support Windows.Spatial.Perception namespace (https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/using-the-windows-namespace-with-unity-apps-for-hololens) but it looks like it does not include SpatialAnchor related APIs. As a result, it is not possible to call SpatialAnchor APIs in Unity editor just hitting "Play".
On the other hand, when I inspect the NuGet DotNetWinRT package, the XML file listed the SpatialAnchor API, which is very weird.
Although this is not directly related to MRTK, but I couldn't find a better place than here to post this request. Thanks!
Describe the solution you'd like
Extend the DotNetWinRT API to include SpatialAnchor
Describe alternatives you've considered
Is there any other workaround that we could do to use SpatialAnchor in editor mode?