import { Vec3 } from 'playcanvas';
import { DataTable } from '../data-table';
/**
 * Axis-aligned bounding box for BVH nodes.
 */
interface BVHBounds {
    minX: number;
    minY: number;
    minZ: number;
    maxX: number;
    maxY: number;
    maxZ: number;
}
/**
 * BVH node for Gaussian AABBs.
 */
interface GaussianBVHNode {
    /** Number of Gaussians in this subtree */
    count: number;
    /** Bounds of all Gaussian AABBs in this subtree */
    bounds: BVHBounds;
    /** Gaussian indices (only for leaf nodes) */
    indices?: Uint32Array;
    /** Left child (only for interior nodes) */
    left?: GaussianBVHNode;
    /** Right child (only for interior nodes) */
    right?: GaussianBVHNode;
}
/**
 * BVH (Bounding Volume Hierarchy) for efficient spatial queries on Gaussian AABBs.
 *
 * Unlike the centroid-based BTree, this BVH stores the full AABB for each node,
 * computed from position +/- extent for all Gaussians in the subtree.
 */
declare class GaussianBVH {
    /** Root node of the BVH */
    root: GaussianBVHNode;
    /** Position data from the original DataTable */
    private x;
    private y;
    private z;
    /** Extent data */
    private extentX;
    private extentY;
    private extentZ;
    /** Maximum leaf size */
    private static readonly MAX_LEAF_SIZE;
    /**
     * Construct a BVH from Gaussian data.
     *
     * @param dataTable - DataTable containing position (x, y, z) columns
     * @param extents - DataTable containing extent (extent_x, extent_y, extent_z) columns
     */
    constructor(dataTable: DataTable, extents: DataTable);
    /**
     * Compute the AABB that bounds all Gaussian AABBs for the given indices.
     *
     * @param indices - Array of Gaussian indices
     * @returns The bounding box that contains all specified Gaussians
     */
    private computeBounds;
    /**
     * Build a BVH node recursively.
     *
     * @param indices - Array of Gaussian indices to include in this subtree
     * @returns The constructed BVH node
     */
    private buildNode;
    /**
     * Query all Gaussian indices whose AABBs overlap the given box.
     *
     * @param boxMin - Minimum corner of query box
     * @param boxMax - Maximum corner of query box
     * @returns Array of Gaussian indices that overlap the box
     */
    queryOverlapping(boxMin: Vec3, boxMax: Vec3): number[];
    /**
     * Query all Gaussian indices whose AABBs overlap the given box (using raw coordinates).
     *
     * @param minX - Minimum X of query box
     * @param minY - Minimum Y of query box
     * @param minZ - Minimum Z of query box
     * @param maxX - Maximum X of query box
     * @param maxY - Maximum Y of query box
     * @param maxZ - Maximum Z of query box
     * @returns Array of Gaussian indices that overlap the box
     */
    queryOverlappingRaw(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): number[];
    /**
     * Recursive query helper.
     *
     * @param node - Current BVH node to query
     * @param minX - Query box minimum X
     * @param minY - Query box minimum Y
     * @param minZ - Query box minimum Z
     * @param maxX - Query box maximum X
     * @param maxY - Query box maximum Y
     * @param maxZ - Query box maximum Z
     * @param result - Array to append matching indices to
     */
    private queryNode;
    /**
     * Get the total number of Gaussians in the BVH.
     *
     * @returns The total count of Gaussians
     */
    get count(): number;
    /**
     * Get the bounds of the entire scene.
     *
     * @returns The scene bounding box
     */
    get sceneBounds(): BVHBounds;
}
export { GaussianBVH, GaussianBVHNode, BVHBounds };
