import { ComputePrefixSum } from '../../Compute/ComputePrefixSum.js'; import type { ComputeNode, Renderer } from 'three/webgpu'; import type { GPUInteractionBuffers } from './GPUInteractionBuffers.js'; export type GPUInteractionGridVector3 = [number, number, number]; export interface GPUInteractionGridOptions { cellSize?: number | undefined; dimensions?: readonly number[] | undefined; origin?: readonly number[] | undefined; maxCellsPerCollider?: number | undefined; } export interface GPUInteractionGridConfig { readonly cellSize: number; readonly dimensions: GPUInteractionGridVector3; readonly origin: GPUInteractionGridVector3; readonly maxCellsPerCollider: number; } export interface GPUInteractionSpatialGridOptions { grid?: GPUInteractionGridOptions | undefined; maxGridLinks: number; maxGlobalColliders: number; } export interface GPUInteractionGridPasses { readonly clearCells: ComputeNode; readonly clearCounts: ComputeNode; readonly countCells: ComputeNode; readonly scatter: ComputeNode; } export interface GPUInteractionSpatialGridComputeBatch extends Array { name: 'InteractionSpatialGrid'; isComputeNode: true; } export interface GPUInteractionReferenceCollider { id: number; active: boolean; global?: boolean | undefined; aabbMinimum: GPUInteractionGridVector3; aabbMaximum: GPUInteractionGridVector3; } export interface GPUInteractionSpatialGridReference { readonly cells: Map; readonly globals: readonly number[]; readonly gridLinks: number; readonly gridLinkOverflows: number; readonly globalColliderOverflows: number; } export interface GPUInteractionSpatialGridSizingReport { readonly cellCount: number; readonly cellArrayBytes: number; readonly linkBytes: number; readonly globalColliderBytes: number; } declare function normalizeGridOptions(grid?: GPUInteractionGridOptions): Readonly; declare class GPUInteractionSpatialGrid { config: Readonly; maxGridLinks: number; maxGlobalColliders: number; cellCount: number; maxCellsPerCollider: number; prefixSum: ComputePrefixSum | null; passes: GPUInteractionGridPasses | null; computeBatch: GPUInteractionSpatialGridComputeBatch | null | undefined; constructor({ grid, maxGridLinks, maxGlobalColliders }: GPUInteractionSpatialGridOptions); initialize(renderer: Renderer, buffers: GPUInteractionBuffers, scanCount: number): GPUInteractionSpatialGridComputeBatch; getComputeNodes(): GPUInteractionSpatialGridComputeBatch | []; getCellsForAabb(minimum: GPUInteractionGridVector3, maximum: GPUInteractionGridVector3): number[]; isOversizedAabb(minimum: GPUInteractionGridVector3, maximum: GPUInteractionGridVector3): boolean; buildReference(colliders: readonly GPUInteractionReferenceCollider[]): GPUInteractionSpatialGridReference; queryPointReference(reference: GPUInteractionSpatialGridReference, point: GPUInteractionGridVector3): number[]; getSizingReport(): GPUInteractionSpatialGridSizingReport; dispose(): void; } export { GPUInteractionSpatialGrid, normalizeGridOptions };