import type { RagdollConfig } from "../physics/ragdoll.js"; import { type SkeletonMap, type SkeletonSlot } from "./skeletonStandard.js"; /** * One standard slot's world pose, sampled at the moment a character is killed. The orientation is * the reference the ragdoll's aim rotates from, so every bone keeps the roll it died with. */ export interface RagdollPose { slot: SkeletonSlot; position: readonly [number, number, number]; /** World orientation of the bone, as `[x, y, z, w]`. */ orientation: readonly [number, number, number, number]; } /** Half-extents and mass of one standard slot's physics body, in the rig's own world units. */ export interface RagdollBodyShape { halfExtents: readonly [number, number, number]; mass: number; } /** * Humanoid body shapes for the standard slots, sized for a roughly 1.8 m character standing on the * ground. A rig of another scale multiplies them (see {@link RagdollRigOptions.scale}). */ export declare const HUMANOID_RAGDOLL_BODIES: Readonly>>; /** Tuning for {@link ragdollConfigFromPoses}. */ export interface RagdollRigOptions { /** Overrides {@link HUMANOID_RAGDOLL_BODIES} per slot. A slot absent from both is skipped. */ bodies?: Readonly>>; /** Multiplies every half-extent; a rig taller than 1.8 m passes its height over 1.8. Default 1. */ scale?: number; /** Also build a body for slots with no shape of their own. Default false. */ includeUnshaped?: boolean; } /** * World orientations for a ragdoll's bones from its bodies' current positions: each bone rotates * from its rest direction-to-child onto the current one, so the aim follows the joints while every * bone keeps the roll it had in the death pose. A bone with no posed child keeps its rest * orientation. The physics bodies carry translation only, so this is what gives the ragdoll a * skeleton instead of a pile of boxes. * * @capability animation orient a ragdoll's bones from its physics bodies' positions */ export declare function ragdollBoneOrientations(rest: readonly RagdollPose[], positions: Readonly>>): Partial>; /** * A jointed ragdoll for a mapped rig from its bones' world poses at the moment of death: one box * body per standard slot that has a shape, sized to the character, and one distance link per slot * that has its parent present, holding the bones' own separation. The bodies start where the * character actually was, so the collapse continues the death pose instead of snapping to a preset. * * `handSlot.l`/`handSlot.r` carry no body: they are prop sockets, not body parts. A slot whose bone * the rig does not have is skipped, and its children link to the nearest present ancestor instead. * * @capability animation build a physics ragdoll from a mapped rig's death pose */ export declare function ragdollConfigFromPoses(map: SkeletonMap, poses: readonly RagdollPose[], options?: RagdollRigOptions): RagdollConfig;