API

Class OutlineRenderer

This class is responsible to draw the outline/overlay of meshes. It should not be used directly but through the available method on mesh.

Implements

Index
enabled: boolean = true

Gets or sets a boolean indicating if the renderer is enabled

name: string = SceneComponentConstants.NAME_OUTLINERENDERER

The name of the component. Each component must have a unique name.

scene: Scene

The scene the component belongs to.

zOffset: number = 1

Defines a zOffset default Factor to prevent zFighting between the overlay and the mesh.

zOffsetUnits: number = 4

Defines a zOffset default Unit to prevent zFighting between the overlay and the mesh.

  • Returns whether or not the outline renderer is ready for a given submesh. All the dependencies e.g. submeshes, texture, effect... mus be ready

    Parameters

    • subMesh: SubMesh

      Defines the submesh to check readiness for

    • useInstances: boolean

      Defines whether wee are trying to render instances or not

    • OptionalrenderPassId: number

      Render pass id to use to render the mesh

    Returns boolean

    true if ready otherwise false

  • Renders the outline in the canvas.

    Parameters

    • subMesh: SubMesh

      Defines the sumesh to render

    • batch: _InstancesBatch

      Defines the batch of meshes in case of instances

    • useOverlay: boolean = false

      Defines if the rendering is for the overlay or the outline

    • OptionalrenderPassId: number

      Render pass id to use to render the mesh

    Returns void