Skip to main content

Raycasters

A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 Tutorial. 📘 API.

Extends

Implements

Properties

enabled

enabled: boolean = true

Component.enabled

Overrides

Component . enabled


list

list: Map<string, SimpleRaycaster>

A Map that stores raycasters for each world. The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.


onDisposed

onDisposed: Event<unknown>

Disposable.onDisposed

Implementation of

Disposable . onDisposed


uuid

static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace"

A unique identifier for the component. This UUID is used to register the component within the Components system.

Methods

delete()

delete(world): void

Deletes the SimpleRaycaster instance associated with the given world. If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.

Parameters

ParameterTypeDescription
worldWorldThe world for which to delete the SimpleRaycaster instance.

Returns

void


dispose()

dispose(): void

Disposable.dispose

Returns

void

Implementation of

Disposable . dispose


get()

get(world): SimpleRaycaster

Retrieves a SimpleRaycaster instance for the given world. If a SimpleRaycaster instance already exists for the world, it will be returned. Otherwise, a new SimpleRaycaster instance will be created and added to the list.

Parameters

ParameterTypeDescription
worldWorldThe world for which to retrieve or create a SimpleRaycaster instance.

Returns

SimpleRaycaster

The SimpleRaycaster instance for the given world.


isConfigurable()

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns

this is Configurable<any, any>

Inherited from

Component . isConfigurable


isDisposeable()

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

Component . isDisposeable


isHideable()

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

Component . isHideable


isResizeable()

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

Component . isResizeable


isUpdateable()

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

Component . isUpdateable