@babylonjs/loaders 5.0.0-beta.6 → 5.0.0-beta.8-snapshot

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. package/package.json +20 -198
  2. package/OBJ/index.d.ts +0 -4
  3. package/OBJ/index.js +0 -5
  4. package/OBJ/index.js.map +0 -1
  5. package/OBJ/mtlFileLoader.d.ts +0 -40
  6. package/OBJ/mtlFileLoader.js +0 -222
  7. package/OBJ/mtlFileLoader.js.map +0 -1
  8. package/OBJ/objFileLoader.d.ts +0 -133
  9. package/OBJ/objFileLoader.js +0 -301
  10. package/OBJ/objFileLoader.js.map +0 -1
  11. package/OBJ/objLoadingOptions.d.ts +0 -43
  12. package/OBJ/objLoadingOptions.js +0 -2
  13. package/OBJ/objLoadingOptions.js.map +0 -1
  14. package/OBJ/solidParser.d.ts +0 -153
  15. package/OBJ/solidParser.js +0 -700
  16. package/OBJ/solidParser.js.map +0 -1
  17. package/STL/index.d.ts +0 -1
  18. package/STL/index.js +0 -2
  19. package/STL/index.js.map +0 -1
  20. package/STL/stlFileLoader.d.ts +0 -71
  21. package/STL/stlFileLoader.js +0 -240
  22. package/STL/stlFileLoader.js.map +0 -1
  23. package/glTF/1.0/glTFBinaryExtension.d.ts +0 -13
  24. package/glTF/1.0/glTFBinaryExtension.js +0 -62
  25. package/glTF/1.0/glTFBinaryExtension.js.map +0 -1
  26. package/glTF/1.0/glTFLoader.d.ts +0 -106
  27. package/glTF/1.0/glTFLoader.js +0 -1697
  28. package/glTF/1.0/glTFLoader.js.map +0 -1
  29. package/glTF/1.0/glTFLoaderInterfaces.d.ts +0 -412
  30. package/glTF/1.0/glTFLoaderInterfaces.js +0 -96
  31. package/glTF/1.0/glTFLoaderInterfaces.js.map +0 -1
  32. package/glTF/1.0/glTFLoaderUtils.d.ts +0 -62
  33. package/glTF/1.0/glTFLoaderUtils.js +0 -233
  34. package/glTF/1.0/glTFLoaderUtils.js.map +0 -1
  35. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +0 -10
  36. package/glTF/1.0/glTFMaterialsCommonExtension.js +0 -128
  37. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +0 -1
  38. package/glTF/1.0/index.d.ts +0 -5
  39. package/glTF/1.0/index.js +0 -6
  40. package/glTF/1.0/index.js.map +0 -1
  41. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +0 -36
  42. package/glTF/2.0/Extensions/EXT_lights_image_based.js +0 -111
  43. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +0 -1
  44. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +0 -27
  45. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +0 -80
  46. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +0 -1
  47. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +0 -27
  48. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +0 -43
  49. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +0 -1
  50. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +0 -21
  51. package/glTF/2.0/Extensions/EXT_texture_webp.js +0 -33
  52. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +0 -1
  53. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +0 -32
  54. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +0 -56
  55. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +0 -1
  56. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +0 -31
  57. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +0 -102
  58. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +0 -1
  59. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +0 -28
  60. package/glTF/2.0/Extensions/KHR_lights_punctual.js +0 -82
  61. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +0 -1
  62. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +0 -31
  63. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +0 -87
  64. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +0 -1
  65. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +0 -30
  66. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +0 -46
  67. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +0 -1
  68. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +0 -34
  69. package/glTF/2.0/Extensions/KHR_materials_ior.js +0 -55
  70. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +0 -1
  71. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +0 -30
  72. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +0 -73
  73. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +0 -1
  74. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -31
  75. package/glTF/2.0/Extensions/KHR_materials_sheen.js +0 -77
  76. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +0 -1
  77. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +0 -30
  78. package/glTF/2.0/Extensions/KHR_materials_specular.js +0 -67
  79. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +0 -1
  80. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +0 -31
  81. package/glTF/2.0/Extensions/KHR_materials_translucency.js +0 -77
  82. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +0 -1
  83. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +0 -30
  84. package/glTF/2.0/Extensions/KHR_materials_transmission.js +0 -278
  85. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +0 -1
  86. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +0 -30
  87. package/glTF/2.0/Extensions/KHR_materials_unlit.js +0 -66
  88. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +0 -1
  89. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +0 -76
  90. package/glTF/2.0/Extensions/KHR_materials_variants.js +0 -244
  91. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +0 -1
  92. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +0 -31
  93. package/glTF/2.0/Extensions/KHR_materials_volume.js +0 -79
  94. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +0 -1
  95. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +0 -19
  96. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +0 -22
  97. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +0 -1
  98. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +0 -21
  99. package/glTF/2.0/Extensions/KHR_texture_basisu.js +0 -33
  100. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +0 -1
  101. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +0 -25
  102. package/glTF/2.0/Extensions/KHR_texture_transform.js +0 -54
  103. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +0 -1
  104. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +0 -29
  105. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +0 -47
  106. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +0 -1
  107. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +0 -38
  108. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +0 -217
  109. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +0 -1
  110. package/glTF/2.0/Extensions/MSFT_lod.d.ts +0 -75
  111. package/glTF/2.0/Extensions/MSFT_lod.js +0 -334
  112. package/glTF/2.0/Extensions/MSFT_lod.js.map +0 -1
  113. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +0 -14
  114. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +0 -37
  115. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +0 -1
  116. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +0 -14
  117. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +0 -37
  118. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +0 -1
  119. package/glTF/2.0/Extensions/index.d.ts +0 -26
  120. package/glTF/2.0/Extensions/index.js +0 -27
  121. package/glTF/2.0/Extensions/index.js.map +0 -1
  122. package/glTF/2.0/glTFLoader.d.ts +0 -355
  123. package/glTF/2.0/glTFLoader.js +0 -2184
  124. package/glTF/2.0/glTFLoader.js.map +0 -1
  125. package/glTF/2.0/glTFLoaderExtension.d.ts +0 -152
  126. package/glTF/2.0/glTFLoaderExtension.js +0 -2
  127. package/glTF/2.0/glTFLoaderExtension.js.map +0 -1
  128. package/glTF/2.0/glTFLoaderInterfaces.d.ts +0 -212
  129. package/glTF/2.0/glTFLoaderInterfaces.js +0 -2
  130. package/glTF/2.0/glTFLoaderInterfaces.js.map +0 -1
  131. package/glTF/2.0/index.d.ts +0 -4
  132. package/glTF/2.0/index.js +0 -5
  133. package/glTF/2.0/index.js.map +0 -1
  134. package/glTF/glTFFileLoader.d.ts +0 -364
  135. package/glTF/glTFFileLoader.js +0 -865
  136. package/glTF/glTFFileLoader.js.map +0 -1
  137. package/glTF/glTFValidation.d.ts +0 -29
  138. package/glTF/glTFValidation.js +0 -122
  139. package/glTF/glTFValidation.js.map +0 -1
  140. package/glTF/index.d.ts +0 -5
  141. package/glTF/index.js +0 -6
  142. package/glTF/index.js.map +0 -1
  143. package/index.d.ts +0 -3
  144. package/index.js.map +0 -1
  145. package/legacy/legacy-glTF.d.ts +0 -2
  146. package/legacy/legacy-glTF.js +0 -19
  147. package/legacy/legacy-glTF.js.map +0 -1
  148. package/legacy/legacy-glTF1.d.ts +0 -2
  149. package/legacy/legacy-glTF1.js +0 -15
  150. package/legacy/legacy-glTF1.js.map +0 -1
  151. package/legacy/legacy-glTF1FileLoader.d.ts +0 -2
  152. package/legacy/legacy-glTF1FileLoader.js +0 -3
  153. package/legacy/legacy-glTF1FileLoader.js.map +0 -1
  154. package/legacy/legacy-glTF2.d.ts +0 -2
  155. package/legacy/legacy-glTF2.js +0 -33
  156. package/legacy/legacy-glTF2.js.map +0 -1
  157. package/legacy/legacy-glTF2FileLoader.d.ts +0 -2
  158. package/legacy/legacy-glTF2FileLoader.js +0 -3
  159. package/legacy/legacy-glTF2FileLoader.js.map +0 -1
  160. package/legacy/legacy-glTFFileLoader.d.ts +0 -3
  161. package/legacy/legacy-glTFFileLoader.js +0 -4
  162. package/legacy/legacy-glTFFileLoader.js.map +0 -1
  163. package/legacy/legacy-objFileLoader.d.ts +0 -1
  164. package/legacy/legacy-objFileLoader.js +0 -13
  165. package/legacy/legacy-objFileLoader.js.map +0 -1
  166. package/legacy/legacy-stlFileLoader.d.ts +0 -1
  167. package/legacy/legacy-stlFileLoader.js +0 -13
  168. package/legacy/legacy-stlFileLoader.js.map +0 -1
  169. package/legacy/legacy.d.ts +0 -6
  170. package/legacy/legacy.js +0 -7
  171. package/legacy/legacy.js.map +0 -1
  172. package/readme.md +0 -24
