1、添加XR Simple Interactable组件 为了让场景内的物体能够响应射线的操作,需要在该物体上添加“XR Simple Interactable”组件,并对射线的交互事件编写脚本看,最常用的是“Hover”和“Select”事件。 如果物体没有碰撞体,则需要通过点击“Add Component”,搜索Collider,为物体添加一个合
XR Simple Interactable vs Unity Events 经过上面的设置与指定之后,我们已经有了视觉的效果,但是此时我们已经没有代码告诉表明当按下按钮的时候,应该如何操作。也有看到很多不同的方法,但实质其实都很相似,比如根据按钮的高度/位置来判断是否处于被按下的状态,然后使用 XR Simple Interactable 或者 UnityEvent 来调用方...
这里已经不是用的按钮的属性/功能,这明显我们是把按钮变成了一个 XR Simple Interactable ,其实即使这不是一个按钮,同样的方法也适用(所以我们还不如适用别的物体,比如 Cube,然后和手碰撞发生的时候改变它的位置,这样按钮的互动更加真实) XR Simple Interactable 的 Hover Entered 让我有点疑惑,是只要 Hover Entere...
XRI Starter Kit + Hand Poser XRI Starter KitIs a playground for me to create new VR Interactions such as Alyx style distance grabbing, Alyx inspired Inventory system, VR Ready guns with firing mechanics and recoil, shooting mini-games, extra interactables (i.e. doors, sliding drawers, rotat...
在下图中,带有 XR Grab Interactable 的 GameObject 支持平滑跟踪的抓取、移动、丢弃和投掷。 提示通过 GameObject > XR 菜单添加的可交互对象使用 Box Collider 来检测交互,但其他类型的 Collider 组件(如凸面 Mesh Collider)可以提供更好的命中检测,代价是性能降低。
目前,凝视指针只能通过XR Simple Interactable与场景中的 UI 对象进行交互 (打开新窗口)组件,与Pointer Controller不同,Pointer Controller 可以与 UI 和 3D 对象交互。 XR Gaze Interactor 还具有Spaces Composition Layer组件。有关使用合成图层渲染视图锁定内容的文档,请参阅Unity Gaze Pointer 合成图层示例。
一、XR Interaction Toolkit代码拾取 手动添加到手柄拾取中 首先,我们需要在代码中获取这个被拾取的物体 IXRSelectInteractable(也就是XRGrabInteractable),还需要获取抓着他的交互器 IXRSelectInteractor(可以是DirectInteractor或RayInteractor,详细看上篇)。
With XRI installed, you now have access to its components through the main menu bar, that is, Component | XR. As shown in the following screenshot of the menu, these include XR Rig, XR Controller, XR Interaction Manager, and XR Simple Interactable: There are some pre-made game objects ...
一个是 Interactor,一个是 Interactable。Interactor 是发起交互的对象,Interactable 是可以被交互的对象。以抓取交互为例,抓取的流程就是用手去抓一个物体的过程,那么手就是发起抓取的对象,也就是 Interactor,物体就是可以被抓取的对象,也就是 Interactable。这个 Interactor 和Interactable 的概念会在我们后续的教程中...
The following stations are available in the XRI Examples: Station 1: Locomotion Setup- Overview of the built-in locomotion options and how to configure them. Station 2: Grab Interactables- Basic object manipulation. Station 3: Activate Interactables- Manipulation of objects that can be triggered ...