@babylonjs/loaders 5.0.0-rc.7 → 5.0.0-rc.9
Sign up to get free protection for your applications and to get access to all the features.
- package/OBJ/index.d.ts +4 -4
- package/OBJ/index.js +4 -4
- package/OBJ/mtlFileLoader.d.ts +41 -41
- package/OBJ/mtlFileLoader.js +232 -232
- package/OBJ/objFileLoader.d.ts +126 -126
- package/OBJ/objFileLoader.js +296 -296
- package/OBJ/objLoadingOptions.d.ts +43 -43
- package/OBJ/objLoadingOptions.js +1 -1
- package/OBJ/solidParser.d.ts +154 -154
- package/OBJ/solidParser.js +693 -693
- package/STL/index.d.ts +1 -1
- package/STL/index.js +1 -1
- package/STL/stlFileLoader.d.ts +64 -64
- package/STL/stlFileLoader.js +233 -233
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -60
- package/glTF/1.0/glTFLoader.d.ts +136 -136
- package/glTF/1.0/glTFLoader.js +1815 -1815
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
- package/glTF/1.0/glTFLoaderUtils.d.ts +62 -62
- package/glTF/1.0/glTFLoaderUtils.js +250 -250
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
- package/glTF/1.0/index.d.ts +5 -5
- package/glTF/1.0/index.js +5 -5
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
- package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
- package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
- package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
- package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
- package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
- package/glTF/2.0/Extensions/index.d.ts +26 -26
- package/glTF/2.0/Extensions/index.js +26 -26
- package/glTF/2.0/glTFLoader.d.ts +405 -405
- package/glTF/2.0/glTFLoader.js +2366 -2366
- package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
- package/glTF/2.0/glTFLoaderExtension.js +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
- package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
- package/glTF/2.0/index.d.ts +4 -4
- package/glTF/2.0/index.js +4 -4
- package/glTF/glTFFileLoader.d.ts +433 -433
- package/glTF/glTFFileLoader.js +927 -927
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -123
- package/glTF/index.d.ts +5 -5
- package/glTF/index.js +5 -5
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js +18 -18
- package/legacy/legacy-glTF1.d.ts +2 -2
- package/legacy/legacy-glTF1.js +14 -14
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF1FileLoader.js +3 -3
- package/legacy/legacy-glTF2.d.ts +2 -2
- package/legacy/legacy-glTF2.js +32 -32
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.js +3 -3
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -4
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js +12 -12
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js +12 -12
- package/legacy/legacy.d.ts +6 -6
- package/legacy/legacy.js +7 -7
- package/package.json +3 -3
@@ -1,61 +1,61 @@
|
|
1
|
-
import { __extends } from "tslib";
|
2
|
-
import { GLTFLoaderExtension, GLTFLoader, GLTFLoaderBase } from "./glTFLoader
|
3
|
-
import { GLTFUtils } from "./glTFLoaderUtils
|
4
|
-
import { EComponentType } from "./glTFLoaderInterfaces
|
5
|
-
var BinaryExtensionBufferName = "binary_glTF";
|
6
|
-
/** @hidden */
|
7
|
-
var GLTFBinaryExtension = /** @class */ (function (_super) {
|
8
|
-
__extends(GLTFBinaryExtension, _super);
|
9
|
-
function GLTFBinaryExtension() {
|
10
|
-
return _super.call(this, "KHR_binary_glTF") || this;
|
11
|
-
}
|
12
|
-
GLTFBinaryExtension.prototype.loadRuntimeAsync = function (scene, data, rootUrl, onSuccess) {
|
13
|
-
var extensionsUsed = data.json.extensionsUsed;
|
14
|
-
if (!extensionsUsed || extensionsUsed.indexOf(this.name) === -1 || !data.bin) {
|
15
|
-
return false;
|
16
|
-
}
|
17
|
-
this._bin = data.bin;
|
18
|
-
onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene, rootUrl));
|
19
|
-
return true;
|
20
|
-
};
|
21
|
-
GLTFBinaryExtension.prototype.loadBufferAsync = function (gltfRuntime, id, onSuccess, onError) {
|
22
|
-
if (gltfRuntime.extensionsUsed.indexOf(this.name) === -1) {
|
23
|
-
return false;
|
24
|
-
}
|
25
|
-
if (id !== BinaryExtensionBufferName) {
|
26
|
-
return false;
|
27
|
-
}
|
28
|
-
this._bin.readAsync(0, this._bin.byteLength).then(onSuccess, function (error) { return onError(error.message); });
|
29
|
-
return true;
|
30
|
-
};
|
31
|
-
GLTFBinaryExtension.prototype.loadTextureBufferAsync = function (gltfRuntime, id, onSuccess) {
|
32
|
-
var texture = gltfRuntime.textures[id];
|
33
|
-
var source = gltfRuntime.images[texture.source];
|
34
|
-
if (!source.extensions || !(this.name in source.extensions)) {
|
35
|
-
return false;
|
36
|
-
}
|
37
|
-
var sourceExt = source.extensions[this.name];
|
38
|
-
var bufferView = gltfRuntime.bufferViews[sourceExt.bufferView];
|
39
|
-
var buffer = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);
|
40
|
-
onSuccess(buffer);
|
41
|
-
return true;
|
42
|
-
};
|
43
|
-
GLTFBinaryExtension.prototype.loadShaderStringAsync = function (gltfRuntime, id, onSuccess) {
|
44
|
-
var shader = gltfRuntime.shaders[id];
|
45
|
-
if (!shader.extensions || !(this.name in shader.extensions)) {
|
46
|
-
return false;
|
47
|
-
}
|
48
|
-
var binaryExtensionShader = shader.extensions[this.name];
|
49
|
-
var bufferView = gltfRuntime.bufferViews[binaryExtensionShader.bufferView];
|
50
|
-
var shaderBytes = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);
|
51
|
-
setTimeout(function () {
|
52
|
-
var shaderString = GLTFUtils.DecodeBufferToText(shaderBytes);
|
53
|
-
onSuccess(shaderString);
|
54
|
-
});
|
55
|
-
return true;
|
56
|
-
};
|
57
|
-
return GLTFBinaryExtension;
|
58
|
-
}(GLTFLoaderExtension));
|
59
|
-
export { GLTFBinaryExtension };
|
60
|
-
GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
|
1
|
+
import { __extends } from "tslib";
|
2
|
+
import { GLTFLoaderExtension, GLTFLoader, GLTFLoaderBase } from "./glTFLoader";
|
3
|
+
import { GLTFUtils } from "./glTFLoaderUtils";
|
4
|
+
import { EComponentType } from "./glTFLoaderInterfaces";
|
5
|
+
var BinaryExtensionBufferName = "binary_glTF";
|
6
|
+
/** @hidden */
|
7
|
+
var GLTFBinaryExtension = /** @class */ (function (_super) {
|
8
|
+
__extends(GLTFBinaryExtension, _super);
|
9
|
+
function GLTFBinaryExtension() {
|
10
|
+
return _super.call(this, "KHR_binary_glTF") || this;
|
11
|
+
}
|
12
|
+
GLTFBinaryExtension.prototype.loadRuntimeAsync = function (scene, data, rootUrl, onSuccess) {
|
13
|
+
var extensionsUsed = data.json.extensionsUsed;
|
14
|
+
if (!extensionsUsed || extensionsUsed.indexOf(this.name) === -1 || !data.bin) {
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
this._bin = data.bin;
|
18
|
+
onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene, rootUrl));
|
19
|
+
return true;
|
20
|
+
};
|
21
|
+
GLTFBinaryExtension.prototype.loadBufferAsync = function (gltfRuntime, id, onSuccess, onError) {
|
22
|
+
if (gltfRuntime.extensionsUsed.indexOf(this.name) === -1) {
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
if (id !== BinaryExtensionBufferName) {
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
this._bin.readAsync(0, this._bin.byteLength).then(onSuccess, function (error) { return onError(error.message); });
|
29
|
+
return true;
|
30
|
+
};
|
31
|
+
GLTFBinaryExtension.prototype.loadTextureBufferAsync = function (gltfRuntime, id, onSuccess) {
|
32
|
+
var texture = gltfRuntime.textures[id];
|
33
|
+
var source = gltfRuntime.images[texture.source];
|
34
|
+
if (!source.extensions || !(this.name in source.extensions)) {
|
35
|
+
return false;
|
36
|
+
}
|
37
|
+
var sourceExt = source.extensions[this.name];
|
38
|
+
var bufferView = gltfRuntime.bufferViews[sourceExt.bufferView];
|
39
|
+
var buffer = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);
|
40
|
+
onSuccess(buffer);
|
41
|
+
return true;
|
42
|
+
};
|
43
|
+
GLTFBinaryExtension.prototype.loadShaderStringAsync = function (gltfRuntime, id, onSuccess) {
|
44
|
+
var shader = gltfRuntime.shaders[id];
|
45
|
+
if (!shader.extensions || !(this.name in shader.extensions)) {
|
46
|
+
return false;
|
47
|
+
}
|
48
|
+
var binaryExtensionShader = shader.extensions[this.name];
|
49
|
+
var bufferView = gltfRuntime.bufferViews[binaryExtensionShader.bufferView];
|
50
|
+
var shaderBytes = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE);
|
51
|
+
setTimeout(function () {
|
52
|
+
var shaderString = GLTFUtils.DecodeBufferToText(shaderBytes);
|
53
|
+
onSuccess(shaderString);
|
54
|
+
});
|
55
|
+
return true;
|
56
|
+
};
|
57
|
+
return GLTFBinaryExtension;
|
58
|
+
}(GLTFLoaderExtension));
|
59
|
+
export { GLTFBinaryExtension };
|
60
|
+
GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
|
61
61
|
//# sourceMappingURL=glTFBinaryExtension.js.map
|
package/glTF/1.0/glTFLoader.d.ts
CHANGED
@@ -1,136 +1,136 @@
|
|
1
|
-
import { IGLTFRuntime } from "./glTFLoaderInterfaces";
|
2
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
3
|
-
import { Material } from "@babylonjs/core/Materials/material.js";
|
4
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
5
|
-
import { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
|
6
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
7
|
-
import { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
|
8
|
-
import { AssetContainer } from "@babylonjs/core/assetContainer.js";
|
9
|
-
/**
|
10
|
-
* Implementation of the base glTF spec
|
11
|
-
* @hidden
|
12
|
-
*/
|
13
|
-
export declare class GLTFLoaderBase {
|
14
|
-
static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
|
15
|
-
static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
|
16
|
-
static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void;
|
17
|
-
static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: Nullable<ArrayBufferView>, onSuccess: (texture: Texture) => void): void;
|
18
|
-
static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string | ArrayBuffer) => void, onError?: (message: string) => void): void;
|
19
|
-
static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* glTF V1 Loader
|
23
|
-
* @hidden
|
24
|
-
*/
|
25
|
-
export declare class GLTFLoader implements IGLTFLoader {
|
26
|
-
static Extensions: {
|
27
|
-
[name: string]: GLTFLoaderExtension;
|
28
|
-
};
|
29
|
-
static RegisterExtension(extension: GLTFLoaderExtension): void;
|
30
|
-
dispose(): void;
|
31
|
-
private _importMeshAsync;
|
32
|
-
/**
|
33
|
-
* Imports one or more meshes from a loaded gltf file and adds them to the scene
|
34
|
-
* @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
|
35
|
-
* @param scene the scene the meshes should be added to
|
36
|
-
* @param assetContainer defines the asset container to use (can be null)
|
37
|
-
* @param data gltf data containing information of the meshes in a loaded file
|
38
|
-
* @param rootUrl root url to load from
|
39
|
-
* @param onProgress event that fires when loading progress has occured
|
40
|
-
* @returns a promise containg the loaded meshes, particles, skeletons and animations
|
41
|
-
*/
|
42
|
-
importMeshAsync(meshesNames: any, scene: Scene, assetContainer: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void): Promise<ISceneLoaderAsyncResult>;
|
43
|
-
private _loadAsync;
|
44
|
-
/**
|
45
|
-
* Imports all objects from a loaded gltf file and adds them to the scene
|
46
|
-
* @param scene the scene the objects should be added to
|
47
|
-
* @param data gltf data containing information of the meshes in a loaded file
|
48
|
-
* @param rootUrl root url to load from
|
49
|
-
* @param onProgress event that fires when loading progress has occured
|
50
|
-
* @returns a promise which completes when objects have been loaded to the scene
|
51
|
-
*/
|
52
|
-
loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void): Promise<void>;
|
53
|
-
private _loadShadersAsync;
|
54
|
-
private _loadBuffersAsync;
|
55
|
-
private _createNodes;
|
56
|
-
}
|
57
|
-
/** @hidden */
|
58
|
-
export declare abstract class GLTFLoaderExtension {
|
59
|
-
private _name;
|
60
|
-
constructor(name: string);
|
61
|
-
get name(): string;
|
62
|
-
/**
|
63
|
-
* Defines an override for loading the runtime
|
64
|
-
* Return true to stop further extensions from loading the runtime
|
65
|
-
* @param scene
|
66
|
-
* @param data
|
67
|
-
* @param rootUrl
|
68
|
-
* @param onSuccess
|
69
|
-
* @param onError
|
70
|
-
*/
|
71
|
-
loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: IGLTFRuntime) => void, onError?: (message: string) => void): boolean;
|
72
|
-
/**
|
73
|
-
* Defines an onverride for creating gltf runtime
|
74
|
-
* Return true to stop further extensions from creating the runtime
|
75
|
-
* @param gltfRuntime
|
76
|
-
* @param onSuccess
|
77
|
-
* @param onError
|
78
|
-
*/
|
79
|
-
loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): boolean;
|
80
|
-
/**
|
81
|
-
* Defines an override for loading buffers
|
82
|
-
* Return true to stop further extensions from loading this buffer
|
83
|
-
* @param gltfRuntime
|
84
|
-
* @param id
|
85
|
-
* @param onSuccess
|
86
|
-
* @param onError
|
87
|
-
* @param onProgress
|
88
|
-
*/
|
89
|
-
loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
|
90
|
-
/**
|
91
|
-
* Defines an override for loading texture buffers
|
92
|
-
* Return true to stop further extensions from loading this texture data
|
93
|
-
* @param gltfRuntime
|
94
|
-
* @param id
|
95
|
-
* @param onSuccess
|
96
|
-
* @param onError
|
97
|
-
*/
|
98
|
-
loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
|
99
|
-
/**
|
100
|
-
* Defines an override for creating textures
|
101
|
-
* Return true to stop further extensions from loading this texture
|
102
|
-
* @param gltfRuntime
|
103
|
-
* @param id
|
104
|
-
* @param buffer
|
105
|
-
* @param onSuccess
|
106
|
-
* @param onError
|
107
|
-
*/
|
108
|
-
createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
|
109
|
-
/**
|
110
|
-
* Defines an override for loading shader strings
|
111
|
-
* Return true to stop further extensions from loading this shader data
|
112
|
-
* @param gltfRuntime
|
113
|
-
* @param id
|
114
|
-
* @param onSuccess
|
115
|
-
* @param onError
|
116
|
-
*/
|
117
|
-
loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
|
118
|
-
/**
|
119
|
-
* Defines an override for loading materials
|
120
|
-
* Return true to stop further extensions from loading this material
|
121
|
-
* @param gltfRuntime
|
122
|
-
* @param id
|
123
|
-
* @param onSuccess
|
124
|
-
* @param onError
|
125
|
-
*/
|
126
|
-
loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
127
|
-
static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: IGLTFRuntime) => void, onError?: (message: string) => void): void;
|
128
|
-
static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): void;
|
129
|
-
static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
|
130
|
-
static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
|
131
|
-
static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string | ArrayBuffer) => void, onError: (message: string) => void): void;
|
132
|
-
static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
|
133
|
-
private static _LoadTextureBufferAsync;
|
134
|
-
private static _CreateTextureAsync;
|
135
|
-
private static _ApplyExtensions;
|
136
|
-
}
|
1
|
+
import { IGLTFRuntime } from "./glTFLoaderInterfaces";
|
2
|
+
import { Nullable } from "@babylonjs/core/types.js";
|
3
|
+
import { Material } from "@babylonjs/core/Materials/material.js";
|
4
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
5
|
+
import { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
|
6
|
+
import { Scene } from "@babylonjs/core/scene.js";
|
7
|
+
import { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
|
8
|
+
import { AssetContainer } from "@babylonjs/core/assetContainer.js";
|
9
|
+
/**
|
10
|
+
* Implementation of the base glTF spec
|
11
|
+
* @hidden
|
12
|
+
*/
|
13
|
+
export declare class GLTFLoaderBase {
|
14
|
+
static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
|
15
|
+
static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
|
16
|
+
static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void;
|
17
|
+
static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: Nullable<ArrayBufferView>, onSuccess: (texture: Texture) => void): void;
|
18
|
+
static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string | ArrayBuffer) => void, onError?: (message: string) => void): void;
|
19
|
+
static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* glTF V1 Loader
|
23
|
+
* @hidden
|
24
|
+
*/
|
25
|
+
export declare class GLTFLoader implements IGLTFLoader {
|
26
|
+
static Extensions: {
|
27
|
+
[name: string]: GLTFLoaderExtension;
|
28
|
+
};
|
29
|
+
static RegisterExtension(extension: GLTFLoaderExtension): void;
|
30
|
+
dispose(): void;
|
31
|
+
private _importMeshAsync;
|
32
|
+
/**
|
33
|
+
* Imports one or more meshes from a loaded gltf file and adds them to the scene
|
34
|
+
* @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
|
35
|
+
* @param scene the scene the meshes should be added to
|
36
|
+
* @param assetContainer defines the asset container to use (can be null)
|
37
|
+
* @param data gltf data containing information of the meshes in a loaded file
|
38
|
+
* @param rootUrl root url to load from
|
39
|
+
* @param onProgress event that fires when loading progress has occured
|
40
|
+
* @returns a promise containg the loaded meshes, particles, skeletons and animations
|
41
|
+
*/
|
42
|
+
importMeshAsync(meshesNames: any, scene: Scene, assetContainer: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void): Promise<ISceneLoaderAsyncResult>;
|
43
|
+
private _loadAsync;
|
44
|
+
/**
|
45
|
+
* Imports all objects from a loaded gltf file and adds them to the scene
|
46
|
+
* @param scene the scene the objects should be added to
|
47
|
+
* @param data gltf data containing information of the meshes in a loaded file
|
48
|
+
* @param rootUrl root url to load from
|
49
|
+
* @param onProgress event that fires when loading progress has occured
|
50
|
+
* @returns a promise which completes when objects have been loaded to the scene
|
51
|
+
*/
|
52
|
+
loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void): Promise<void>;
|
53
|
+
private _loadShadersAsync;
|
54
|
+
private _loadBuffersAsync;
|
55
|
+
private _createNodes;
|
56
|
+
}
|
57
|
+
/** @hidden */
|
58
|
+
export declare abstract class GLTFLoaderExtension {
|
59
|
+
private _name;
|
60
|
+
constructor(name: string);
|
61
|
+
get name(): string;
|
62
|
+
/**
|
63
|
+
* Defines an override for loading the runtime
|
64
|
+
* Return true to stop further extensions from loading the runtime
|
65
|
+
* @param scene
|
66
|
+
* @param data
|
67
|
+
* @param rootUrl
|
68
|
+
* @param onSuccess
|
69
|
+
* @param onError
|
70
|
+
*/
|
71
|
+
loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: IGLTFRuntime) => void, onError?: (message: string) => void): boolean;
|
72
|
+
/**
|
73
|
+
* Defines an onverride for creating gltf runtime
|
74
|
+
* Return true to stop further extensions from creating the runtime
|
75
|
+
* @param gltfRuntime
|
76
|
+
* @param onSuccess
|
77
|
+
* @param onError
|
78
|
+
*/
|
79
|
+
loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): boolean;
|
80
|
+
/**
|
81
|
+
* Defines an override for loading buffers
|
82
|
+
* Return true to stop further extensions from loading this buffer
|
83
|
+
* @param gltfRuntime
|
84
|
+
* @param id
|
85
|
+
* @param onSuccess
|
86
|
+
* @param onError
|
87
|
+
* @param onProgress
|
88
|
+
*/
|
89
|
+
loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
|
90
|
+
/**
|
91
|
+
* Defines an override for loading texture buffers
|
92
|
+
* Return true to stop further extensions from loading this texture data
|
93
|
+
* @param gltfRuntime
|
94
|
+
* @param id
|
95
|
+
* @param onSuccess
|
96
|
+
* @param onError
|
97
|
+
*/
|
98
|
+
loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
|
99
|
+
/**
|
100
|
+
* Defines an override for creating textures
|
101
|
+
* Return true to stop further extensions from loading this texture
|
102
|
+
* @param gltfRuntime
|
103
|
+
* @param id
|
104
|
+
* @param buffer
|
105
|
+
* @param onSuccess
|
106
|
+
* @param onError
|
107
|
+
*/
|
108
|
+
createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
|
109
|
+
/**
|
110
|
+
* Defines an override for loading shader strings
|
111
|
+
* Return true to stop further extensions from loading this shader data
|
112
|
+
* @param gltfRuntime
|
113
|
+
* @param id
|
114
|
+
* @param onSuccess
|
115
|
+
* @param onError
|
116
|
+
*/
|
117
|
+
loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
|
118
|
+
/**
|
119
|
+
* Defines an override for loading materials
|
120
|
+
* Return true to stop further extensions from loading this material
|
121
|
+
* @param gltfRuntime
|
122
|
+
* @param id
|
123
|
+
* @param onSuccess
|
124
|
+
* @param onError
|
125
|
+
*/
|
126
|
+
loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
127
|
+
static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: IGLTFRuntime) => void, onError?: (message: string) => void): void;
|
128
|
+
static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): void;
|
129
|
+
static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
|
130
|
+
static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
|
131
|
+
static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string | ArrayBuffer) => void, onError: (message: string) => void): void;
|
132
|
+
static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
|
133
|
+
private static _LoadTextureBufferAsync;
|
134
|
+
private static _CreateTextureAsync;
|
135
|
+
private static _ApplyExtensions;
|
136
|
+
}
|