Class ScenePickViewportInteraction

A viewport interaction that uses ScenePicking to pick a position in the viewport and signal an event. The interaction will signal the event on first left mouse button press and provide updates as long as the user moves the mouse with the button pressed. The user should unset the interaction manually on mouse up and call 'Destroy' to dispose the interaction if it's used as a one-stop interaction.

Hierarchy (view full)

Constructors

Properties

viewportRenderer: UIViewportRenderer

The viewport this interaction controls.

Accessors

  • get viewportCamera(): ViewportCamera
  • The ViewportCamera the interaction controls.

    Returns ViewportCamera

Methods

  • Starts a temporary picking action in the viewportRenderer. When a pick occured, the onPicked callback is invoked with the picking data with the picking data which may contain a null SceneObject when pick was made on a non pickable object or void. The picking exits if the onPicked callback returns false, or the sceneSelection changed.

    Parameters

    • actionName: string

      The name of the action that requires the picking.

    • viewportRenderer: UIViewportRenderer

      The viewport renderer to pick from.

    • sceneSelection: SceneSelectionState

      The scene selection to observe when another object is selected.

    • onPicked: ((scenePickInfo: ScenePickInformation, event: UIMouseEvent, isMouseUp: boolean) => boolean)

      Invoked when a mouse event occured. Return true to continue opicking, false to exit picking.

    • OptionalonAbort: (() => void)

      Invoked when the picking was aborted, due to a change of the selection.

        • (): void
        • Returns void

    Returns void

Events

onPickViewportPosition: Event<[ScenePickInformation, UIMouseEvent, boolean], void>

The interaction will signal the event on first left mouse button press and provide updates as long as the user moves the mouse with the left mouse button pressed.