@babylonjs/loaders 5.0.0-beta.8 → 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 -357
  123. package/glTF/2.0/glTFLoader.js +0 -2249
  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 -209
  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 -368
  135. package/glTF/glTFFileLoader.js +0 -869
  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,368 +0,0 @@
1
- import * as GLTF2 from "babylonjs-gltf2interface";
2
- import { Nullable } from "@babylonjs/core/types";
3
- import { Observable } from "@babylonjs/core/Misc/observable";
4
- import { Camera } from "@babylonjs/core/Cameras/camera";
5
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
6
- import { Material } from "@babylonjs/core/Materials/material";
7
- import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
8
- import { ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderPluginAsync, ISceneLoaderProgressEvent, ISceneLoaderPluginExtensions, ISceneLoaderAsyncResult } from "@babylonjs/core/Loading/sceneLoader";
9
- import { AssetContainer } from "@babylonjs/core/assetContainer";
10
- import { Scene, IDisposable } from "@babylonjs/core/scene";
11
- import { WebRequest } from "@babylonjs/core/Misc/webRequest";
12
- import { IFileRequest } from "@babylonjs/core/Misc/fileRequest";
13
- import { IDataBuffer } from '@babylonjs/core/Misc/dataReader';
14
- import { LoadFileError } from '@babylonjs/core/Misc/fileTools';
15
- /**
16
- * Mode that determines the coordinate system to use.
17
- */
18
- export declare enum GLTFLoaderCoordinateSystemMode {
19
- /**
20
- * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
21
- */
22
- AUTO = 0,
23
- /**
24
- * Sets the useRightHandedSystem flag on the scene.
25
- */
26
- FORCE_RIGHT_HANDED = 1
27
- }
28
- /**
29
- * Mode that determines what animations will start.
30
- */
31
- export declare enum GLTFLoaderAnimationStartMode {
32
- /**
33
- * No animation will start.
34
- */
35
- NONE = 0,
36
- /**
37
- * The first animation will start.
38
- */
39
- FIRST = 1,
40
- /**
41
- * All animations will start.
42
- */
43
- ALL = 2
44
- }
45
- /**
46
- * Interface that contains the data for the glTF asset.
47
- */
48
- export interface IGLTFLoaderData {
49
- /**
50
- * The object that represents the glTF JSON.
51
- */
52
- json: Object;
53
- /**
54
- * The BIN chunk of a binary glTF.
55
- */
56
- bin: Nullable<IDataBuffer>;
57
- }
58
- /**
59
- * Interface for extending the loader.
60
- */
61
- export interface IGLTFLoaderExtension {
62
- /**
63
- * The name of this extension.
64
- */
65
- readonly name: string;
66
- /**
67
- * Defines whether this extension is enabled.
68
- */
69
- enabled: boolean;
70
- /**
71
- * Defines the order of this extension.
72
- * The loader sorts the extensions using these values when loading.
73
- */
74
- order?: number;
75
- }
76
- /**
77
- * Loader state.
78
- */
79
- export declare enum GLTFLoaderState {
80
- /**
81
- * The asset is loading.
82
- */
83
- LOADING = 0,
84
- /**
85
- * The asset is ready for rendering.
86
- */
87
- READY = 1,
88
- /**
89
- * The asset is completely loaded.
90
- */
91
- COMPLETE = 2
92
- }
93
- /** @hidden */
94
- export interface IGLTFLoader extends IDisposable {
95
- importMeshAsync: (meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<ISceneLoaderAsyncResult>;
96
- loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
97
- }
98
- /**
99
- * File loader for loading glTF files into a scene.
100
- */
101
- export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
102
- /** @hidden */
103
- static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;
104
- /** @hidden */
105
- static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;
106
- /**
107
- * Raised when the asset has been parsed
108
- */
109
- onParsedObservable: Observable<IGLTFLoaderData>;
110
- private _onParsedObserver;
111
- /**
112
- * Raised when the asset has been parsed
113
- */
114
- set onParsed(callback: (loaderData: IGLTFLoaderData) => void);
115
- /**
116
- * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
117
- * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
118
- * Defaults to true.
119
- * @hidden
120
- */
121
- static IncrementalLoading: boolean;
122
- /**
123
- * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
124
- * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
125
- * @hidden
126
- */
127
- static HomogeneousCoordinates: boolean;
128
- /**
129
- * The coordinate system mode. Defaults to AUTO.
130
- */
131
- coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
132
- /**
133
- * The animation start mode. Defaults to FIRST.
134
- */
135
- animationStartMode: GLTFLoaderAnimationStartMode;
136
- /**
137
- * Defines if the loader should compile materials before raising the success callback. Defaults to false.
138
- */
139
- compileMaterials: boolean;
140
- /**
141
- * Defines if the loader should also compile materials with clip planes. Defaults to false.
142
- */
143
- useClipPlane: boolean;
144
- /**
145
- * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
146
- */
147
- compileShadowGenerators: boolean;
148
- /**
149
- * Defines if the Alpha blended materials are only applied as coverage.
150
- * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
151
- * If true, no extra effects are applied to transparent pixels.
152
- */
153
- transparencyAsCoverage: boolean;
154
- /**
155
- * Defines if the loader should use range requests when load binary glTF files from HTTP.
156
- * Enabling will disable offline support and glTF validator.
157
- * Defaults to false.
158
- */
159
- useRangeRequests: boolean;
160
- /**
161
- * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
162
- */
163
- createInstances: boolean;
164
- /**
165
- * Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
166
- */
167
- alwaysComputeBoundingBox: boolean;
168
- /**
169
- * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
170
- */
171
- loadAllMaterials: boolean;
172
- /**
173
- * If true, load the color (gamma encoded) textures into sRGB buffers (if supported by the GPU), which will yield more accurate results when sampling the texture. Defaults to true.
174
- */
175
- useSRGBBuffers: boolean;
176
- /**
177
- * When loading glTF animations, which are defined in seconds, target them to this FPS.
178
- */
179
- targetFps: number;
180
- /**
181
- * Function called before loading a url referenced by the asset.
182
- */
183
- preprocessUrlAsync: (url: string) => Promise<string>;
184
- /**
185
- * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
186
- * Note that the observable is raised as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
187
- */
188
- readonly onMeshLoadedObservable: Observable<AbstractMesh>;
189
- private _onMeshLoadedObserver;
190
- /**
191
- * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
192
- * Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
193
- */
194
- set onMeshLoaded(callback: (mesh: AbstractMesh) => void);
195
- /**
196
- * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
197
- */
198
- readonly onTextureLoadedObservable: Observable<BaseTexture>;
199
- private _onTextureLoadedObserver;
200
- /**
201
- * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
202
- */
203
- set onTextureLoaded(callback: (texture: BaseTexture) => void);
204
- /**
205
- * Observable raised when the loader creates a material after parsing the glTF properties of the material.
206
- */
207
- readonly onMaterialLoadedObservable: Observable<Material>;
208
- private _onMaterialLoadedObserver;
209
- /**
210
- * Callback raised when the loader creates a material after parsing the glTF properties of the material.
211
- */
212
- set onMaterialLoaded(callback: (material: Material) => void);
213
- /**
214
- * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
215
- */
216
- readonly onCameraLoadedObservable: Observable<Camera>;
217
- private _onCameraLoadedObserver;
218
- /**
219
- * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
220
- */
221
- set onCameraLoaded(callback: (camera: Camera) => void);
222
- /**
223
- * Observable raised when the asset is completely loaded, immediately before the loader is disposed.
224
- * For assets with LODs, raised when all of the LODs are complete.
225
- * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
226
- */
227
- readonly onCompleteObservable: Observable<void>;
228
- private _onCompleteObserver;
229
- /**
230
- * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
231
- * For assets with LODs, raised when all of the LODs are complete.
232
- * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
233
- */
234
- set onComplete(callback: () => void);
235
- /**
236
- * Observable raised when an error occurs.
237
- */
238
- readonly onErrorObservable: Observable<any>;
239
- private _onErrorObserver;
240
- /**
241
- * Callback raised when an error occurs.
242
- */
243
- set onError(callback: (reason: any) => void);
244
- /**
245
- * Observable raised after the loader is disposed.
246
- */
247
- readonly onDisposeObservable: Observable<void>;
248
- private _onDisposeObserver;
249
- /**
250
- * Callback raised after the loader is disposed.
251
- */
252
- set onDispose(callback: () => void);
253
- /**
254
- * Observable raised after a loader extension is created.
255
- * Set additional options for a loader extension in this event.
256
- */
257
- readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
258
- private _onExtensionLoadedObserver;
259
- /**
260
- * Callback raised after a loader extension is created.
261
- */
262
- set onExtensionLoaded(callback: (extension: IGLTFLoaderExtension) => void);
263
- /**
264
- * Defines if the loader logging is enabled.
265
- */
266
- get loggingEnabled(): boolean;
267
- set loggingEnabled(value: boolean);
268
- /**
269
- * Defines if the loader should capture performance counters.
270
- */
271
- get capturePerformanceCounters(): boolean;
272
- set capturePerformanceCounters(value: boolean);
273
- /**
274
- * Defines if the loader should validate the asset.
275
- */
276
- validate: boolean;
277
- /**
278
- * Observable raised after validation when validate is set to true. The event data is the result of the validation.
279
- */
280
- readonly onValidatedObservable: Observable<GLTF2.IGLTFValidationResults>;
281
- private _onValidatedObserver;
282
- /**
283
- * Callback raised after a loader extension is created.
284
- */
285
- set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void);
286
- private _loader;
287
- private _state;
288
- private _progressCallback?;
289
- private _requests;
290
- private static magicBase64Encoded;
291
- /**
292
- * Name of the loader ("gltf")
293
- */
294
- name: string;
295
- /** @hidden */
296
- extensions: ISceneLoaderPluginExtensions;
297
- /**
298
- * Disposes the loader, releases resources during load, and cancels any outstanding requests.
299
- */
300
- dispose(): void;
301
- /** @hidden */
302
- loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: any, responseURL?: string) => void, onProgress?: (ev: ISceneLoaderProgressEvent) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void): IFileRequest;
303
- /** @hidden */
304
- importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
305
- /** @hidden */
306
- loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
307
- /** @hidden */
308
- loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
309
- /** @hidden */
310
- canDirectLoad(data: string): boolean;
311
- /** @hidden */
312
- directLoad(scene: Scene, data: string): Promise<any>;
313
- /**
314
- * The callback that allows custom handling of the root url based on the response url.
315
- * @param rootUrl the original root url
316
- * @param responseURL the response url if available
317
- * @returns the new root url
318
- */
319
- rewriteRootURL?(rootUrl: string, responseURL?: string): string;
320
- /** @hidden */
321
- createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
322
- /**
323
- * The loader state or null if the loader is not active.
324
- */
325
- get loaderState(): Nullable<GLTFLoaderState>;
326
- /**
327
- * Observable raised when the loader state changes.
328
- */
329
- onLoaderStateChangedObservable: Observable<Nullable<GLTFLoaderState>>;
330
- /**
331
- * Returns a promise that resolves when the asset is completely loaded.
332
- * @returns a promise that resolves when the asset is completely loaded.
333
- */
334
- whenCompleteAsync(): Promise<void>;
335
- /** @hidden */
336
- _setState(state: GLTFLoaderState): void;
337
- /** @hidden */
338
- _loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
339
- private _onProgress;
340
- private _validate;
341
- private _getLoader;
342
- private _parseJson;
343
- private _unpackBinaryAsync;
344
- private _unpackBinaryV1Async;
345
- private _unpackBinaryV2Async;
346
- private static _parseVersion;
347
- private static _compareVersion;
348
- private static readonly _logSpaces;
349
- private _logIndentLevel;
350
- private _loggingEnabled;
351
- /** @hidden */
352
- _log: (message: string) => void;
353
- /** @hidden */
354
- _logOpen(message: string): void;
355
- /** @hidden */
356
- _logClose(): void;
357
- private _logEnabled;
358
- private _logDisabled;
359
- private _capturePerformanceCounters;
360
- /** @hidden */
361
- _startPerformanceCounter: (counterName: string) => void;
362
- /** @hidden */
363
- _endPerformanceCounter: (counterName: string) => void;
364
- private _startPerformanceCounterEnabled;
365
- private _startPerformanceCounterDisabled;
366
- private _endPerformanceCounterEnabled;
367
- private _endPerformanceCounterDisabled;
368
- }