Interface Pickable<TResult, TOptions>

Interface for an Entity3D that implements picking.

By default, Entity3D objects implement picking via Three.js raycasting. Custom entities can implement this interface to provide an alternative picking method via pickAt.

This interface uses several generic types:

  • TResult represents the type of results returned via picking with pickAt,
  • TOptions can define additional options for picking directly on this entity or on its features.
interface Pickable<TResult, TOptions> {
    isPickable: true;
    pick: ((canvasCoords: Vector2, options?: TOptions) => TResult[]);
}

Type Parameters

Implemented by

Properties

Properties

isPickable
pick: ((canvasCoords: Vector2, options?: TOptions) => TResult[])

Picks objects from this entity.

Implementations must respect at least limit and filter options.

Type declaration

    • (canvasCoords, options?): TResult[]
    • Parameters

      • canvasCoords: Vector2

        Coordinates on the rendering canvas

      • Optionaloptions: TOptions

        Options

      Returns TResult[]

      Target