API

Class SubMesh

Defines a subdivision inside a mesh

Implements

Index
  • Creates a new submesh

    Parameters

    • materialIndex: number

      defines the material index to use

    • verticesStart: number

      defines vertex index start

    • verticesCount: number

      defines vertices count

    • indexStart: number

      defines index start

    • indexCount: number

      defines indices count

    • mesh: AbstractMesh

      defines the parent mesh

    • OptionalrenderingMesh: Mesh

      defines an optional rendering mesh

    • createBoundingBox: boolean = true

      defines if bounding box should be created for this submesh

    • addToMesh: boolean = true

      defines a boolean indicating that the submesh must be added to the mesh.subMeshes array (true by default)

    Returns SubMesh

indexCount: number

indices count

indexStart: number

index start

materialIndex: number

the material index to use

verticesCount: number

vertices count

verticesStart: number

vertex index start

  • Release associated resources

    Parameters

    • immediate: boolean = false

      If true, the effect will be disposed immediately (false by default)

    Returns void

  • Returns the submesh material

    Parameters

    • getDefaultMaterial: boolean = true

      Defines whether or not to get the default material if nothing has been defined.

    • OptionalpassId: number

      Optional render pass id to get the material with. If undefined, the engine's current render pass id is used.

    Returns Nullable<Material>

    null or the current material

  • Resets the draw wrappers cache

    Parameters

    • OptionalpassId: number

      If provided, releases only the draw wrapper corresponding to this render pass id

    • immediate: boolean = false

      If true, the draw wrapper will dispose the effect immediately (false by default)

    Returns void

  • Sets associated effect (effect used to render this submesh)

    Parameters

    • effect: Nullable<Effect>

      defines the effect to associate with

    • defines: Nullable<string | MaterialDefines> = null

      defines the set of defines used to compile this effect

    • OptionalmaterialContext: IMaterialContext

      material context associated to the effect

    • resetContext: boolean = true

      true to reset the draw context

    Returns void

  • Add a new submesh to a mesh

    Parameters

    • materialIndex: number

      defines the material index to use

    • verticesStart: number

      defines vertex index start

    • verticesCount: number

      defines vertices count

    • indexStart: number

      defines index start

    • indexCount: number

      defines indices count

    • mesh: AbstractMesh

      defines the parent mesh

    • OptionalrenderingMesh: Mesh

      defines an optional rendering mesh

    • createBoundingBox: boolean = true

      defines if bounding box should be created for this submesh

    Returns SubMesh

    the new submesh

  • Creates a new submesh from indices data

    Parameters

    • materialIndex: number

      the index of the main mesh material

    • startIndex: number

      the index where to start the copy in the mesh indices array

    • indexCount: number

      the number of indices to copy then from the startIndex

    • mesh: AbstractMesh

      the main mesh to create the submesh from

    • OptionalrenderingMesh: Mesh

      the optional rendering mesh

    • createBoundingBox: boolean = true

      defines if bounding box should be created for this submesh

    Returns SubMesh

    a new submesh