I've been working on implementing a raycaster to find intersections, but no matter what I do, it always gives back an empty array.
Here's how I add objects to my objects array:
var obstructionGeom = new THREE.BoxGeometry(6,5,0.5);
var obstructionMaterial = new THREE.MeshBasicMaterial( {color: 0x000000} );
var obstruction1 = new THREE.Mesh(obstructionGeom, obstructionMaterial);
obstruction1.position.set(-10,0,-15);
obstruction1.name = "obstruction";
scene.add(obstruction1);
obstructions.push(obstruction1);
Then, when I call intersectObjects like this:
let raycaster = new THREE.Raycaster();
raycaster.set(new THREE.Vector3(), obstruction1.position);
let intersections = raycaster.intersectObjects(obstructions);
Even though I've aimed the raycaster at the mesh's position, it still returns an empty result. Any idea what could be causing this unexpected behavior?