Acabo de crear un entorno simple con 2 esferas y haciendo raycast entre ellas. De A a BI hay intersección pero no de B a A, ¿por qué puede suceder esto?
aquí un violín
objs.forEach(obj => { const Object = new THREE.Mesh(new THREE.SphereGeometry(1, 32, 32), new THREE.MeshBasicMaterial({ color: 0xff0000 })); Object.position.set(obj.pos.x, obj.pos.y, obj.pos.z); scene.add(Object); }); objs.forEach(originObj => { // origin const oPos = new THREE.Vector3(originObj.pos.x, originObj.pos.y, originObj.pos.z); objs.forEach(destinyObj => { // destiny if (originObj.id != destinyObj.id) { // only check with the others const dPos = new THREE.Vector3(destinyObj.pos.x, destinyObj.pos.y, destinyObj.pos.z); let dir = new THREE.Vector3(); dir = dir.subVectors(dPos, oPos).normalize(); const raycaster = new THREE.Raycaster(); raycaster.set(oPos, dir); const intersects = raycaster.intersectObject(scene, true); } }); });Gracias por adelantado