/** * LODBridge — Core-to-Renderer LOD Pipeline Bridge * * Connects the core LODGenerator (which computes simplified meshes using * Quadric Error Metrics, vertex clustering, etc.) to the renderer's * LODMeshNode (which displays the appropriate LOD based on camera distance). * * This bridge implements the missing link in the HoloScript asset pipeline: * LODGenerator (core) → LODBridge → LODMeshNode (r3f-renderer) * * It manages: * 1. Computing LOD levels from source mesh data * 2. Caching computed LOD chains per entity * 3. Providing LOD data in the format LODMeshNode expects * 4. Integration with DraftManager for maturity-aware LOD selection * * @see W.084 — HoloScript has 65% infrastructure * @see P.080 — Draft-Mesh-Sim Circular Pipeline */ import { type MeshData } from './LODGenerator'; import { type LODConfig, type LODTransition, type LODGenerationOptions } from './LODTypes'; import { type AssetMaturity } from '@holoscript/core'; /** Single LOD level in a chain — wraps GeneratedLODLevel with source MeshData */ export interface LODChainLevel { /** The simplified mesh data for this level */ mesh: MeshData; /** Triangle count at this level */ triangleCount: number; /** Reduction ratio from original (1.0 = full detail) */ ratio: number; } /** LOD chain for a single entity — contains all computed LOD levels */ export interface LODChain { /** Entity ID this chain belongs to */ entityId: string; /** Source mesh data (LOD 0 = full detail) */ source: MeshData; /** Generated LOD levels (sorted by detail: highest first) */ levels: LODChainLevel[]; /** Distance thresholds for each LOD level */ distances: number[]; /** Current asset maturity */ maturity: AssetMaturity; /** Transition strategy between levels */ transition: LODTransition; /** Timestamp of last computation */ computedAt: number; } /** Options for the LOD bridge */ export interface LODBridgeOptions { /** LOD generation options passed to LODGenerator */ generatorOptions?: Partial; /** Default distance thresholds [LOD0, LOD1, LOD2, LOD3] */ defaultDistances?: number[]; /** Default transition strategy */ defaultTransition?: LODTransition; /** Maximum cached chains (LRU eviction) */ maxCacheSize?: number; } export declare class LODBridge { private generator; private cache; private options; constructor(options?: LODBridgeOptions); /** * Compute LOD chain for a mesh. This is the core bridge operation: * takes source MeshData → runs LODGenerator → caches result. */ computeChain(entityId: string, source: MeshData, maturity?: AssetMaturity, distances?: number[], transition?: LODTransition): LODChain; /** Get cached LOD chain for an entity */ getChain(entityId: string): LODChain | null; /** Check if an entity has a computed LOD chain */ hasChain(entityId: string): boolean; /** * Select the appropriate LOD level based on camera distance. * Returns the MeshData for the best LOD level. */ selectLOD(entityId: string, cameraDistance: number): MeshData | null; /** * Get LOD config in the format expected by LODMeshNode. * This bridges core LOD data to the renderer's expected format. */ getLODConfig(entityId: string): LODConfig | null; /** Invalidate a chain (e.g., when mesh is updated) */ invalidate(entityId: string): void; /** Clear all cached chains */ clear(): void; /** Get cache statistics */ get stats(): { size: number; maxSize: number; }; private setCached; } //# sourceMappingURL=LODBridge.d.ts.map