Closed andyli closed 7 years ago
A demo of the bug and fix:
The original A-Frame hello world: https://aframe.io/examples/showcase/helloworld/ Put up the inspector, try click on the cylinder and the floor behind it will be selected.
The same demo with the fixed inspector: https://aframe-inspector-selection-fix.glitch.me Put up the inspector. The cylinder can be selected by clicking on it.
@andyli sorry for the late merge. Good catch! thanks
raycaster.intersectObjects(objects)
returns intersections sorted by distance, closest first, according to the doc at https://threejs.org/docs/?q=Raycaster#Reference/Core/RaycasterSo, once we find a valid selection target, we should break the loop, because the later ones will be further away from the camera.