@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,869 +0,0 @@
1
- import { Observable } from "@babylonjs/core/Misc/observable.js";
2
- import { Tools } from "@babylonjs/core/Misc/tools.js";
3
- import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader.js";
4
- import { AssetContainer } from "@babylonjs/core/assetContainer.js";
5
- import { Logger } from '@babylonjs/core/Misc/logger.js';
6
- import { DataReader } from '@babylonjs/core/Misc/dataReader.js';
7
- import { GLTFValidation } from './glTFValidation.js';
8
- import { DecodeBase64UrlToBinary } from '@babylonjs/core/Misc/fileTools.js';
9
- import { StringTools } from '@babylonjs/core/Misc/stringTools.js';
10
- function readAsync(arrayBuffer, byteOffset, byteLength) {
11
- try {
12
- return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength));
13
- }
14
- catch (e) {
15
- return Promise.reject(e);
16
- }
17
- }
18
- /**
19
- * Mode that determines the coordinate system to use.
20
- */
21
- export var GLTFLoaderCoordinateSystemMode;
22
- (function (GLTFLoaderCoordinateSystemMode) {
23
- /**
24
- * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
25
- */
26
- GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["AUTO"] = 0] = "AUTO";
27
- /**
28
- * Sets the useRightHandedSystem flag on the scene.
29
- */
30
- GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED";
31
- })(GLTFLoaderCoordinateSystemMode || (GLTFLoaderCoordinateSystemMode = {}));
32
- /**
33
- * Mode that determines what animations will start.
34
- */
35
- export var GLTFLoaderAnimationStartMode;
36
- (function (GLTFLoaderAnimationStartMode) {
37
- /**
38
- * No animation will start.
39
- */
40
- GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["NONE"] = 0] = "NONE";
41
- /**
42
- * The first animation will start.
43
- */
44
- GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["FIRST"] = 1] = "FIRST";
45
- /**
46
- * All animations will start.
47
- */
48
- GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["ALL"] = 2] = "ALL";
49
- })(GLTFLoaderAnimationStartMode || (GLTFLoaderAnimationStartMode = {}));
50
- /**
51
- * Loader state.
52
- */
53
- export var GLTFLoaderState;
54
- (function (GLTFLoaderState) {
55
- /**
56
- * The asset is loading.
57
- */
58
- GLTFLoaderState[GLTFLoaderState["LOADING"] = 0] = "LOADING";
59
- /**
60
- * The asset is ready for rendering.
61
- */
62
- GLTFLoaderState[GLTFLoaderState["READY"] = 1] = "READY";
63
- /**
64
- * The asset is completely loaded.
65
- */
66
- GLTFLoaderState[GLTFLoaderState["COMPLETE"] = 2] = "COMPLETE";
67
- })(GLTFLoaderState || (GLTFLoaderState = {}));
68
- /**
69
- * File loader for loading glTF files into a scene.
70
- */
71
- var GLTFFileLoader = /** @class */ (function () {
72
- function GLTFFileLoader() {
73
- // --------------
74
- // Common options
75
- // --------------
76
- /**
77
- * Raised when the asset has been parsed
78
- */
79
- this.onParsedObservable = new Observable();
80
- // ----------
81
- // V2 options
82
- // ----------
83
- /**
84
- * The coordinate system mode. Defaults to AUTO.
85
- */
86
- this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
87
- /**
88
- * The animation start mode. Defaults to FIRST.
89
- */
90
- this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
91
- /**
92
- * Defines if the loader should compile materials before raising the success callback. Defaults to false.
93
- */
94
- this.compileMaterials = false;
95
- /**
96
- * Defines if the loader should also compile materials with clip planes. Defaults to false.
97
- */
98
- this.useClipPlane = false;
99
- /**
100
- * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
101
- */
102
- this.compileShadowGenerators = false;
103
- /**
104
- * Defines if the Alpha blended materials are only applied as coverage.
105
- * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
106
- * If true, no extra effects are applied to transparent pixels.
107
- */
108
- this.transparencyAsCoverage = false;
109
- /**
110
- * Defines if the loader should use range requests when load binary glTF files from HTTP.
111
- * Enabling will disable offline support and glTF validator.
112
- * Defaults to false.
113
- */
114
- this.useRangeRequests = false;
115
- /**
116
- * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
117
- */
118
- this.createInstances = true;
119
- /**
120
- * 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.
121
- */
122
- this.alwaysComputeBoundingBox = false;
123
- /**
124
- * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
125
- */
126
- this.loadAllMaterials = false;
127
- /**
128
- * 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.
129
- */
130
- this.useSRGBBuffers = true;
131
- /**
132
- * When loading glTF animations, which are defined in seconds, target them to this FPS.
133
- */
134
- this.targetFps = 60;
135
- /**
136
- * Function called before loading a url referenced by the asset.
137
- */
138
- this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
139
- /**
140
- * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
141
- * 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, ...)
142
- */
143
- this.onMeshLoadedObservable = new Observable();
144
- /**
145
- * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
146
- */
147
- this.onTextureLoadedObservable = new Observable();
148
- /**
149
- * Observable raised when the loader creates a material after parsing the glTF properties of the material.
150
- */
151
- this.onMaterialLoadedObservable = new Observable();
152
- /**
153
- * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
154
- */
155
- this.onCameraLoadedObservable = new Observable();
156
- /**
157
- * Observable raised when the asset is completely loaded, immediately before the loader is disposed.
158
- * For assets with LODs, raised when all of the LODs are complete.
159
- * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
160
- */
161
- this.onCompleteObservable = new Observable();
162
- /**
163
- * Observable raised when an error occurs.
164
- */
165
- this.onErrorObservable = new Observable();
166
- /**
167
- * Observable raised after the loader is disposed.
168
- */
169
- this.onDisposeObservable = new Observable();
170
- /**
171
- * Observable raised after a loader extension is created.
172
- * Set additional options for a loader extension in this event.
173
- */
174
- this.onExtensionLoadedObservable = new Observable();
175
- /**
176
- * Defines if the loader should validate the asset.
177
- */
178
- this.validate = false;
179
- /**
180
- * Observable raised after validation when validate is set to true. The event data is the result of the validation.
181
- */
182
- this.onValidatedObservable = new Observable();
183
- this._loader = null;
184
- this._state = null;
185
- this._requests = new Array();
186
- /**
187
- * Name of the loader ("gltf")
188
- */
189
- this.name = "gltf";
190
- /** @hidden */
191
- this.extensions = {
192
- ".gltf": { isBinary: false },
193
- ".glb": { isBinary: true }
194
- };
195
- /**
196
- * Observable raised when the loader state changes.
197
- */
198
- this.onLoaderStateChangedObservable = new Observable();
199
- this._logIndentLevel = 0;
200
- this._loggingEnabled = false;
201
- /** @hidden */
202
- this._log = this._logDisabled;
203
- this._capturePerformanceCounters = false;
204
- /** @hidden */
205
- this._startPerformanceCounter = this._startPerformanceCounterDisabled;
206
- /** @hidden */
207
- this._endPerformanceCounter = this._endPerformanceCounterDisabled;
208
- }
209
- Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
210
- /**
211
- * Raised when the asset has been parsed
212
- */
213
- set: function (callback) {
214
- if (this._onParsedObserver) {
215
- this.onParsedObservable.remove(this._onParsedObserver);
216
- }
217
- this._onParsedObserver = this.onParsedObservable.add(callback);
218
- },
219
- enumerable: false,
220
- configurable: true
221
- });
222
- Object.defineProperty(GLTFFileLoader.prototype, "onMeshLoaded", {
223
- /**
224
- * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
225
- * 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, ...)
226
- */
227
- set: function (callback) {
228
- if (this._onMeshLoadedObserver) {
229
- this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);
230
- }
231
- this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(callback);
232
- },
233
- enumerable: false,
234
- configurable: true
235
- });
236
- Object.defineProperty(GLTFFileLoader.prototype, "onTextureLoaded", {
237
- /**
238
- * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
239
- */
240
- set: function (callback) {
241
- if (this._onTextureLoadedObserver) {
242
- this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);
243
- }
244
- this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(callback);
245
- },
246
- enumerable: false,
247
- configurable: true
248
- });
249
- Object.defineProperty(GLTFFileLoader.prototype, "onMaterialLoaded", {
250
- /**
251
- * Callback raised when the loader creates a material after parsing the glTF properties of the material.
252
- */
253
- set: function (callback) {
254
- if (this._onMaterialLoadedObserver) {
255
- this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);
256
- }
257
- this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(callback);
258
- },
259
- enumerable: false,
260
- configurable: true
261
- });
262
- Object.defineProperty(GLTFFileLoader.prototype, "onCameraLoaded", {
263
- /**
264
- * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
265
- */
266
- set: function (callback) {
267
- if (this._onCameraLoadedObserver) {
268
- this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver);
269
- }
270
- this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(callback);
271
- },
272
- enumerable: false,
273
- configurable: true
274
- });
275
- Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
276
- /**
277
- * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
278
- * For assets with LODs, raised when all of the LODs are complete.
279
- * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
280
- */
281
- set: function (callback) {
282
- if (this._onCompleteObserver) {
283
- this.onCompleteObservable.remove(this._onCompleteObserver);
284
- }
285
- this._onCompleteObserver = this.onCompleteObservable.add(callback);
286
- },
287
- enumerable: false,
288
- configurable: true
289
- });
290
- Object.defineProperty(GLTFFileLoader.prototype, "onError", {
291
- /**
292
- * Callback raised when an error occurs.
293
- */
294
- set: function (callback) {
295
- if (this._onErrorObserver) {
296
- this.onErrorObservable.remove(this._onErrorObserver);
297
- }
298
- this._onErrorObserver = this.onErrorObservable.add(callback);
299
- },
300
- enumerable: false,
301
- configurable: true
302
- });
303
- Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
304
- /**
305
- * Callback raised after the loader is disposed.
306
- */
307
- set: function (callback) {
308
- if (this._onDisposeObserver) {
309
- this.onDisposeObservable.remove(this._onDisposeObserver);
310
- }
311
- this._onDisposeObserver = this.onDisposeObservable.add(callback);
312
- },
313
- enumerable: false,
314
- configurable: true
315
- });
316
- Object.defineProperty(GLTFFileLoader.prototype, "onExtensionLoaded", {
317
- /**
318
- * Callback raised after a loader extension is created.
319
- */
320
- set: function (callback) {
321
- if (this._onExtensionLoadedObserver) {
322
- this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);
323
- }
324
- this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(callback);
325
- },
326
- enumerable: false,
327
- configurable: true
328
- });
329
- Object.defineProperty(GLTFFileLoader.prototype, "loggingEnabled", {
330
- /**
331
- * Defines if the loader logging is enabled.
332
- */
333
- get: function () {
334
- return this._loggingEnabled;
335
- },
336
- set: function (value) {
337
- if (this._loggingEnabled === value) {
338
- return;
339
- }
340
- this._loggingEnabled = value;
341
- if (this._loggingEnabled) {
342
- this._log = this._logEnabled;
343
- }
344
- else {
345
- this._log = this._logDisabled;
346
- }
347
- },
348
- enumerable: false,
349
- configurable: true
350
- });
351
- Object.defineProperty(GLTFFileLoader.prototype, "capturePerformanceCounters", {
352
- /**
353
- * Defines if the loader should capture performance counters.
354
- */
355
- get: function () {
356
- return this._capturePerformanceCounters;
357
- },
358
- set: function (value) {
359
- if (this._capturePerformanceCounters === value) {
360
- return;
361
- }
362
- this._capturePerformanceCounters = value;
363
- if (this._capturePerformanceCounters) {
364
- this._startPerformanceCounter = this._startPerformanceCounterEnabled;
365
- this._endPerformanceCounter = this._endPerformanceCounterEnabled;
366
- }
367
- else {
368
- this._startPerformanceCounter = this._startPerformanceCounterDisabled;
369
- this._endPerformanceCounter = this._endPerformanceCounterDisabled;
370
- }
371
- },
372
- enumerable: false,
373
- configurable: true
374
- });
375
- Object.defineProperty(GLTFFileLoader.prototype, "onValidated", {
376
- /**
377
- * Callback raised after a loader extension is created.
378
- */
379
- set: function (callback) {
380
- if (this._onValidatedObserver) {
381
- this.onValidatedObservable.remove(this._onValidatedObserver);
382
- }
383
- this._onValidatedObserver = this.onValidatedObservable.add(callback);
384
- },
385
- enumerable: false,
386
- configurable: true
387
- });
388
- /**
389
- * Disposes the loader, releases resources during load, and cancels any outstanding requests.
390
- */
391
- GLTFFileLoader.prototype.dispose = function () {
392
- if (this._loader) {
393
- this._loader.dispose();
394
- this._loader = null;
395
- }
396
- for (var _i = 0, _a = this._requests; _i < _a.length; _i++) {
397
- var request = _a[_i];
398
- request.abort();
399
- }
400
- this._requests.length = 0;
401
- delete this._progressCallback;
402
- this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
403
- this.onMeshLoadedObservable.clear();
404
- this.onTextureLoadedObservable.clear();
405
- this.onMaterialLoadedObservable.clear();
406
- this.onCameraLoadedObservable.clear();
407
- this.onCompleteObservable.clear();
408
- this.onExtensionLoadedObservable.clear();
409
- this.onDisposeObservable.notifyObservers(undefined);
410
- this.onDisposeObservable.clear();
411
- };
412
- /** @hidden */
413
- GLTFFileLoader.prototype.loadFile = function (scene, fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError) {
414
- var _this = this;
415
- this._progressCallback = onProgress;
416
- if (useArrayBuffer) {
417
- if (this.useRangeRequests) {
418
- if (this.validate) {
419
- Logger.Warn("glTF validation is not supported when range requests are enabled");
420
- }
421
- var fileRequest_1 = {
422
- abort: function () { },
423
- onCompleteObservable: new Observable()
424
- };
425
- var dataBuffer = {
426
- readAsync: function (byteOffset, byteLength) {
427
- return new Promise(function (resolve, reject) {
428
- _this._loadFile(scene, fileOrUrl, function (data) {
429
- resolve(new Uint8Array(data));
430
- }, true, function (error) {
431
- reject(error);
432
- }, function (webRequest) {
433
- webRequest.setRequestHeader("Range", "bytes=".concat(byteOffset, "-").concat(byteOffset + byteLength - 1));
434
- });
435
- });
436
- },
437
- byteLength: 0
438
- };
439
- this._unpackBinaryAsync(new DataReader(dataBuffer)).then(function (loaderData) {
440
- fileRequest_1.onCompleteObservable.notifyObservers(fileRequest_1);
441
- onSuccess(loaderData);
442
- }, onError ? function (error) { return onError(undefined, error); } : undefined);
443
- return fileRequest_1;
444
- }
445
- return this._loadFile(scene, fileOrUrl, function (data) {
446
- var arrayBuffer = data;
447
- _this._unpackBinaryAsync(new DataReader({
448
- readAsync: function (byteOffset, byteLength) { return readAsync(arrayBuffer, byteOffset, byteLength); },
449
- byteLength: arrayBuffer.byteLength
450
- })).then(function (loaderData) {
451
- onSuccess(loaderData);
452
- }, onError ? function (error) { return onError(undefined, error); } : undefined);
453
- }, true, onError);
454
- }
455
- return this._loadFile(scene, fileOrUrl, function (data) {
456
- if (fileOrUrl.name) {
457
- _this._validate(scene, data, "file:", fileOrUrl.name);
458
- }
459
- else {
460
- var url = fileOrUrl;
461
- _this._validate(scene, data, Tools.GetFolderPath(url), Tools.GetFilename(url));
462
- }
463
- onSuccess({ json: _this._parseJson(data) });
464
- }, useArrayBuffer, onError);
465
- };
466
- /** @hidden */
467
- GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress, fileName) {
468
- var _this = this;
469
- return Promise.resolve().then(function () {
470
- _this.onParsedObservable.notifyObservers(data);
471
- _this.onParsedObservable.clear();
472
- _this._log("Loading ".concat(fileName || ""));
473
- _this._loader = _this._getLoader(data);
474
- return _this._loader.importMeshAsync(meshesNames, scene, null, data, rootUrl, onProgress, fileName);
475
- });
476
- };
477
- /** @hidden */
478
- GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress, fileName) {
479
- var _this = this;
480
- return Promise.resolve().then(function () {
481
- _this.onParsedObservable.notifyObservers(data);
482
- _this.onParsedObservable.clear();
483
- _this._log("Loading ".concat(fileName || ""));
484
- _this._loader = _this._getLoader(data);
485
- return _this._loader.loadAsync(scene, data, rootUrl, onProgress, fileName);
486
- });
487
- };
488
- /** @hidden */
489
- GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress, fileName) {
490
- var _this = this;
491
- return Promise.resolve().then(function () {
492
- _this.onParsedObservable.notifyObservers(data);
493
- _this.onParsedObservable.clear();
494
- _this._log("Loading ".concat(fileName || ""));
495
- _this._loader = _this._getLoader(data);
496
- // Prepare the asset container.
497
- var container = new AssetContainer(scene);
498
- // Get materials/textures when loading to add to container
499
- var materials = [];
500
- _this.onMaterialLoadedObservable.add(function (material) {
501
- materials.push(material);
502
- });
503
- var textures = [];
504
- _this.onTextureLoadedObservable.add(function (texture) {
505
- textures.push(texture);
506
- });
507
- var cameras = [];
508
- _this.onCameraLoadedObservable.add(function (camera) {
509
- cameras.push(camera);
510
- });
511
- return _this._loader.importMeshAsync(null, scene, container, data, rootUrl, onProgress, fileName).then(function (result) {
512
- Array.prototype.push.apply(container.geometries, result.geometries);
513
- Array.prototype.push.apply(container.meshes, result.meshes);
514
- Array.prototype.push.apply(container.particleSystems, result.particleSystems);
515
- Array.prototype.push.apply(container.skeletons, result.skeletons);
516
- Array.prototype.push.apply(container.animationGroups, result.animationGroups);
517
- Array.prototype.push.apply(container.materials, materials);
518
- Array.prototype.push.apply(container.textures, textures);
519
- Array.prototype.push.apply(container.lights, result.lights);
520
- Array.prototype.push.apply(container.transformNodes, result.transformNodes);
521
- Array.prototype.push.apply(container.cameras, cameras);
522
- return container;
523
- });
524
- });
525
- };
526
- /** @hidden */
527
- GLTFFileLoader.prototype.canDirectLoad = function (data) {
528
- return (data.indexOf("asset") !== -1 && data.indexOf("version") !== -1)
529
- || StringTools.StartsWith(data, "data:base64," + GLTFFileLoader.magicBase64Encoded) // this is technically incorrect, but will continue to support for backcompat.
530
- || StringTools.StartsWith(data, "data:;base64," + GLTFFileLoader.magicBase64Encoded)
531
- || StringTools.StartsWith(data, "data:application/octet-stream;base64," + GLTFFileLoader.magicBase64Encoded)
532
- || StringTools.StartsWith(data, "data:model/gltf-binary;base64," + GLTFFileLoader.magicBase64Encoded);
533
- };
534
- /** @hidden */
535
- GLTFFileLoader.prototype.directLoad = function (scene, data) {
536
- if (StringTools.StartsWith(data, "base64," + GLTFFileLoader.magicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
537
- StringTools.StartsWith(data, ";base64," + GLTFFileLoader.magicBase64Encoded) ||
538
- StringTools.StartsWith(data, "application/octet-stream;base64," + GLTFFileLoader.magicBase64Encoded) ||
539
- StringTools.StartsWith(data, "model/gltf-binary;base64," + GLTFFileLoader.magicBase64Encoded)) {
540
- var arrayBuffer_1 = DecodeBase64UrlToBinary(data);
541
- this._validate(scene, arrayBuffer_1);
542
- return this._unpackBinaryAsync(new DataReader({
543
- readAsync: function (byteOffset, byteLength) { return readAsync(arrayBuffer_1, byteOffset, byteLength); },
544
- byteLength: arrayBuffer_1.byteLength
545
- }));
546
- }
547
- this._validate(scene, data);
548
- return Promise.resolve({ json: this._parseJson(data) });
549
- };
550
- /** @hidden */
551
- GLTFFileLoader.prototype.createPlugin = function () {
552
- return new GLTFFileLoader();
553
- };
554
- Object.defineProperty(GLTFFileLoader.prototype, "loaderState", {
555
- /**
556
- * The loader state or null if the loader is not active.
557
- */
558
- get: function () {
559
- return this._state;
560
- },
561
- enumerable: false,
562
- configurable: true
563
- });
564
- /**
565
- * Returns a promise that resolves when the asset is completely loaded.
566
- * @returns a promise that resolves when the asset is completely loaded.
567
- */
568
- GLTFFileLoader.prototype.whenCompleteAsync = function () {
569
- var _this = this;
570
- return new Promise(function (resolve, reject) {
571
- _this.onCompleteObservable.addOnce(function () {
572
- resolve();
573
- });
574
- _this.onErrorObservable.addOnce(function (reason) {
575
- reject(reason);
576
- });
577
- });
578
- };
579
- /** @hidden */
580
- GLTFFileLoader.prototype._setState = function (state) {
581
- if (this._state === state) {
582
- return;
583
- }
584
- this._state = state;
585
- this.onLoaderStateChangedObservable.notifyObservers(this._state);
586
- this._log(GLTFLoaderState[this._state]);
587
- };
588
- /** @hidden */
589
- GLTFFileLoader.prototype._loadFile = function (scene, fileOrUrl, onSuccess, useArrayBuffer, onError, onOpened) {
590
- var _this = this;
591
- var request = scene._loadFile(fileOrUrl, onSuccess, function (event) {
592
- _this._onProgress(event, request);
593
- }, true, useArrayBuffer, onError, onOpened);
594
- request.onCompleteObservable.add(function (request) {
595
- _this._requests.splice(_this._requests.indexOf(request), 1);
596
- });
597
- this._requests.push(request);
598
- return request;
599
- };
600
- GLTFFileLoader.prototype._onProgress = function (event, request) {
601
- if (!this._progressCallback) {
602
- return;
603
- }
604
- request._lengthComputable = event.lengthComputable;
605
- request._loaded = event.loaded;
606
- request._total = event.total;
607
- var lengthComputable = true;
608
- var loaded = 0;
609
- var total = 0;
610
- for (var _i = 0, _a = this._requests; _i < _a.length; _i++) {
611
- var request_1 = _a[_i];
612
- if (request_1._lengthComputable === undefined || request_1._loaded === undefined || request_1._total === undefined) {
613
- return;
614
- }
615
- lengthComputable = lengthComputable && request_1._lengthComputable;
616
- loaded += request_1._loaded;
617
- total += request_1._total;
618
- }
619
- this._progressCallback({
620
- lengthComputable: lengthComputable,
621
- loaded: loaded,
622
- total: lengthComputable ? total : 0
623
- });
624
- };
625
- GLTFFileLoader.prototype._validate = function (scene, data, rootUrl, fileName) {
626
- var _this = this;
627
- if (rootUrl === void 0) { rootUrl = ""; }
628
- if (fileName === void 0) { fileName = ""; }
629
- if (!this.validate) {
630
- return;
631
- }
632
- this._startPerformanceCounter("Validate JSON");
633
- GLTFValidation.ValidateAsync(data, rootUrl, fileName, function (uri) {
634
- return _this.preprocessUrlAsync(rootUrl + uri).then(function (url) { return scene._loadFileAsync(url, undefined, true, true); });
635
- }).then(function (result) {
636
- _this._endPerformanceCounter("Validate JSON");
637
- _this.onValidatedObservable.notifyObservers(result);
638
- _this.onValidatedObservable.clear();
639
- }, function (reason) {
640
- _this._endPerformanceCounter("Validate JSON");
641
- Tools.Warn("Failed to validate: ".concat(reason.message));
642
- _this.onValidatedObservable.clear();
643
- });
644
- };
645
- GLTFFileLoader.prototype._getLoader = function (loaderData) {
646
- var asset = loaderData.json.asset || {};
647
- this._log("Asset version: ".concat(asset.version));
648
- asset.minVersion && this._log("Asset minimum version: ".concat(asset.minVersion));
649
- asset.generator && this._log("Asset generator: ".concat(asset.generator));
650
- var version = GLTFFileLoader._parseVersion(asset.version);
651
- if (!version) {
652
- throw new Error("Invalid version: " + asset.version);
653
- }
654
- if (asset.minVersion !== undefined) {
655
- var minVersion = GLTFFileLoader._parseVersion(asset.minVersion);
656
- if (!minVersion) {
657
- throw new Error("Invalid minimum version: " + asset.minVersion);
658
- }
659
- if (GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 }) > 0) {
660
- throw new Error("Incompatible minimum version: " + asset.minVersion);
661
- }
662
- }
663
- var createLoaders = {
664
- 1: GLTFFileLoader._CreateGLTF1Loader,
665
- 2: GLTFFileLoader._CreateGLTF2Loader
666
- };
667
- var createLoader = createLoaders[version.major];
668
- if (!createLoader) {
669
- throw new Error("Unsupported version: " + asset.version);
670
- }
671
- return createLoader(this);
672
- };
673
- GLTFFileLoader.prototype._parseJson = function (json) {
674
- this._startPerformanceCounter("Parse JSON");
675
- this._log("JSON length: ".concat(json.length));
676
- var parsed = JSON.parse(json);
677
- this._endPerformanceCounter("Parse JSON");
678
- return parsed;
679
- };
680
- GLTFFileLoader.prototype._unpackBinaryAsync = function (dataReader) {
681
- var _this = this;
682
- this._startPerformanceCounter("Unpack Binary");
683
- // Read magic + version + length + json length + json format
684
- return dataReader.loadAsync(20).then(function () {
685
- var Binary = {
686
- Magic: 0x46546C67
687
- };
688
- var magic = dataReader.readUint32();
689
- if (magic !== Binary.Magic) {
690
- throw new Error("Unexpected magic: " + magic);
691
- }
692
- var version = dataReader.readUint32();
693
- if (_this.loggingEnabled) {
694
- _this._log("Binary version: ".concat(version));
695
- }
696
- var length = dataReader.readUint32();
697
- if (dataReader.buffer.byteLength !== 0 && length !== dataReader.buffer.byteLength) {
698
- throw new Error("Length in header does not match actual data length: ".concat(length, " != ").concat(dataReader.buffer.byteLength));
699
- }
700
- var unpacked;
701
- switch (version) {
702
- case 1: {
703
- unpacked = _this._unpackBinaryV1Async(dataReader, length);
704
- break;
705
- }
706
- case 2: {
707
- unpacked = _this._unpackBinaryV2Async(dataReader, length);
708
- break;
709
- }
710
- default: {
711
- throw new Error("Unsupported version: " + version);
712
- }
713
- }
714
- _this._endPerformanceCounter("Unpack Binary");
715
- return unpacked;
716
- });
717
- };
718
- GLTFFileLoader.prototype._unpackBinaryV1Async = function (dataReader, length) {
719
- var ContentFormat = {
720
- JSON: 0
721
- };
722
- var contentLength = dataReader.readUint32();
723
- var contentFormat = dataReader.readUint32();
724
- if (contentFormat !== ContentFormat.JSON) {
725
- throw new Error("Unexpected content format: ".concat(contentFormat));
726
- }
727
- var bodyLength = length - dataReader.byteOffset;
728
- var data = { json: this._parseJson(dataReader.readString(contentLength)), bin: null };
729
- if (bodyLength !== 0) {
730
- var startByteOffset_1 = dataReader.byteOffset;
731
- data.bin = {
732
- readAsync: function (byteOffset, byteLength) { return dataReader.buffer.readAsync(startByteOffset_1 + byteOffset, byteLength); },
733
- byteLength: bodyLength
734
- };
735
- }
736
- return Promise.resolve(data);
737
- };
738
- GLTFFileLoader.prototype._unpackBinaryV2Async = function (dataReader, length) {
739
- var _this = this;
740
- var ChunkFormat = {
741
- JSON: 0x4E4F534A,
742
- BIN: 0x004E4942
743
- };
744
- // Read the JSON chunk header.
745
- var chunkLength = dataReader.readUint32();
746
- var chunkFormat = dataReader.readUint32();
747
- if (chunkFormat !== ChunkFormat.JSON) {
748
- throw new Error("First chunk format is not JSON");
749
- }
750
- // Bail if there are no other chunks.
751
- if (dataReader.byteOffset + chunkLength === length) {
752
- return dataReader.loadAsync(chunkLength).then(function () {
753
- return { json: _this._parseJson(dataReader.readString(chunkLength)), bin: null };
754
- });
755
- }
756
- // Read the JSON chunk and the length and type of the next chunk.
757
- return dataReader.loadAsync(chunkLength + 8).then(function () {
758
- var data = { json: _this._parseJson(dataReader.readString(chunkLength)), bin: null };
759
- var readAsync = function () {
760
- var chunkLength = dataReader.readUint32();
761
- var chunkFormat = dataReader.readUint32();
762
- switch (chunkFormat) {
763
- case ChunkFormat.JSON: {
764
- throw new Error("Unexpected JSON chunk");
765
- }
766
- case ChunkFormat.BIN: {
767
- var startByteOffset_2 = dataReader.byteOffset;
768
- data.bin = {
769
- readAsync: function (byteOffset, byteLength) { return dataReader.buffer.readAsync(startByteOffset_2 + byteOffset, byteLength); },
770
- byteLength: chunkLength
771
- };
772
- dataReader.skipBytes(chunkLength);
773
- break;
774
- }
775
- default: {
776
- // ignore unrecognized chunkFormat
777
- dataReader.skipBytes(chunkLength);
778
- break;
779
- }
780
- }
781
- if (dataReader.byteOffset !== length) {
782
- return dataReader.loadAsync(8).then(readAsync);
783
- }
784
- return Promise.resolve(data);
785
- };
786
- return readAsync();
787
- });
788
- };
789
- GLTFFileLoader._parseVersion = function (version) {
790
- if (version === "1.0" || version === "1.0.1") {
791
- return {
792
- major: 1,
793
- minor: 0
794
- };
795
- }
796
- var match = (version + "").match(/^(\d+)\.(\d+)/);
797
- if (!match) {
798
- return null;
799
- }
800
- return {
801
- major: parseInt(match[1]),
802
- minor: parseInt(match[2])
803
- };
804
- };
805
- GLTFFileLoader._compareVersion = function (a, b) {
806
- if (a.major > b.major) {
807
- return 1;
808
- }
809
- if (a.major < b.major) {
810
- return -1;
811
- }
812
- if (a.minor > b.minor) {
813
- return 1;
814
- }
815
- if (a.minor < b.minor) {
816
- return -1;
817
- }
818
- return 0;
819
- };
820
- /** @hidden */
821
- GLTFFileLoader.prototype._logOpen = function (message) {
822
- this._log(message);
823
- this._logIndentLevel++;
824
- };
825
- /** @hidden */
826
- GLTFFileLoader.prototype._logClose = function () {
827
- --this._logIndentLevel;
828
- };
829
- GLTFFileLoader.prototype._logEnabled = function (message) {
830
- var spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2);
831
- Logger.Log("".concat(spaces).concat(message));
832
- };
833
- GLTFFileLoader.prototype._logDisabled = function (message) {
834
- };
835
- GLTFFileLoader.prototype._startPerformanceCounterEnabled = function (counterName) {
836
- Tools.StartPerformanceCounter(counterName);
837
- };
838
- GLTFFileLoader.prototype._startPerformanceCounterDisabled = function (counterName) {
839
- };
840
- GLTFFileLoader.prototype._endPerformanceCounterEnabled = function (counterName) {
841
- Tools.EndPerformanceCounter(counterName);
842
- };
843
- GLTFFileLoader.prototype._endPerformanceCounterDisabled = function (counterName) {
844
- };
845
- // ----------
846
- // V1 options
847
- // ----------
848
- /**
849
- * 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.
850
- * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
851
- * Defaults to true.
852
- * @hidden
853
- */
854
- GLTFFileLoader.IncrementalLoading = true;
855
- /**
856
- * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
857
- * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
858
- * @hidden
859
- */
860
- GLTFFileLoader.HomogeneousCoordinates = false;
861
- GLTFFileLoader.magicBase64Encoded = "Z2xURg"; // "glTF" base64 encoded (without the quotes!)
862
- GLTFFileLoader._logSpaces = " ";
863
- return GLTFFileLoader;
864
- }());
865
- export { GLTFFileLoader };
866
- if (SceneLoader) {
867
- SceneLoader.RegisterPlugin(new GLTFFileLoader());
868
- }
869
- //# sourceMappingURL=glTFFileLoader.js.map