@babylonjs/loaders 5.0.0-rc.7 → 5.0.1
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/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.d.ts +126 -126
- package/OBJ/objFileLoader.js +296 -296
- package/OBJ/objFileLoader.js.map +1 -1
- package/OBJ/objLoadingOptions.d.ts +43 -43
- package/OBJ/objLoadingOptions.js +1 -1
- package/OBJ/objLoadingOptions.js.map +1 -1
- package/OBJ/solidParser.d.ts +154 -154
- package/OBJ/solidParser.js +693 -693
- package/OBJ/solidParser.js.map +1 -1
- 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/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -60
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +136 -136
- package/glTF/1.0/glTFLoader.js +1814 -1815
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
- package/glTF/1.0/glTFLoaderUtils.js +250 -250
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- 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_lights_image_based.js.map +1 -1
- 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_mesh_gpu_instancing.js.map +1 -1
- 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_meshopt_compression.js.map +1 -1
- 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/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- 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_draco_mesh_compression.js.map +1 -1
- 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_lights_punctual.js.map +1 -1
- 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_clearcoat.js.map +1 -1
- 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_emissive_strength.js.map +1 -1
- 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_ior.js.map +1 -1
- 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_pbrSpecularGlossiness.js.map +1 -1
- 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_sheen.js.map +1 -1
- 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_specular.js.map +1 -1
- 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_translucency.js.map +1 -1
- 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_transmission.js.map +1 -1
- 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_unlit.js.map +1 -1
- 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_variants.js.map +1 -1
- 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_materials_volume.js.map +1 -1
- 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_mesh_quantization.js.map +1 -1
- 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_basisu.js.map +1 -1
- 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_texture_transform.js.map +1 -1
- 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/KHR_xmp_json_ld.js.map +1 -1
- 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_audio_emitter.js.map +1 -1
- 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_lod.js.map +1 -1
- 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_minecraftMesh.js.map +1 -1
- 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/MSFT_sRGBFactors.js.map +1 -1
- 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 +406 -405
- package/glTF/2.0/glTFLoader.js +2366 -2366
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
- package/glTF/2.0/glTFLoaderExtension.js +1 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
- package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/2.0/index.d.ts +4 -4
- package/glTF/2.0/index.js +5 -4
- package/glTF/2.0/index.js.map +1 -1
- package/glTF/glTFFileLoader.d.ts +433 -433
- package/glTF/glTFFileLoader.js +927 -927
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -123
- package/glTF/glTFValidation.js.map +1 -1
- package/glTF/index.d.ts +5 -5
- package/glTF/index.js +6 -5
- package/glTF/index.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js +18 -18
- package/legacy/legacy-glTF.js.map +1 -1
- package/legacy/legacy-glTF1.d.ts +2 -2
- package/legacy/legacy-glTF1.js +15 -14
- package/legacy/legacy-glTF1.js.map +1 -1
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF1FileLoader.js +3 -3
- package/legacy/legacy-glTF1FileLoader.js.map +1 -1
- package/legacy/legacy-glTF2.d.ts +2 -2
- package/legacy/legacy-glTF2.js +33 -32
- package/legacy/legacy-glTF2.js.map +1 -1
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.js +3 -3
- package/legacy/legacy-glTF2FileLoader.js.map +1 -1
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -4
- package/legacy/legacy-glTFFileLoader.js.map +1 -1
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js +13 -12
- package/legacy/legacy-objFileLoader.js.map +1 -1
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js +13 -12
- package/legacy/legacy-stlFileLoader.js.map +1 -1
- package/legacy/legacy.d.ts +6 -6
- package/legacy/legacy.js +8 -7
- package/legacy/legacy.js.map +1 -1
- package/license.md +71 -0
- package/package.json +25 -6
package/glTF/2.0/glTFLoader.d.ts
CHANGED
@@ -1,405 +1,406 @@
|
|
1
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
2
|
-
import { Camera } from "@babylonjs/core/Cameras/camera.js";
|
3
|
-
import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
4
|
-
import { Material } from "@babylonjs/core/Materials/material.js";
|
5
|
-
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
6
|
-
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
7
|
-
import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
8
|
-
import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
9
|
-
import { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
|
10
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
11
|
-
import { IProperty } from "babylonjs-gltf2interface";
|
12
|
-
import { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IAnimationChannel, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "./glTFLoaderInterfaces";
|
13
|
-
import { IGLTFLoaderExtension } from "./glTFLoaderExtension";
|
14
|
-
import { IGLTFLoader,
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
*
|
26
|
-
* @param
|
27
|
-
* @param
|
28
|
-
* @
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
*
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
private readonly
|
51
|
-
private
|
52
|
-
private
|
53
|
-
private
|
54
|
-
private
|
55
|
-
private
|
56
|
-
private
|
57
|
-
private
|
58
|
-
private
|
59
|
-
private
|
60
|
-
private
|
61
|
-
private
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
*
|
69
|
-
* @param
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
*
|
75
|
-
* @
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
* @
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
* @param
|
108
|
-
* @param
|
109
|
-
* @param
|
110
|
-
* @param
|
111
|
-
* @param
|
112
|
-
* @param
|
113
|
-
* @
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
* @param
|
119
|
-
* @param
|
120
|
-
* @param
|
121
|
-
* @param
|
122
|
-
* @
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
private
|
127
|
-
private
|
128
|
-
private
|
129
|
-
private
|
130
|
-
private
|
131
|
-
|
132
|
-
|
133
|
-
*
|
134
|
-
* @param
|
135
|
-
* @
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
private
|
140
|
-
private
|
141
|
-
private
|
142
|
-
private
|
143
|
-
private
|
144
|
-
private
|
145
|
-
|
146
|
-
|
147
|
-
*
|
148
|
-
* @param
|
149
|
-
* @param
|
150
|
-
* @
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
* @
|
157
|
-
* @param
|
158
|
-
* @param
|
159
|
-
* @param
|
160
|
-
* @param
|
161
|
-
* @param
|
162
|
-
* @
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
private
|
167
|
-
private
|
168
|
-
private
|
169
|
-
private
|
170
|
-
private
|
171
|
-
private
|
172
|
-
private
|
173
|
-
private
|
174
|
-
private
|
175
|
-
private
|
176
|
-
private
|
177
|
-
|
178
|
-
|
179
|
-
*
|
180
|
-
* @param
|
181
|
-
* @param
|
182
|
-
* @
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
*
|
189
|
-
* @param
|
190
|
-
* @
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
* @
|
196
|
-
* @param
|
197
|
-
* @param
|
198
|
-
* @param
|
199
|
-
* @param
|
200
|
-
* @param
|
201
|
-
* @
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
*
|
208
|
-
* @param
|
209
|
-
* @param
|
210
|
-
* @param
|
211
|
-
* @
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
*
|
217
|
-
* @param
|
218
|
-
* @
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
* @param
|
225
|
-
* @
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
private
|
230
|
-
private
|
231
|
-
private
|
232
|
-
|
233
|
-
|
234
|
-
* @param
|
235
|
-
* @param
|
236
|
-
* @param
|
237
|
-
* @param
|
238
|
-
* @
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
*
|
245
|
-
* @param
|
246
|
-
* @param
|
247
|
-
* @
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
*
|
253
|
-
* @param
|
254
|
-
* @param
|
255
|
-
* @
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
*
|
261
|
-
* @param
|
262
|
-
* @param
|
263
|
-
* @
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
*
|
269
|
-
*
|
270
|
-
* @param
|
271
|
-
* @param
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
*
|
277
|
-
* @param
|
278
|
-
* @param
|
279
|
-
* @
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
* @param
|
285
|
-
* @param
|
286
|
-
* @
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
* @param
|
292
|
-
* @param
|
293
|
-
* @param
|
294
|
-
* @param
|
295
|
-
* @param
|
296
|
-
* @
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
*
|
303
|
-
* @param
|
304
|
-
* @
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
*
|
310
|
-
* @param
|
311
|
-
* @param
|
312
|
-
* @
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
*
|
318
|
-
* @param babylonObject
|
319
|
-
* @param
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
private static
|
326
|
-
private static
|
327
|
-
private static
|
328
|
-
private static
|
329
|
-
private static
|
330
|
-
|
331
|
-
|
332
|
-
* @param
|
333
|
-
* @
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
private
|
338
|
-
private
|
339
|
-
private
|
340
|
-
private
|
341
|
-
private
|
342
|
-
private
|
343
|
-
private
|
344
|
-
private
|
345
|
-
private
|
346
|
-
private
|
347
|
-
private
|
348
|
-
private
|
349
|
-
private
|
350
|
-
private
|
351
|
-
private
|
352
|
-
private
|
353
|
-
private
|
354
|
-
private
|
355
|
-
private
|
356
|
-
private
|
357
|
-
|
358
|
-
|
359
|
-
*
|
360
|
-
* @param
|
361
|
-
* @param
|
362
|
-
* @param
|
363
|
-
* @
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
*
|
369
|
-
* @param
|
370
|
-
* @param
|
371
|
-
* @param
|
372
|
-
* @
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
*
|
378
|
-
* @
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
*
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
*
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
*
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
*
|
403
|
-
|
404
|
-
|
405
|
-
|
1
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import { Camera } from "@babylonjs/core/Cameras/camera.js";
|
3
|
+
import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
4
|
+
import { Material } from "@babylonjs/core/Materials/material.js";
|
5
|
+
import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
6
|
+
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
7
|
+
import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
8
|
+
import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
9
|
+
import type { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
|
10
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
11
|
+
import type { IProperty } from "babylonjs-gltf2interface/.js";
|
12
|
+
import type { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IAnimationChannel, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "./glTFLoaderInterfaces";
|
13
|
+
import type { IGLTFLoaderExtension } from "./glTFLoaderExtension";
|
14
|
+
import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
|
15
|
+
import { GLTFFileLoader } from "../glTFFileLoader";
|
16
|
+
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
17
|
+
import type { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
|
18
|
+
import type { Light } from "@babylonjs/core/Lights/light.js";
|
19
|
+
import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
|
20
|
+
/**
|
21
|
+
* Helper class for working with arrays when loading the glTF asset
|
22
|
+
*/
|
23
|
+
export declare class ArrayItem {
|
24
|
+
/**
|
25
|
+
* Gets an item from the given array.
|
26
|
+
* @param context The context when loading the asset
|
27
|
+
* @param array The array to get the item from
|
28
|
+
* @param index The index to the array
|
29
|
+
* @returns The array item
|
30
|
+
*/
|
31
|
+
static Get<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
|
32
|
+
/**
|
33
|
+
* Assign an `index` field to each item of the given array.
|
34
|
+
* @param array The array of items
|
35
|
+
*/
|
36
|
+
static Assign(array?: IArrItem[]): void;
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* The glTF 2.0 loader
|
40
|
+
*/
|
41
|
+
export declare class GLTFLoader implements IGLTFLoader {
|
42
|
+
/** @hidden */
|
43
|
+
_completePromises: Promise<any>[];
|
44
|
+
/** @hidden */
|
45
|
+
_assetContainer: Nullable<AssetContainer>;
|
46
|
+
/** Storage */
|
47
|
+
_babylonLights: Light[];
|
48
|
+
/** @hidden */
|
49
|
+
_disableInstancedMesh: number;
|
50
|
+
private readonly _parent;
|
51
|
+
private readonly _extensions;
|
52
|
+
private _disposed;
|
53
|
+
private _rootUrl;
|
54
|
+
private _fileName;
|
55
|
+
private _uniqueRootUrl;
|
56
|
+
private _gltf;
|
57
|
+
private _bin;
|
58
|
+
private _babylonScene;
|
59
|
+
private _rootBabylonMesh;
|
60
|
+
private _defaultBabylonMaterialData;
|
61
|
+
private _postSceneLoadActions;
|
62
|
+
private static _RegisteredExtensions;
|
63
|
+
/**
|
64
|
+
* The default glTF sampler.
|
65
|
+
*/
|
66
|
+
static readonly DefaultSampler: ISampler;
|
67
|
+
/**
|
68
|
+
* Registers a loader extension.
|
69
|
+
* @param name The name of the loader extension.
|
70
|
+
* @param factory The factory function that creates the loader extension.
|
71
|
+
*/
|
72
|
+
static RegisterExtension(name: string, factory: (loader: GLTFLoader) => IGLTFLoaderExtension): void;
|
73
|
+
/**
|
74
|
+
* Unregisters a loader extension.
|
75
|
+
* @param name The name of the loader extension.
|
76
|
+
* @returns A boolean indicating whether the extension has been unregistered
|
77
|
+
*/
|
78
|
+
static UnregisterExtension(name: string): boolean;
|
79
|
+
/**
|
80
|
+
* The object that represents the glTF JSON.
|
81
|
+
*/
|
82
|
+
get gltf(): IGLTF;
|
83
|
+
/**
|
84
|
+
* The BIN chunk of a binary glTF.
|
85
|
+
*/
|
86
|
+
get bin(): Nullable<IDataBuffer>;
|
87
|
+
/**
|
88
|
+
* The parent file loader.
|
89
|
+
*/
|
90
|
+
get parent(): GLTFFileLoader;
|
91
|
+
/**
|
92
|
+
* The Babylon scene when loading the asset.
|
93
|
+
*/
|
94
|
+
get babylonScene(): Scene;
|
95
|
+
/**
|
96
|
+
* The root Babylon mesh when loading the asset.
|
97
|
+
*/
|
98
|
+
get rootBabylonMesh(): Nullable<Mesh>;
|
99
|
+
/**
|
100
|
+
* @param parent
|
101
|
+
* @hidden
|
102
|
+
*/
|
103
|
+
constructor(parent: GLTFFileLoader);
|
104
|
+
/** @hidden */
|
105
|
+
dispose(): void;
|
106
|
+
/**
|
107
|
+
* @param meshesNames
|
108
|
+
* @param scene
|
109
|
+
* @param container
|
110
|
+
* @param data
|
111
|
+
* @param rootUrl
|
112
|
+
* @param onProgress
|
113
|
+
* @param fileName
|
114
|
+
* @hidden
|
115
|
+
*/
|
116
|
+
importMeshAsync(meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
117
|
+
/**
|
118
|
+
* @param scene
|
119
|
+
* @param data
|
120
|
+
* @param rootUrl
|
121
|
+
* @param onProgress
|
122
|
+
* @param fileName
|
123
|
+
* @hidden
|
124
|
+
*/
|
125
|
+
loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
126
|
+
private _loadAsync;
|
127
|
+
private _loadData;
|
128
|
+
private _setupData;
|
129
|
+
private _loadExtensions;
|
130
|
+
private _checkExtensions;
|
131
|
+
private _createRootNode;
|
132
|
+
/**
|
133
|
+
* Loads a glTF scene.
|
134
|
+
* @param context The context when loading the asset
|
135
|
+
* @param scene The glTF scene property
|
136
|
+
* @returns A promise that resolves when the load is complete
|
137
|
+
*/
|
138
|
+
loadSceneAsync(context: string, scene: IScene): Promise<void>;
|
139
|
+
private _forEachPrimitive;
|
140
|
+
private _getGeometries;
|
141
|
+
private _getMeshes;
|
142
|
+
private _getTransformNodes;
|
143
|
+
private _getSkeletons;
|
144
|
+
private _getAnimationGroups;
|
145
|
+
private _startAnimations;
|
146
|
+
/**
|
147
|
+
* Loads a glTF node.
|
148
|
+
* @param context The context when loading the asset
|
149
|
+
* @param node The glTF node property
|
150
|
+
* @param assign A function called synchronously after parsing the glTF properties
|
151
|
+
* @returns A promise that resolves with the loaded Babylon mesh when the load is complete
|
152
|
+
*/
|
153
|
+
loadNodeAsync(context: string, node: INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
|
154
|
+
private _loadMeshAsync;
|
155
|
+
/**
|
156
|
+
* @hidden Define this method to modify the default behavior when loading data for mesh primitives.
|
157
|
+
* @param context The context when loading the asset
|
158
|
+
* @param name The mesh name when loading the asset
|
159
|
+
* @param node The glTF node when loading the asset
|
160
|
+
* @param mesh The glTF mesh when loading the asset
|
161
|
+
* @param primitive The glTF mesh primitive property
|
162
|
+
* @param assign A function called synchronously after parsing the glTF properties
|
163
|
+
* @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
|
164
|
+
*/
|
165
|
+
_loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
|
166
|
+
private _loadVertexDataAsync;
|
167
|
+
private _createMorphTargets;
|
168
|
+
private _loadMorphTargetsAsync;
|
169
|
+
private _loadMorphTargetVertexDataAsync;
|
170
|
+
private static _LoadTransform;
|
171
|
+
private _loadSkinAsync;
|
172
|
+
private _loadBones;
|
173
|
+
private _findSkeletonRootNode;
|
174
|
+
private _loadBone;
|
175
|
+
private _loadSkinInverseBindMatricesDataAsync;
|
176
|
+
private _updateBoneMatrices;
|
177
|
+
private _getNodeMatrix;
|
178
|
+
/**
|
179
|
+
* Loads a glTF camera.
|
180
|
+
* @param context The context when loading the asset
|
181
|
+
* @param camera The glTF camera property
|
182
|
+
* @param assign A function called synchronously after parsing the glTF properties
|
183
|
+
* @returns A promise that resolves with the loaded Babylon camera when the load is complete
|
184
|
+
*/
|
185
|
+
loadCameraAsync(context: string, camera: ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
|
186
|
+
private _loadAnimationsAsync;
|
187
|
+
/**
|
188
|
+
* Loads a glTF animation.
|
189
|
+
* @param context The context when loading the asset
|
190
|
+
* @param animation The glTF animation property
|
191
|
+
* @returns A promise that resolves with the loaded Babylon animation group when the load is complete
|
192
|
+
*/
|
193
|
+
loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup>;
|
194
|
+
/**
|
195
|
+
* @hidden Loads a glTF animation channel.
|
196
|
+
* @param context The context when loading the asset
|
197
|
+
* @param animationContext The context of the animation when loading the asset
|
198
|
+
* @param animation The glTF animation property
|
199
|
+
* @param channel The glTF animation channel property
|
200
|
+
* @param babylonAnimationGroup The babylon animation group property
|
201
|
+
* @param animationTargetOverride The babylon animation channel target override property. My be null.
|
202
|
+
* @returns A void promise when the channel load is complete
|
203
|
+
*/
|
204
|
+
_loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
|
205
|
+
private _loadAnimationSamplerAsync;
|
206
|
+
/**
|
207
|
+
* Loads a glTF buffer.
|
208
|
+
* @param context The context when loading the asset
|
209
|
+
* @param buffer The glTF buffer property
|
210
|
+
* @param byteOffset The byte offset to use
|
211
|
+
* @param byteLength The byte length to use
|
212
|
+
* @returns A promise that resolves with the loaded data when the load is complete
|
213
|
+
*/
|
214
|
+
loadBufferAsync(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Promise<ArrayBufferView>;
|
215
|
+
/**
|
216
|
+
* Loads a glTF buffer view.
|
217
|
+
* @param context The context when loading the asset
|
218
|
+
* @param bufferView The glTF buffer view property
|
219
|
+
* @returns A promise that resolves with the loaded data when the load is complete
|
220
|
+
*/
|
221
|
+
loadBufferViewAsync(context: string, bufferView: IBufferView): Promise<ArrayBufferView>;
|
222
|
+
private _loadAccessorAsync;
|
223
|
+
/**
|
224
|
+
* @param context
|
225
|
+
* @param accessor
|
226
|
+
* @hidden
|
227
|
+
*/
|
228
|
+
_loadFloatAccessorAsync(context: string, accessor: IAccessor): Promise<Float32Array>;
|
229
|
+
private _loadIndicesAccessorAsync;
|
230
|
+
private _loadVertexBufferViewAsync;
|
231
|
+
private _loadVertexAccessorAsync;
|
232
|
+
private _loadMaterialMetallicRoughnessPropertiesAsync;
|
233
|
+
/**
|
234
|
+
* @param context
|
235
|
+
* @param material
|
236
|
+
* @param babylonMesh
|
237
|
+
* @param babylonDrawMode
|
238
|
+
* @param assign
|
239
|
+
* @hidden
|
240
|
+
*/
|
241
|
+
_loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
|
242
|
+
private _createDefaultMaterial;
|
243
|
+
/**
|
244
|
+
* Creates a Babylon material from a glTF material.
|
245
|
+
* @param context The context when loading the asset
|
246
|
+
* @param material The glTF material property
|
247
|
+
* @param babylonDrawMode The draw mode for the Babylon material
|
248
|
+
* @returns The Babylon material
|
249
|
+
*/
|
250
|
+
createMaterial(context: string, material: IMaterial, babylonDrawMode: number): Material;
|
251
|
+
/**
|
252
|
+
* Loads properties from a glTF material into a Babylon material.
|
253
|
+
* @param context The context when loading the asset
|
254
|
+
* @param material The glTF material property
|
255
|
+
* @param babylonMaterial The Babylon material
|
256
|
+
* @returns A promise that resolves when the load is complete
|
257
|
+
*/
|
258
|
+
loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
|
259
|
+
/**
|
260
|
+
* Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
|
261
|
+
* @param context The context when loading the asset
|
262
|
+
* @param material The glTF material property
|
263
|
+
* @param babylonMaterial The Babylon material
|
264
|
+
* @returns A promise that resolves when the load is complete
|
265
|
+
*/
|
266
|
+
loadMaterialBasePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
|
267
|
+
/**
|
268
|
+
* Loads the alpha properties from a glTF material into a Babylon material.
|
269
|
+
* Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
|
270
|
+
* @param context The context when loading the asset
|
271
|
+
* @param material The glTF material property
|
272
|
+
* @param babylonMaterial The Babylon material
|
273
|
+
*/
|
274
|
+
loadMaterialAlphaProperties(context: string, material: IMaterial, babylonMaterial: Material): void;
|
275
|
+
/**
|
276
|
+
* Loads a glTF texture info.
|
277
|
+
* @param context The context when loading the asset
|
278
|
+
* @param textureInfo The glTF texture info property
|
279
|
+
* @param assign A function called synchronously after parsing the glTF properties
|
280
|
+
* @returns A promise that resolves with the loaded Babylon texture when the load is complete
|
281
|
+
*/
|
282
|
+
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
283
|
+
/**
|
284
|
+
* @param context
|
285
|
+
* @param texture
|
286
|
+
* @param assign
|
287
|
+
* @hidden
|
288
|
+
*/
|
289
|
+
_loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
290
|
+
/**
|
291
|
+
* @param context
|
292
|
+
* @param sampler
|
293
|
+
* @param image
|
294
|
+
* @param assign
|
295
|
+
* @param textureLoaderOptions
|
296
|
+
* @param useSRGBBuffer
|
297
|
+
* @hidden
|
298
|
+
*/
|
299
|
+
_createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void, textureLoaderOptions?: any, useSRGBBuffer?: boolean): Promise<BaseTexture>;
|
300
|
+
private _loadSampler;
|
301
|
+
/**
|
302
|
+
* Loads a glTF image.
|
303
|
+
* @param context The context when loading the asset
|
304
|
+
* @param image The glTF image property
|
305
|
+
* @returns A promise that resolves with the loaded data when the load is complete
|
306
|
+
*/
|
307
|
+
loadImageAsync(context: string, image: IImage): Promise<ArrayBufferView>;
|
308
|
+
/**
|
309
|
+
* Loads a glTF uri.
|
310
|
+
* @param context The context when loading the asset
|
311
|
+
* @param property The glTF property associated with the uri
|
312
|
+
* @param uri The base64 or relative uri
|
313
|
+
* @returns A promise that resolves with the loaded data when the load is complete
|
314
|
+
*/
|
315
|
+
loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
|
316
|
+
/**
|
317
|
+
* Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
|
318
|
+
* @param babylonObject the Babylon object with metadata
|
319
|
+
* @param babylonObject.metadata
|
320
|
+
* @param pointer the JSON pointer
|
321
|
+
*/
|
322
|
+
static AddPointerMetadata(babylonObject: {
|
323
|
+
metadata: any;
|
324
|
+
}, pointer: string): void;
|
325
|
+
private static _GetTextureWrapMode;
|
326
|
+
private static _GetTextureSamplingMode;
|
327
|
+
private static _GetTypedArrayConstructor;
|
328
|
+
private static _GetTypedArray;
|
329
|
+
private static _GetNumComponents;
|
330
|
+
private static _ValidateUri;
|
331
|
+
/**
|
332
|
+
* @param context
|
333
|
+
* @param mode
|
334
|
+
* @hidden
|
335
|
+
*/
|
336
|
+
static _GetDrawMode(context: string, mode: number | undefined): number;
|
337
|
+
private _compileMaterialsAsync;
|
338
|
+
private _compileShadowGeneratorsAsync;
|
339
|
+
private _forEachExtensions;
|
340
|
+
private _applyExtensions;
|
341
|
+
private _extensionsOnLoading;
|
342
|
+
private _extensionsOnReady;
|
343
|
+
private _extensionsLoadSceneAsync;
|
344
|
+
private _extensionsLoadNodeAsync;
|
345
|
+
private _extensionsLoadCameraAsync;
|
346
|
+
private _extensionsLoadVertexDataAsync;
|
347
|
+
private _extensionsLoadMeshPrimitiveAsync;
|
348
|
+
private _extensionsLoadMaterialAsync;
|
349
|
+
private _extensionsCreateMaterial;
|
350
|
+
private _extensionsLoadMaterialPropertiesAsync;
|
351
|
+
private _extensionsLoadTextureInfoAsync;
|
352
|
+
private _extensionsLoadTextureAsync;
|
353
|
+
private _extensionsLoadAnimationAsync;
|
354
|
+
private _extensionsLoadSkinAsync;
|
355
|
+
private _extensionsLoadUriAsync;
|
356
|
+
private _extensionsLoadBufferViewAsync;
|
357
|
+
private _extensionsLoadBufferAsync;
|
358
|
+
/**
|
359
|
+
* Helper method called by a loader extension to load an glTF extension.
|
360
|
+
* @param context The context when loading the asset
|
361
|
+
* @param property The glTF property to load the extension from
|
362
|
+
* @param extensionName The name of the extension to load
|
363
|
+
* @param actionAsync The action to run
|
364
|
+
* @returns The promise returned by actionAsync or null if the extension does not exist
|
365
|
+
*/
|
366
|
+
static LoadExtensionAsync<TExtension = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extensionContext: string, extension: TExtension) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
|
367
|
+
/**
|
368
|
+
* Helper method called by a loader extension to load a glTF extra.
|
369
|
+
* @param context The context when loading the asset
|
370
|
+
* @param property The glTF property to load the extra from
|
371
|
+
* @param extensionName The name of the extension to load
|
372
|
+
* @param actionAsync The action to run
|
373
|
+
* @returns The promise returned by actionAsync or null if the extra does not exist
|
374
|
+
*/
|
375
|
+
static LoadExtraAsync<TExtra = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extraContext: string, extra: TExtra) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
|
376
|
+
/**
|
377
|
+
* Checks for presence of an extension.
|
378
|
+
* @param name The name of the extension to check
|
379
|
+
* @returns A boolean indicating the presence of the given extension name in `extensionsUsed`
|
380
|
+
*/
|
381
|
+
isExtensionUsed(name: string): boolean;
|
382
|
+
/**
|
383
|
+
* Increments the indentation level and logs a message.
|
384
|
+
* @param message The message to log
|
385
|
+
*/
|
386
|
+
logOpen(message: string): void;
|
387
|
+
/**
|
388
|
+
* Decrements the indentation level.
|
389
|
+
*/
|
390
|
+
logClose(): void;
|
391
|
+
/**
|
392
|
+
* Logs a message
|
393
|
+
* @param message The message to log
|
394
|
+
*/
|
395
|
+
log(message: string): void;
|
396
|
+
/**
|
397
|
+
* Starts a performance counter.
|
398
|
+
* @param counterName The name of the performance counter
|
399
|
+
*/
|
400
|
+
startPerformanceCounter(counterName: string): void;
|
401
|
+
/**
|
402
|
+
* Ends a performance counter.
|
403
|
+
* @param counterName The name of the performance counter
|
404
|
+
*/
|
405
|
+
endPerformanceCounter(counterName: string): void;
|
406
|
+
}
|