@babylonjs/loaders 5.0.0-rc.3 → 5.0.0-rc.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. package/OBJ/index.js.map +1 -1
  2. package/OBJ/mtlFileLoader.d.ts +7 -6
  3. package/OBJ/mtlFileLoader.js +15 -14
  4. package/OBJ/mtlFileLoader.js.map +1 -1
  5. package/OBJ/objFileLoader.d.ts +11 -18
  6. package/OBJ/objFileLoader.js +19 -23
  7. package/OBJ/objFileLoader.js.map +1 -1
  8. package/OBJ/objLoadingOptions.d.ts +1 -1
  9. package/OBJ/objLoadingOptions.js.map +1 -1
  10. package/OBJ/solidParser.d.ts +6 -5
  11. package/OBJ/solidParser.js +15 -21
  12. package/OBJ/solidParser.js.map +1 -1
  13. package/STL/index.js.map +1 -1
  14. package/STL/stlFileLoader.d.ts +7 -14
  15. package/STL/stlFileLoader.js +15 -21
  16. package/STL/stlFileLoader.js.map +1 -1
  17. package/glTF/1.0/glTFBinaryExtension.d.ts +4 -4
  18. package/glTF/1.0/glTFBinaryExtension.js +4 -5
  19. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  20. package/glTF/1.0/glTFLoader.d.ts +80 -50
  21. package/glTF/1.0/glTFLoader.js +265 -146
  22. package/glTF/1.0/glTFLoader.js.map +1 -1
  23. package/glTF/1.0/glTFLoaderInterfaces.d.ts +10 -10
  24. package/glTF/1.0/glTFLoaderInterfaces.js +3 -3
  25. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderUtils.d.ts +25 -25
  27. package/glTF/1.0/glTFLoaderUtils.js +70 -52
  28. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  29. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +2 -2
  30. package/glTF/1.0/glTFMaterialsCommonExtension.js +13 -11
  31. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  32. package/glTF/1.0/index.js.map +1 -1
  33. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +11 -4
  34. package/glTF/2.0/Extensions/EXT_lights_image_based.js +9 -2
  35. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  36. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +13 -5
  37. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +12 -4
  38. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  39. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +10 -3
  40. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +10 -3
  41. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  42. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +12 -4
  43. package/glTF/2.0/Extensions/EXT_texture_webp.js +11 -3
  44. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  45. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +26 -8
  46. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +22 -4
  47. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  48. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +14 -6
  49. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +17 -6
  50. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  51. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +12 -4
  52. package/glTF/2.0/Extensions/KHR_lights_punctual.js +11 -3
  53. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  54. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +12 -4
  55. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +10 -2
  56. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  57. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +12 -4
  58. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +10 -2
  59. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  60. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +12 -4
  61. package/glTF/2.0/Extensions/KHR_materials_ior.js +10 -2
  62. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  63. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +12 -4
  64. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +10 -2
  65. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  66. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +12 -4
  67. package/glTF/2.0/Extensions/KHR_materials_sheen.js +11 -3
  68. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  69. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +12 -4
  70. package/glTF/2.0/Extensions/KHR_materials_specular.js +11 -3
  71. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  72. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +12 -4
  73. package/glTF/2.0/Extensions/KHR_materials_translucency.js +11 -4
  74. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  75. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +12 -4
  76. package/glTF/2.0/Extensions/KHR_materials_transmission.js +24 -13
  77. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  78. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +12 -4
  79. package/glTF/2.0/Extensions/KHR_materials_unlit.js +10 -2
  80. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  81. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +17 -6
  82. package/glTF/2.0/Extensions/KHR_materials_variants.js +19 -8
  83. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  84. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +12 -4
  85. package/glTF/2.0/Extensions/KHR_materials_volume.js +12 -5
  86. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  87. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +4 -1
  88. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +5 -3
  89. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  90. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +12 -4
  91. package/glTF/2.0/Extensions/KHR_texture_basisu.js +11 -3
  92. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  93. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +12 -4
  94. package/glTF/2.0/Extensions/KHR_texture_transform.js +10 -2
  95. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  96. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +4 -1
  97. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +4 -1
  98. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  99. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +23 -7
  100. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +38 -14
  101. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  102. package/glTF/2.0/Extensions/MSFT_lod.d.ts +45 -11
  103. package/glTF/2.0/Extensions/MSFT_lod.js +44 -8
  104. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  105. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +2 -2
  106. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  107. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +2 -2
  108. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  109. package/glTF/2.0/Extensions/index.js.map +1 -1
  110. package/glTF/2.0/glTFLoader.d.ts +70 -22
  111. package/glTF/2.0/glTFLoader.js +180 -93
  112. package/glTF/2.0/glTFLoader.js.map +1 -1
  113. package/glTF/2.0/glTFLoaderExtension.d.ts +11 -11
  114. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  115. package/glTF/2.0/glTFLoaderInterfaces.d.ts +7 -7
  116. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  117. package/glTF/2.0/index.js.map +1 -1
  118. package/glTF/glTFFileLoader.d.ts +87 -27
  119. package/glTF/glTFFileLoader.js +102 -45
  120. package/glTF/glTFFileLoader.js.map +1 -1
  121. package/glTF/glTFValidation.d.ts +1 -1
  122. package/glTF/glTFValidation.js +12 -12
  123. package/glTF/glTFValidation.js.map +1 -1
  124. package/glTF/index.js.map +1 -1
  125. package/index.js.map +1 -1
  126. package/legacy/legacy-glTF.d.ts +2 -2
  127. package/legacy/legacy-glTF.js +5 -5
  128. package/legacy/legacy-glTF.js.map +1 -1
  129. package/legacy/legacy-glTF1.d.ts +1 -1
  130. package/legacy/legacy-glTF1.js +2 -2
  131. package/legacy/legacy-glTF1.js.map +1 -1
  132. package/legacy/legacy-glTF1FileLoader.js +1 -0
  133. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  134. package/legacy/legacy-glTF2.d.ts +1 -1
  135. package/legacy/legacy-glTF2.js +11 -11
  136. package/legacy/legacy-glTF2.js.map +1 -1
  137. package/legacy/legacy-glTF2FileLoader.js +1 -0
  138. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  139. package/legacy/legacy-glTFFileLoader.js +1 -0
  140. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  141. package/legacy/legacy-objFileLoader.d.ts +1 -1
  142. package/legacy/legacy-objFileLoader.js +3 -3
  143. package/legacy/legacy-objFileLoader.js.map +1 -1
  144. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  145. package/legacy/legacy-stlFileLoader.js +3 -3
  146. package/legacy/legacy-stlFileLoader.js.map +1 -1
  147. package/legacy/legacy.d.ts +1 -1
  148. package/legacy/legacy.js +2 -1
  149. package/legacy/legacy.js.map +1 -1
  150. package/package.json +23 -198
  151. package/readme.md +2 -2
