Lens Scripting API

    An InteractionPlane defines a zone which triggers near field targeting logic for HandInteractors. An InteractionPlane should be added to any 2D UIs with high button density, such as ContainerFrame menus. Only one InteractionPlane should be added per UI (ContainerFrame adds an InteractionPlane by default).

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    api: Record<string, any>

    Generic object accessible by other instances of ScriptComponent. Use this object to store references to properties and methods that need to be accessible from other ScriptComponents.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    name: string
    sceneObject: SceneObject

    The scene object this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get behindDistance(): number

      Returns the depth (in world units) of the plane's behind zone along the local Z axis of the SceneObject.

      Returns number

    • set behindDistance(distance: number): void

      Sets the depth (in world units) of the plane's behind zone along the local Z axis of the SceneObject.

      Parameters

      • distance: number

      Returns void

    • get directZoneDistance(): number

      Returns the depth (in world units) of the plane's direct interaction zone along the local Z axis of the SceneObject.

      Returns number

    • set directZoneDistance(distance: number): void

      Sets the depth (in world units) of the plane's direct interaction zone along the local Z axis of the SceneObject.

      Parameters

      • distance: number

      Returns void

    • get drawDebug(): boolean

      Returns boolean

      if the interaction zone should be drawn via debug gizmos.

    • set drawDebug(enabled: boolean): void

      Sets if the interaction zone should be drawn via debug gizmos.

      Parameters

      • enabled: boolean

      Returns void

    • get normal(): vec3

      Returns vec3

      a vec3 representing the normal vector of the plane.

    • get planeSize(): vec2

      Returns vec2

      the size (in world units) of the plane's interaction zone along the local X and Y axes of the SceneObject.

    • set planeSize(size: vec2): void

      Sets the size (in world units) of the plane's interaction zone along the local X and Y axes of the SceneObject.

      Parameters

      Returns void

    • get proximityDistance(): number

      Returns the depth (in world units) of the plane's interaction zone along the local Z axis of the SceneObject.

      Returns number

    • set proximityDistance(distance: number): void

      Sets the depth (in world units) of the plane's interaction zone along the local Z axis of the SceneObject.

      Parameters

      • distance: number

      Returns void

    Methods

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

      Parameters

      • type: string

      Returns boolean

    • Project a 3D point in world space onto the InteractionPlane.

      Parameters

      • point: vec3

        a 3D point in world space

      Returns ZoneProjection

      • a ZoneProjection representing the point's projection onto the plane, the distance of the point from the plane (negative if behind the plane), a boolean checking if the point resides within the interaction zone of the plane (defined by size and proximityDistance), and a boolean checking if the point resides within the behind zone of the plane (right behind the plane), or null if the point does not project onto the plane.
    • Returns void

    MMNEPVFCICPMFPCPTTAAATR