CauldronGPU.Pose (CauldronGPU v0.3.3)

Copy Markdown View Source

How an instance's mesh is bent this tick, applied on the graphics card before drawing, shadows and ray tracing.

  • blend_to and blend — vertex animation: each vertex moves blend (0 to 1) of the way to the same vertex of blend_to, a mesh handle with as many vertices (a later keyframe), and the normals with it
  • bones — skinning: a list of 3×4 matrices, each 12 numbers row by row, used by a mesh uploaded with a skin (CauldronGPU.Mesh); a vertex becomes the weighted sum of its bones' matrices applied to it, after any blending

Up to 255 bones. A pose with neither leaves the mesh as uploaded.

{:pose, 7, %CauldronGPU.Pose{blend_to: run_2, blend: 0.4}}

Summary

Types

matrix()

@type matrix() :: [number()]

t()

@type t() :: %CauldronGPU.Pose{
  blend: number(),
  blend_to: CauldronGPU.Handle.t() | nil,
  bones: [matrix()]
}