Interface IRaycastOptions

interface IRaycastOptions {
    cam?: null | Camera;
    layerMask?: number | Layers;
    lineThreshold?: number;
    maxDistance?: number;
    minDistance?: number;
    precise?: boolean;
    ray?: Ray;
    raycaster?: Raycaster;
    recursive?: boolean;
    results?: Intersection<Object3D<Object3DEventMap>>[];
    screenPoint?: Vector2;
    targets?: Object3D<Object3DEventMap>[];
    testObject?: RaycastTestObjectCallback;
    useAcceleratedRaycast?: boolean;
}

Implemented by

Properties

cam?: null | Camera

The camera to use for the raycaster

layerMask?: number | Layers

raw layer mask, use setLayer to set an individual layer active

lineThreshold?: number
maxDistance?: number

Set the raycaster far distance:
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.

minDistance?: number

Set the raycaster near distance:
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.

precise?: boolean

If true, the raycaster will use a more precise method to test for intersections. This is slower but more accurate.

true
ray?: Ray

Optional ray that can be used for raycasting

raycaster?: Raycaster

Optionally a custom raycaster can be provided. Other properties will then be set on this raycaster

recursive?: boolean

If true, the raycaster will traverse the scene recursively.

true
results?: Intersection<Object3D<Object3DEventMap>>[]

Raycast results array. You can provide an array here to avoid creating a new one (note that if your array already contains items they will be removed)

screenPoint?: Vector2

Point on screen in raycast space / normalized device coordinates (-1 to 1).

targets?: Object3D<Object3DEventMap>[]

Objects to raycast against. If no target array is provided the whole scene will be raycasted

testObject?: RaycastTestObjectCallback

Optional calback function to be called per object before tested for intersections.
This can be used to filter objects.
Return false to ignore the object completely or "continue in children" to skip the object but continue to traverse its children (if you do raycast with recursive enabled)

useAcceleratedRaycast?: boolean

Use MeshBVH for raycasting. This is faster than the default threejs raycaster but uses more memory.

undefined