unity3d - ARCore + Unity:在 SessionConfig 上设置 PlaneFindingMode 对平面检测没有影响
问题描述
在我的 AR 应用程序中,我希望一些内容只能放置在墙壁上,而一些内容只能放置在地板上。我试图通过在分配给会话的 ARCoreSessionConfig 对象上设置 PlaneFindingMode 来实现这一点,然后重置会话,但无论我选择什么选项,应用程序仍然会检测水平和垂直表面。
public void SetVertical(bool vertical)
{
if (vertical)
{
config.PlaneFindingMode = DetectedPlaneFindingMode.Vertical;
}
else
{
config.PlaneFindingMode = DetectedPlaneFindingMode.Horizontal;
}
StartCoroutine(ResetSession());
}
private IEnumerator ResetSession()
{
ARCoreSession session = goARCoreDevice.GetComponent<ARCoreSession>();
ARCoreSessionConfig myConfig = session.SessionConfig;
DestroyImmediate(session);
yield return null;
session = goARCoreDevice.AddComponent<ARCoreSession>();
session.SessionConfig = myConfig;
session.enabled = true;
}
我还发现,即使我删除此代码并手动设置 PlaneFindingMode,也会出现相同的结果。即使我将 PlaneFindingMode 设置为禁用,它仍然会在墙壁和地板上找到飞机。
配置肯定分配给会话,所以我不知道在哪里看。我在这里错过了其他东西吗?
解决方案
推荐阅读
- extjs - EXTJS如何访问存储中的全局变量
- terraform - Terraform 升级到 .12 导致元素出现问题
- php - 如何回显不会自动打开的登录模式按钮?
- go - 另一个 golang 提出了关于理解它如何处理的问题
- flutter - 将flutter的CustomScrollView元素提取到一个小部件中
- sql - ?+.+ 在 HiveQL 中的 select 语句中的作用
- mesh - 如何从观察对象顶部的点云生成线框
- java - Selenium 在较小的屏幕分辨率中找不到元素
- python - 如何从python代码中的.txt文件中删除双引号内的多个引号和行?
- javascript - Puppeteer 等待页面和 setTimeout 在 Firebase 云功能中不起作用