import { GltfAsset } from 'gltf-loader-ts'; import { MeshPrimitive } from 'gltf-loader-ts/lib/gltf'; import { GLTFMesh } from './gltfmesh'; import { GLTFPrimitive } from './gltfprimitive'; import { Context } from '../context'; import { ResourceManager } from '../core'; import { Program } from '../program'; import { Material } from '../scene'; import { SceneNode } from '../scene/scenenode'; import { Texture2D } from '../texture2d'; /** * This class can be used to load the glTF file format, which describes scenes and models. * It handles all buffer, texture and geometry creation as well as scene generation. * Per glTF scene, one SceneNode is generated which represents the hierarchy of the scene. * ``` * const loader = new GLTFLoader(this._context); * await loader.loadAsset(GltfRenderer.assetURI); * const rootNode = loader.defaultScene; * ``` */ export declare class GLTFLoader { protected _context: Context; protected _sceneName: string; protected _defaultScene: SceneNode | undefined; protected _scenes: Array; protected _resourceManager: ResourceManager; protected _meshes: Array; protected _nameMeshMap: Map; protected _uriTextureMap: Map; protected _pbrProgram: Program; protected _pbrDefaultMaterial: Material; constructor(context: Context); protected loadTextures(asset: GltfAsset): Promise; protected getTexture(index: number): Texture2D | undefined; protected loadMaterials(asset: GltfAsset): Promise; protected inferBufferUsage(asset: GltfAsset, bufferViewId: number): GLenum; protected loadBuffers(asset: GltfAsset): Promise; protected loadMeshes(asset: GltfAsset): Promise>; protected loadPrimitive(asset: GltfAsset, primitiveInfo: MeshPrimitive, id: number): Promise; protected generateScenes(asset: GltfAsset): Promise; loadAsset(uri: string): Promise; uninitialize(): void; /** * Get a single mesh from the glTF scene. * * @param name - Name of the mesh as specified in the glTF file */ getMeshByName(name: string): GLTFMesh | undefined; /** * Get a list of all meshes contained in the glTF asset. * The meshes are given in the order in which they appear in the glTF file. */ get meshes(): Array; /** * Returns a map, where the key is an URI referncing image data and the values are * the corresponding generated texture by this loader. * For textures, where no URI is available (e.g. loaded from an internal data blob), * an id generated by the loader is used. */ get uriTextureMap(): Map; /** * A default program, which can be used to render resources loaded with glTF. * It supports physically-based rendering as described in the glTF standard. */ get pbrProgram(): Program; get scenes(): Array; /** * Returns the default scene is specified by glTF, otherwise returns the first scene. */ get defaultScene(): SceneNode; }