@babylonjs/loaders 5.0.0-rc.1 → 5.0.0-rc.10
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,31 +1,39 @@
|
|
1
|
-
import { Nullable } from "@babylonjs/core/types";
|
2
|
-
import { Material } from "@babylonjs/core/Materials/material";
|
3
|
-
import { IMaterial } from "../glTFLoaderInterfaces";
|
4
|
-
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
-
import { GLTFLoader } from "../glTFLoader";
|
6
|
-
/**
|
7
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)
|
8
|
-
* @since 5.0.0
|
9
|
-
*/
|
10
|
-
export declare class KHR_materials_volume implements IGLTFLoaderExtension {
|
11
|
-
/**
|
12
|
-
* The name of this extension.
|
13
|
-
*/
|
14
|
-
readonly name = "KHR_materials_volume";
|
15
|
-
/**
|
16
|
-
* Defines whether this extension is enabled.
|
17
|
-
*/
|
18
|
-
enabled: boolean;
|
19
|
-
/**
|
20
|
-
* Defines a number that determines the order the extensions are applied.
|
21
|
-
*/
|
22
|
-
order: number;
|
23
|
-
private _loader;
|
24
|
-
/**
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import type { Material } from "@babylonjs/core/Materials/material.js";
|
3
|
+
import type { IMaterial } from "../glTFLoaderInterfaces";
|
4
|
+
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
+
import { GLTFLoader } from "../glTFLoader";
|
6
|
+
/**
|
7
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)
|
8
|
+
* @since 5.0.0
|
9
|
+
*/
|
10
|
+
export declare class KHR_materials_volume implements IGLTFLoaderExtension {
|
11
|
+
/**
|
12
|
+
* The name of this extension.
|
13
|
+
*/
|
14
|
+
readonly name = "KHR_materials_volume";
|
15
|
+
/**
|
16
|
+
* Defines whether this extension is enabled.
|
17
|
+
*/
|
18
|
+
enabled: boolean;
|
19
|
+
/**
|
20
|
+
* Defines a number that determines the order the extensions are applied.
|
21
|
+
*/
|
22
|
+
order: number;
|
23
|
+
private _loader;
|
24
|
+
/**
|
25
|
+
* @param loader
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
constructor(loader: GLTFLoader);
|
29
|
+
/** @hidden */
|
30
|
+
dispose(): void;
|
31
|
+
/**
|
32
|
+
* @param context
|
33
|
+
* @param material
|
34
|
+
* @param babylonMaterial
|
35
|
+
* @hidden
|
36
|
+
*/
|
37
|
+
loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
38
|
+
private _loadVolumePropertiesAsync;
|
39
|
+
}
|
@@ -1,79 +1,86 @@
|
|
1
|
-
import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
|
2
|
-
import { GLTFLoader } from "../glTFLoader
|
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
|
-
/**
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
this.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
babylonMaterial.subSurface.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
77
|
-
|
78
|
-
|
1
|
+
import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
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
|
+
/**
|
10
|
+
* @param loader
|
11
|
+
* @hidden
|
12
|
+
*/
|
13
|
+
function KHR_materials_volume(loader) {
|
14
|
+
/**
|
15
|
+
* The name of this extension.
|
16
|
+
*/
|
17
|
+
this.name = NAME;
|
18
|
+
/**
|
19
|
+
* Defines a number that determines the order the extensions are applied.
|
20
|
+
*/
|
21
|
+
this.order = 173;
|
22
|
+
this._loader = loader;
|
23
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
24
|
+
if (this.enabled) {
|
25
|
+
// We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh
|
26
|
+
this._loader._disableInstancedMesh++;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
/** @hidden */
|
30
|
+
KHR_materials_volume.prototype.dispose = function () {
|
31
|
+
if (this.enabled) {
|
32
|
+
this._loader._disableInstancedMesh--;
|
33
|
+
}
|
34
|
+
this._loader = null;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* @param context
|
38
|
+
* @param material
|
39
|
+
* @param babylonMaterial
|
40
|
+
* @hidden
|
41
|
+
*/
|
42
|
+
KHR_materials_volume.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
|
43
|
+
var _this = this;
|
44
|
+
return GLTFLoader.LoadExtensionAsync(context, material, this.name, function (extensionContext, extension) {
|
45
|
+
var promises = new Array();
|
46
|
+
promises.push(_this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
|
47
|
+
promises.push(_this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
48
|
+
promises.push(_this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));
|
49
|
+
return Promise.all(promises).then(function () { });
|
50
|
+
});
|
51
|
+
};
|
52
|
+
KHR_materials_volume.prototype._loadVolumePropertiesAsync = function (context, material, babylonMaterial, extension) {
|
53
|
+
if (!(babylonMaterial instanceof PBRMaterial)) {
|
54
|
+
throw new Error("".concat(context, ": Material type not supported"));
|
55
|
+
}
|
56
|
+
// If transparency isn't enabled already, this extension shouldn't do anything.
|
57
|
+
// i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.
|
58
|
+
if ((!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled) || !extension.thicknessFactor) {
|
59
|
+
return Promise.resolve();
|
60
|
+
}
|
61
|
+
// IOR in this extension only affects interior.
|
62
|
+
babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;
|
63
|
+
var attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;
|
64
|
+
babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;
|
65
|
+
if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {
|
66
|
+
babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);
|
67
|
+
}
|
68
|
+
babylonMaterial.subSurface.minimumThickness = 0.0;
|
69
|
+
babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;
|
70
|
+
babylonMaterial.subSurface.useThicknessAsDepth = true;
|
71
|
+
if (extension.thicknessTexture) {
|
72
|
+
extension.thicknessTexture.nonColorData = true;
|
73
|
+
return this._loader.loadTextureInfoAsync("".concat(context, "/thicknessTexture"), extension.thicknessTexture).then(function (texture) {
|
74
|
+
babylonMaterial.subSurface.thicknessTexture = texture;
|
75
|
+
babylonMaterial.subSurface.useGltfStyleTextures = true;
|
76
|
+
});
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
return Promise.resolve();
|
80
|
+
}
|
81
|
+
};
|
82
|
+
return KHR_materials_volume;
|
83
|
+
}());
|
84
|
+
export { KHR_materials_volume };
|
85
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_materials_volume(loader); });
|
79
86
|
//# sourceMappingURL=KHR_materials_volume.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KHR_materials_volume.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"KHR_materials_volume.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_materials_volume.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qDAAuC;AAK7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,sBAAsB,CAAC;AASpC;;;GAGG;AACH;IAkBI;;;OAGG;IACH,8BAAY,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;QAClD,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,qH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AAC;gBACtD,eAAe,CAAC,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAC3D,CAAC,CAAC,CAAC;SACN;aAAM;YACH,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC5B;IACL,CAAC;IACL,2BAAC;AAAD,CAAC,AAvFD,IAuFC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,oBAAoB,CAAC,MAAM,CAAC,EAAhC,CAAgC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IMaterial, ITextureInfo } from \"../glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader } from \"../glTFLoader\";\r\n\r\nconst NAME = \"KHR_materials_volume\";\r\n\r\ninterface IMaterialsTransmission {\r\n attenuationColor?: number[];\r\n attenuationDistance?: number;\r\n thicknessTexture?: ITextureInfo;\r\n thicknessFactor?: number;\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)\r\n * @since 5.0.0\r\n */\r\nexport class KHR_materials_volume 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 = 173;\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 if (this.enabled) {\r\n // We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh\r\n this._loader._disableInstancedMesh++;\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n if (this.enabled) {\r\n this._loader._disableInstancedMesh--;\r\n }\r\n (this._loader as any) = null;\r\n }\r\n\r\n /**\r\n * @param context\r\n * @param material\r\n * @param babylonMaterial\r\n * @hidden\r\n */\r\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IMaterialsTransmission>(context, material, this.name, (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\r\n promises.push(this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));\r\n return Promise.all(promises).then(() => {});\r\n });\r\n }\r\n\r\n private _loadVolumePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material, extension: IMaterialsTransmission): Promise<void> {\r\n if (!(babylonMaterial instanceof PBRMaterial)) {\r\n throw new Error(`${context}: Material type not supported`);\r\n }\r\n\r\n // If transparency isn't enabled already, this extension shouldn't do anything.\r\n // i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.\r\n if ((!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled) || !extension.thicknessFactor) {\r\n return Promise.resolve();\r\n }\r\n\r\n // IOR in this extension only affects interior.\r\n babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;\r\n const attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;\r\n babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;\r\n if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {\r\n babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);\r\n }\r\n\r\n babylonMaterial.subSurface.minimumThickness = 0.0;\r\n babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;\r\n babylonMaterial.subSurface.useThicknessAsDepth = true;\r\n if (extension.thicknessTexture) {\r\n (extension.thicknessTexture as ITextureInfo).nonColorData = true;\r\n return this._loader.loadTextureInfoAsync(`${context}/thicknessTexture`, extension.thicknessTexture).then((texture: BaseTexture) => {\r\n babylonMaterial.subSurface.thicknessTexture = texture;\r\n babylonMaterial.subSurface.useGltfStyleTextures = true;\r\n });\r\n } else {\r\n return Promise.resolve();\r\n }\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_volume(loader));\r\n"]}
|
@@ -1,19 +1,22 @@
|
|
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
|
-
/**
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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_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
|
+
/**
|
16
|
+
* @param loader
|
17
|
+
* @hidden
|
18
|
+
*/
|
19
|
+
constructor(loader: GLTFLoader);
|
20
|
+
/** @hidden */
|
21
|
+
dispose(): void;
|
22
|
+
}
|
@@ -1,22 +1,24 @@
|
|
1
|
-
import { GLTFLoader } from "../glTFLoader
|
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
|
-
/**
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
import { GLTFLoader } from "../glTFLoader";
|
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
|
+
/**
|
8
|
+
* @param loader
|
9
|
+
* @hidden
|
10
|
+
*/
|
11
|
+
function KHR_mesh_quantization(loader) {
|
12
|
+
/**
|
13
|
+
* The name of this extension.
|
14
|
+
*/
|
15
|
+
this.name = NAME;
|
16
|
+
this.enabled = loader.isExtensionUsed(NAME);
|
17
|
+
}
|
18
|
+
/** @hidden */
|
19
|
+
KHR_mesh_quantization.prototype.dispose = function () { };
|
20
|
+
return KHR_mesh_quantization;
|
21
|
+
}());
|
22
|
+
export { KHR_mesh_quantization };
|
23
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_mesh_quantization(loader); });
|
22
24
|
//# sourceMappingURL=KHR_mesh_quantization.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KHR_mesh_quantization.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"KHR_mesh_quantization.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_mesh_quantization.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,IAAM,IAAI,GAAG,uBAAuB,CAAC;AAErC;;GAEG;AACH;IAWI;;;OAGG;IACH,+BAAY,MAAkB;QAd9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAYxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;IACP,uCAAO,GAAd,cAAkB,CAAC;IACvB,4BAAC;AAAD,CAAC,AArBD,IAqBC;;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 { 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 /**\r\n * @param loader\r\n * @hidden\r\n */\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\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_mesh_quantization(loader));\r\n"]}
|
@@ -1,21 +1,29 @@
|
|
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
|
-
/**
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
3
|
+
import type { ITexture } from "../glTFLoaderInterfaces";
|
4
|
+
import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
5
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
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
|
+
/**
|
16
|
+
* @param loader
|
17
|
+
* @hidden
|
18
|
+
*/
|
19
|
+
constructor(loader: GLTFLoader);
|
20
|
+
/** @hidden */
|
21
|
+
dispose(): void;
|
22
|
+
/**
|
23
|
+
* @param context
|
24
|
+
* @param texture
|
25
|
+
* @param assign
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
_loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
29
|
+
}
|
@@ -1,33 +1,41 @@
|
|
1
|
-
import { GLTFLoader, ArrayItem } from "../glTFLoader
|
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
|
-
/**
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
this.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
import { GLTFLoader, ArrayItem } from "../glTFLoader";
|
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
|
+
/**
|
8
|
+
* @param loader
|
9
|
+
* @hidden
|
10
|
+
*/
|
11
|
+
function KHR_texture_basisu(loader) {
|
12
|
+
/** The name of this extension. */
|
13
|
+
this.name = NAME;
|
14
|
+
this._loader = loader;
|
15
|
+
this.enabled = loader.isExtensionUsed(NAME);
|
16
|
+
}
|
17
|
+
/** @hidden */
|
18
|
+
KHR_texture_basisu.prototype.dispose = function () {
|
19
|
+
this._loader = null;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* @param context
|
23
|
+
* @param texture
|
24
|
+
* @param assign
|
25
|
+
* @hidden
|
26
|
+
*/
|
27
|
+
KHR_texture_basisu.prototype._loadTextureAsync = function (context, texture, assign) {
|
28
|
+
var _this = this;
|
29
|
+
return GLTFLoader.LoadExtensionAsync(context, texture, this.name, function (extensionContext, extension) {
|
30
|
+
var sampler = texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get("".concat(context, "/sampler"), _this._loader.gltf.samplers, texture.sampler);
|
31
|
+
var image = ArrayItem.Get("".concat(extensionContext, "/source"), _this._loader.gltf.images, extension.source);
|
32
|
+
return _this._loader._createTextureAsync(context, sampler, image, function (babylonTexture) {
|
33
|
+
assign(babylonTexture);
|
34
|
+
}, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture._textureInfo.nonColorData);
|
35
|
+
});
|
36
|
+
};
|
37
|
+
return KHR_texture_basisu;
|
38
|
+
}());
|
39
|
+
export { KHR_texture_basisu };
|
40
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_basisu(loader); });
|
33
41
|
//# sourceMappingURL=KHR_texture_basisu.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KHR_texture_basisu.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"KHR_texture_basisu.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_texture_basisu.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMtD,IAAM,IAAI,GAAG,oBAAoB,CAAC;AAElC;;GAEG;AACH;IASI;;;OAGG;IACH,4BAAY,MAAkB;QAZ9B,kCAAkC;QAClB,SAAI,GAAG,IAAI,CAAC;QAYxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;IACP,oCAAO,GAAd;QACK,IA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\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\nimport type { ITexture } from \"../glTFLoaderInterfaces\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { 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 /**\r\n * @param loader\r\n * @hidden\r\n */\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 /**\r\n * @param context\r\n * @param texture\r\n * @param assign\r\n * @hidden\r\n */\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(\r\n context,\r\n sampler,\r\n image,\r\n (babylonTexture) => {\r\n assign(babylonTexture);\r\n },\r\n texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined,\r\n !texture._textureInfo.nonColorData\r\n );\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_texture_basisu(loader));\r\n"]}
|
@@ -1,25 +1,33 @@
|
|
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
|
-
/**
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
1
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
3
|
+
import type { ITextureInfo } from "../glTFLoaderInterfaces";
|
4
|
+
import type { 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
|
+
/**
|
20
|
+
* @param loader
|
21
|
+
* @hidden
|
22
|
+
*/
|
23
|
+
constructor(loader: GLTFLoader);
|
24
|
+
/** @hidden */
|
25
|
+
dispose(): void;
|
26
|
+
/**
|
27
|
+
* @param context
|
28
|
+
* @param textureInfo
|
29
|
+
* @param assign
|
30
|
+
* @hidden
|
31
|
+
*/
|
32
|
+
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
33
|
+
}
|