/**
 * # SolverBodyState — data-oriented mirror of the per-body solver hot state
 *
 * The TGS substep window (contact solver, joint solver, gravity / position
 * integration) reads and writes a small, fixed set of per-body quantities
 * thousands of times per step: linear / angular velocity, inverse mass,
 * inverse-inertia diagonal, and orientation. In the object world those live on
 * the {@link RigidBody} and {@link Transform} *components*, reached via
 * `system.__bodies[idx]` / `system.__transforms[idx]` — a chain of pointer
 * dereferences (array → component object → `Vector3` field) on the hottest
 * inner loop in the engine.
 *
 * This class packs exactly those quantities into one ArrayBuffer-backed,
 * stride-{@link SBS_STRIDE} `Float64Array` indexed by **body slot index** (the
 * same index the rest of the physics system already uses). A body's whole
 * solver state sits in one contiguous span, so the solver reads it with flat
 * typed-array indexing and no object dereference.
 *
 * ## Lifecycle within one `fixedUpdate`
 *
 *  - {@link begin} once, after islands are built: ensures capacity and rolls
 *    the per-step gather stamp.
 *  - {@link gather} every body referenced this step (the awake set + the
 *    static / kinematic anchors referenced by contacts and joints). Idempotent
 *    per step via the stamp, so callers may gather the same body redundantly.
 *    MUST run after the once-per-step force integration (so the gathered
 *    velocity is post-force) and before any substep stage reads it.
 *  - the substep loop mutates `data` in place.
 *  - {@link scatter} once at the end: write the persistent linear / angular
 *    velocity back to each gathered body's `RigidBody`. Pose is NOT scattered
 *    here — `integrate_position` keeps the authoritative pose on the
 *    `Transform` (write-through, so its `onChanged` subscribers and the
 *    per-substep concave re-detection still see the moved pose); the
 *    orientation quaternion is mirrored into `data` purely for the impulse
 *    loop's world-inverse-inertia evaluation.
 *
 * ## Material content
 *
 * For Static / Kinematic bodies `invMass` and the inverse-inertia diagonal are
 * stored as **zero** regardless of the component values — the solver treats
 * "no inverse mass / no inverse inertia" as immovable, which is exactly how the
 * object path's `kind !== Dynamic` guards behave. Velocity is mirrored as-is
 * (a kinematic mover carries a real velocity the contact rows must see; a
 * static reads zero). Scattering velocity back to a non-dynamic body is a
 * no-op in value (the solver never moves it), so scatter need not special-case.
 *
 * The arithmetic the solver performs on this data is identical to the object
 * path — only the *source of the operands* changes — so the engine's
 * same-runtime bit-identical determinism contract is preserved.
 *
 * @author Alex Goldring
 * @copyright Company Named Limited (c) 2026
 */
/** Inverse mass (0 for Static / Kinematic). */
export const SBS_INV_MASS: 0;
/** Inverse-inertia diagonal, body-local principal frame (0,0,0 for non-dynamic). */
export const SBS_INV_I_X: 1;
export const SBS_INV_I_Y: 2;
export const SBS_INV_I_Z: 3;
/** Orientation quaternion (mirrors `transform.rotation`, refreshed per substep). */
export const SBS_QX: 4;
export const SBS_QY: 5;
export const SBS_QZ: 6;
export const SBS_QW: 7;
/** Persistent linear velocity. */
export const SBS_LV_X: 8;
export const SBS_LV_Y: 9;
export const SBS_LV_Z: 10;
/** Persistent angular velocity. */
export const SBS_AV_X: 11;
export const SBS_AV_Y: 12;
export const SBS_AV_Z: 13;
/** Doubles per body. */
export const SBS_STRIDE: 14;
export class SolverBodyState {
    constructor(initial_capacity?: number);
    /**
     * Interleaved per-body state, `slot_index * SBS_STRIDE + field`.
     * @type {Float64Array}
     */
    data: Float64Array;
    /**
     * Per-body "gathered this step" stamp; equals {@link __gen} when the
     * body's slot has been gathered in the current step.
     * @private
     * @type {Int32Array}
     */
    private __stamp;
    /**
     * Dense list of slot indices gathered this step, for {@link scatter}.
     * @private
     * @type {Uint32Array}
     */
    private __gathered;
    /** @private */
    private __gathered_count;
    /**
     * Monotonic per-step generation. {@link begin} increments it so the
     * previous step's stamps are stale without an O(n) clear.
     * @private
     */
    private __gen;
    /** @private */
    private __capacity;
    /**
     * Number of bodies gathered in the current step.
     * @returns {number}
     */
    get gathered_count(): number;
    /**
     * Ensure the typed arrays can index slot `[0, hwm)` and roll the per-step
     * gather state. Call once per `fixedUpdate`, after islands are built.
     *
     * @param {number} hwm body-storage high-water mark
     */
    begin(hwm: number): void;
    /**
     * Mirror one body's solver state into `data` if not already gathered this
     * step. Idempotent per step. Reads the body's current (post-force)
     * velocity and current pose.
     *
     * @param {number} idx body slot index
     * @param {RigidBody} rb
     * @param {Transform} transform
     */
    gather(idx: number, rb: RigidBody, transform: Transform): void;
    /**
     * Write the solved persistent linear / angular velocity back onto every
     * gathered body's `RigidBody`. Direct typed-array writes into the
     * `Vector3` backing — the same observer-bypassing path the solver already
     * uses for velocity (`lv[0] += …`), so no `onChanged` semantics change.
     *
     * @param {RigidBody[]} bodies sparse, indexed by slot
     */
    scatter(bodies: RigidBody[]): void;
    /**
     * @private
     * @param {number} hwm
     */
    private __grow;
}
//# sourceMappingURL=SolverBodyState.d.ts.map