Class VertexAnimationBaker
Hierarchy
- VertexAnimationBaker
Index
Constructors
constructor
-
Create a new VertexAnimationBaker object which can help baking animations into a texture.
Parameters
Returns VertexAnimationBaker
Methods
bake Vertex DataSearch 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.
-
load Baked Vertex Data FromJSONSearch playground for loadBakedVertexDataFromJSON
-
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.
-
load Baked Vertex Data From ObjectSearch playground for loadBakedVertexDataFromObject
-
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.
-
serialize Baked Vertex Data ToJSONSearch playground for serializeBakedVertexDataToJSON
-
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.
-
serialize Baked Vertex Data ToObjectSearch playground for serializeBakedVertexDataToObject
-
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.
-
texture From Baked Vertex DataSearch playground for textureFromBakedVertexData
-
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.
-
Class to bake vertex animation textures.
5.0