简体   繁体   English

空间映射在设备上不起作用

[英]Spatial Mapping not working on device

I added the spatial mapping prefab and spatial understanding prefab to a scene. 我将空间映射预制和空间理解预制添加到场景中。 On top of this scene, I load another scene in the additive mode. 在此场景之上,以加性模式加载另一个场景。 To test this out in unity, i added a room mesh in Unity and everything works fine. 为了统一测试,我在Unity中添加了一个房间网格,一切正常。 However, when I deploy this project to the device, the spatial mapping component is not active at all. 但是,当我将该项目部署到设备上时,空间映射组件根本没有激活。 I am displaying the stats for the meshes observed ( SpatialUnderstanding.Instance.UnderstandingDLL.GetStaticPlayspaceStats() ) and the total scanned area just remains at zero. 我正在显示观察到的网格的统计信息( SpatialUnderstanding.Instance.UnderstandingDLL.GetStaticPlayspaceStats() ),而总扫描区域仅保持为零。

As an additional check, I ticked the Draw Visual Meshes box for the Spatial Mapping Manager and no meshes are being drawn in the scene. 作为一项附加检查,我在“空间贴图管理器”的“绘制可视网格”框中打了勾,并且场景中没有绘制网格。 I have double checked that the spatial perception capability is present in the App manifest. 我已经仔细检查了App清单中是否存在空间感知能力。

Added some logs to confirm that a call to SpatialUnderstandingDll.Imports.GeneratePlayspace_InitScan is being made but not sure what is going wrong after that. 添加了一些日志,以确认正在对SpatialUnderstandingDll.Imports.GeneratePlayspace_InitScan进行调用,但不确定此后出了什么问题。 Any ideas on what could be going wrong? 关于可能出什么问题的任何想法?

Check the debug window, you may have an exception thrown and discarding the initialization of the spatial mapping. 检查调试窗口,可能会引发异常并放弃空间映射的初始化。

I actually had a similar case where it would work in editor and Debug/Release build but Master would fail to get input and mapping. 我实际上有一个类似的案例,它可以在编辑器和Debug / Release构建中工作,但是Master无法获取输入和映射。 Looking at the console, it would show that input gets exited on start with some 0xSomeValue. 查看控制台,它将显示输入从一些0xSomeValue开始退出。 It would not crash the application, simply those functionalities would not run. 它不会使应用程序崩溃,只是那些功能将无法运行。

Issue was the .rsp files in the Assets folder. 问题是Assets文件夹中的.rsp文件。 While updating the Holotoolkit, they would be new ones added with new names. 在更新Holotoolkit时,它们将是新的,并添加了新名称。 mcs, gmcs,...It seems the build process was grabing the wrong one or got confused while seeing many of those. mcs,gmcs等...似乎在构建过程中遇到了许多错误,或者感到困惑。 I removed the older ones and only keep the mcs.rsp and it goes fine for me now. 我删除了较旧的版本,只保留了mcs.rsp,现在对我来说还不错。

Those files only contains the line -unsafe which is used for multithreading processes. 这些文件仅包含-unsafe行,用于多线程进程。 Input and spatial mapping are both requiring that files for the multithread. 输入和空间映射都需要该文件用于多线程。

Maybe, just maybe, you got the same issue. 也许,也许,您遇到了同样的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM