Lens Scripting API

    No longer recommended for use in new projects. This class provides visual representation for interactor lines. It allows customization of the line's material, colors, width, length, and visual style. The class integrates with the InteractionManager and WorldCameraFinderProvider to manage interactions and camera positioning.

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    _beginColor: vec3 = ...

    The color at the start (origin) of the interactor line visual.

    _endColor: vec3 = ...

    The color at the end (target) of the interactor line visual.

    _interactor?: default

    Reference to the Interactor component that this line will visualize. The line visual appears only when the referenced interactor is using Indirect targeting mode and is actively targeting.

    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.

    lineStyle: number = 2

    Controls the visual style of the interactor line: 0: Full: Renders a continuous line from start to end. 1: Split: Creates a segmented line with gaps between sections. 2: FadedEnd: Gradually fades out the line toward its end point.

    name: string
    sceneObject: SceneObject

    The scene object this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get beginColor(): vec3

      Gets the color of the visual from the start.

      Returns vec3

    • set beginColor(color: vec3): void

      Sets the color of the visual from the start.

      Parameters

      Returns void

    • get endColor(): vec3

      Gets the color of the visual from the end.

      Returns vec3

    • set endColor(color: vec3): void

      Sets the color of the visual from the end.

      Parameters

      Returns void

    • get isEnabled(): boolean

      Gets whether the visual is active (can be shown if hand is in frame and we're in far field targeting mode).

      Returns boolean

    • set isEnabled(isEnabled: boolean): void

      Sets whether the visual can be shown, so developers can show/hide the ray in certain parts of their lens.

      Parameters

      • isEnabled: boolean

      Returns void

    Methods

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

      Parameters

      • type: string

      Returns boolean

    • Returns void

    • Destroys cursor & line renderer when the custom component is destroyed.

      Returns void

    • Updates the line visual each frame

      Returns void

    MMNEPVFCICPMFPCPTTAAATR