babylonjs-loaders 8.23.1 → 8.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -168,88 +168,102 @@ declare module BABYLON {
168
168
  */
169
169
  abstract onParsed?: ((loaderData: IGLTFLoaderData) => void) | undefined;
170
170
  /**
171
- * The coordinate system mode. Defaults to AUTO.
172
- */
173
- coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
174
- /**
175
- * The animation start mode. Defaults to FIRST.
171
+ * Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
176
172
  */
177
- animationStartMode: GLTFLoaderAnimationStartMode;
173
+ alwaysComputeBoundingBox: boolean;
178
174
  /**
179
- * Defines if the loader should load node animations. Defaults to true.
180
- * NOTE: The animation of this node will still load if the node is also a joint of a skin and `loadSkins` is true.
175
+ * Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using `skin.skeleton`. Defaults to false.
176
+ * Set this to true if loading assets with invalid `skin.skeleton` values.
181
177
  */
182
- loadNodeAnimations: boolean;
178
+ alwaysComputeSkeletonRootNode: boolean;
183
179
  /**
184
- * Defines if the loader should load skins. Defaults to true.
180
+ * The animation start mode. Defaults to FIRST.
185
181
  */
186
- loadSkins: boolean;
182
+ animationStartMode: GLTFLoaderAnimationStartMode;
187
183
  /**
188
- * Defines if the loader should load morph targets. Defaults to true.
184
+ * Defines if the loader should capture performance counters.
189
185
  */
190
- loadMorphTargets: boolean;
186
+ abstract capturePerformanceCounters: boolean;
191
187
  /**
192
188
  * Defines if the loader should compile materials before raising the success callback. Defaults to false.
193
189
  */
194
190
  compileMaterials: boolean;
195
- /**
196
- * Defines if the loader should also compile materials with clip planes. Defaults to false.
197
- */
198
- useClipPlane: boolean;
199
191
  /**
200
192
  * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
201
193
  */
202
194
  compileShadowGenerators: boolean;
203
195
  /**
204
- * Defines if the Alpha blended materials are only applied as coverage.
205
- * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
206
- * If true, no extra effects are applied to transparent pixels.
207
- */
208
- transparencyAsCoverage: boolean;
209
- /**
210
- * Defines if the loader should use range requests when load binary glTF files from HTTP.
211
- * Enabling will disable offline support and glTF validator.
212
- * Defaults to false.
196
+ * The coordinate system mode. Defaults to AUTO.
213
197
  */
214
- useRangeRequests: boolean;
198
+ coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
215
199
  /**
216
200
  * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
217
201
  */
218
202
  createInstances: boolean;
219
203
  /**
220
- * Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
204
+ * Defines the node to use as the root of the hierarchy when loading the scene (default: undefined). If not defined, a root node will be automatically created.
205
+ * You can also pass null if you don't want a root node to be created.
221
206
  */
222
- alwaysComputeBoundingBox: boolean;
207
+ customRootNode?: Nullable<TransformNode>;
208
+ /**
209
+ * Defines options for glTF extensions.
210
+ */
211
+ extensionOptions: {
212
+ [Extension in keyof GLTFLoaderExtensionOptions]?: {
213
+ [Option in keyof DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>]: DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>[Option];
214
+ };
215
+ };
223
216
  /**
224
217
  * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
225
218
  */
226
219
  loadAllMaterials: boolean;
220
+ /**
221
+ * Defines if the loader should load morph targets. Defaults to true.
222
+ */
223
+ loadMorphTargets: boolean;
224
+ /**
225
+ * Defines if the loader should load node animations. Defaults to true.
226
+ * NOTE: The animation of this node will still load if the node is also a joint of a skin and `loadSkins` is true.
227
+ */
228
+ loadNodeAnimations: boolean;
227
229
  /**
228
230
  * If true, load only the materials defined in the file. Defaults to false.
229
231
  */
230
232
  loadOnlyMaterials: boolean;
231
233
  /**
232
- * If true, do not load any materials defined in the file. Defaults to false.
234
+ * Defines if the loader should load skins. Defaults to true.
233
235
  */
234
- skipMaterials: boolean;
236
+ loadSkins: boolean;
235
237
  /**
236
- * If true, load the color (gamma encoded) textures into sRGB buffers (if supported by the GPU), which will yield more accurate results when sampling the texture. Defaults to true.
238
+ * If true, enable logging for the loader. Defaults to false.
237
239
  */
238
- useSRGBBuffers: boolean;
240
+ abstract loggingEnabled: boolean;
239
241
  /**
240
- * When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.
242
+ * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
241
243
  */
242
- targetFps: number;
244
+ abstract onCameraLoaded?: (camera: Camera) => void;
243
245
  /**
244
- * Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using `skin.skeleton`. Defaults to false.
245
- * Set this to true if loading assets with invalid `skin.skeleton` values.
246
+ * Callback raised when the loader creates a material after parsing the glTF properties of the material.
246
247
  */
247
- alwaysComputeSkeletonRootNode: boolean;
248
+ abstract onMaterialLoaded?: (material: Material) => void;
248
249
  /**
249
- * If true, the loader will derive the name for Babylon textures from the glTF texture name, image name, or image url. Defaults to false.
250
- * Note that it is possible for multiple Babylon textures to share the same name when the Babylon textures load from the same glTF texture or image.
250
+ * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
251
+ * Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
251
252
  */
252
- useGltfTextureNames: boolean;
253
+ abstract onMeshLoaded?: (mesh: AbstractMesh) => void;
254
+ /**
255
+ * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.
256
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh
257
+ */
258
+ abstract onSkinLoaded?: (node: TransformNode, skinnedNode: TransformNode) => void;
259
+ /**
260
+ * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
261
+ */
262
+ abstract onTextureLoaded?: (texture: BaseTexture) => void;
263
+ /**
264
+ * Callback raised after the asset is validated.
265
+ */
266
+ abstract onValidated?: (results: GLTF2.IGLTFValidationResults) => void;
253
267
  /**
254
268
  * Function called before loading a url referenced by the asset.
255
269
  * @param url url referenced by the asset
@@ -257,40 +271,42 @@ declare module BABYLON {
257
271
  */
258
272
  preprocessUrlAsync: (url: string) => Promise<string>;
259
273
  /**
260
- * Defines the node to use as the root of the hierarchy when loading the scene (default: undefined). If not defined, a root node will be automatically created.
261
- * You can also pass null if you don't want a root node to be created.
274
+ * If true, do not load any materials defined in the file. Defaults to false.
262
275
  */
263
- customRootNode?: Nullable<TransformNode>;
276
+ skipMaterials: boolean;
264
277
  /**
265
- * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
266
- * Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
278
+ * When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.
267
279
  */
268
- abstract onMeshLoaded?: ((mesh: AbstractMesh) => void) | undefined;
280
+ targetFps: number;
269
281
  /**
270
- * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.
271
- * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh
282
+ * Defines if the Alpha blended materials are only applied as coverage.
283
+ * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
284
+ * If true, no extra effects are applied to transparent pixels.
272
285
  */
273
- abstract onSkinLoaded?: ((node: TransformNode, skinnedNode: TransformNode) => void) | undefined;
286
+ transparencyAsCoverage: boolean;
274
287
  /**
275
- * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
288
+ * Defines if the loader should also compile materials with clip planes. Defaults to false.
276
289
  */
277
- abstract onTextureLoaded?: ((texture: BaseTexture) => void) | undefined;
290
+ useClipPlane: boolean;
278
291
  /**
279
- * Callback raised when the loader creates a material after parsing the glTF properties of the material.
292
+ * If true, the loader will derive the name for Babylon textures from the glTF texture name, image name, or image url. Defaults to false.
293
+ * Note that it is possible for multiple Babylon textures to share the same name when the Babylon textures load from the same glTF texture or image.
280
294
  */
281
- abstract onMaterialLoaded?: ((material: Material) => void) | undefined;
295
+ useGltfTextureNames: boolean;
282
296
  /**
283
- * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
297
+ * Defines if the loader should use range requests when load binary glTF files from HTTP.
298
+ * Enabling will disable offline support and glTF validator.
299
+ * Defaults to false.
284
300
  */
285
- abstract onCameraLoaded?: ((camera: Camera) => void) | undefined;
301
+ useRangeRequests: boolean;
286
302
  /**
287
- * Defines options for glTF extensions.
303
+ * If true, load the color (gamma encoded) textures into sRGB buffers (if supported by the GPU), which will yield more accurate results when sampling the texture. Defaults to true.
288
304
  */
289
- extensionOptions: {
290
- [Extension in keyof GLTFLoaderExtensionOptions]?: {
291
- [Option in keyof DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>]: DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>[Option];
292
- };
293
- };
305
+ useSRGBBuffers: boolean;
306
+ /**
307
+ * Defines if the loader should validate the asset.
308
+ */
309
+ validate: boolean;
294
310
  }
295
311
  /**
296
312
  * File loader for loading glTF files into a scene.
@@ -432,17 +448,13 @@ declare module BABYLON {
432
448
  */
433
449
  get capturePerformanceCounters(): boolean;
434
450
  set capturePerformanceCounters(value: boolean);
435
- /**
436
- * Defines if the loader should validate the asset.
437
- */
438
- validate: boolean;
439
451
  /**
440
452
  * Observable raised after validation when validate is set to true. The event data is the result of the validation.
441
453
  */
442
454
  readonly onValidatedObservable: Observable<GLTF2.IGLTFValidationResults>;
443
455
  private _onValidatedObserver;
444
456
  /**
445
- * Callback raised after a loader extension is created.
457
+ * Callback raised after the asset is validated.
446
458
  */
447
459
  set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void);
448
460
  private _loader;