@@ -1,79 +0,0 @@
1
- import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
2
- import { GLTFLoader } from "../glTFLoader.js";
3
- var NAME = "KHR_materials_volume";
4
- /**
5
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)
6
- * @since 5.0.0
7
- */
8
- var KHR_materials_volume = /** @class */ (function () {
9
- /** @hidden */
10
- function KHR_materials_volume(loader) {
11
- /**
12
- * The name of this extension.
13
- */
14
- this.name = NAME;
15
- /**
16
- * Defines a number that determines the order the extensions are applied.
17
- */
18
- this.order = 173;
19
- this._loader = loader;
20
- this.enabled = this._loader.isExtensionUsed(NAME);
21
- if (this.enabled) {
22
- // We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh
23
- this._loader._disableInstancedMesh++;
24
- }
25
- }
26
- /** @hidden */
27
- KHR_materials_volume.prototype.dispose = function () {
28
- if (this.enabled) {
29
- this._loader._disableInstancedMesh--;
30
- }
31
- this._loader = null;
32
- };
33
- /** @hidden */
34
- KHR_materials_volume.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
35
- var _this = this;
36
- return GLTFLoader.LoadExtensionAsync(context, material, this.name, function (extensionContext, extension) {
37
- var promises = new Array();
38
- promises.push(_this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
39
- promises.push(_this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
40
- promises.push(_this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));
41
- return Promise.all(promises).then(function () { });
42
- });
43
- };
44
- KHR_materials_volume.prototype._loadVolumePropertiesAsync = function (context, material, babylonMaterial, extension) {
45
- if (!(babylonMaterial instanceof PBRMaterial)) {
46
- throw new Error("".concat(context, ": Material type not supported"));
47
- }
48
- // If transparency isn't enabled already, this extension shouldn't do anything.
49
- // i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.
50
- if (!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled || !extension.thicknessFactor) {
51
- return Promise.resolve();
52
- }
53
- // IOR in this extension only affects interior.
54
- babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;
55
- var attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;
56
- babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;
57
- if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {
58
- babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);
59
- }
60
- babylonMaterial.subSurface.minimumThickness = 0.0;
61
- babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;
62
- babylonMaterial.subSurface.useThicknessAsDepth = true;
63
- if (extension.thicknessTexture) {
64
- extension.thicknessTexture.nonColorData = true;
65
- return this._loader.loadTextureInfoAsync("".concat(context, "/thicknessTexture"), extension.thicknessTexture)
66
- .then(function (texture) {
67
- babylonMaterial.subSurface.thicknessTexture = texture;
68
- babylonMaterial.subSurface.useGltfStyleTextures = true;
69
- });
70
- }
71
- else {
72
- return Promise.resolve();
73
- }
74
- };
75
- return KHR_materials_volume;
76
- }());
77
- export { KHR_materials_volume };
78
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_materials_volume(loader); });
79
- //# sourceMappingURL=KHR_materials_volume.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_materials_volume.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_materials_volume.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAKxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,sBAAsB,CAAC;AASpC;;;GAGG;AACH;IAkBI,cAAc;IACd,8BAAY,MAAkB;QAlB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAMf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,qHAAqH;YACrH,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;SACxC;IACL,CAAC;IAED,cAAc;IACP,sCAAO,GAAd;QACI,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;SACxC;QACA,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,0DAA2B,GAAlC,UAAmC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAAlG,iBAQC;QAPG,OAAO,UAAU,CAAC,kBAAkB,CAAyB,OAAO,EAAE,QAAQ,EAAE,I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nimport { Material } from \"@babylonjs/core/Materials/material\";\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\nimport { IMaterial, ITextureInfo } from \"../glTFLoaderInterfaces\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { GLTFLoader } from \"../glTFLoader\";\n\nconst NAME = \"KHR_materials_volume\";\n\ninterface IMaterialsTransmission {\n attenuationColor?: number[];\n attenuationDistance?: number;\n thicknessTexture?: ITextureInfo;\n thicknessFactor?: number;\n}\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)\n * @since 5.0.0\n */\nexport class KHR_materials_volume implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n public order = 173;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n if (this.enabled) {\n // We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh\n this._loader._disableInstancedMesh++;\n }\n }\n\n /** @hidden */\n public dispose() {\n if (this.enabled) {\n this._loader._disableInstancedMesh--;\n }\n (this._loader as any) = null;\n }\n\n /** @hidden */\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\n return GLTFLoader.LoadExtensionAsync<IMaterialsTransmission>(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array<Promise<any>>();\n promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));\n return Promise.all(promises).then(() => { });\n });\n }\n\n private _loadVolumePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material, extension: IMaterialsTransmission): Promise<void> {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n\n // If transparency isn't enabled already, this extension shouldn't do anything.\n // i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.\n if (!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled || !extension.thicknessFactor) {\n return Promise.resolve();\n }\n\n // IOR in this extension only affects interior.\n babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;\n const attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;\n babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;\n if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {\n babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);\n }\n\n babylonMaterial.subSurface.minimumThickness = 0.0;\n babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;\n babylonMaterial.subSurface.useThicknessAsDepth = true;\n if (extension.thicknessTexture) {\n (extension.thicknessTexture as ITextureInfo).nonColorData = true;\n return this._loader.loadTextureInfoAsync(`${context}/thicknessTexture`, extension.thicknessTexture)\n .then((texture: BaseTexture) => {\n babylonMaterial.subSurface.thicknessTexture = texture;\n babylonMaterial.subSurface.useGltfStyleTextures = true;\n });\n } else {\n return Promise.resolve();\n }\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_volume(loader));"]}
@@ -1,19 +0,0 @@
1
- import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import { GLTFLoader } from "../glTFLoader";
3
- /**
4
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
5
- */
6
- export declare class KHR_mesh_quantization implements IGLTFLoaderExtension {
7
- /**
8
- * The name of this extension.
9
- */
10
- readonly name = "KHR_mesh_quantization";
11
- /**
12
- * Defines whether this extension is enabled.
13
- */
14
- enabled: boolean;
15
- /** @hidden */
16
- constructor(loader: GLTFLoader);
17
- /** @hidden */
18
- dispose(): void;
19
- }
@@ -1,22 +0,0 @@
1
- import { GLTFLoader } from "../glTFLoader.js";
2
- var NAME = "KHR_mesh_quantization";
3
- /**
4
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
5
- */
6
- var KHR_mesh_quantization = /** @class */ (function () {
7
- /** @hidden */
8
- function KHR_mesh_quantization(loader) {
9
- /**
10
- * The name of this extension.
11
- */
12
- this.name = NAME;
13
- this.enabled = loader.isExtensionUsed(NAME);
14
- }
15
- /** @hidden */
16
- KHR_mesh_quantization.prototype.dispose = function () {
17
- };
18
- return KHR_mesh_quantization;
19
- }());
20
- export { KHR_mesh_quantization };
21
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_mesh_quantization(loader); });
22
- //# sourceMappingURL=KHR_mesh_quantization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_mesh_quantization.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_mesh_quantization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,uBAAuB,CAAC;AAErC;;GAEG;AACH;IAWI,cAAc;IACd,+BAAY,MAAkB;QAX9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QASxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;IACP,uCAAO,GAAd;IACA,CAAC;IACL,4BAAC;AAAD,CAAC,AAnBD,IAmBC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAjC,CAAiC,CAAC,CAAC","sourcesContent":["import { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"KHR_mesh_quantization\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)\r\n */\r\nexport class KHR_mesh_quantization implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this.enabled = loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_mesh_quantization(loader));\r\n"]}
@@ -1,21 +0,0 @@
1
- import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import { GLTFLoader } from "../glTFLoader";
3
- import { ITexture } from "../glTFLoaderInterfaces";
4
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
5
- import { Nullable } from "@babylonjs/core/types";
6
- /**
7
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
8
- */
9
- export declare class KHR_texture_basisu implements IGLTFLoaderExtension {
10
- /** The name of this extension. */
11
- readonly name = "KHR_texture_basisu";
12
- /** Defines whether this extension is enabled. */
13
- enabled: boolean;
14
- private _loader;
15
- /** @hidden */
16
- constructor(loader: GLTFLoader);
17
- /** @hidden */
18
- dispose(): void;
19
- /** @hidden */
20
- _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
21
- }
@@ -1,33 +0,0 @@
1
- import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
2
- var NAME = "KHR_texture_basisu";
3
- /**
4
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
5
- */
6
- var KHR_texture_basisu = /** @class */ (function () {
7
- /** @hidden */
8
- function KHR_texture_basisu(loader) {
9
- /** The name of this extension. */
10
- this.name = NAME;
11
- this._loader = loader;
12
- this.enabled = loader.isExtensionUsed(NAME);
13
- }
14
- /** @hidden */
15
- KHR_texture_basisu.prototype.dispose = function () {
16
- this._loader = null;
17
- };
18
- /** @hidden */
19
- KHR_texture_basisu.prototype._loadTextureAsync = function (context, texture, assign) {
20
- var _this = this;
21
- return GLTFLoader.LoadExtensionAsync(context, texture, this.name, function (extensionContext, extension) {
22
- var sampler = (texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get("".concat(context, "/sampler"), _this._loader.gltf.samplers, texture.sampler));
23
- var image = ArrayItem.Get("".concat(extensionContext, "/source"), _this._loader.gltf.images, extension.source);
24
- return _this._loader._createTextureAsync(context, sampler, image, function (babylonTexture) {
25
- assign(babylonTexture);
26
- }, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture._textureInfo.nonColorData);
27
- });
28
- };
29
- return KHR_texture_basisu;
30
- }());
31
- export { KHR_texture_basisu };
32
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_basisu(loader); });
33
- //# sourceMappingURL=KHR_texture_basisu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_texture_basisu.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMtD,IAAM,IAAI,GAAG,oBAAoB,CAAC;AAElC;;GAEG;AACH;IASI,cAAc;IACd,4BAAY,MAAkB;QAT9B,kCAAkC;QAClB,SAAI,GAAG,IAAI,CAAC;QASxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,C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":["import { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\nimport { ITexture } from \"../glTFLoaderInterfaces\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { IKHRTextureBasisU } from 'babylonjs-gltf2interface';\r\n\r\nconst NAME = \"KHR_texture_basisu\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)\r\n */\r\nexport class KHR_texture_basisu implements IGLTFLoaderExtension {\r\n /** The name of this extension. */\r\n public readonly name = NAME;\r\n\r\n /** Defines whether this extension is enabled. */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRTextureBasisU, BaseTexture>(context, texture, this.name, (extensionContext, extension) => {\r\n const sampler = (texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler));\r\n const image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);\r\n return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {\r\n assign(babylonTexture);\r\n }, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture._textureInfo.nonColorData);\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_texture_basisu(loader));"]}
@@ -1,25 +0,0 @@
1
- import { Nullable } from "@babylonjs/core/types";
2
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
3
- import { ITextureInfo } from "../glTFLoaderInterfaces";
4
- import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
5
- import { GLTFLoader } from "../glTFLoader";
6
- /**
7
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
8
- */
9
- export declare class KHR_texture_transform implements IGLTFLoaderExtension {
10
- /**
11
- * The name of this extension.
12
- */
13
- readonly name = "KHR_texture_transform";
14
- /**
15
- * Defines whether this extension is enabled.
16
- */
17
- enabled: boolean;
18
- private _loader;
19
- /** @hidden */
20
- constructor(loader: GLTFLoader);
21
- /** @hidden */
22
- dispose(): void;
23
- /** @hidden */
24
- loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
25
- }
@@ -1,54 +0,0 @@
1
- import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
2
- import { GLTFLoader } from "../glTFLoader.js";
3
- var NAME = "KHR_texture_transform";
4
- /**
5
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
6
- */
7
- var KHR_texture_transform = /** @class */ (function () {
8
- /** @hidden */
9
- function KHR_texture_transform(loader) {
10
- /**
11
- * The name of this extension.
12
- */
13
- this.name = NAME;
14
- this._loader = loader;
15
- this.enabled = this._loader.isExtensionUsed(NAME);
16
- }
17
- /** @hidden */
18
- KHR_texture_transform.prototype.dispose = function () {
19
- this._loader = null;
20
- };
21
- /** @hidden */
22
- KHR_texture_transform.prototype.loadTextureInfoAsync = function (context, textureInfo, assign) {
23
- var _this = this;
24
- return GLTFLoader.LoadExtensionAsync(context, textureInfo, this.name, function (extensionContext, extension) {
25
- return _this._loader.loadTextureInfoAsync(context, textureInfo, function (babylonTexture) {
26
- if (!(babylonTexture instanceof Texture)) {
27
- throw new Error("".concat(extensionContext, ": Texture type not supported"));
28
- }
29
- if (extension.offset) {
30
- babylonTexture.uOffset = extension.offset[0];
31
- babylonTexture.vOffset = extension.offset[1];
32
- }
33
- // Always rotate around the origin.
34
- babylonTexture.uRotationCenter = 0;
35
- babylonTexture.vRotationCenter = 0;
36
- if (extension.rotation) {
37
- babylonTexture.wAng = -extension.rotation;
38
- }
39
- if (extension.scale) {
40
- babylonTexture.uScale = extension.scale[0];
41
- babylonTexture.vScale = extension.scale[1];
42
- }
43
- if (extension.texCoord != undefined) {
44
- babylonTexture.coordinatesIndex = extension.texCoord;
45
- }
46
- assign(babylonTexture);
47
- });
48
- });
49
- };
50
- return KHR_texture_transform;
51
- }());
52
- export { KHR_texture_transform };
53
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_transform(loader); });
54
- //# sourceMappingURL=KHR_texture_transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_texture_transform.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAIrE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,IAAM,IAAI,GAAG,uBAAuB,CAAC;AAErC;;GAEG;AACH;IAaI,cAAc;IACd,+BAAY,MAAkB;QAb9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAWxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACP,uCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,oDAAoB,GAA3B,UAA4B,OAAe,EAAE,WAAyB,EAAE,MAA6C;QAArH,iBAgCC;QA/BG,OAAO,UAAU,CAAC,kBAAkB,CAAo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,CAAC,EAAjC,CAAiC,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\n\r\nimport { ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport { IKHRTextureTransform } from 'babylonjs-gltf2interface';\r\n\r\nconst NAME = \"KHR_texture_transform\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)\r\n */\r\nexport class KHR_texture_transform implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRTextureTransform, BaseTexture>(context, textureInfo, this.name, (extensionContext, extension) => {\r\n return this._loader.loadTextureInfoAsync(context, textureInfo, (babylonTexture) => {\r\n if (!(babylonTexture instanceof Texture)) {\r\n throw new Error(`${extensionContext}: Texture type not supported`);\r\n }\r\n\r\n if (extension.offset) {\r\n babylonTexture.uOffset = extension.offset[0];\r\n babylonTexture.vOffset = extension.offset[1];\r\n }\r\n\r\n // Always rotate around the origin.\r\n babylonTexture.uRotationCenter = 0;\r\n babylonTexture.vRotationCenter = 0;\r\n\r\n if (extension.rotation) {\r\n babylonTexture.wAng = -extension.rotation;\r\n }\r\n\r\n if (extension.scale) {\r\n babylonTexture.uScale = extension.scale[0];\r\n babylonTexture.vScale = extension.scale[1];\r\n }\r\n\r\n if (extension.texCoord != undefined) {\r\n babylonTexture.coordinatesIndex = extension.texCoord;\r\n }\r\n\r\n assign(babylonTexture);\r\n });\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_texture_transform(loader));"]}
@@ -1,29 +0,0 @@
1
- import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import { GLTFLoader } from "../glTFLoader";
3
- /**
4
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_xmp_json_ld)
5
- * @since 5.0.0
6
- */
7
- export declare class KHR_xmp_json_ld implements IGLTFLoaderExtension {
8
- /**
9
- * The name of this extension.
10
- */
11
- readonly name = "KHR_xmp_json_ld";
12
- /**
13
- * Defines whether this extension is enabled.
14
- */
15
- enabled: boolean;
16
- /**
17
- * Defines a number that determines the order the extensions are applied.
18
- */
19
- order: number;
20
- private _loader;
21
- /** @hidden */
22
- constructor(loader: GLTFLoader);
23
- /** @hidden */
24
- dispose(): void;
25
- /**
26
- * Called after the loader state changes to LOADING.
27
- */
28
- onLoading(): void;
29
- }
@@ -1,47 +0,0 @@
1
- import { GLTFLoader } from "../glTFLoader.js";
2
- var NAME = "KHR_xmp_json_ld";
3
- /**
4
- * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_xmp_json_ld)
5
- * @since 5.0.0
6
- */
7
- var KHR_xmp_json_ld = /** @class */ (function () {
8
- /** @hidden */
9
- function KHR_xmp_json_ld(loader) {
10
- /**
11
- * The name of this extension.
12
- */
13
- this.name = NAME;
14
- /**
15
- * Defines a number that determines the order the extensions are applied.
16
- */
17
- this.order = 100;
18
- this._loader = loader;
19
- this.enabled = this._loader.isExtensionUsed(NAME);
20
- }
21
- /** @hidden */
22
- KHR_xmp_json_ld.prototype.dispose = function () {
23
- this._loader = null;
24
- };
25
- /**
26
- * Called after the loader state changes to LOADING.
27
- */
28
- KHR_xmp_json_ld.prototype.onLoading = function () {
29
- var _a, _b, _c;
30
- if (this._loader.rootBabylonMesh === null) {
31
- return;
32
- }
33
- var xmp_gltf = (_a = this._loader.gltf.extensions) === null || _a === void 0 ? void 0 : _a.KHR_xmp_json_ld;
34
- var xmp_node = (_c = (_b = this._loader.gltf.asset) === null || _b === void 0 ? void 0 : _b.extensions) === null || _c === void 0 ? void 0 : _c.KHR_xmp_json_ld;
35
- if (xmp_gltf && xmp_node) {
36
- var packet = +xmp_node.packet;
37
- if (xmp_gltf.packets && packet < xmp_gltf.packets.length) {
38
- this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {};
39
- this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet];
40
- }
41
- }
42
- };
43
- return KHR_xmp_json_ld;
44
- }());
45
- export { KHR_xmp_json_ld };
46
- GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_xmp_json_ld(loader); });
47
- //# sourceMappingURL=KHR_xmp_json_ld.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KHR_xmp_json_ld.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_xmp_json_ld.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,IAAM,IAAI,GAAG,iBAAiB,CAAC;AAE/B;;;GAGG;AACH;IAkBI,cAAc;IACd,yBAAY,MAAkB;QAlB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAMf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACP,iCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,mCAAS,GAAhB;;QACI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,EAAE;YACvC,OAAO;SACV;QAED,IAAM,QAAQ,GAAI,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,0CAAE,eAAsC,CAAC;QACvF,IAAM,QAAQ,GAAI,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,0CAAE,UAAU,0CAAE,eAAsC,CAAC;QAC9F,IAAI,QAAQ,IAAI,QAAQ,EAAE;YACtB,IAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;YAChC,IAAI,QAAQ,CAAC,OAAO,IAAI,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;gBACtD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,IAAI,EAAE,CAAC;gBACpF,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aACxE;SACJ;IACL,CAAC;IACL,sBAAC;AAAD,CAAC,AA/CD,IA+CC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,eAAe,CAAC,MAAM,CAAC,EAA3B,CAA2B,CAAC,CAAC","sourcesContent":["import { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { IKHRXmpJsonLd_Gltf, IKHRXmpJsonLd_Node } from 'babylonjs-gltf2interface';\n\nconst NAME = \"KHR_xmp_json_ld\";\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_xmp_json_ld)\n * @since 5.0.0\n */\nexport class KHR_xmp_json_ld implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n public order = 100;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n }\n\n /**\n * Called after the loader state changes to LOADING.\n */\n public onLoading(): void {\n if (this._loader.rootBabylonMesh === null) {\n return;\n }\n\n const xmp_gltf = (this._loader.gltf.extensions?.KHR_xmp_json_ld as IKHRXmpJsonLd_Gltf);\n const xmp_node = (this._loader.gltf.asset?.extensions?.KHR_xmp_json_ld as IKHRXmpJsonLd_Node);\n if (xmp_gltf && xmp_node) {\n const packet = +xmp_node.packet;\n if (xmp_gltf.packets && packet < xmp_gltf.packets.length) {\n this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {};\n this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet];\n }\n }\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_xmp_json_ld(loader));"]}
@@ -1,38 +0,0 @@
1
- import { Nullable } from "@babylonjs/core/types";
2
- import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
3
- import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
4
- import { IScene, INode, IAnimation } from "../glTFLoaderInterfaces";
5
- import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
6
- import { GLTFLoader } from "../glTFLoader";
7
- /**
8
- * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
9
- */
10
- export declare class MSFT_audio_emitter implements IGLTFLoaderExtension {
11
- /**
12
- * The name of this extension.
13
- */
14
- readonly name = "MSFT_audio_emitter";
15
- /**
16
- * Defines whether this extension is enabled.
17
- */
18
- enabled: boolean;
19
- private _loader;
20
- private _clips;
21
- private _emitters;
22
- /** @hidden */
23
- constructor(loader: GLTFLoader);
24
- /** @hidden */
25
- dispose(): void;
26
- /** @hidden */
27
- onLoading(): void;
28
- /** @hidden */
29
- loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
30
- /** @hidden */
31
- loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
32
- /** @hidden */
33
- loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
34
- private _loadClipAsync;
35
- private _loadEmitterAsync;
36
- private _getEventAction;
37
- private _loadAnimationEventAsync;
38
- }