/** * Spherical nearest-tile lookup — shared spatial index used by every * caller that needs to map an arbitrary world-space point to its closest * tile on a hexasphere. * * The trick is a 2D azimuth × polar grid covering the unit sphere. Each * tile is binned into one cell at index time; queries scan the 3×3 cell * neighbourhood around the query direction. Polar rows wrap fully in * azimuth so the wrap-around at the poles is handled correctly. * * Cost is `O(k)` per query where `k` is the average tile count per cell * (≈ 36 for ~640 tiles), versus `O(T)` for a brute-force dot product * scan. Allocation-free on the hot path — typed-array buckets only. */ /** Minimal tile shape the lookup needs — accepts `Tile[]` directly. */ export interface SphericalIndexedTile { id: number; centerPoint: { x: number; y: number; z: number; }; } /** * Builds a single-nearest lookup. Returns the tile id of the tile whose * unit-sphere centre is closest to the query direction (highest dot * product). Allocation-free per query. */ export declare function buildSphericalNearestLookup(tiles: readonly SphericalIndexedTile[]): (x: number, y: number, z: number) => number; /** * Builds a top-K lookup. Writes K tile ids and their normalised blend * weights into caller-supplied typed arrays starting at `outOffset`, * so the caller can pre-allocate a single flat buffer of size `verts × K` * and the query path stays allocation-free. * * Weights are derived from `dot − dotKth` (offset against the K-th best) * then normalised to sum to 1; degenerate cases (all dots equal) collapse * to uniform `1/K`. This is the natural smooth-blend weighting for * vertex paint use cases — point-by-point queries can ignore the weight * output if they only need the ids. * * `k` is silently clamped to `tiles.length` when smaller; a tiles array * of length zero is a usage error and never expected. */ export declare function buildSphericalKNearestLookup(tiles: readonly SphericalIndexedTile[], k: number): (x: number, y: number, z: number, outIds: Int32Array, outWeights: Float32Array, outOffset: number) => void; //# sourceMappingURL=sphericalTileLookup.d.ts.map