ViewModel for the InteractorCursor that uses a StateMachine to keep track of cursor updates & state changes.

Constructors

  • Parameters

    • enableCursorHolding: boolean
    • enableFilter: boolean
    • Optional_interactor: Interactor

    Returns CursorViewModel

Properties

_cursorPosition: vec3 = null
_interactor?: Interactor
camera: default = ...
currentInteractable: Interactable = null
currentInteractableUnsubscribeCallback: unsubscribe = null
currentManipulation: InteractableManipulation = null
cursorDistance: number = DEFAULT_INITIAL_DISTANCE
distanceCancelSet: CancelSet = ...
enableCursorHolding: boolean
enableFilter: boolean
filter: OneEuroFilterVec3 = ...

Currently using a one-euro filter optimized for reducing slow speed jitter.

handProvider: HandInputData = ...
interactionConfigurationProvider: InteractionConfigurationProvider = ...
interactionManager: InteractionManager = ...
isAnimating: boolean = false
isScrolling: boolean = false
log: default = ...
onCursorUpdate: PublicApi<CursorViewState> = ...
onCursorUpdateEvent: default<CursorViewState> = ...
onStateChange: PublicApi<CursorState> = ...
onStateChangeEvent: default<CursorState> = ...
positionOverride: vec3 = null
scrollView: ScrollView = null
stateMachine: default = ...

Accessors

Methods

  • Parameters

    • distance: number
    • easing:
          | "linear"
          | "ease-in-sine"
          | "ease-out-sine"
          | "ease-in-out-sine"
          | "ease-in-quad"
          | "ease-out-quad"
          | "ease-in-out-quad"
          | "ease-in-cubic"
          | "ease-out-cubic"
          | "ease-in-out-cubic"
          | "ease-in-quart"
          | "ease-out-quart"
          | "ease-in-out-quart"
          | "ease-in-quint"
          | "ease-out-quint"
          | "ease-in-out-quint"
          | "ease-in-expo"
          | "ease-out-expo"
          | "ease-in-out-expo"
          | "ease-in-circ"
          | "ease-out-circ"
          | "ease-in-out-circ"
          | "ease-in-back"
          | "ease-out-back"
          | "ease-in-out-back"
          | "ease-in-elastic"
          | "ease-out-elastic"
          | "ease-in-out-elastic"
          | "ease-in-bounce"
          | "ease-out-bounce"
          | "ease-in-out-bounce"
          | "ease-out-back-cubic"
          | "ease-in-back-cubic"
          | "ease-in-out-back-cubic"
    • duration: number

    Returns void

  • Returns number

  • Returns boolean

  • Returns boolean

  • Calculates the position of the cursor based on the center of the targeting ray.

    Returns vec3

    the position of the cursor, or null if not applicable

  • Returns the held cursor position, where it's stuck to the center of target when currently selecting, or the hit position otherwise.

    Returns vec3

    the position of the held cursor, with the regular far field cursor position or null as a fallback if the target hit position cannot be found.

  • Returns vec3

  • Returns void

  • Returns boolean

    if the cursor should be held to the hit position. During manipulation, since the interactor is assumed to be triggered, we hold the cursor to maintain local offset.

  • Returns boolean

  • When in indirect interaction mode while targeting an Interactable, positions to interaction hit point if snapping. If there is no origin, then hide the cursor instead.

    Parameters

    • interactionStrength: number
    • position: vec3

    Returns void

MMNEPVFCICPMFPCPTTAAATR