import type { ComputeNode } from 'three/webgpu'; import type { GPUInteractionBuffers } from './GPUInteractionBuffers.cjs'; import type { TSLFloatNode, TSLMat4Node, TSLStorageNode } from '../../types/tsl.cjs'; export type GPUInteractionSimulationKind = 'boids' | 'fluid' | 'smoke'; export type GPUInteractionQueryMode = 'grid' | 'scan'; export type ParticleInteractionComputeKey = 'default' | 'position' | 'velocity' | 'density' | 'positionDelta'; export interface SimulationInteractionOptions { enabled?: boolean | undefined; layer?: number | undefined; mask?: number | undefined; feedback?: boolean | undefined; feedbackScale?: number | undefined; feedbackResolution?: number | undefined; queryMode?: GPUInteractionQueryMode | undefined; avoidanceDistance?: number | undefined; lookAheadTime?: number | undefined; avoidanceStrength?: number | undefined; particleRadius?: number | undefined; particleSpacing?: number | undefined; friction?: number | undefined; restitution?: number | undefined; positionOnly?: boolean | undefined; velocityOnly?: boolean | undefined; readonly [name: string]: unknown; } export interface ParticleInteractionSchedulingOptions { positionOnly?: boolean | undefined; velocityOnly?: boolean | undefined; } export interface ParticleInteractionWorld { initialized: boolean; buffers: GPUInteractionBuffers | null; } export interface ParticleInteractionBuffers { positions: TSLStorageNode<'vec3'>; velocities: TSLStorageNode<'vec3'>; prevPositions?: TSLStorageNode<'vec3'> | null | undefined; readonly [name: string]: unknown; } export interface ParticleInteractionUniforms { deltaTime: TSLFloatNode; domainMatrix?: TSLMat4Node | undefined; domainMatrixInverse?: TSLMat4Node | undefined; readonly [name: string]: unknown; } export interface ParticleInteractionConsumer { interactionWorld: ParticleInteractionWorld | null; interaction: Readonly | null; _interactionKind: GPUInteractionSimulationKind; _interactionCompute: ComputeNode | null; _interactionComputes: Map | null; _interactionComputeWorld: ParticleInteractionWorld | null; buffers: ParticleInteractionBuffers; particleCount: number; ubos: ParticleInteractionUniforms; _particleSpacing: number; particleRadius: number; is3D: boolean; } export interface ParticleDensityInteractionConsumer extends ParticleInteractionConsumer { ubos: ParticleInteractionUniforms & { h: TSLFloatNode; h2: TSLFloatNode; mass: TSLFloatNode; poly6Kernel: TSLFloatNode; }; } export interface ParticlePositionDeltaInteractionConsumer extends ParticleDensityInteractionConsumer { ubos: ParticleDensityInteractionConsumer['ubos'] & { restDensity: TSLFloatNode; spiky: TSLFloatNode; deltaQ: TSLFloatNode; sCorrK: TSLFloatNode; sCorrN: TSLFloatNode; }; } declare function setSimulationInteractionWorld(simulation: TSimulation, world: ParticleInteractionWorld | null, options?: SimulationInteractionOptions, kind?: GPUInteractionSimulationKind): TSimulation; declare function clearSimulationInteractionWorld(simulation: TSimulation): TSimulation; declare function getParticleInteractionCompute(simulation: ParticleInteractionConsumer, scheduling?: ParticleInteractionSchedulingOptions): ComputeNode | null; declare function getParticleInteractionDensityCompute(simulation: ParticleDensityInteractionConsumer): ComputeNode | null; declare function getParticleInteractionPositionDeltaCompute(simulation: ParticlePositionDeltaInteractionConsumer): ComputeNode | null; export { clearSimulationInteractionWorld, getParticleInteractionCompute, getParticleInteractionDensityCompute, getParticleInteractionPositionDeltaCompute, setSimulationInteractionWorld };