I want to know if my raycaster is looking at an OBJ that I've loaded. Due to the way exported from Cinema4D, I believe the OBJ is a THREE.Group with 3 children, instead of a THREE.Object. Can I just change my raycaster line of code to look for this group instead of an object?
raycaster.set(controls.getObject().position, controls.getDirection(), 0, 40)
var intersects = raycaster.intersectObjects(scene.children, true);
if (intersects.length > 0) {
//CURRENTLY INTERSECTING SOMETHING
for (var i = 0; i < onOffCubes.length; i++) {
//if the first thing the raycaster sees is a one of my cubes
if (intersects[0].object == onOffCubes[i]) {
ExperiencesData[i].userClose = true
}
}
}
onOffCubes is an array of 6 OBJs/THREE.js Groups: