[name]

This class makes raycasting easier. Raycasting is used for picking and more.

Constructor

[name]( [page:Vector3 origin], [page:Vector3 direction], [page:Float near], [page:Float far] ) {

[page:Vector3 origin] — The origin vector where the ray casts from.
[page:Vector3 direction] — The direction vector that gives direction to the ray.
[page:Float near] — All results returned are further away then near. Near can't be negative. Default value is 0.
[page:Float far] — All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
This creates a new raycaster object.

Properties

.[page:Ray ray]

The Ray used for the raycasting.

.[page:float near]

The near factor of the raycaster. This value indicates which objects can be discarded based on the distance.
This value shouldn't be negative and should be smaller than the far property.

.[page:float far]

The far factor of the raycaster. This value indicates which objects can be discarded based on the distance.
This value shouldn't be negative and should be larger than the near property.

.[page:float precision]

The precision factor of the raycaster.

Methods

.set( [page:Vector3 origin], [page:Vector3 direction] )

[page:Vector3 origin] — The origin vector where the ray casts from.
[page:Vector3 direction] — The direction vector that gives direction to the ray.
Updates the ray with a new origin and direction.

.intersectObject( [page:Object3D object], [page:Boolean recursive] )

[page:Object3D object] — The object to check for intersection with the ray.
[page:Boolean recursive] — If set, it also checks all descendants. Otherwise it only checks intersecton with the object.
checks all intersection between the ray and the object with or without the descendants.

.intersectObjects( [page:Array objects], [page:Boolean recursive] )

[page:Array objects] — The objects to check for intersection with the ray.
[page:Boolean recursive] — If set, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects.
checks all intersection between the ray and the objects with or without the descendants.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]