@babylonjs/loaders 5.0.0-rc.7 → 5.0.0-rc.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/index.js +4 -4
  3. package/OBJ/mtlFileLoader.d.ts +41 -41
  4. package/OBJ/mtlFileLoader.js +232 -232
  5. package/OBJ/objFileLoader.d.ts +126 -126
  6. package/OBJ/objFileLoader.js +296 -296
  7. package/OBJ/objLoadingOptions.d.ts +43 -43
  8. package/OBJ/objLoadingOptions.js +1 -1
  9. package/OBJ/solidParser.d.ts +154 -154
  10. package/OBJ/solidParser.js +693 -693
  11. package/STL/index.d.ts +1 -1
  12. package/STL/index.js +1 -1
  13. package/STL/stlFileLoader.d.ts +64 -64
  14. package/STL/stlFileLoader.js +233 -233
  15. package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
  16. package/glTF/1.0/glTFBinaryExtension.js +60 -60
  17. package/glTF/1.0/glTFLoader.d.ts +136 -136
  18. package/glTF/1.0/glTFLoader.js +1815 -1815
  19. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
  20. package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
  21. package/glTF/1.0/glTFLoaderUtils.d.ts +62 -62
  22. package/glTF/1.0/glTFLoaderUtils.js +250 -250
  23. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
  24. package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
  25. package/glTF/1.0/index.d.ts +5 -5
  26. package/glTF/1.0/index.js +5 -5
  27. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
  28. package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
  29. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
  30. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
  31. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
  32. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
  33. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
  34. package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
  35. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
  36. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
  37. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
  38. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
  39. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
  40. package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
  41. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
  42. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
  43. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
  44. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
  45. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
  46. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
  47. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
  48. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
  49. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
  50. package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
  51. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
  52. package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
  53. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
  54. package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
  55. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
  56. package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
  57. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
  58. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
  59. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
  60. package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
  61. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
  62. package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
  63. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
  64. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
  65. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
  66. package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
  67. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
  68. package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
  69. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
  70. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
  71. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
  72. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
  73. package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
  74. package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
  75. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
  76. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
  77. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
  78. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
  79. package/glTF/2.0/Extensions/index.d.ts +26 -26
  80. package/glTF/2.0/Extensions/index.js +26 -26
  81. package/glTF/2.0/glTFLoader.d.ts +405 -405
  82. package/glTF/2.0/glTFLoader.js +2366 -2366
  83. package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
  84. package/glTF/2.0/glTFLoaderExtension.js +1 -1
  85. package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
  86. package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
  87. package/glTF/2.0/index.d.ts +4 -4
  88. package/glTF/2.0/index.js +4 -4
  89. package/glTF/glTFFileLoader.d.ts +433 -433
  90. package/glTF/glTFFileLoader.js +927 -927
  91. package/glTF/glTFValidation.d.ts +29 -29
  92. package/glTF/glTFValidation.js +123 -123
  93. package/glTF/index.d.ts +5 -5
  94. package/glTF/index.js +5 -5
  95. package/index.d.ts +3 -3
  96. package/index.js +3 -3
  97. package/legacy/legacy-glTF.d.ts +2 -2
  98. package/legacy/legacy-glTF.js +18 -18
  99. package/legacy/legacy-glTF1.d.ts +2 -2
  100. package/legacy/legacy-glTF1.js +14 -14
  101. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  102. package/legacy/legacy-glTF1FileLoader.js +3 -3
  103. package/legacy/legacy-glTF2.d.ts +2 -2
  104. package/legacy/legacy-glTF2.js +32 -32
  105. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  106. package/legacy/legacy-glTF2FileLoader.js +3 -3
  107. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  108. package/legacy/legacy-glTFFileLoader.js +4 -4
  109. package/legacy/legacy-objFileLoader.d.ts +1 -1
  110. package/legacy/legacy-objFileLoader.js +12 -12
  111. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  112. package/legacy/legacy-stlFileLoader.js +12 -12
  113. package/legacy/legacy.d.ts +6 -6
  114. package/legacy/legacy.js +7 -7
  115. package/package.json +3 -3
