import type { MeshData } from '@ifc-lite/geometry'; import type { Ray, Vec3 } from './raycaster.js'; export interface AABB { min: Vec3; max: Vec3; } export interface BVHNode { bounds: AABB; meshIndices: number[]; left?: BVHNode; right?: BVHNode; isLeaf: boolean; } export declare class BVH { private root; private readonly maxMeshesPerLeaf; private meshAABBs; /** * Build BVH from meshes */ build(meshes: MeshData[]): void; /** * Get meshes that potentially intersect with ray */ getMeshesForRay(ray: Ray, meshes: MeshData[]): number[]; /** * Build a BVH node recursively */ private buildNode; /** * Traverse BVH and collect meshes that intersect ray */ private traverseRay; /** * Ray-AABB intersection test */ private rayIntersectsAABB; /** * Union the cached per-mesh AABBs for a set of mesh indices (no vertex scan) */ private unionCachedBounds; /** * Center of a cached mesh AABB along an axis (k = 0|1|2). Derived in f64 from * the lossless f32 bounds, so it equals the old getMeshCenter exactly. */ private cachedCenter; /** * Get longest axis of bounding box */ private getLongestAxis; } //# sourceMappingURL=bvh.d.ts.map