I've been struggling with this issue for a few days now, and I finally gave up and decided to reach out for help. My goal is to implement a simple object detection feature, but since the intersectScene method was replaced with intersectObjects (which is not recursive), I'm creating a new array to store all the objects I want to interact with. I've tried using pure mesh and Object3D, but it's not working for either of them. When I pass my array to the intersectObjects function, the returned array is always empty.
Here's some code:
// Translate page coordinates to element coordinates
var offset = $(this.renderer.domElement).offset();
var eltx = pagex - offset.left;
var elty = pagey - offset.top;
// Translate client coordinates into viewport x,y
var vpx = (eltx / this.container.offsetWidth) * 2 - 1;
var vpy = -(elty / this.container.offsetHeight) * 2 + 1;
var vector = new THREE.Vector3(vpx, vpy, 0.5);
this.projector.unprojectVector(vector, this.camera);
var ray = new THREE.Ray(this.camera.position,
vector.subSelf(this.camera.position).normalize());
//console.log(ray);
var intersects = ray.intersectObjects(this.intersectedList);
console.log(intersects.length);
Any suggestions?