【问题标题】:Ghost raycaster still sending events after removal?Ghost raycaster 移除后仍然发送事件?
【发布时间】:2017-02-27 07:18:06
【问题描述】:

在下面的场景中,我试图理解为什么在单击球体切换相机和光标 (via.removeAttribute/.setAttribute) 后似乎仍然换回even if I click outside the sphere--即使场景检查器显示没有光标或 firstCursorEl 上的 raycaster 以引发重影点击事件。测试场景在http://codepen.io/anon/pen/GWJrXe,如果我遗漏了重要的东西,请告诉我! (jhsu 提到如果在初始化时调用了 .removeAttribute('cursor'),则需要绑定 render-target-loaded 以等待加载的画布元素,但我假设这不需要在单击时发生。)这里是检查员给出的实体 HTML 在交换后的样子(如果有帮助的话):

<a-entity print-onenter="" id="firstCursorEl" mixin="avatarCursor"></a-entity>
<a-entity print-onenter="" mixin="avatarCursor" id="secondCursorEl" raycaster="" cursor=""></a-entity>

其中 firstCursorEl 是起始相机的子代, secondCursorEl 是我们交换到的相机的子代。由于 secondCursorEl 的光标/光线投射器的目标远离交换按钮球体(除非它们与相机注视的方向不同步?),并且 firstCursorEl 似乎没有这样的组件,它如何仍然交换回来?

【问题讨论】:

    标签: aframe


    【解决方案1】:

    Don McCurdy 修复了此问题:https://github.com/aframevr/aframe/pull/2397 以实现光标删除处理程序。

    您可以使用此构建:&lt;script src="https://rawgit.com/aframevr/aframe/84c6431/dist/aframe-master.min.js"&gt;&lt;/script&gt; 将其拉入,直到 0.5.1 或 0.6.0 发布。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-18
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多