how to set “objects” property in aframe raycaster component

浪尽此生 提交于 2019-12-25 08:23:18

问题


I want to use raycaster component in <a-cursor> entity to intersect some cubes.
I set the objects property like '#box' (my cube's id), but the cursor still intersects all element.
I step into the raycaster source code, and the data.objects is '' .
So, I wonder if I set the property in a wrong way?


回答1:


There was a bug in A-Frame with dependency components. It's been fixed in the Dev Builds: https://github.com/aframevr/aframe/tree/master/dist#dev-builds and will be released with 0.4.0.

A workaround is to put the raycaster component before the cursor:

<a-entity raycaster="..." cursor="..."></a-entity>


来源:https://stackoverflow.com/questions/40522866/how-to-set-objects-property-in-aframe-raycaster-component

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!