import * as THREE from 'three'; import { GlTF, TextureInfo, Mesh, MeshPrimitive } from './glTF'; import type { GlTFResult } from './type'; import { BaseExtension } from './extensions/base'; import { Fetcher } from '../../../utils/ajax'; import { PBMMeshMaterial } from '../../materials/pbmMeshMaterial'; import { PBMPointCloudMaterial } from '../../materials/pbmPointCloudMaterial'; import { ImageBitmapLike } from '../../../texture/imageBitmap'; type ParserOptions = { copyUV2: boolean; resourcePath: string; search: string; fetcher: Fetcher; }; type SkinEntry = { joints: number[]; inverseBindMatrices?: THREE.BufferAttribute | THREE.InterleavedBufferAttribute; }; export declare class Parser { json: GlTF; extensions: Record; options: ParserOptions; cache: Map; disposeSet: Set<{ dispose?: () => void; close?: () => void; }>; textureSet: Set; private nodeNamesUsed; constructor(json: GlTF, extensions: Record, options: ParserOptions); dispose(): void; markDefs(): void; parse(): Promise; /** * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras * @param index * @returns */ loadCamera(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param index * @return */ loadSkin(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param index */ loadAnimation(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param index * @returns */ loadBuffer(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param index * @returns */ loadBufferView(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param index */ loadAccessor(index: number): Promise; createPrimitiveKey(primitiveDef: MeshPrimitive): string; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry * @param primitiveDef */ loadGeometry(primitiveDef: MeshPrimitive): Promise; loadImage(index: number): Promise; loadMeshPrimitive(meshDef: Mesh, primitiveDef: MeshPrimitive): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes * @param index */ loadMesh(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param primitiveDef */ loadMaterial(primitiveDef: MeshPrimitive): Promise; loadMaterialAsPBMPointCloudMaterial(primitiveDef: MeshPrimitive): Promise; loadMaterialAsPBMMeshMaterial(primitiveDef: MeshPrimitive): Promise; loadMaterialAsLineBasicMaterial(primitiveDef: MeshPrimitive): Promise; loadTexture(index: number): Promise; /** * 当骨骼权重和不足 1 时,可能出现问题。 * skinnedMesh.normalizeSkinWeights 只能处理非 normalized 的数据。 * 需要对 normalized 也做检测。 */ normalizeSkinWeights(skinnedMesh: THREE.SkinnedMesh): void; assignFinalMaterial(mesh: THREE.Points | THREE.Line | THREE.Mesh): void; loadNodeAttachments(index: number): Promise[]; /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy * @param index * @returns */ loadNode(index: number): Promise; /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes * @param index */ loadScene(index: number): Promise; createMaterialTexture(mapDef: TextureInfo): Promise; addGeometryPrimitiveAttributes(geometry: THREE.BufferGeometry, primitiveDef: MeshPrimitive): Promise; buildNodeHierarchy(nodeId: number, parentObject: THREE.Object3D): Promise; resolveResouce(uri: string): string; toGeometryTrianglesDrawMode(geometry: THREE.BufferGeometry, drawMode: THREE.TrianglesDrawModes): THREE.BufferGeometry; } export {};