@babylonjs/loaders 5.0.0-rc.0 → 5.0.0-rc.11
Sign up to get free protection for your applications and to get access to all the features.
- package/OBJ/index.d.ts +4 -4
- package/OBJ/index.js +4 -4
- package/OBJ/index.js.map +1 -1
- package/OBJ/mtlFileLoader.d.ts +41 -40
- package/OBJ/mtlFileLoader.js +232 -231
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.d.ts +126 -133
- package/OBJ/objFileLoader.js +296 -300
- package/OBJ/objFileLoader.js.map +1 -1
- package/OBJ/objLoadingOptions.d.ts +43 -43
- package/OBJ/objLoadingOptions.js +1 -1
- package/OBJ/objLoadingOptions.js.map +1 -1
- package/OBJ/solidParser.d.ts +154 -153
- package/OBJ/solidParser.js +693 -699
- package/OBJ/solidParser.js.map +1 -1
- package/STL/index.d.ts +1 -1
- package/STL/index.js +1 -1
- package/STL/index.js.map +1 -1
- package/STL/stlFileLoader.d.ts +64 -71
- package/STL/stlFileLoader.js +233 -239
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -61
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +136 -106
- package/glTF/1.0/glTFLoader.js +1814 -1696
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
- package/glTF/1.0/glTFLoaderUtils.js +250 -232
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -127
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/1.0/index.d.ts +5 -5
- package/glTF/1.0/index.js +5 -5
- package/glTF/1.0/index.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -36
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -110
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -28
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -80
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -27
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -42
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -21
- package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -32
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -32
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -55
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -101
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -28
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -81
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -86
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -45
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -34
- package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -54
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -72
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -76
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -66
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -76
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -277
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -30
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -65
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -76
- package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -243
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -31
- package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -78
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -19
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -21
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -21
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -32
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -25
- package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -53
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -29
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -46
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -38
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -216
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -75
- package/glTF/2.0/Extensions/MSFT_lod.js +369 -333
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/Extensions/index.d.ts +26 -26
- package/glTF/2.0/Extensions/index.js +26 -26
- package/glTF/2.0/Extensions/index.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +406 -357
- package/glTF/2.0/glTFLoader.js +2366 -2266
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
- package/glTF/2.0/glTFLoaderExtension.js +1 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -209
- package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/2.0/index.d.ts +4 -4
- package/glTF/2.0/index.js +5 -4
- package/glTF/2.0/index.js.map +1 -1
- package/glTF/glTFFileLoader.d.ts +433 -373
- package/glTF/glTFFileLoader.js +927 -870
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -121
- package/glTF/glTFValidation.js.map +1 -1
- package/glTF/index.d.ts +5 -5
- package/glTF/index.js +6 -5
- package/glTF/index.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js +18 -18
- package/legacy/legacy-glTF.js.map +1 -1
- package/legacy/legacy-glTF1.d.ts +2 -2
- package/legacy/legacy-glTF1.js +15 -14
- package/legacy/legacy-glTF1.js.map +1 -1
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF1FileLoader.js +3 -2
- package/legacy/legacy-glTF1FileLoader.js.map +1 -1
- package/legacy/legacy-glTF2.d.ts +2 -2
- package/legacy/legacy-glTF2.js +33 -32
- package/legacy/legacy-glTF2.js.map +1 -1
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.js +3 -2
- package/legacy/legacy-glTF2FileLoader.js.map +1 -1
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -3
- package/legacy/legacy-glTFFileLoader.js.map +1 -1
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js +13 -12
- package/legacy/legacy-objFileLoader.js.map +1 -1
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js +13 -12
- package/legacy/legacy-stlFileLoader.js.map +1 -1
- package/legacy/legacy.d.ts +6 -6
- package/legacy/legacy.js +8 -6
- package/legacy/legacy.js.map +1 -1
- package/package.json +23 -198
- package/readme.md +2 -2
@@ -1,54 +1,62 @@
|
|
1
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
2
|
-
import { GLTFLoader } from "../glTFLoader
|
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
|
-
/**
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
babylonTexture
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
1
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
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
|
+
/**
|
9
|
+
* @param loader
|
10
|
+
* @hidden
|
11
|
+
*/
|
12
|
+
function KHR_texture_transform(loader) {
|
13
|
+
/**
|
14
|
+
* The name of this extension.
|
15
|
+
*/
|
16
|
+
this.name = NAME;
|
17
|
+
this._loader = loader;
|
18
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
19
|
+
}
|
20
|
+
/** @hidden */
|
21
|
+
KHR_texture_transform.prototype.dispose = function () {
|
22
|
+
this._loader = null;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* @param context
|
26
|
+
* @param textureInfo
|
27
|
+
* @param assign
|
28
|
+
* @hidden
|
29
|
+
*/
|
30
|
+
KHR_texture_transform.prototype.loadTextureInfoAsync = function (context, textureInfo, assign) {
|
31
|
+
var _this = this;
|
32
|
+
return GLTFLoader.LoadExtensionAsync(context, textureInfo, this.name, function (extensionContext, extension) {
|
33
|
+
return _this._loader.loadTextureInfoAsync(context, textureInfo, function (babylonTexture) {
|
34
|
+
if (!(babylonTexture instanceof Texture)) {
|
35
|
+
throw new Error("".concat(extensionContext, ": Texture type not supported"));
|
36
|
+
}
|
37
|
+
if (extension.offset) {
|
38
|
+
babylonTexture.uOffset = extension.offset[0];
|
39
|
+
babylonTexture.vOffset = extension.offset[1];
|
40
|
+
}
|
41
|
+
// Always rotate around the origin.
|
42
|
+
babylonTexture.uRotationCenter = 0;
|
43
|
+
babylonTexture.vRotationCenter = 0;
|
44
|
+
if (extension.rotation) {
|
45
|
+
babylonTexture.wAng = -extension.rotation;
|
46
|
+
}
|
47
|
+
if (extension.scale) {
|
48
|
+
babylonTexture.uScale = extension.scale[0];
|
49
|
+
babylonTexture.vScale = extension.scale[1];
|
50
|
+
}
|
51
|
+
if (extension.texCoord != undefined) {
|
52
|
+
babylonTexture.coordinatesIndex = extension.texCoord;
|
53
|
+
}
|
54
|
+
assign(babylonTexture);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
};
|
58
|
+
return KHR_texture_transform;
|
59
|
+
}());
|
60
|
+
export { KHR_texture_transform };
|
61
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_transform(loader); });
|
54
62
|
//# sourceMappingURL=KHR_texture_transform.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KHR_texture_transform.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"KHR_texture_transform.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_texture_transform.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAI1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,IAAM,IAAI,GAAG,uBAAuB,CAAC;AAErC;;GAEG;AACH;IAaI;;;OAGG;IACH,+BAAY,MAAkB;QAhB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAcxB,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;;;;;OAKG;IACI,oDAAoB,GAA3B,UAA4B,OAAe,EAAE,WAAyB,EAAE,MAA6C;QAArH,iBAgCC;QA/BG,OAAO,UAAU,CAAC,kBAAkB,CAAoC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YACjI,OAAO,KAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,UAAC,cAAc;gBAC1E,IAAI,CAAC,CAAC,cAAc,YAAY,OAAO,CAAC,EAAE;oBACtC,MAAM,IAAI,KAAK,CAAC,UAAG,gBAAgB,iCAA8B,CAAC,CAAC;iBACtE;gBAED,IAAI,SAAS,CAAC,MAAM,EAAE;oBAClB,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBAC7C,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAChD;gBAED,mCAAmC;gBACnC,cAAc,CAAC,eAAe,GAAG,CAAC,CAAC;gBACnC,cAAc,CAAC,eAAe,GAAG,CAAC,CAAC;gBAEnC,IAAI,SAAS,CAAC,QAAQ,EAAE;oBACpB,cAAc,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;iBAC7C;gBAED,IAAI,SAAS,CAAC,KAAK,EAAE;oBACjB,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC3C,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBAC9C;gBAED,IAAI,SAAS,CAAC,QAAQ,IAAI,SAAS,EAAE;oBACjC,cAAc,CAAC,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC;iBACxD;gBAED,MAAM,CAAC,cAAc,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,4BAAC;AAAD,CAAC,AAlED,IAkEC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAjC,CAAiC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\nimport type { ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { 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 /**\r\n * @param loader\r\n * @hidden\r\n */\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 /**\r\n * @param context\r\n * @param textureInfo\r\n * @param assign\r\n * @hidden\r\n */\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));\r\n"]}
|
@@ -1,29 +1,32 @@
|
|
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
|
-
/**
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
1
|
+
import type { 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
|
+
/**
|
22
|
+
* @param loader
|
23
|
+
* @hidden
|
24
|
+
*/
|
25
|
+
constructor(loader: GLTFLoader);
|
26
|
+
/** @hidden */
|
27
|
+
dispose(): void;
|
28
|
+
/**
|
29
|
+
* Called after the loader state changes to LOADING.
|
30
|
+
*/
|
31
|
+
onLoading(): void;
|
32
|
+
}
|
@@ -1,47 +1,50 @@
|
|
1
|
-
import { GLTFLoader } from "../glTFLoader
|
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
|
-
/**
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
-
|
46
|
-
|
1
|
+
import { GLTFLoader } from "../glTFLoader";
|
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
|
+
/**
|
9
|
+
* @param loader
|
10
|
+
* @hidden
|
11
|
+
*/
|
12
|
+
function KHR_xmp_json_ld(loader) {
|
13
|
+
/**
|
14
|
+
* The name of this extension.
|
15
|
+
*/
|
16
|
+
this.name = NAME;
|
17
|
+
/**
|
18
|
+
* Defines a number that determines the order the extensions are applied.
|
19
|
+
*/
|
20
|
+
this.order = 100;
|
21
|
+
this._loader = loader;
|
22
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
23
|
+
}
|
24
|
+
/** @hidden */
|
25
|
+
KHR_xmp_json_ld.prototype.dispose = function () {
|
26
|
+
this._loader = null;
|
27
|
+
};
|
28
|
+
/**
|
29
|
+
* Called after the loader state changes to LOADING.
|
30
|
+
*/
|
31
|
+
KHR_xmp_json_ld.prototype.onLoading = function () {
|
32
|
+
var _a, _b, _c;
|
33
|
+
if (this._loader.rootBabylonMesh === null) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
var xmp_gltf = (_a = this._loader.gltf.extensions) === null || _a === void 0 ? void 0 : _a.KHR_xmp_json_ld;
|
37
|
+
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;
|
38
|
+
if (xmp_gltf && xmp_node) {
|
39
|
+
var packet = +xmp_node.packet;
|
40
|
+
if (xmp_gltf.packets && packet < xmp_gltf.packets.length) {
|
41
|
+
this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {};
|
42
|
+
this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet];
|
43
|
+
}
|
44
|
+
}
|
45
|
+
};
|
46
|
+
return KHR_xmp_json_ld;
|
47
|
+
}());
|
48
|
+
export { KHR_xmp_json_ld };
|
49
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_xmp_json_ld(loader); });
|
47
50
|
//# sourceMappingURL=KHR_xmp_json_ld.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KHR_xmp_json_ld.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"KHR_xmp_json_ld.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_xmp_json_ld.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,IAAM,IAAI,GAAG,iBAAiB,CAAC;AAE/B;;;GAGG;AACH;IAkBI;;;OAGG;IACH,yBAAY,MAAkB;QArB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QASf,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,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,0CAAE,eAAqC,CAAC;QACrF,IAAM,QAAQ,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,0CAAE,UAAU,0CAAE,eAAqC,CAAC;QAC5F,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,AAlDD,IAkDC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,eAAe,CAAC,MAAM,CAAC,EAA3B,CAA2B,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\nimport type { IKHRXmpJsonLd_Gltf, IKHRXmpJsonLd_Node } from \"babylonjs-gltf2interface\";\r\n\r\nconst NAME = \"KHR_xmp_json_ld\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_xmp_json_ld)\r\n * @since 5.0.0\r\n */\r\nexport class KHR_xmp_json_ld 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 /**\r\n * Defines a number that determines the order the extensions are applied.\r\n */\r\n public order = 100;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /**\r\n * @param loader\r\n * @hidden\r\n */\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 /**\r\n * Called after the loader state changes to LOADING.\r\n */\r\n public onLoading(): void {\r\n if (this._loader.rootBabylonMesh === null) {\r\n return;\r\n }\r\n\r\n const xmp_gltf = this._loader.gltf.extensions?.KHR_xmp_json_ld as IKHRXmpJsonLd_Gltf;\r\n const xmp_node = this._loader.gltf.asset?.extensions?.KHR_xmp_json_ld as IKHRXmpJsonLd_Node;\r\n if (xmp_gltf && xmp_node) {\r\n const packet = +xmp_node.packet;\r\n if (xmp_gltf.packets && packet < xmp_gltf.packets.length) {\r\n this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {};\r\n this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet];\r\n }\r\n }\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_xmp_json_ld(loader));\r\n"]}
|
@@ -1,38 +1,54 @@
|
|
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
|
-
/**
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
1
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import type { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
3
|
+
import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
4
|
+
import type { IScene, INode, IAnimation } from "../glTFLoaderInterfaces";
|
5
|
+
import type { 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
|
+
/**
|
23
|
+
* @param loader
|
24
|
+
* @hidden
|
25
|
+
*/
|
26
|
+
constructor(loader: GLTFLoader);
|
27
|
+
/** @hidden */
|
28
|
+
dispose(): void;
|
29
|
+
/** @hidden */
|
30
|
+
onLoading(): void;
|
31
|
+
/**
|
32
|
+
* @param context
|
33
|
+
* @param scene
|
34
|
+
* @hidden
|
35
|
+
*/
|
36
|
+
loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
|
37
|
+
/**
|
38
|
+
* @param context
|
39
|
+
* @param node
|
40
|
+
* @param assign
|
41
|
+
* @hidden
|
42
|
+
*/
|
43
|
+
loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
|
44
|
+
/**
|
45
|
+
* @param context
|
46
|
+
* @param animation
|
47
|
+
* @hidden
|
48
|
+
*/
|
49
|
+
loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
50
|
+
private _loadClipAsync;
|
51
|
+
private _loadEmitterAsync;
|
52
|
+
private _getEventAction;
|
53
|
+
private _loadAnimationEventAsync;
|
54
|
+
}
|