问题
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