export type SwingVec3 = readonly [number, number, number]; export interface GrappleSwingConfig { /** Rope shortens by this many units/s while `reeling`. Default `0` (fixed length). */ reelSpeed?: number; minLength?: number; /** Extra spring pull toward the anchor when the rope is taut (elastic feel); default `0` (hard constraint only). */ stiffness?: number; /** Velocity damping per second while attached; default `0.1`. */ damping?: number; } export interface GrappleSwingState { attached: boolean; anchor: SwingVec3 | null; ropeLength: number; } export interface GrappleSwingStep { position: SwingVec3; velocity: SwingVec3; } /** * A rope-swing constraint for kinematic controllers (#282.5) — the walk-controller-compatible * sibling of `physics/traversal`'s rigid-body `Grapple`. Fire at an anchor, feed each frame's * integrated position/velocity through `step`, and commit what comes back (via `beforeCommit` * or `setPose`): positions beyond the rope clamp to its sphere and velocity loses its outward * radial component, which is exactly a pendulum swing. */ export interface GrappleSwing { fire(anchor: SwingVec3, from: SwingVec3): void; release(): void; state(): GrappleSwingState; /** Puts a {@link GrappleSwing.state} back; `anchor: null` detaches. */ restore(next: GrappleSwingState): void; /** Constrain one frame. `reeling` shortens the rope; returns the corrected position/velocity. */ step(position: SwingVec3, velocity: SwingVec3, dt: number, reeling?: boolean): GrappleSwingStep; } /** * Grappling-hook rope swing physics with anchor, pendulum motion, and reel-in. * * @capability grapple-swing grappling-hook rope swing physics with reel-in */ export declare function createGrappleSwing(config?: GrappleSwingConfig): GrappleSwing;