Skip to main content

Class: SimpleRaycaster

components.SimpleRaycaster

A simple raycaster that allows to easily get items from the scene using the mouse and touch events.

Hierarchy

  • Component<THREE.Raycaster>

    SimpleRaycaster

Implements

Properties

enabled

enabled: boolean = true

enabled

Overrides

Component.enabled

Defined in

temp/components/core/SimpleRaycaster/index.ts:18


mouse

Readonly mouse: Mouse

The position of the mouse in the screen.

Defined in

temp/components/core/SimpleRaycaster/index.ts:21


name

name: string = "SimpleRaycaster"

name

Overrides

Component.name

Defined in

temp/components/core/SimpleRaycaster/index.ts:15

Methods

castRay

castRay(items?): null | Intersection<Object3D<Event>>

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

NameTypeDescription
itemsMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[]>[]the meshes to query. If not provided, it will query all the meshes stored in meshes.

Returns

null | Intersection<Object3D<Event>>

Implementation of

Raycaster.castRay

Defined in

temp/components/core/SimpleRaycaster/index.ts:46


get

get(): Raycaster

get

Returns

Raycaster

Overrides

Component.get

Defined in

temp/components/core/SimpleRaycaster/index.ts:33


hasUI

hasUI(): this is UI

Whether is component implements any kind of UI.

Returns

this is UI

Inherited from

Component.hasUI

Defined in

temp/components/base-types/component.ts:48


isDisposeable

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

Component.isDisposeable

Defined in

temp/components/base-types/component.ts:28


isHideable

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

Component.isHideable

Defined in

temp/components/base-types/component.ts:43


isResizeable

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

Component.isResizeable

Defined in

temp/components/base-types/component.ts:33


isUpdateable

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

Component.isUpdateable

Defined in

temp/components/base-types/component.ts:38