//#region src/poses.d.ts /** * Poses: an orientation as a function of time. * * A pose takes `t` in [0, 1) -- one trip round the loop -- and returns degrees * of yaw, pitch and roll. Every pose here is *periodic*, meaning the value at * t = 1 is the value at t = 0, so a clip rendered across one full cycle joins * back onto itself with no seam. That is the whole trick behind a loopable * animation: nothing fades or resets, the head simply arrives back where it * started. */ interface Orientation { /** Degrees. */ yaw: number; pitch: number; roll: number; } /** `t` runs 0 -> 1 over one loop. Must be periodic to loop cleanly. */ type Pose = (t: number) => Partial; interface Keyframe extends Partial { /** Where in the loop this frame sits, 0 -> 1. */ at: number; } declare const poses: Record; type PoseName = keyof typeof poses & string; declare const POSE_NAMES: PoseName[]; /** * Build a pose. * * Pass a function for full control, or keyframes to be interpolated: * * definePose([{ at: 0, yaw: -30 }, { at: 0.5, yaw: 30 }]) * * Keyframes wrap around, so the last one eases back into the first and the * result loops without you having to repeat a frame at `at: 1`. */ declare function definePose(spec: Pose | Keyframe[]): Pose; /** A name, a function, or keyframes -- all become a pose. */ declare function resolvePose(pose: PoseName | Pose | Keyframe[] | undefined): Pose; /** The orientation at time `t`, laid over whatever the caller already set. */ declare function poseAt(pose: Pose, t: number, base?: Partial): Orientation; //#endregion export { Keyframe, Orientation, POSE_NAMES, Pose, PoseName, definePose, poseAt, poses, resolvePose };