@@ -1,6 +1,6 @@
1
1
  import { Observable } from "@babylonjs/core/Misc/observable.js";
2
2
  import { Tools } from "@babylonjs/core/Misc/tools.js";
3
- import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader.js";
3
+ import { SceneLoader, } from "@babylonjs/core/Loading/sceneLoader.js";
4
4
  import { AssetContainer } from "@babylonjs/core/assetContainer.js";
5
5
  import { Logger } from "@babylonjs/core/Misc/logger.js";
6
6
  import { DataReader } from "@babylonjs/core/Misc/dataReader.js";
@@ -86,8 +86,8 @@ var GLTFFileLoader = /** @class */ (function () {
86
86
  */
87
87
  this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
88
88
  /**
89
- * The animation start mode. Defaults to FIRST.
90
- */
89
+ * The animation start mode. Defaults to FIRST.
90
+ */
91
91
  this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
92
92
  /**
93
93
  * Defines if the loader should compile materials before raising the success callback. Defaults to false.
@@ -125,6 +125,14 @@ var GLTFFileLoader = /** @class */ (function () {
125
125
  * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
126
126
  */
127
127
  this.loadAllMaterials = false;
128
+ /**
129
+ * If true, load only the materials defined in the file. Defaults to false.
130
+ */
131
+ this.loadOnlyMaterials = false;
132
+ /**
133
+ * If true, do not load any materials defined in the file. Defaults to false.
134
+ */
135
+ this.skipMaterials = false;
128
136
  /**
129
137
  * 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.
130
138
  */
@@ -139,8 +147,9 @@ var GLTFFileLoader = /** @class */ (function () {
139
147
  */
140
148
  this.alwaysComputeSkeletonRootNode = false;
141
149
  /**
142
- * Function called before loading a url referenced by the asset.
143
- */
150
+ * Function called before loading a url referenced by the asset.
151
+ * @param url
152
+ */
144
153
  this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
145
154
  /**
146
155
  * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
@@ -196,7 +205,7 @@ var GLTFFileLoader = /** @class */ (function () {
196
205
  /** @hidden */
197
206
  this.extensions = {
198
207
  ".gltf": { isBinary: false },
199
- ".glb": { isBinary: true }
208
+ ".glb": { isBinary: true },
200
209
  };
201
210
  /**
202
211
  * Observable raised when the loader state changes.
@@ -415,7 +424,15 @@ var GLTFFileLoader = /** @class */ (function () {
415
424
  this.onDisposeObservable.notifyObservers(undefined);
416
425
  this.onDisposeObservable.clear();
417
426
  };
418
- /** @hidden */
427
+ /**
428
+ * @param scene
429
+ * @param fileOrUrl
430
+ * @param onSuccess
431
+ * @param onProgress
432
+ * @param useArrayBuffer
433
+ * @param onError
434
+ * @hidden
435
+ */
419
436
  GLTFFileLoader.prototype.loadFile = function (scene, fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError) {
420
437
  var _this = this;
421
438
  this._progressCallback = onProgress;
@@ -428,7 +445,7 @@ var GLTFFileLoader = /** @class */ (function () {
428
445
  }
429
446
  var fileRequest_1 = {
430
447
  abort: function () { },
431
- onCompleteObservable: new Observable()
448
+ onCompleteObservable: new Observable(),
432
449
  };
433
450
  var dataBuffer = {
434
451
  readAsync: function (byteOffset, byteLength) {
@@ -442,7 +459,7 @@ var GLTFFileLoader = /** @class */ (function () {
442
459
  });
443
460
  });
444
461
  },
445
- byteLength: 0
462
+ byteLength: 0,
446
463
  };
447
464
  this._unpackBinaryAsync(new DataReader(dataBuffer)).then(function (loaderData) {
448
465
  fileRequest_1.onCompleteObservable.notifyObservers(fileRequest_1);
@@ -454,7 +471,7 @@ var GLTFFileLoader = /** @class */ (function () {
454
471
  _this._validate(scene, data, rootUrl, fileName);
455
472
  _this._unpackBinaryAsync(new DataReader({
456
473
  readAsync: function (byteOffset, byteLength) { return readAsync(data, byteOffset, byteLength); },
457
- byteLength: data.byteLength
474
+ byteLength: data.byteLength,
458
475
  })).then(function (loaderData) {
459
476
  onSuccess(loaderData);
460
477
  }, onError ? function (error) { return onError(undefined, error); } : undefined);
@@ -465,7 +482,15 @@ var GLTFFileLoader = /** @class */ (function () {
465
482
  onSuccess({ json: _this._parseJson(data) });
466
483
  }, useArrayBuffer, onError);
467
484
  };
468
- /** @hidden */
485
+ /**
486
+ * @param meshesNames
487
+ * @param scene
488
+ * @param data
489
+ * @param rootUrl
490
+ * @param onProgress
491
+ * @param fileName
492
+ * @hidden
493
+ */
469
494
  GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
470
495
  var _this = this;
471
496
  return Promise.resolve().then(function () {
@@ -476,7 +501,14 @@ var GLTFFileLoader = /** @class */ (function () {
476
501
  return _this._loader.importMeshAsync(meshesNames, scene, null, data, rootUrl, onProgress, fileName);
477
502
  });
478
503
  };
479
- /** @hidden */
504
+ /**
505
+ * @param scene
506
+ * @param data
507
+ * @param rootUrl
508
+ * @param onProgress
509
+ * @param fileName
510
+ * @hidden
511
+ */
480
512
  GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
481
513
  var _this = this;
482
514
  return Promise.resolve().then(function () {
@@ -487,7 +519,14 @@ var GLTFFileLoader = /** @class */ (function () {
487
519
  return _this._loader.loadAsync(scene, data, rootUrl, onProgress, fileName);
488
520
  });
489
521
  };
490
- /** @hidden */
522
+ /**
523
+ * @param scene
524
+ * @param data
525
+ * @param rootUrl
526
+ * @param onProgress
527
+ * @param fileName
528
+ * @hidden
529
+ */
491
530
  GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress, fileName) {
492
531
  var _this = this;
493
532
  return Promise.resolve().then(function () {
@@ -525,25 +564,32 @@ var GLTFFileLoader = /** @class */ (function () {
525
564
  });
526
565
  });
527
566
  };
528
- /** @hidden */
567
+ /**
568
+ * @param data
569
+ * @hidden
570
+ */
529
571
  GLTFFileLoader.prototype.canDirectLoad = function (data) {
530
- return (data.indexOf("asset") !== -1 && data.indexOf("version") !== -1)
531
- || StringTools.StartsWith(data, "data:base64," + GLTFFileLoader.magicBase64Encoded) // this is technically incorrect, but will continue to support for backcompat.
532
- || StringTools.StartsWith(data, "data:;base64," + GLTFFileLoader.magicBase64Encoded)
533
- || StringTools.StartsWith(data, "data:application/octet-stream;base64," + GLTFFileLoader.magicBase64Encoded)
534
- || StringTools.StartsWith(data, "data:model/gltf-binary;base64," + GLTFFileLoader.magicBase64Encoded);
572
+ return ((data.indexOf("asset") !== -1 && data.indexOf("version") !== -1) ||
573
+ StringTools.StartsWith(data, "data:base64," + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
574
+ StringTools.StartsWith(data, "data:;base64," + GLTFFileLoader._MagicBase64Encoded) ||
575
+ StringTools.StartsWith(data, "data:application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) ||
576
+ StringTools.StartsWith(data, "data:model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded));
535
577
  };
536
- /** @hidden */
578
+ /**
579
+ * @param scene
580
+ * @param data
581
+ * @hidden
582
+ */
537
583
  GLTFFileLoader.prototype.directLoad = function (scene, data) {
538
- if (StringTools.StartsWith(data, "base64," + GLTFFileLoader.magicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
539
- StringTools.StartsWith(data, ";base64," + GLTFFileLoader.magicBase64Encoded) ||
540
- StringTools.StartsWith(data, "application/octet-stream;base64," + GLTFFileLoader.magicBase64Encoded) ||
541
- StringTools.StartsWith(data, "model/gltf-binary;base64," + GLTFFileLoader.magicBase64Encoded)) {
584
+ if (StringTools.StartsWith(data, "base64," + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
585
+ StringTools.StartsWith(data, ";base64," + GLTFFileLoader._MagicBase64Encoded) ||
586
+ StringTools.StartsWith(data, "application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) ||
587
+ StringTools.StartsWith(data, "model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded)) {
542
588
  var arrayBuffer_1 = DecodeBase64UrlToBinary(data);
543
589
  this._validate(scene, arrayBuffer_1);
544
590
  return this._unpackBinaryAsync(new DataReader({
545
591
  readAsync: function (byteOffset, byteLength) { return readAsync(arrayBuffer_1, byteOffset, byteLength); },
546
- byteLength: arrayBuffer_1.byteLength
592
+ byteLength: arrayBuffer_1.byteLength,
547
593
  }));
548
594
  }
549
595
  this._validate(scene, data);
@@ -578,7 +624,10 @@ var GLTFFileLoader = /** @class */ (function () {
578
624
  });
579
625
  });
580
626
  };
581
- /** @hidden */
627
+ /**
628
+ * @param state
629
+ * @hidden
630
+ */
582
631
  GLTFFileLoader.prototype._setState = function (state) {
583
632
  if (this._state === state) {
584
633
  return;
@@ -587,7 +636,15 @@ var GLTFFileLoader = /** @class */ (function () {
587
636
  this.onLoaderStateChangedObservable.notifyObservers(this._state);
588
637
  this._log(GLTFLoaderState[this._state]);
589
638
  };
590
- /** @hidden */
639
+ /**
640
+ * @param scene
641
+ * @param fileOrUrl
642
+ * @param onSuccess
643
+ * @param useArrayBuffer
644
+ * @param onError
645
+ * @param onOpened
646
+ * @hidden
647
+ */
591
648
  GLTFFileLoader.prototype._loadFile = function (scene, fileOrUrl, onSuccess, useArrayBuffer, onError, onOpened) {
592
649
  var _this = this;
593
650
  var request = scene._loadFile(fileOrUrl, onSuccess, function (event) {
@@ -621,7 +678,7 @@ var GLTFFileLoader = /** @class */ (function () {
621
678
  this._progressCallback({
622
679
  lengthComputable: lengthComputable,
623
680
  loaded: loaded,
624
- total: lengthComputable ? total : 0
681
+ total: lengthComputable ? total : 0,
625
682
  });
626
683
  };
627
684
  GLTFFileLoader.prototype._validate = function (scene, data, rootUrl, fileName) {
@@ -664,7 +721,7 @@ var GLTFFileLoader = /** @class */ (function () {
664
721
  }
665
722
  var createLoaders = {
666
723
  1: GLTFFileLoader._CreateGLTF1Loader,
667
- 2: GLTFFileLoader._CreateGLTF2Loader
724
+ 2: GLTFFileLoader._CreateGLTF2Loader,
668
725
  };
669
726
  var createLoader = createLoaders[version.major];
670
727
  if (!createLoader) {
@@ -685,7 +742,7 @@ var GLTFFileLoader = /** @class */ (function () {
685
742
  // Read magic + version + length + json length + json format
686
743
  return dataReader.loadAsync(20).then(function () {
687
744
  var Binary = {
688
- Magic: 0x46546C67
745
+ Magic: 0x46546c67,
689
746
  };
690
747
  var magic = dataReader.readUint32();
691
748
  if (magic !== Binary.Magic) {
@@ -719,7 +776,7 @@ var GLTFFileLoader = /** @class */ (function () {
719
776
  };
720
777
  GLTFFileLoader.prototype._unpackBinaryV1Async = function (dataReader, length) {
721
778
  var ContentFormat = {
722
- JSON: 0
779
+ JSON: 0,
723
780
  };
724
781
  var contentLength = dataReader.readUint32();
725
782
  var contentFormat = dataReader.readUint32();
@@ -732,7 +789,7 @@ var GLTFFileLoader = /** @class */ (function () {
732
789
  var startByteOffset_1 = dataReader.byteOffset;
733
790
  data.bin = {
734
791
  readAsync: function (byteOffset, byteLength) { return dataReader.buffer.readAsync(startByteOffset_1 + byteOffset, byteLength); },
735
- byteLength: bodyLength
792
+ byteLength: bodyLength,
736
793
  };
737
794
  }
738
795
  return Promise.resolve(data);
@@ -740,8 +797,8 @@ var GLTFFileLoader = /** @class */ (function () {
740
797
  GLTFFileLoader.prototype._unpackBinaryV2Async = function (dataReader, length) {
741
798
  var _this = this;
742
799
  var ChunkFormat = {
743
- JSON: 0x4E4F534A,
744
- BIN: 0x004E4942
800
+ JSON: 0x4e4f534a,
801
+ BIN: 0x004e4942,
745
802
  };
746
803
  // Read the JSON chunk header.
747
804
  var chunkLength = dataReader.readUint32();
@@ -769,7 +826,7 @@ var GLTFFileLoader = /** @class */ (function () {
769
826
  var startByteOffset_2 = dataReader.byteOffset;
770
827
  data.bin = {
771
828
  readAsync: function (byteOffset, byteLength) { return dataReader.buffer.readAsync(startByteOffset_2 + byteOffset, byteLength); },
772
- byteLength: chunkLength
829
+ byteLength: chunkLength,
773
830
  };
774
831
  dataReader.skipBytes(chunkLength);
775
832
  break;
@@ -792,7 +849,7 @@ var GLTFFileLoader = /** @class */ (function () {
792
849
  if (version === "1.0" || version === "1.0.1") {
793
850
  return {
794
851
  major: 1,
795
- minor: 0
852
+ minor: 0,
796
853
  };
797
854
  }
798
855
  var match = (version + "").match(/^(\d+)\.(\d+)/);
@@ -801,7 +858,7 @@ var GLTFFileLoader = /** @class */ (function () {
801
858
  }
802
859
  return {
803
860
  major: parseInt(match[1]),
804
- minor: parseInt(match[2])
861
+ minor: parseInt(match[2]),
805
862
  };
806
863
  };
807
864
  GLTFFileLoader._compareVersion = function (a, b) {
@@ -819,7 +876,10 @@ var GLTFFileLoader = /** @class */ (function () {
819
876
  }
820
877
  return 0;
821
878
  };
822
- /** @hidden */
879
+ /**
880
+ * @param message
881
+ * @hidden
882
+ */
823
883
  GLTFFileLoader.prototype._logOpen = function (message) {
824
884
  this._log(message);
825
885
  this._logIndentLevel++;
@@ -832,18 +892,15 @@ var GLTFFileLoader = /** @class */ (function () {
832
892
  var spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2);
833
893
  Logger.Log("".concat(spaces).concat(message));
834
894
  };
835
- GLTFFileLoader.prototype._logDisabled = function (message) {
836
- };
895
+ GLTFFileLoader.prototype._logDisabled = function (message) { };
837
896
  GLTFFileLoader.prototype._startPerformanceCounterEnabled = function (counterName) {
838
897
  Tools.StartPerformanceCounter(counterName);
839
898
  };
840
- GLTFFileLoader.prototype._startPerformanceCounterDisabled = function (counterName) {
841
- };
899
+ GLTFFileLoader.prototype._startPerformanceCounterDisabled = function (counterName) { };
842
900
  GLTFFileLoader.prototype._endPerformanceCounterEnabled = function (counterName) {
843
901
  Tools.EndPerformanceCounter(counterName);
844
902
  };
845
- GLTFFileLoader.prototype._endPerformanceCounterDisabled = function (counterName) {
846
- };
903
+ GLTFFileLoader.prototype._endPerformanceCounterDisabled = function (counterName) { };
847
904
  // ----------
848
905
  // V1 options
849
906
  // ----------
@@ -860,7 +917,7 @@ var GLTFFileLoader = /** @class */ (function () {
860
917
  * @hidden
861
918
  */
862
919
  GLTFFileLoader.HomogeneousCoordinates = false;
863
- GLTFFileLoader.magicBase64Encoded = "Z2xURg"; // "glTF" base64 encoded (without the quotes!)
920
+ GLTFFileLoader._MagicBase64Encoded = "Z2xURg"; // "glTF" base64 encoded (without the quotes!)
864
921
  GLTFFileLoader._logSpaces = " ";
865
922
  return GLTFFileLoader;
866
923
  }());