嘿社区/(皮奥特·亚当)
我的raycaster应该与类"clickable“的元素交互。这很好,但我的鼠标仍然激活每个元素,我如何让我的鼠标知道,它应该只与“可点击”的元素?
这里有一些代码,但我想没有必要:
<a-scene cursor="rayOrigin: mouse">
<a-entity rotation="0 90 0">
<a-camera user-height="0" look-controls>
<a-cursor fuse="true" fusetimeout="2000"
position="0 0 -0.1"
raycaster="objects: .clickable"
geometry="primitive: ring;
radiusInner: 0.002;
radiusOuter: 0.003"
material="color: red; shader: flat">
<a-animation attribute="scale"
to="3 3 3"
dur="2000"
begin="cursor-fusing"
fill="backwards"
easing="linear">
</a-animation>
</a-cursor>
<a-entity id="redcircle" position="0 0 -0.1"
geometry="primitive: ring;
radiusInner: 0.007;
radiusOuter: 0.0077"
material="color: red; opacity: 0.25; shader: flat"></a-entity>
</a-camera>
</a-entity> 发布于 2018-06-11 14:26:53
只需将白名单片段扔到场景中,就可以看到鼠标光标:
<a-scene cursor="rayOrigin: mouse" raycaster="objects: .clickable">小提琴这里.
但是理想情况下,如果您有一些代码,根据您的需要设置一个游标或另一个游标。
https://stackoverflow.com/questions/50795874
复制相似问题