InteractorLineRenderer is a modified LineRenderer meant for use with Interactors. It uses a special shader material in order to display the line gradients and visuals shown in the spec.

Hierarchy (view full)

Constructors

Properties

_alpha: number = 1
attachedToScene: boolean = false
childViews: default<any>[] = []
container: SceneObject
isDestroyed: boolean = false
material: Material = ...
onEnabled: PublicApi<boolean> = ...
onCreateView: PublicApi<default<any>> = ...
onDestroyView: PublicApi<default<any>> = ...

Accessors

  • get alpha(): number
  • Returns the current alpha of the view

    Returns number

  • set alpha(a): void
  • Parameters

    • a: number

    Returns void

  • get config(): Config
  • Returns Config

  • get endColor(): vec4
  • Gets the color of the line at the end.

    Returns vec4

  • set endColor(color): void
  • Sets the color of the line at the end.

    Parameters

    Returns void

  • get endWidth(): number
  • Gets the width of the line at the end.

    Returns number

  • set endWidth(newWidth): void
  • Sets the width of the line at the end.

    Parameters

    • newWidth: number

    Returns void

  • get localPosition(): vec3
  • Returns vec3

  • set localPosition(position): void
  • Parameters

    Returns void

  • get localRotation(): quat
  • Returns quat

  • set localRotation(rotation): void
  • Parameters

    Returns void

  • get localScale(): number
  • Return the local scale of an object, assuming uniform scaling

    Returns number

  • set localScale(scale): void
  • Parameters

    • scale: number

    Returns void

  • get localScaleVec3(): vec3
  • Returns vec3

  • set localScaleVec3(vec): void
  • Parameters

    Returns void

  • get lookAtCamera(): boolean
  • Returns boolean

  • set lookAtCamera(isEnabled): void
  • Parameters

    • isEnabled: boolean

    Returns void

  • get name(): string
  • Returns string

  • get opacity(): number
  • Returns number

    maximum opacity level of the line

  • set opacity(opacity): void
  • Set the maximum opacity level of the line

    Parameters

    • opacity: number

    Returns void

  • get points(): vec3[]
  • Returns a shallow copy of the array of points that the LineRenderer will draw a line between.

    Returns vec3[]

  • set points(points): void
  • Set the array of points that the LineRenderer will draw a line between.

    Parameters

    Returns void

  • get position(): vec3
  • Deprecated

    use localPosition instead

    Returns vec3

  • set position(position): void
  • Deprecated

    pleasre use localPosition

    Parameters

    Returns void

  • set scale(scale): void
  • Deprecated

    use localScale instead

    Parameters

    • scale: number

    Returns void

  • get startColor(): vec4
  • Gets the color of the line at the start.

    Returns vec4

  • set startColor(color): void
  • Sets the color of the line at the start.

    Parameters

    Returns void

  • get startWidth(): number
  • Gets the width of the line at the start.

    Returns number

  • set startWidth(newWidth): void
  • Sets the width of the line at the start.

    Parameters

    • newWidth: number

    Returns void

  • get visualStyle(): VisualStyle
  • Returns VisualStyle

    visual gradient style of the line

  • set visualStyle(style): void
  • Set the visual gradient style of the line

    Parameters

    Returns void

  • get worldPosition(): vec3
  • Returns vec3

  • set worldPosition(position): void
  • Parameters

    Returns void

  • get worldRotation(): quat
  • Returns quat

  • set worldRotation(rotation): void
  • Parameters

    Returns void

  • get worldScale(): number
  • Returns number

  • set worldScale(scale): void
  • Parameters

    • scale: number

    Returns void

  • get worldScaleVec3(): vec3
  • Returns vec3

  • set worldScaleVec3(scale): void
  • Parameters

    Returns void

Methods

  • Type Parameters

    Parameters

    • child: Child
    • Optionalconfigure: ((c: Child) => void)
        • (c): void
        • Parameters

          Returns void

    • preserveWorldTransform: boolean = false

    Returns Child

  • Destroys and removes the child from this View

    Type Parameters

    Parameters

    • child: Child

      the child to be destroyed

    Returns boolean

    whether the child was destroyed

  • Detaches child from parent and removes the child from this View

    Type Parameters

    Parameters

    • child: Child

      the child to be detached

    Returns boolean

    whether the child was detached

  • Parameters

    • worldPos: vec3

      a point representing something's world position

    Returns vec3

    the point's position relative to this view

  • Parameters

    • defaults: Partial<{
          colorMask: vec4b;
          font: Font;
          fontSize: number;
          textColor: vec4;
      }>
    • parentView: default<Partial<{
          defaults: Partial<{
              colorMask: vec4b;
              font: Font;
              fontSize: number;
              textColor: vec4;
          }>;
          enabled: boolean;
          name: string;
          position: vec3;
          rotation: quat;
          scale: number;
      }>>

    Returns void

  • Deprecated

    use destroyChild or detachChild instead.

    Type Parameters

    Parameters

    Returns void

  • Set the alpha of the View to a, and recursively apply this alpha to all descendents. The alpha will be applied by setting the .a component of baseColor to a.

    Parameters

    • a: number

      The value to set the alpha of the view to, from 0 to 1

    Returns void

  • Parameters

    • enabled: boolean

    Returns void

  • Sets line to a single solid color instead of a gradient

    Parameters

    • color: vec4

      color of the line

    Returns void

  • Updates position of point (in this._points) at the indicated index

    Parameters

    • index: number

      (index in the points[] array) of the vertex to be changed

    • newPos: vec3

      the vertex's new position

    Returns void