Lens Scripting API

    Manages interactions between Interactor and Interactable, and decides if events need to be transmitted to Interactable

    Index

    Constructors

    Properties

    dispatchEventArgs: DispatchableEventArgs[] = []

    Relevant only to lenses that use SpectaclesSyncKit when it has SyncInteractionManager in its prefab. Stores the DispatchableEventArgs of a frame to automatically propagate to other connections using SpectaclesSyncKit's SyncInteractionManager.

    getInstance: () => InteractionManager

    Accessors

    • get debugModeEnabled(): boolean

      Returns boolean

    • set debugModeEnabled(enabled: boolean): void

      Parameters

      • enabled: boolean

      Returns void

    Methods

    • Removes an Interactor from the interaction manager's registry, so that it will no longer be considered when determining which interactors are interacting with interactables.

      Parameters

      Returns void

    • Dispatches an event in 3 phases:

      • Trickle-down: the event descends the hierarchy, from the first interactable ancestor of the target to its parent
      • Target: the event is sent to the target
      • Bubble-up: the event ascends the hierarchy, from the target's parent to its first interactable ancestor

      The eventArgs.origin is not included in the propagation path and the dispatch starts at eventArgs.origin child.

      Parameters

      Returns void

    • Relevant only to lenses that use SpectaclesSyncKit when it has SyncInteractionManager in its prefab. Returns the Interactable of the passed ID.

      Parameters

      • id: string

      Returns Interactable

    • Relevant only to lenses that use SpectaclesSyncKit when it has SyncInteractionManager in its prefab. Returns the ID of the passed Interactable if it is synced.

      Parameters

      Returns string

    • Parameters

      • targetingMode: TargetingMode

        the targeting mode that the interactable(s) are configured to

      Returns Interactable[]

      use getInteractablesThatTarget(targetingMode) instead.

    • Returns all interactors that are currently targeting

      Returns Interactor[]

      An array of interactors that are targeting.

    • Adds an Interactable to the interaction manager's registry. This registry helps speed up calculations when raycasting objects in the scene.

      Parameters

      Returns void

    • Adds an Interactor to the interaction manager's registry, so it can be used to determine which {interactors} are interacting with interactables.

      Parameters

      Returns void

    MMNEPVFCICPMFPCPTTAAATR