intersectBoundingSphere方法用于检查射线是否与给定的包围球相交。如果相交,则返回相交点。
intersectBoundingSphere(sphere, target)
sphere
- THREE.Sphere
类型的包围球。target
- 返回的交点。如果未传递,则会创建一个新的THREE.Vector3
。target
,否则返回null
。var raycaster = new THREE.Raycaster();
var sphere = new THREE.Sphere(new THREE.Vector3(0, 0, 0), 1);
var intersectionPoint = new THREE.Vector3();
raycaster.intersectBoundingSphere(sphere, intersectionPoint);
intersectBoundingSphere
方法将射线与包围球进行测试。如果射线与包围球相交,则可以通过该方法获取相交点。