/**
 * Culling Utilities
 *
 * Frustum culling and LOD (Level of Detail) management for 3D scene optimization.
 *
 * @packageDocumentation
 */
import * as THREE from 'three';
export interface CullingOptions {
    /** Camera frustum for culling */
    camera: THREE.Camera;
    /** Optional padding around frustum */
    padding?: number;
}
export interface LODLevel {
    /** Distance threshold for this LOD level */
    distance: number;
    /** Geometry or mesh for this level */
    geometry?: THREE.BufferGeometry;
    /** Scale multiplier for this level */
    scale?: number;
    /** Whether to use simplified material */
    simpleMaterial?: boolean;
}
export interface LODConfig {
    /** LOD levels from closest to farthest */
    levels: LODLevel[];
    /** Transition smoothness (0-1) */
    transitionSmoothness?: number;
}
/**
 * Frustum culling check for a position
 * @param position - World position to check
 * @param camera - Camera to check against
 * @param padding - Optional padding in world units
 * @returns Whether the position is within the frustum
 */
export declare function isInFrustum(position: THREE.Vector3, camera: THREE.Camera, padding?: number): boolean;
/**
 * Filter an array of positions to only those within the frustum
 * @param positions - Array of world positions
 * @param camera - Camera to check against
 * @param padding - Optional padding in world units
 * @returns Array of positions within frustum
 */
export declare function filterByFrustum(positions: THREE.Vector3[], camera: THREE.Camera, padding?: number): THREE.Vector3[];
/**
 * Get indices of visible items from an array
 * @param positions - Array of world positions
 * @param camera - Camera to check against
 * @param padding - Optional padding in world units
 * @returns Set of visible indices
 */
export declare function getVisibleIndices(positions: THREE.Vector3[], camera: THREE.Camera, padding?: number): Set<number>;
/**
 * Calculate LOD level based on distance from camera
 * @param position - Object position
 * @param camera - Camera position
 * @param lodLevels - Array of distance thresholds (sorted closest to farthest)
 * @returns Index of the LOD level to use
 */
export declare function calculateLODLevel(position: THREE.Vector3, camera: THREE.Camera, lodLevels: number[]): number;
/**
 * Create a distance-based LOD system for an instanced mesh
 * @param instancedMesh - The instanced mesh to manage
 * @param positions - Array of instance positions
 * @param camera - Camera to calculate distances from
 * @param lodDistances - Distance thresholds for LOD levels
 * @returns Array of LOD indices for each instance
 */
export declare function updateInstanceLOD(instancedMesh: THREE.InstancedMesh, positions: THREE.Vector3[], camera: THREE.Camera, lodDistances: number[]): Uint8Array;
/**
 * Create visibility data for instanced mesh culling
 * Updates the instance matrix to hide/show instances
 * @param instancedMesh - The instanced mesh
 * @param positions - Array of instance positions
 * @param visibleIndices - Set of visible indices
 * @returns Updated count of visible instances
 */
export declare function cullInstancedMesh(instancedMesh: THREE.InstancedMesh, positions: THREE.Vector3[], visibleIndices: Set<number>): number;
/**
 * Spatial hash grid for efficient object queries
 */
export declare class SpatialHashGrid {
    private cellSize;
    private cells;
    private objectPositions;
    constructor(cellSize?: number);
    /**
     * Get cell key for a position
     */
    private getCellKey;
    /**
     * Insert an object into the grid
     */
    insert(id: string, position: THREE.Vector3): void;
    /**
     * Remove an object from the grid
     */
    remove(id: string): void;
    /**
     * Update an object's position
     */
    update(id: string, newPosition: THREE.Vector3): void;
    /**
     * Query objects within a radius of a position
     */
    queryRadius(center: THREE.Vector3, radius: number): string[];
    /**
     * Query objects within a bounding box
     */
    queryBox(minX: number, maxX: number, minZ: number, maxZ: number): string[];
    /**
     * Clear all objects from the grid
     */
    clear(): void;
    /**
     * Get statistics about the grid
     */
    getStats(): {
        objects: number;
        cells: number;
    };
}
declare const _default: {
    isInFrustum: typeof isInFrustum;
    filterByFrustum: typeof filterByFrustum;
    getVisibleIndices: typeof getVisibleIndices;
    calculateLODLevel: typeof calculateLODLevel;
    updateInstanceLOD: typeof updateInstanceLOD;
    cullInstancedMesh: typeof cullInstancedMesh;
    SpatialHashGrid: typeof SpatialHashGrid;
};
export default _default;
