IGetSetVerticesData

Define an interface for all classes that will get and set the data on vertices

Hierarchy

  • IGetSetVerticesData

Implemented by

Index

Methods

getIndices

Find examples in Playground
  • Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.

    Parameters

    • Optional copyWhenShared: boolean

      If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.

    • Optional forceCopy: boolean

      defines a boolean indicating that the returned array must be cloned upon returning it

    Returns Nullable<IndicesArray>

    the indices array or an empty array if the mesh has no geometry

getVerticesData

Find examples in Playground
  • getVerticesData(kind: string, copyWhenShared?: boolean, forceCopy?: boolean): Nullable<FloatArray>
  • Gets a specific vertex data attached to this geometry. Float data is constructed if the vertex buffer data cannot be returned directly.

    Parameters

    • kind: string

      defines the data kind (Position, normal, etc...)

    • Optional copyWhenShared: boolean

      defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes

    • Optional forceCopy: boolean

      defines a boolean indicating that the returned array must be cloned upon returning it

    Returns Nullable<FloatArray>

    a float array containing vertex data

isVerticesDataPresent

Find examples in Playground
  • isVerticesDataPresent(kind: string): boolean
  • Gets a boolean indicating if specific vertex data is present

    Parameters

    • kind: string

      defines the vertex data kind to use

    Returns boolean

    true is data kind is present

setIndices

Find examples in Playground
  • Creates a new index buffer

    Parameters

    • indices: IndicesArray

      defines the indices to store in the index buffer

    • totalVertices: Nullable<number>

      defines the total number of vertices (could be null)

    • Optional updatable: boolean

      defines if the index buffer must be flagged as updatable (false by default)

    Returns void

setVerticesData

Find examples in Playground
  • setVerticesData(kind: string, data: FloatArray, updatable: boolean): void
  • Set specific vertex data

    Parameters

    • kind: string

      defines the data kind (Position, normal, etc...)

    • data: FloatArray

      defines the vertex data to use

    • updatable: boolean

      defines if the vertex must be flagged as updatable (false as default)

    Returns void

updateVerticesData

Find examples in Playground
  • updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): void
  • Update a specific associated vertex buffer

    Parameters

    • kind: string

      defines which buffer to write to (positions, indices, normals, etc). Possible kind values :

      • BABYLON.VertexBuffer.PositionKind
      • BABYLON.VertexBuffer.UVKind
      • BABYLON.VertexBuffer.UV2Kind
      • BABYLON.VertexBuffer.UV3Kind
      • BABYLON.VertexBuffer.UV4Kind
      • BABYLON.VertexBuffer.UV5Kind
      • BABYLON.VertexBuffer.UV6Kind
      • BABYLON.VertexBuffer.ColorKind
      • BABYLON.VertexBuffer.MatricesIndicesKind
      • BABYLON.VertexBuffer.MatricesIndicesExtraKind
      • BABYLON.VertexBuffer.MatricesWeightsKind
      • BABYLON.VertexBuffer.MatricesWeightsExtraKind
    • data: FloatArray

      defines the data source

    • Optional updateExtends: boolean

      defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind

    • Optional makeItUnique: boolean

      defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)

    Returns void

Generated using TypeDoc