Basically, Ray/Raycaster used to ignore invisible objects for a while, but then there were people that needed those to be checked too. So, instead of overcomplicating the code I opted for letting the user handle that instead.
So if you want Raycaster to not check invisible objects don't add those to the list of objects you're passing.
I already encounter this "issue"...
Is there a reason why we can't have a simple boolean "pickable" set to true by default in Object3D ?
Because right now if you got a huge scene with half of your object invisible your only option is to kept one array with the pickable stuffs and another with the invisible which might not be convenient. (you could also pick everything and take the nearest visible picked object but it would mean unnecessary computation...)
The only drawback (imho) for the "pickable" solution is the overhead a single "if" test in the raycasting....
Another option would be to add a boolean invisibleObjectsPickable argument to Raycaster.intersectObjects( objects, recursive ).
(there must be a better name than that)
Here's a previous discussion on this same subject: https://github.com/mrdoob/three.js/issues/1167
@mrdoob Should I close this or do you have a different fix in mind?
I think closing is fine...
On Thu, Jul 2, 2015 at 6:06 AM, dubejf [email protected] wrote:
@mrdoob https://github.com/mrdoob Should I close this or do you have a
different fix in mind?—
Reply to this email directly or view it on GitHub
https://github.com/mrdoob/three.js/issues/3647#issuecomment-118026298.
Lets continue in #6757.
Actually, #6757 mutated...
Implemented 😅
Most helpful comment
Basically, Ray/Raycaster used to ignore invisible objects for a while, but then there were people that needed those to be checked too. So, instead of overcomplicating the code I opted for letting the user handle that instead.
So if you want Raycaster to not check invisible objects don't add those to the list of objects you're passing.