Defines API for Interactor type

Hierarchy (view full)

Implements

Constructors

Properties

_dragProvider: DragProvider = ...
_drawDebug: boolean = false
_maxRaycastDistance: number = 500
_planecastDragProvider: DragProvider = ...
_previousStartPoint: vec3 = null
api: Record<string, any>
currentDragVector: vec3 = null

Returns the current vector associated to a dragging movement since the last frame, and null if not dragging

currentInteractable: Interactable = null

Returns the current targeted interactable or null.

currentTrigger: InteractorTriggerType = InteractorTriggerType.None

Returns the current trigger value

enabled: boolean = true

If disabled, the Component will stop enacting its behavior.

indirectDragThreshold: number = 3.0
indirectTargetingVolumeMultiplier: number = 1
inputType: InteractorInputType = InteractorInputType.None

Defines the interactor's input type. This can be used for prioritization or for discerning controller vs hands.

interactionManager: InteractionManager = ...
name: string
onCurrentInteractableChanged: PublicApi<Interactable> = ...

Called whenever the Interactor changes the target Interactable

previousDragVector: vec3 = null

Returns the nullable drag vector, computed in the previous frame

previousInteractable: Interactable = null

Returns the previous targeted interactable or null.

previousTrigger: InteractorTriggerType = InteractorTriggerType.None

Returns the previous trigger value

sceneObject: SceneObject
spherecastDistanceThresholds: number[] = ...
sphereCastEnabled: boolean = false
spherecastRadii: number[] = ...
transform: Transform
uniqueIdentifier: string
updatePriority: number

Accessors

  • get distanceToTarget(): number
  • Deprecated

    in favor of using targetHitInfo Returns the distance to the current target in cm

    Returns number

  • get dragType(): DragType
  • Used to define the type of drag vector that the interactor is invoking. By default, interactor drag vectors will be as SixDof drags.

    Returns DragType

  • get drawDebug(): boolean
  • Returns boolean

    if the Interactor is currently drawing a debug gizmo of collider/raycasts in the scene.

  • set drawDebug(debug): void
  • Set if the Interactor is should draw a debug gizmo of collider/raycasts in the scene.

    Parameters

    • debug: boolean

    Returns void

  • get interactionStrength(): number
  • Returns a normalized value from 0-1, where 0 is the lowest strength and 1 the highest. Returns null if the strength cannot be computed.

    Returns number

  • get maxRaycastDistance(): number
  • Returns the maximum raycast length for world targeting in cm

    Returns number

  • get planecastDragVector(): vec3
  • Returns vec3

    the drag vector projected onto the plane defined by the current Interactable's forward and origin

  • get targetHitPosition(): vec3
  • Deprecated

    in favor of using targetHitInfo Returns the point at which the interactor intersected the current target

    Returns vec3

Methods

  • Returns void

  • Clears the current Interactable, used when an Interactable is deleted at runtime

    Returns void

  • Returns void

  • Projects the direct collider's position onto the plane defined by the Interactable's forward vector / origin

    Parameters

    • interactable: Interactable

      the Interactable used to define the plane of intersection

    Returns vec3

    the direct collider's position projected onto the plane

  • Returns true if the interactor is active

    Returns boolean

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Returns true if the interactor is actively targeting

    Returns boolean

  • Calculates the intersection of the Interactor's indirect raycast and the plane defined by the Interactable's forward vector / origin

    Parameters

    • interactable: Interactable

      the Interactable used to define the plane of intersection

    Returns vec3

    the intersection point of the indirect raycast and plane

  • Returns void

  • Disables or enables the input powering this interactor

    Parameters

    • enabled: boolean

      whether the input powering the interactor should be enabled

    Returns void

  • Returns void

  • Updates the targeting and trigger state of the interactor

    Returns void