I have a threejs scene with intersection checking on objects. I'm adding every scene object to the array which is then checked by the raycaster.
var intersects = raycaster.intersectObjects( scene.children );
I then check the color of an object and change it on contact with the mouse pointer.
INTERSECTED.material.emissive.setHex( 0xff0000 );
If I add a helper object, like CameraHelper
or GridHelper
, to the scene I get constant errors because .getHex
.setHex
is not possible with the helper objects.
Is it possible to exclude the helper objects from this check and how would I do this?
It has to be something like scene.children
- scene.helpers but I cannot come up with a way to do this.
Thanks for the help.