Lens Scripting API

    A subclass of View that has a RenderMeshVisual Component. You must provide the RenderMesh and Material via the MeshViewConfig. NOTE: that the blendMode is set to 0 on the material by default. This is almost always the right choice, and it's easy to change it to something else if your usecase is different

    Hierarchy (View Summary, Expand)

    Implements

    Index

    Constructors

    Properties

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

    Accessors

    • get alpha(): number

      Returns the current alpha of the view

      Returns number

    • set alpha(a: number): void

      Parameters

      • a: number

      Returns void

    • get baseColor(): vec4

      Returns vec4

    • set baseColor(color: vec4): void

      Parameters

      Returns void

    • get config(): Config

      Returns Config

    • get localPosition(): vec3

      Returns vec3

    • set localPosition(position: vec3): void

      Parameters

      Returns void

    • get localRotation(): quat

      Returns quat

    • set localRotation(rotation: quat): void

      Parameters

      Returns void

    • get localScale(): number

      Return the local scale of an object, assuming uniform scaling

      Returns number

    • set localScale(scale: number): void

      Parameters

      • scale: number

      Returns void

    • get localScaleVec3(): vec3

      Returns vec3

    • set localScaleVec3(vec: vec3): void

      Parameters

      Returns void

    • get name(): string

      Returns string

    • get position(): vec3

      Returns vec3

      use localPosition instead

    • set position(position: vec3): void

      Parameters

      Returns void

      pleasre use localPosition

    • set renderOrder(order: number): void

      Parameters

      • order: number

      Returns void

    • set scale(scale: number): void

      Parameters

      • scale: number

      Returns void

      use localScale instead

    • get worldPosition(): vec3

      Returns vec3

    • set worldPosition(position: vec3): void

      Parameters

      Returns void

    • get worldRotation(): quat

      Returns quat

    • set worldRotation(rotation: quat): void

      Parameters

      Returns void

    • get worldScale(): number

      Returns number

    • set worldScale(scale: number): void

      Parameters

      • scale: number

      Returns void

    • get worldScaleVec3(): vec3

      Returns vec3

    • set worldScaleVec3(scale: vec3): void

      Parameters

      Returns void

    Methods

    • Type Parameters

      Parameters

      • child: Child
      • Optionalconfigure: (c: Child) => void
      • preserveWorldTransform: boolean = false

      Returns Child

    • Adds a new material after cloning it. The cloned material is returned.

      Parameters

      • material: Material

        the material to be added

      Returns Material

      the cloned material

    • Returns void

    • 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

    • Returns an axis aligned bounding box which represents the bounds of a view around which a UI can be created

      Returns aabb

    • Parameters

      • index: number

      Returns Material

    • Returns number

    • Returns a world-space axis aligned bounding box which represents the bounds of a view around which a UI can be created

      Returns aabb

    • Type Parameters

      • Conf
      • Child extends default<
            Conf extends Partial<
                {
                    defaults: Partial;
                    enabled: boolean;
                    name: string;
                    position: vec3;
                    rotation: quat;
                    scale: number;
                },
            >
                ? Conf<Conf>
                : never,
        >

      Parameters

      Returns Child

    • Parameters

      • defaults: Partial
      • parentView: default<
            Partial<
                {
                    defaults: Partial;
                    enabled: boolean;
                    name: string;
                    position: vec3;
                    rotation: quat;
                    scale: number;
                },
            >,
        >

      Returns void

    • 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

    MMNEPVFCICPMFPCPTTAAATR