World Locking Tools for Unity (四)架构部分

12 篇文章 0 订阅
10 篇文章 2 订阅

架构

在这里插入图片描述
客户端应用可以通过World Locking Manager中进行声明.

World Locking Manager

在一个应用中,WorldLockingManager是唯一的.用户可以在Unity编辑器中设置属性.
除了管理用户选项外,还提供了对三个界面的访问.

IAnchorManager

构建和维护空间定位点网络,将其用作冻结世界引擎的输入,并在每一帧将其送入引擎.

冻结世界引擎依赖于用户周围的空间定位点网络,从中计算理想的世界锁定空间.

目前有许多IAnchorManager的实现,所有这些实现都源自Assets/WorldLocking.Core/Scripts/AnchorManager.cs中的基类AnchorManager。AnchorManager操纵抽象的SpongyAnchor,执行常见anchor图维护操作.例如,AnchorManagerXR类管理构建在XRAnchors上的SpongyAnchor。冰冻世界引擎本身不知道所使用的anchor的类型。

如果用户在环境中移动,AnchorManager根据以下算法生成anchor图:

如果用户离最近的定位点距离超过X米:
	添加新的锚点.
	将所有距离新锚点小于Y米的锚点与该锚点连接一条边.

上面的“X”和“Y”值是AnchorManager中的常量,分别为MinanchordInstance和MaxAnchordInstance。这些可以转换为属性,以WorldLockingContext API表面的复杂性为代价提供更大的灵活性。然而,到目前为止,1米和1.2米的设置令人满意。
上述算法在用户在初始探索期间穿越的空间中增长anchor图,最终进入静态网络。
anchor manager可以跨多个会话持久化anchor图。
AnchorManager具有在会话期间自动保存其anchor图、在启动时加载先前保存的图或按需保存和加载的选项。持久性可用性取决于平台支持。

IFragmentManager

将连接点分组为碎片,以实现重新装配.

IAttachmentPointManager

创建,释放和移动附着点.

IAttachmentPointManager是客户端应用程序访问的最常见的世界锁定工具接口。
但是附着点接口非常小。它为客户端应用程序提供了执行附件点上可用的四个操作的机会。

创建

这里要注意的有趣的事情是作为参数传递给create函数的委托。
这些参数中的一个或两个都可能为null,在这种情况下,创建的附件点将不会收到与该委托对应的任何通知.
这些委托在创建后不能更改。这不应该是一个负担,因为委托本身可能会根据当前状态派生行为。如果连这都不可能,则必须释放附着点
,并创建带有所需新代理的新附着点。

释放

当不再需要连接点时,客户端应用程序应通过发布API通知系统。

移动

与大多数spatial anchors不同,附着点可以在世界上自由移动,并在其新位置自动绑定到最相关的锚点。
附着点移动时,其所有者应通知系统其新位置。这一运动可能来自物理模拟或任何其他动画技术。

传送

令人困惑的是,比起移动,传送与创造更相像。与其认为传送是移动到一个新的位置,不如认为它停止存在,然后在一个(可能的)新位置重新开始创造。
经验法则是,如果对象从旧位置连续移动到新位置,请使用MoveAttachmentPoint。如果它在新位置突然出现,请使用TeleportAttachmentPoint。

IAlignmentManager

指定世界锁定空间与物理空间的对齐方式.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
QHierarchy is an editor extension that adds several often used functions to hierarchy window: - Displaying the icon of a GameObject - Showing / hiding a GameObject - Locking / unlocking a GameObject - Prevent selection of locked GameObject - Displaying tag and layer of a GameObject - Displaying color label for a GameObject - Displaying the icon of MonoBehaviour script attached to a GameObject - GameObject can be showed / hidden only for edit-time, and the visibility state will return during play-time - Displaying the number of children of a GameObject - Displaying the number of vertices and triangles of the GameObject (can display the number including all children) - Change the colors of icons and labels - Displaying custom icon for any layer - Displaying custom icon for any tag - Displaying prefab connection status - Displaying static flags icon of GameObject - Displaying the error icon (MonoBehaviour script missing / Reference property is null / String property is empty / Callback of event is missing) - Displaying icons of all scripts that attached to a GameObject - Showing / hiding wireframe objects - Enable / Disable MeshRenderer - Order of icons can be changed - Displaying the list of GameObjects in the form of a tree - Option to add right indent (useful if you use other plugins that add another icons to the hierarchy window) - Any feature can be disabled - Source Code Included. Website | Documentation | Contacts Compatible with Unity 4.6.0+ / 5.0.1+ / 2017.1+ / 2018.1+
当你在命令行中遇到"zsh: locking failed for /root/.zsh_history: 只读"的错误消息时,它意味着你的操作系统中的Zsh shell无法将当前用户的命令历史记录文件写入到/root/.zsh_history中,因为该文件是只读的。 通常,当你使用Zsh shell时,它会尝试将你在终端中输入的每个命令都记录到一个历史记录文件中,以便你在以后的会话中可以检索和重复执行之前的命令。 然而,/root/.zsh_history是存储命令历史记录的文件,而且它属于根用户(root)。根用户的文件通常是只读的,这意味着普通用户无法更改或写入这些文件。 当你作为普通用户运行Zsh shell时,它会尝试锁定/root/.zsh_history文件,以便其他进程或用户无法同时读取或写入它。但由于文件是只读的,它无法锁定文件,从而导致了"locking failed for /root/.zsh_history: 只读"的错误消息。 为了解决这个问题,你有几个选项: 1. 在Zsh shell中禁用命令历史记录:你可以在Zsh配置文件(通常是~/.zshrc)中注释掉关于命令历史记录的行。这样,Zsh将不再尝试将命令记录到/root/.zsh_history文件中。 2. 更改命令历史记录文件位置:你可以将命令历史记录文件的位置更改为另一个你有写入权限的目录。你可以通过修改Zsh配置文件中的HISTFILE变量来实现。 3. 以根用户身份更改文件权限: 如果你有根用户的权限,你可以更改/root/.zsh_history文件的权限,使其对普通用户可写。 无论你选择哪种解决方案,都应该记住,改变重要的系统文件的权限可能会对系统的安全性和稳定性产生风险,所以请谨慎操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值