/** * @holoscript/core LOD Generator * * Automatic LOD generation through mesh simplification. * Implements Quadric Error Metrics (QEM) and other algorithms * for generating multiple LOD levels from a high-poly mesh. */ import { LODConfig, LODGenerationOptions, LODGenerationResult, GeneratedLODLevel, SimplificationAlgorithm } from './LODTypes'; /** * Input mesh data for LOD generation */ export interface MeshData { /** Vertex positions (x, y, z for each vertex) */ positions: Float32Array; /** Vertex normals (optional) */ normals?: Float32Array; /** Texture coordinates (optional) */ uvs?: Float32Array; /** Triangle indices */ indices: Uint32Array; /** Vertex colors (optional) */ colors?: Float32Array; } /** * Validation result for mesh data */ export interface MeshValidation { valid: boolean; vertexCount: number; triangleCount: number; errors: string[]; warnings: string[]; } /** * LOD Generator for creating simplified mesh levels */ export declare class LODGenerator { private options; constructor(options?: Partial); /** * Generate multiple LOD levels from a mesh */ generate(mesh: MeshData): LODGenerationResult; /** * Generate a single LOD level at a specific reduction ratio */ generateLevel(mesh: MeshData, targetRatio: number, level?: number): GeneratedLODLevel; /** * Create LOD configuration from generated levels */ createConfigFromLevels(id: string, levels: GeneratedLODLevel[], baseDistance?: number): LODConfig; /** * Simplify mesh to target triangle count */ simplifyMesh(mesh: MeshData, targetTriangles: number, algorithm: SimplificationAlgorithm): MeshData; /** * Quadric Error Metrics simplification (Garland & Heckbert) */ private simplifyQuadricError; /** * Simple edge collapse simplification */ private simplifyEdgeCollapse; /** * Vertex clustering simplification */ private simplifyVertexClustering; /** * Voxelization-based simplification */ private simplifyVoxel; /** * Validate mesh data */ validateMesh(mesh: MeshData): MeshValidation; /** * Clone mesh data */ private cloneMesh; /** * Calculate face normal */ private calculateNormal; /** * Calculate plane equation from point and normal */ private calculatePlane; /** * Calculate quadric matrix from plane equation */ private calculateQuadricFromPlane; /** * Create zero 4x4 matrix */ private createZeroMatrix; /** * Add matrices in place */ private addMatrices; /** * Add edge to edge list */ private addEdge; /** * Update edge error using quadric metrics */ private updateEdgeError; /** * Check if edge should be preserved */ private shouldPreserveEdge; /** * Rebuild mesh from simplified data */ private rebuildMesh; /** * Calculate visual error between two meshes */ private calculateError; /** * Update generator options */ setOptions(options: Partial): void; /** * Get current options */ getOptions(): LODGenerationOptions; } /** * Create LOD generator with default options */ export declare function createLODGenerator(options?: Partial): LODGenerator; /** * Generate LOD levels for a mesh with default settings */ export declare function generateLODs(mesh: MeshData, levelCount?: number): LODGenerationResult; /** * Create a simple cube mesh for testing */ export declare function createTestCube(): MeshData; /** * Create a higher-poly sphere for testing */ export declare function createTestSphere(segments?: number): MeshData; //# sourceMappingURL=LODGenerator.d.ts.map