Skip to main content

FastModelPicker

A fast model picker that uses color coding to identify fragment models under the mouse cursor. This is much faster than raycasting for simple model identification.

Implements​

Properties​

components​

components: Components

The components instance to which this FastModelPicker belongs.


debugMode​

debugMode: boolean = false

Whether debug mode is enabled. When enabled, shows the color-coded canvas.


enabled​

enabled: boolean = true

Component.enabled


mouse​

readonly mouse: Mouse

The position of the mouse in the screen.


onDisposed​

readonly onDisposed: Event<unknown>

Disposable.onDisposed

Implementation of​

Disposable . onDisposed


world​

world: World

A reference to the world instance to which this FastModelPicker belongs. This is used to access the camera and scene.

Methods​

dispose()​

dispose(): void

Disposable.dispose

Returns​

void

Implementation of​

Disposable . dispose


getModelAt()​

getModelAt(position?): Promise<null | string>

Gets the model ID at the given screen position.

Parameters​

ParameterTypeDescription
position?Vector2Optional screen position. If not provided, uses current mouse position.

Returns​

Promise<null | string>

The model ID at the position, or null if no model is found.


setDebugMode()​

setDebugMode(enabled): void

Enables or disables debug mode. When enabled, shows a canvas with the color-coded render.

Parameters​

ParameterType
enabledboolean

Returns​

void