Raycaster
This class is designed to assist with raycasting. Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.
Properties
ray
The Ray used for the raycasting.
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.
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.
line Precision
The precision factor of the raycaster when intersecting Line objects.
point Threshold
The distance threshold to check a point's intersection.
layers
enable Screen Space Tolerance
Accept some difference when picked point do not locate on the line or points
_ camera
_ view Height
Methods
set
set From Camera
intersect Object
- intersectObject(
object: Object3D,
recursive: boolean,
intersects?: Intersection[],
): Intersection[]Calculating intersection for given object, return this object if the ray intersect with it.
Parameters
- object: Object3D
- recursive: boolean
put children of given object into calculation together.
- intersects: Intersection[]
if given, the result will be store here.
Returns Intersection[]
intersect Objects
- intersectObjects(
objects: Object3D[],
recursive: boolean,
intersects?: Intersection[],
): Intersection[]Calculating intersection for array of objects, return the objects which the ray intersect with.
Parameters
- objects: Object3D[]
- recursive: boolean
put children of objects into calculation together.
- intersects: Intersection[]
if given, the result will be store here.
Returns Intersection[]
raycast Scene
Parameters
- scene: Scene3D
- intersects: Intersection[]
Returns Intersection[]
This class is designed to assist with raycasting. Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.