/** A clip to bake: its name and length in seconds. */ export interface BoneTextureClipInput { name: string; duration: number; } /** One baked clip's rows in a {@link BoneTextureLayout}. */ export interface BoneTextureClip { name: string; /** First texture row of the clip. */ startFrame: number; /** Rows baked for the clip, first and last pose included. */ frameCount: number; duration: number; } /** * Where every bone matrix of every baked frame lives in a vertex-animation texture: one row per * frame, four RGBA texels (matrix columns) per bone. Plain data, so a baked crowd can be cached, * shipped or checked in a test without a renderer. */ export interface BoneTextureLayout { boneCount: number; fps: number; width: number; height: number; clips: BoneTextureClip[]; } /** Inputs for {@link planBoneTexture}. */ export interface BoneTextureInput { boneCount: number; clips: readonly BoneTextureClipInput[]; /** Baked samples per second. Default 30. */ fps?: number; /** Largest texture side the target GPU accepts. Default 4096. */ maxTextureSize?: number; } /** * Plans a bone-matrix texture for a rig's clips. Throws when the rig or the clip set does not fit * `maxTextureSize`; lower `fps` or bake fewer clips. * * @capability animation bake many clips of a rig into one bone-matrix texture for instanced crowds */ export declare function planBoneTexture(input: BoneTextureInput): BoneTextureLayout; /** Two texture rows around a playback time and the blend between them. */ export interface BoneTextureSample { rowA: number; rowB: number; t: number; } /** * Finds the baked rows around `time` in a clip, wrapping when `loop` and holding the last pose * otherwise. This is the CPU mirror of the crowd shader's lookup. * * @capability animation look up the baked frames and blend for a crowd member's playback time */ export declare function sampleBoneTexture(clip: BoneTextureClip, fps: number, time: number, loop: boolean, out?: BoneTextureSample): BoneTextureSample;