SimpleRaycaster
A simple raycaster that allows to easily get items from the scene using the mouse and touch events.
Implements
Properties
components
components:
Components
The components instance to which this Raycaster belongs.
enabled
enabled:
boolean=true
mouse
readonlymouse:Mouse
The position of the mouse in the screen.
onDisposed
readonlyonDisposed:Event<unknown>
Implementation of
three
readonlythree:Raycaster
A reference to the Three.js Raycaster instance. This is used for raycasting operations.
world
world:
World
A reference to the world instance to which this Raycaster belongs. This is used to access the camera and meshes.
Methods
castRay()
castRay(
data?):Promise<null|Intersection<Object3D<Object3DEventMap>>>
Throws a ray from the camera to the mouse or touch event point and returns the first item found. This also takes into account the clipping planes used by the renderer.
Parameters
| Parameter | Type |
|---|---|
data? | object |
data.items? | Object3D<Object3DEventMap>[] |
data.position? | Vector2 |
data.snappingClasses? | SnappingClass[] |
Returns
Promise<null | Intersection<Object3D<Object3DEventMap>>>
dispose()
dispose():
void
Returns
void