Viewer - Interaction
    Preparing search index...

    Class InteractionEngine

    Implements

    Index

    Constructors

    Accessors

    • get closed(): boolean

      The current state of the interaction engine.

      Returns boolean

    • get intersectionOpacity(): number

      Opacity at or below which scene geometry does not occlude interactions when occludeBySceneGeometry is enabled. (Default: 0.01)

      Returns number

    • set intersectionOpacity(value: number): void

      Opacity at or below which scene geometry does not occlude interactions when occludeBySceneGeometry is enabled. (Default: 0.01)

      Parameters

      • value: number

      Returns void

    • get lineIntersectionPercentage(): number

      Returns number

    • set lineIntersectionPercentage(value: number): void

      Parameters

      • value: number

      Returns void

    • get pauseWhileBusy(): boolean

      Pause the interactions while the viewport is busy (busy mode, e.g. a session computes), like pause; they continue when the busy mode ends (unless paused by pause). (Default: false)

      Returns boolean

    • set pauseWhileBusy(value: boolean): void

      Pause the interactions while the viewport is busy (busy mode, e.g. a session computes), like pause; they continue when the busy mode ends (unless paused by pause). (Default: false)

      Parameters

      • value: boolean

      Returns void

    • get pointIntersectionPercentage(): number

      Returns number

    • set pointIntersectionPercentage(value: number): void

      Parameters

      • value: number

      Returns void

    Methods

    • Add a new interaction manager to the selection of interaction managers. This manager will be fed with all onDown, onMove and onEnd events by the InteractionEngine. The token that is return can be used to remove this interaction manager.

      Parameters

      Returns string

    • Register a pointer claim for one viewport. While the pointer is claimed, interaction managers on that viewport do not see the pointerdown (nor the end of that gesture), and see no intersections on pointermove (so nothing behind is hovered).

      claim returns a PointerClaim: true claims the pointer regardless of depth. Drawing tools use this so a handle drawn in screen space wins the pointer over a mesh in front of it. A distance claims the pointer only if no engine of the viewport has a closer candidate (e.g. the drag plane of a rectangle transform loses against an object in front of it); the closest distance claim wins over the others.

      A claim made for an owner engine does not apply to that engine: its own managers keep seeing the pointer, unless the claim loses against a closer candidate or against a claim of another owner.

      Parameters

      Returns () => void

    • Closes the interaction engine and removes all managers that where registered.

      Returns void

    • The distance of the closest hit of the ray with the geometry of the nodes, Infinity if none is hit. A claim can report it as its distance (see addPointerDownClaim).

      Parameters

      • ray: IRay
      • nodes: ITreeNode[]

      Returns number

    • Parameters

      • event: KeyboardEvent
      • pointerInCanvas: boolean

      Returns void

    • Parameters

      • event: KeyboardEvent
      • pointerInCanvas: boolean

      Returns void

    • Pause all interactions of the registered managers (selection, hovering, dragging), e.g. while a computation runs: pointer events are ignored until continue is called. An interaction in progress is cancelled (see IInteractionManager.cancelInteraction: a drag returns its nodes to their placement before the drag, hovered nodes are unhovered, a box selection ends without selecting). The selection is kept. The camera is not affected. See also pauseWhileBusy.

      Returns void

    • Remove an interaction manager with the token returned when adding it.

      Parameters

      • token: string

      Returns boolean