Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VertexAnimationBaker

Class to bake vertex animation textures.

since

5.0

Hierarchy

  • VertexAnimationBaker

Index

Constructors

constructor

  • Create a new VertexAnimationBaker object which can help baking animations into a texture.

    Parameters

    • scene: Scene

      Defines the scene the VAT belongs to

    • mesh: Mesh

      Defines the mesh the VAT belongs to

    Returns VertexAnimationBaker

Methods

bakeVertexDataSearch playground for bakeVertexData

  • 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>

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

loadBakedVertexDataFromJSONSearch playground for loadBakedVertexDataFromJSON

  • loadBakedVertexDataFromJSON(json: string): Float32Array
  • 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.

loadBakedVertexDataFromObjectSearch playground for loadBakedVertexDataFromObject

  • loadBakedVertexDataFromObject(data: Record<string, any>): 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.

serializeBakedVertexDataToJSONSearch playground for serializeBakedVertexDataToJSON

  • serializeBakedVertexDataToJSON(vertexData: Float32Array): string
  • 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.

serializeBakedVertexDataToObjectSearch playground for serializeBakedVertexDataToObject

  • serializeBakedVertexDataToObject(vertexData: Float32Array): Record<string, any>
  • 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.

textureFromBakedVertexDataSearch playground for textureFromBakedVertexData

  • textureFromBakedVertexData(vertexData: Float32Array): RawTexture
  • Builds a vertex animation texture given the vertexData in an array.

    Parameters

    • vertexData: Float32Array

      The vertex animation data. You can generate it with bakeVertexData().

    Returns RawTexture

    The vertex animation texture to be used with BakedVertexAnimationManager.

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method