API

Class VertexAnimationBakerSince

Class to bake vertex animation textures. 5.0

Index
  • Bakes the animation into the texture. This should be called once, when the scene starts, so the VAT is generated and associated to the mesh.

    Parameters

    • ranges: AnimationRange[]

      Defines the ranges in the animation that will be baked.

    Returns Promise<Float32Array<ArrayBufferLike>>

    The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.

  • Parameters

    • ranges: AnimationRange[]

      Defines the ranges in the animation that will be baked.

    • halfFloat: boolean

      If true, the vertex data will be returned as half-float (Uint16Array), otherwise as full float (Float32Array).

    Returns Float32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>

    The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array or Uint16Array.

  • Loads previously baked data in string format.

    Parameters

    • json: string

      The json string as serialized by serializeBakedVertexDataToJSON().

    Returns Float32Array

    The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.

  • Loads previously baked data.

    Parameters

    • data: Record<string, any>

      The object as serialized by serializeBakedVertexDataToObject()

    Returns Float32Array

    The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.

  • Serializes our vertexData to a JSON string, with a nice string for the vertexData. Should be called right after bakeVertexData().

    Parameters

    • vertexData: Float32Array

      The vertex array data.

    Returns string

    This object serialized to a safe string.

  • Serializes our vertexData to an object, with a nice string for the vertexData.

    Parameters

    • vertexData: Float32Array

      The vertex array data.

    Returns Record<string, any>

    This object serialized to a JS dict.

  • Builds a vertex animation texture given the vertexData in an array.

    Parameters

    • vertexData: Float32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike>

      The vertex animation data. You can generate it with bakeVertexData(). You can pass in a Float32Array to return a full precision texture, or a Uint16Array to return a half-float texture. If you pass in a Uint16Array, make sure your device supports half-float textures

    Returns RawTexture

    The vertex animation texture to be used with BakedVertexAnimationManager.