Lens Scripting API

    Manages the logic for the dragging behaviour, especially detects when dragging happens, and provides the associated dragVector

    Index

    Constructors

    Accessors

    • get currentDragVector(): vec3

      Returns vec3

      the drag vector of the current frame

    • get isDragging(): boolean

      Returns boolean

      if dragging is happening or not

    • get originPosition(): vec3

      Returns vec3

      origin position for the drag

    Methods

    • Resets the dragging state

      Returns void

    • Detects if the interactor is being dragged and returns dragVector if that happens. Detection algorithm: if the distance between the interaction point and the origin position exceeds the dragging threshold, then dragging is happening.

      Parameters

      • currentPosition: vec3

        position that is used to compute the drag vector

      • enableInstantDrag: boolean

      Returns vec3

      the dragVector as a vec3 if dragging and null otherwise

    MMNEPVFCICPMFPCPTTAAATR