API

Interface VatBakeResult

Result of baking — the GPU texture plus a per-clip row map for choosing playback params.

interface VatBakeResult {
    boneCount: number;
    boneMatrices?: Record<number, Float32Array<ArrayBufferLike>>;
    boneOrigins?: Record<number, Float32Array<ArrayBufferLike>>;
    clips: Record<string, VatClip>;
    frameCount: number;
    texture: GPUTexture;
}
Index
boneCount: number
boneMatrices?: Record<number, Float32Array<ArrayBufferLike>>

Present only when captureBoneMatrices was passed: bone index → that bone's skinning matrix per baked frame, as frameCount * 16 column-major floats (frame row at offset row * 16, matching the texture rows / clips[].fromRow). Each matrix is the exact 16 floats the baked texture holds for that bone on that row, so a consumer can attach rigid geometry to a joint — instance · mesh.world · boneMatrix · p — and stay in lockstep with what the VAT vertex path renders. A requested index outside the skeleton's bone range is absent from the record.

boneOrigins?: Record<number, Float32Array<ArrayBufferLike>>

Present only when captureBoneOrigins was passed: bone index → the bone's posed origin per baked frame, as frameCount * 3 xyz floats (frame row at offset row*3, matching the texture rows / clips[].fromRow). The point is in the mesh's SKIN output space — i.e. the space the VAT vertex path produces before the world uniform — so a consumer gets world space with instance · mesh.world · p. Lets a caller attach geometry to a moving joint (a carried prop, a socketed effect) without a live skeleton.

clips: Record<string, VatClip>

Clip name → row range, for building the per-mesh/per-instance (fromRow,toRow,offset,fps) params.

frameCount: number
texture: GPUTexture