@@ -1,126 +1,126 @@
1
- import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
2
- import { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderAsyncResult } from "@babylonjs/core/Loading/sceneLoader.js";
3
- import { AssetContainer } from "@babylonjs/core/assetContainer.js";
4
- import { Scene } from "@babylonjs/core/scene.js";
5
- import { OBJLoadingOptions } from "./objLoadingOptions";
6
- /**
7
- * OBJ file type loader.
8
- * This is a babylon scene loader plugin.
9
- */
10
- export declare class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
11
- /**
12
- * Defines if UVs are optimized by default during load.
13
- */
14
- static OPTIMIZE_WITH_UV: boolean;
15
- /**
16
- * Invert model on y-axis (does a model scaling inversion)
17
- */
18
- static INVERT_Y: boolean;
19
- /**
20
- * Invert Y-Axis of referenced textures on load
21
- */
22
- static get INVERT_TEXTURE_Y(): boolean;
23
- static set INVERT_TEXTURE_Y(value: boolean);
24
- /**
25
- * Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
26
- */
27
- static IMPORT_VERTEX_COLORS: boolean;
28
- /**
29
- * Compute the normals for the model, even if normals are present in the file.
30
- */
31
- static COMPUTE_NORMALS: boolean;
32
- /**
33
- * Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces.
34
- * Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.
35
- */
36
- static OPTIMIZE_NORMALS: boolean;
37
- /**
38
- * Defines custom scaling of UV coordinates of loaded meshes.
39
- */
40
- static UV_SCALING: Vector2;
41
- /**
42
- * Skip loading the materials even if defined in the OBJ file (materials are ignored).
43
- */
44
- static SKIP_MATERIALS: boolean;
45
- /**
46
- * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
47
- *
48
- * Defaults to true for backwards compatibility.
49
- */
50
- static MATERIAL_LOADING_FAILS_SILENTLY: boolean;
51
- /**
52
- * Defines the name of the plugin.
53
- */
54
- name: string;
55
- /**
56
- * Defines the extension the plugin is able to load.
57
- */
58
- extensions: string;
59
- private _assetContainer;
60
- private _loadingOptions;
61
- /**
62
- * Creates loader for .OBJ files
63
- *
64
- * @param loadingOptions options for loading and parsing OBJ/MTL files.
65
- */
66
- constructor(loadingOptions?: OBJLoadingOptions);
67
- private static get _DefaultLoadingOptions();
68
- /**
69
- * Calls synchronously the MTL file attached to this obj.
70
- * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
71
- * Without this function materials are not displayed in the first frame (but displayed after).
72
- * In consequence it is impossible to get material information in your HTML file
73
- *
74
- * @param url The URL of the MTL file
75
- * @param rootUrl defines where to load data from
76
- * @param onSuccess Callback function to be called when the MTL file is loaded
77
- * @param onFailure
78
- */
79
- private _loadMTL;
80
- /**
81
- * Instantiates a OBJ file loader plugin.
82
- * @returns the created plugin
83
- */
84
- createPlugin(): ISceneLoaderPluginAsync | ISceneLoaderPlugin;
85
- /**
86
- * If the data string can be loaded directly.
87
- * @returns if the data can be loaded directly
88
- */
89
- canDirectLoad(): boolean;
90
- /**
91
- * Imports one or more meshes from the loaded OBJ data and adds them to the scene
92
- * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
93
- * @param scene the scene the meshes should be added to
94
- * @param data the OBJ data to load
95
- * @param rootUrl root url to load from
96
- * @returns a promise containing the loaded meshes, particles, skeletons and animations
97
- */
98
- importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string): Promise<ISceneLoaderAsyncResult>;
99
- /**
100
- * Imports all objects from the loaded OBJ data and adds them to the scene
101
- * @param scene the scene the objects should be added to
102
- * @param data the OBJ data to load
103
- * @param rootUrl root url to load from
104
- * @returns a promise which completes when objects have been loaded to the scene
105
- */
106
- loadAsync(scene: Scene, data: string, rootUrl: string): Promise<void>;
107
- /**
108
- * Load into an asset container.
109
- * @param scene The scene to load into
110
- * @param data The data to import
111
- * @param rootUrl The root url for scene and resources
112
- * @returns The loaded asset container
113
- */
114
- loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string): Promise<AssetContainer>;
115
- /**
116
- * Read the OBJ file and create an Array of meshes.
117
- * Each mesh contains all information given by the OBJ and the MTL file.
118
- * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
119
- * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file
120
- * @param scene defines the scene where are displayed the data
121
- * @param data defines the content of the obj file
122
- * @param rootUrl defines the path to the folder
123
- * @returns the list of loaded meshes
124
- */
125
- private _parseSolid;
126
- }
1
+ import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
2
+ import { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderAsyncResult } from "@babylonjs/core/Loading/sceneLoader.js";
3
+ import { AssetContainer } from "@babylonjs/core/assetContainer.js";
4
+ import { Scene } from "@babylonjs/core/scene.js";
5
+ import { OBJLoadingOptions } from "./objLoadingOptions";
6
+ /**
7
+ * OBJ file type loader.
8
+ * This is a babylon scene loader plugin.
9
+ */
10
+ export declare class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
11
+ /**
12
+ * Defines if UVs are optimized by default during load.
13
+ */
14
+ static OPTIMIZE_WITH_UV: boolean;
15
+ /**
16
+ * Invert model on y-axis (does a model scaling inversion)
17
+ */
18
+ static INVERT_Y: boolean;
19
+ /**
20
+ * Invert Y-Axis of referenced textures on load
21
+ */
22
+ static get INVERT_TEXTURE_Y(): boolean;
23
+ static set INVERT_TEXTURE_Y(value: boolean);
24
+ /**
25
+ * Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
26
+ */
27
+ static IMPORT_VERTEX_COLORS: boolean;
28
+ /**
29
+ * Compute the normals for the model, even if normals are present in the file.
30
+ */
31
+ static COMPUTE_NORMALS: boolean;
32
+ /**
33
+ * Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces.
34
+ * Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.
35
+ */
36
+ static OPTIMIZE_NORMALS: boolean;
37
+ /**
38
+ * Defines custom scaling of UV coordinates of loaded meshes.
39
+ */
40
+ static UV_SCALING: Vector2;
41
+ /**
42
+ * Skip loading the materials even if defined in the OBJ file (materials are ignored).
43
+ */
44
+ static SKIP_MATERIALS: boolean;
45
+ /**
46
+ * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
47
+ *
48
+ * Defaults to true for backwards compatibility.
49
+ */
50
+ static MATERIAL_LOADING_FAILS_SILENTLY: boolean;
51
+ /**
52
+ * Defines the name of the plugin.
53
+ */
54
+ name: string;
55
+ /**
56
+ * Defines the extension the plugin is able to load.
57
+ */
58
+ extensions: string;
59
+ private _assetContainer;
60
+ private _loadingOptions;
61
+ /**
62
+ * Creates loader for .OBJ files
63
+ *
64
+ * @param loadingOptions options for loading and parsing OBJ/MTL files.
65
+ */
66
+ constructor(loadingOptions?: OBJLoadingOptions);
67
+ private static get _DefaultLoadingOptions();
68
+ /**
69
+ * Calls synchronously the MTL file attached to this obj.
70
+ * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
71
+ * Without this function materials are not displayed in the first frame (but displayed after).
72
+ * In consequence it is impossible to get material information in your HTML file
73
+ *
74
+ * @param url The URL of the MTL file
75
+ * @param rootUrl defines where to load data from
76
+ * @param onSuccess Callback function to be called when the MTL file is loaded
77
+ * @param onFailure
78
+ */
79
+ private _loadMTL;
80
+ /**
81
+ * Instantiates a OBJ file loader plugin.
82
+ * @returns the created plugin
83
+ */
84
+ createPlugin(): ISceneLoaderPluginAsync | ISceneLoaderPlugin;
85
+ /**
86
+ * If the data string can be loaded directly.
87
+ * @returns if the data can be loaded directly
88
+ */
89
+ canDirectLoad(): boolean;
90
+ /**
91
+ * Imports one or more meshes from the loaded OBJ data and adds them to the scene
92
+ * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
93
+ * @param scene the scene the meshes should be added to
94
+ * @param data the OBJ data to load
95
+ * @param rootUrl root url to load from
96
+ * @returns a promise containing the loaded meshes, particles, skeletons and animations
97
+ */
98
+ importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string): Promise<ISceneLoaderAsyncResult>;
99
+ /**
100
+ * Imports all objects from the loaded OBJ data and adds them to the scene
101
+ * @param scene the scene the objects should be added to
102
+ * @param data the OBJ data to load
103
+ * @param rootUrl root url to load from
104
+ * @returns a promise which completes when objects have been loaded to the scene
105
+ */
106
+ loadAsync(scene: Scene, data: string, rootUrl: string): Promise<void>;
107
+ /**
108
+ * Load into an asset container.
109
+ * @param scene The scene to load into
110
+ * @param data The data to import
111
+ * @param rootUrl The root url for scene and resources
112
+ * @returns The loaded asset container
113
+ */
114
+ loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string): Promise<AssetContainer>;
115
+ /**
116
+ * Read the OBJ file and create an Array of meshes.
117
+ * Each mesh contains all information given by the OBJ and the MTL file.
118
+ * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
119
+ * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file
120
+ * @param scene defines the scene where are displayed the data
121
+ * @param data defines the content of the obj file
122
+ * @param rootUrl defines the path to the folder
123
+ * @returns the list of loaded meshes
124
+ */
125
+ private _parseSolid;
126
+ }