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 full)

Implements

Constructors

Properties

_alpha: number = 1
attachedToScene: boolean = false
childViews: default<any>[] = []
container: SceneObject
isDestroyed: boolean = false
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 baseColor(): vec4
  • Returns vec4

  • set baseColor(color): void
  • Parameters

    Returns void

  • get config(): Config
  • Returns Config

  • 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 name(): string
  • Returns string

  • get position(): vec3
  • Deprecated

    use localPosition instead

    Returns vec3

  • set position(position): void
  • Deprecated

    pleasre use localPosition

    Parameters

    Returns void

  • set renderOrder(order): void
  • Parameters

    • order: number

    Returns void

  • set scale(scale): void
  • Deprecated

    use localScale instead

    Parameters

    • scale: number

    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

  • 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

  • Returns number

  • Parameters

    • worldPos: vec3

      a point representing something's world position

    Returns vec3

    the point's position relative to this view

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

    Returns aabb

  • 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

  • Parameters

    Returns void