Abstract method to get intersections between a casted ray and this object. Subclasses such as [page:Mesh], [page:Line], and [page:PointCloud] implement this method in order to participate in raycasting.
[page:Object3D object] — The object to check for intersection with the ray.<br/>
[page:Object3D object] — The object to check for intersection with the ray.<br/>
[page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
[page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
</p>
</div>
</div>
<div>
<div>
checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. An array of intersections is returned...
<code>
<code>
[ { distance, point, face, faceIndex, object }, ... ]
[page:Float distance] – distance between the origin of the ray and the intersection<br/>
[page:Vector3 point] – point of intersection, in world coordinates<br/>
[page:Face3 face] – intersected face<br/>
[page:Integer faceIndex] – index of the intersected face<br/>
[page:Array indices] – indices of vertices comprising the intersected face<br/>
[page:Object3D object] – the intersected object
</p>
<p>
When intersecting a [page:Mesh] with a [page:BufferGeometry], the *faceIndex* will be *undefined*, and *indices* will be set; when intersecting a [page:Mesh] with a [page:Geometry], *indices* will be *undefined*.
</p>
<p>
*Raycaster* delegates to the [page:Object3D.raycast raycast] method of the passed object, when evaluating whether the ray intersects the object or not. This allows [page:Mesh meshes] to respond differently to ray casting than [page:Line lines] and [page:PointCloud pointclouds].
</p>
<p>
*Note* that for meshes, faces must be pointed towards the origin of the [page:.ray ray] in order to be detected; intersections of the ray passing through the back of a face will not be detected. To raycast against both faces of an object, you'll want to set the [page:Mesh.material material]'s [page:Material.side side] property to *THREE.DoubleSide*.
[page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
[page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
</div>
</div>
<div>
<div>
checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first.
Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by [page:.intersectObject].
<code>
[ { distance, point, face, faceIndex, object }, ... ]