API

Function GetTypedArrayData

  • Gets the given data array as a typed array that matches the component type. If the data cannot be used directly, a copy is made to support the new typed array. If the data is number[], byteOffset and byteStride must be a multiple of 4, as data will be treated like a list of floats.

    Parameters

    • data: DataArray

      the input data array

    • size: number

      the number of components

    • type: number

      the component type

    • byteOffset: number

      the byte offset of the data

    • byteStride: number

      the byte stride of the data

    • totalVertices: number

      number of vertices in the buffer to take into account

    • OptionalforceCopy: boolean

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

    Returns VertexDataTypedArray

    a typed array containing vertex data