|
@@ -4,8 +4,10 @@ import {
|
|
|
Group,
|
|
|
Loader,
|
|
|
LoadingManager,
|
|
|
+ Mesh,
|
|
|
Object3D,
|
|
|
Material,
|
|
|
+ SkinnedMesh,
|
|
|
Texture
|
|
|
} from '../../../src/Three';
|
|
|
|
|
@@ -39,6 +41,10 @@ export class GLTFLoader extends Loader {
|
|
|
load( url: string, onLoad: ( gltf: GLTF ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
|
|
|
setDRACOLoader( dracoLoader: DRACOLoader ): GLTFLoader;
|
|
|
setDDSLoader( ddsLoader: DDSLoader ): GLTFLoader;
|
|
|
+
|
|
|
+ register( callback: ( parser: GLTFParser ) => GLTFLoaderPlugin ): GLTFLoader;
|
|
|
+ unregister( callback: ( parser: GLTFParser ) => GLTFLoaderPlugin ): GLTFLoader;
|
|
|
+
|
|
|
setKTX2Loader( ktx2Loader: KTX2Loader ): GLTFLoader;
|
|
|
setMeshoptDecoder( meshoptDecoder: /* MeshoptDecoder */ any ): GLTFLoader;
|
|
|
|
|
@@ -61,3 +67,15 @@ export class GLTFParser {
|
|
|
getDependencies: ( type: string ) => Promise<any[]>;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+export interface GLTFLoaderPlugin {
|
|
|
+
|
|
|
+ loadMesh?: ( meshIndex: number ) => Promise<Group | Mesh | SkinnedMesh> | null;
|
|
|
+ loadBufferView?: ( bufferViewIndex: number ) => Promise<ArrayBuffer> | null;
|
|
|
+ loadMaterial?: ( materialIndex: number ) => Promise<Material> | null;
|
|
|
+ loadTexture?: ( textureIndex: number ) => Promise<Texture> | null;
|
|
|
+ getMaterialType?: ( materialIndex: number ) => typeof Material | null;
|
|
|
+ extendMaterialParams?: ( materialIndex: number, materialParams: { [ key: string ]: any } ) => Promise<any> | null;
|
|
|
+ createNodeAttachment?: ( nodeIndex: number ) => Promise<Object3D> | null;
|
|
|
+
|
|
|
+}
|