@babylonjs/loaders 5.0.0-alpha.8 → 5.0.0-beta.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/OBJ/index.d.ts +2 -0
  2. package/OBJ/index.js +4 -2
  3. package/OBJ/index.js.map +1 -1
  4. package/OBJ/mtlFileLoader.d.ts +4 -2
  5. package/OBJ/mtlFileLoader.js +7 -6
  6. package/OBJ/mtlFileLoader.js.map +1 -1
  7. package/OBJ/objFileLoader.d.ts +12 -84
  8. package/OBJ/objFileLoader.js +52 -669
  9. package/OBJ/objFileLoader.js.map +1 -1
  10. package/OBJ/objLoadingOptions.d.ts +43 -0
  11. package/OBJ/objLoadingOptions.js +2 -0
  12. package/OBJ/objLoadingOptions.js.map +1 -0
  13. package/OBJ/solidParser.d.ts +153 -0
  14. package/OBJ/solidParser.js +700 -0
  15. package/OBJ/solidParser.js.map +1 -0
  16. package/STL/index.js +1 -1
  17. package/STL/stlFileLoader.d.ts +6 -0
  18. package/STL/stlFileLoader.js +38 -11
  19. package/STL/stlFileLoader.js.map +1 -1
  20. package/glTF/1.0/glTFBinaryExtension.js +4 -4
  21. package/glTF/1.0/glTFLoader.d.ts +4 -4
  22. package/glTF/1.0/glTFLoader.js +60 -55
  23. package/glTF/1.0/glTFLoader.js.map +1 -1
  24. package/glTF/1.0/glTFLoaderInterfaces.d.ts +3 -1
  25. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderUtils.js +6 -6
  27. package/glTF/1.0/glTFMaterialsCommonExtension.js +12 -12
  28. package/glTF/1.0/index.js +5 -5
  29. package/glTF/2.0/Extensions/EXT_lights_image_based.js +15 -12
  30. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  31. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +1 -0
  32. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +8 -7
  33. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  34. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +1 -5
  35. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +6 -22
  36. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  37. package/glTF/2.0/Extensions/EXT_texture_webp.js +4 -4
  38. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  39. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +1 -1
  40. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +35 -11
  41. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  42. package/glTF/2.0/Extensions/KHR_lights_punctual.js +10 -9
  43. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  44. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +9 -9
  45. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  46. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +30 -0
  47. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +46 -0
  48. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -0
  49. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +1 -2
  50. package/glTF/2.0/Extensions/KHR_materials_ior.js +4 -5
  51. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  52. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +8 -9
  53. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  54. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -1
  55. package/glTF/2.0/Extensions/KHR_materials_sheen.js +8 -9
  56. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  57. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +1 -2
  58. package/glTF/2.0/Extensions/KHR_materials_specular.js +14 -8
  59. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  60. package/glTF/2.0/Extensions/KHR_materials_translucency.js +8 -8
  61. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  62. package/glTF/2.0/Extensions/KHR_materials_transmission.js +95 -86
  63. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_unlit.js +6 -6
  65. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  66. package/glTF/2.0/Extensions/KHR_materials_variants.js +76 -11
  67. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  68. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +31 -0
  69. package/glTF/2.0/Extensions/KHR_materials_volume.js +79 -0
  70. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -0
  71. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +1 -1
  72. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +1 -2
  73. package/glTF/2.0/Extensions/KHR_texture_basisu.js +5 -6
  74. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  75. package/glTF/2.0/Extensions/KHR_texture_transform.js +3 -3
  76. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  77. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +2 -2
  78. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +6 -3
  79. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  80. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +19 -20
  81. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  82. package/glTF/2.0/Extensions/MSFT_lod.d.ts +1 -1
  83. package/glTF/2.0/Extensions/MSFT_lod.js +20 -17
  84. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  85. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +3 -3
  86. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  87. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +3 -3
  88. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  89. package/glTF/2.0/Extensions/index.d.ts +2 -0
  90. package/glTF/2.0/Extensions/index.js +26 -24
  91. package/glTF/2.0/Extensions/index.js.map +1 -1
  92. package/glTF/2.0/glTFLoader.d.ts +10 -13
  93. package/glTF/2.0/glTFLoader.js +416 -299
  94. package/glTF/2.0/glTFLoader.js.map +1 -1
  95. package/glTF/2.0/glTFLoaderInterfaces.d.ts +4 -5
  96. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  97. package/glTF/2.0/index.d.ts +1 -1
  98. package/glTF/2.0/index.js +4 -4
  99. package/glTF/2.0/index.js.map +1 -1
  100. package/glTF/glTFFileLoader.d.ts +25 -10
  101. package/glTF/glTFFileLoader.js +86 -94
  102. package/glTF/glTFFileLoader.js.map +1 -1
  103. package/glTF/glTFValidation.js +2 -2
  104. package/glTF/glTFValidation.js.map +1 -1
  105. package/glTF/index.d.ts +2 -2
  106. package/glTF/index.js +4 -4
  107. package/glTF/index.js.map +1 -1
  108. package/index.d.ts +3 -3
  109. package/index.js +3 -3
  110. package/index.js.map +1 -1
  111. package/legacy/legacy-glTF.js +4 -4
  112. package/legacy/legacy-glTF1.d.ts +1 -1
  113. package/legacy/legacy-glTF1.js +1 -1
  114. package/legacy/legacy-glTF1.js.map +1 -1
  115. package/legacy/legacy-glTF1FileLoader.js +2 -2
  116. package/legacy/legacy-glTF2.d.ts +1 -1
  117. package/legacy/legacy-glTF2.js +3 -3
  118. package/legacy/legacy-glTF2.js.map +1 -1
  119. package/legacy/legacy-glTF2FileLoader.js +2 -2
  120. package/legacy/legacy-glTFFileLoader.js +3 -3
  121. package/legacy/legacy-objFileLoader.d.ts +1 -1
  122. package/legacy/legacy-objFileLoader.js +2 -2
  123. package/legacy/legacy-objFileLoader.js.map +1 -1
  124. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  125. package/legacy/legacy-stlFileLoader.js +2 -2
  126. package/legacy/legacy-stlFileLoader.js.map +1 -1
  127. package/legacy/legacy.js +6 -6
  128. package/package.json +16 -4
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./EXT_lights_image_based\";\r\nexport * from \"./EXT_mesh_gpu_instancing\";\r\nexport * from \"./EXT_meshopt_compression\";\r\nexport * from \"./EXT_texture_webp\";\r\nexport * from \"./KHR_draco_mesh_compression\";\r\nexport * from \"./KHR_lights_punctual\";\r\nexport * from \"./KHR_materials_pbrSpecularGlossiness\";\r\nexport * from \"./KHR_materials_unlit\";\r\nexport * from \"./KHR_materials_clearcoat\";\r\nexport * from \"./KHR_materials_sheen\";\r\nexport * from \"./KHR_materials_specular\";\r\nexport * from \"./KHR_materials_ior\";\r\nexport * from \"./KHR_materials_variants\";\r\nexport * from \"./KHR_materials_transmission\";\r\nexport * from \"./KHR_materials_translucency\";\r\nexport * from \"./KHR_mesh_quantization\";\r\nexport * from \"./KHR_texture_basisu\";\r\nexport * from \"./KHR_texture_transform\";\r\nexport * from \"./KHR_xmp_json_ld\";\r\nexport * from \"./MSFT_audio_emitter\";\r\nexport * from \"./MSFT_lod\";\r\nexport * from \"./MSFT_minecraftMesh\";\r\nexport * from \"./MSFT_sRGBFactors\";\r\nexport * from \"./ExtrasAsMetadata\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./EXT_lights_image_based\";\r\nexport * from \"./EXT_mesh_gpu_instancing\";\r\nexport * from \"./EXT_meshopt_compression\";\r\nexport * from \"./EXT_texture_webp\";\r\nexport * from \"./KHR_draco_mesh_compression\";\r\nexport * from \"./KHR_lights_punctual\";\r\nexport * from \"./KHR_materials_pbrSpecularGlossiness\";\r\nexport * from \"./KHR_materials_unlit\";\r\nexport * from \"./KHR_materials_clearcoat\";\r\nexport * from \"./KHR_materials_emissive_strength\";\r\nexport * from \"./KHR_materials_sheen\";\r\nexport * from \"./KHR_materials_specular\";\r\nexport * from \"./KHR_materials_ior\";\r\nexport * from \"./KHR_materials_variants\";\r\nexport * from \"./KHR_materials_transmission\";\r\nexport * from \"./KHR_materials_translucency\";\r\nexport * from \"./KHR_materials_volume\";\r\nexport * from \"./KHR_mesh_quantization\";\r\nexport * from \"./KHR_texture_basisu\";\r\nexport * from \"./KHR_texture_transform\";\r\nexport * from \"./KHR_xmp_json_ld\";\r\nexport * from \"./MSFT_audio_emitter\";\r\nexport * from \"./MSFT_lod\";\r\nexport * from \"./MSFT_minecraftMesh\";\r\nexport * from \"./MSFT_sRGBFactors\";\r\nexport * from \"./ExtrasAsMetadata\";\r\n"]}
@@ -11,10 +11,11 @@ import { Scene } from "@babylonjs/core/scene";
11
11
  import { IProperty } from "babylonjs-gltf2interface";
