import { default as ShapeHash } from '../Types/ShapeHash';
export interface Aabb {
    min: [number, number, number];
    max: [number, number, number];
}
export interface ShapeBvh {
    /**
     * Flattened nodes, 8 floats (2 RGBA32F texels) per node:
     *   texel 0: aabbMin.xyz | A
     *   texel 1: aabbMax.xyz | B
     * Inner node: A = left child index (> 0), B = right child index.
     * Leaf:       A = -(shapeStart + 1),     B = shape count.
     * Leaf shape ranges index into the REORDERED shape list (`order`).
     */
    nodes: Float32Array;
    nodeCount: number;
    /** order[i] = index into the original shape array for reordered slot i */
    order: number[];
}
/** World-space AABB of a shape's box under its rigid transform. */
export declare function shapeWorldAabb(hash: ShapeHash): Aabb;
/**
 * Median-split BVH over shape AABBs. Balanced by construction, so traversal
 * stack depth is bounded by ~log2(n) + 1.
 */
export declare function buildShapeBvh(aabbs: Aabb[]): ShapeBvh;
/**
 * Reference traversal (mirrors the GLSL implementation, including the
 * per-shape box test that intersectShape performs inside a leaf) — returns
 * the set of ORIGINAL shape indices whose AABB the ray hits. Used by tests
 * to compare against brute force.
 */
export declare function queryBvh(bvh: ShapeBvh, aabbs: Aabb[], origin: [number, number, number], dir: [number, number, number]): Set<number>;