12
12
  import { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IAnimationChannel, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "./glTFLoaderInterfaces";
13
13
  import { IGLTFLoaderExtension } from "./glTFLoaderExtension";
14
- import { IGLTFLoader, GLTFFileLoader, GLTFLoaderState, IGLTFLoaderData } from "../glTFFileLoader";
14
+ import { IGLTFLoader, GLTFFileLoader, IGLTFLoaderData } from "../glTFFileLoader";
15
15
  import { IAnimatable } from '@babylonjs/core/Animations/animatable.interface';
16
16
  import { IDataBuffer } from '@babylonjs/core/Misc/dataReader';
17
17
  import { Light } from '@babylonjs/core/Lights/light';
18
+ import { AssetContainer } from "@babylonjs/core/assetContainer";
18
19
  /**
19
20
  * Helper class for working with arrays when loading the glTF asset
20
21
  */
@@ -40,15 +41,14 @@ export declare class GLTFLoader implements IGLTFLoader {
40
41
  /** @hidden */
41
42
  _completePromises: Promise<any>[];
42
43
  /** @hidden */
43
- _forAssetContainer: boolean;
44
+ _assetContainer: Nullable<AssetContainer>;
44
45
  /** Storage */
45
46
  _babylonLights: Light[];
46
47
  /** @hidden */
47
48
  _disableInstancedMesh: number;
49
+ private readonly _parent;
50
+ private readonly _extensions;
48
51
  private _disposed;
49
- private _parent;
50
- private _state;
51
- private _extensions;
52
52
  private _rootUrl;
53
53
  private _fileName;
54
54
  private _uniqueRootUrl;
@@ -57,6 +57,7 @@ export declare class GLTFLoader implements IGLTFLoader {
57
57
  private _babylonScene;
58
58
  private _rootBabylonMesh;
59
59
  private _defaultBabylonMaterialData;
60
+ private _postSceneLoadActions;
60
61
  private static _RegisteredExtensions;
61
62
  /**
62
63
  * The default glTF sampler.
@@ -74,10 +75,6 @@ export declare class GLTFLoader implements IGLTFLoader {
74
75
  * @returns A boolean indicating whether the extension has been unregistered
75
76
  */
76
77
  static UnregisterExtension(name: string): boolean;
77
- /**
78
- * The loader state.
79
- */
80
- get state(): Nullable<GLTFLoaderState>;
81
78
  /**
82
79
  * The object that represents the glTF JSON.
83
80
  */
@@ -97,13 +94,13 @@ export declare class GLTFLoader implements IGLTFLoader {
97
94
  /**
98
95
  * The root Babylon mesh when loading the asset.
99
96
  */
100
- get rootBabylonMesh(): Mesh;
97
+ get rootBabylonMesh(): Nullable<Mesh>;
101
98
  /** @hidden */
102
99
  constructor(parent: GLTFFileLoader);
103
100
  /** @hidden */
104
101
  dispose(): void;
105
102
  /** @hidden */
106
- importMeshAsync(meshesNames: any, scene: Scene, forAssetContainer: boolean, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
103
+ importMeshAsync(meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
107
104
  /** @hidden */
108
105
  loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
109
106
  private _loadAsync;
@@ -111,7 +108,6 @@ export declare class GLTFLoader implements IGLTFLoader {
111
108
  private _setupData;
112
109
  private _loadExtensions;
113
110
  private _checkExtensions;
114
- private _setState;
115
111
  private _createRootNode;
116
112
  /**
117
113
  * Loads a glTF scene.
@@ -154,6 +150,7 @@ export declare class GLTFLoader implements IGLTFLoader {
154
150
  private static _LoadTransform;
155
151
  private _loadSkinAsync;
156
152
  private _loadBones;
153
+ private _findSkeletonRootNode;
157
154
  private _loadBone;
158
155
  private _loadSkinInverseBindMatricesDataAsync;
159
156
  private _updateBoneMatrices;
@@ -255,7 +252,7 @@ export declare class GLTFLoader implements IGLTFLoader {
255
252
  /** @hidden */
256
253
  _loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
257
254
  /** @hidden */
258
- _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void, textureLoaderOptions?: any): Promise<BaseTexture>;
255
+ _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void, textureLoaderOptions?: any, useSRGBBuffer?: boolean): Promise<BaseTexture>;
259
256
  private _loadSampler;
260
257
  /**
261
258
  * Loads a glTF image.