@onerjs/loaders 8.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/OBJ/index.d.ts +4 -0
  2. package/OBJ/index.js +5 -0
  3. package/OBJ/index.js.map +1 -0
  4. package/OBJ/mtlFileLoader.d.ts +41 -0
  5. package/OBJ/mtlFileLoader.js +231 -0
  6. package/OBJ/mtlFileLoader.js.map +1 -0
  7. package/OBJ/objFileLoader.d.ts +136 -0
  8. package/OBJ/objFileLoader.js +318 -0
  9. package/OBJ/objFileLoader.js.map +1 -0
  10. package/OBJ/objFileLoader.metadata.d.ts +4 -0
  11. package/OBJ/objFileLoader.metadata.js +5 -0
  12. package/OBJ/objFileLoader.metadata.js.map +1 -0
  13. package/OBJ/objLoadingOptions.d.ts +47 -0
  14. package/OBJ/objLoadingOptions.js +2 -0
  15. package/OBJ/objLoadingOptions.js.map +1 -0
  16. package/OBJ/solidParser.d.ts +174 -0
  17. package/OBJ/solidParser.js +862 -0
  18. package/OBJ/solidParser.js.map +1 -0
  19. package/SPLAT/index.d.ts +2 -0
  20. package/SPLAT/index.js +4 -0
  21. package/SPLAT/index.js.map +1 -0
  22. package/SPLAT/splatFileLoader.d.ts +88 -0
  23. package/SPLAT/splatFileLoader.js +562 -0
  24. package/SPLAT/splatFileLoader.js.map +1 -0
  25. package/SPLAT/splatFileLoader.metadata.d.ts +14 -0
  26. package/SPLAT/splatFileLoader.metadata.js +12 -0
  27. package/SPLAT/splatFileLoader.metadata.js.map +1 -0
  28. package/SPLAT/splatLoadingOptions.d.ts +13 -0
  29. package/SPLAT/splatLoadingOptions.js +2 -0
  30. package/SPLAT/splatLoadingOptions.js.map +1 -0
  31. package/STL/index.d.ts +1 -0
  32. package/STL/index.js +2 -0
  33. package/STL/index.js.map +1 -0
  34. package/STL/stlFileLoader.d.ts +78 -0
  35. package/STL/stlFileLoader.js +239 -0
  36. package/STL/stlFileLoader.js.map +1 -0
  37. package/STL/stlFileLoader.metadata.d.ts +8 -0
  38. package/STL/stlFileLoader.metadata.js +8 -0
  39. package/STL/stlFileLoader.metadata.js.map +1 -0
  40. package/bvh/bvhFileLoader.d.ts +69 -0
  41. package/bvh/bvhFileLoader.js +133 -0
  42. package/bvh/bvhFileLoader.js.map +1 -0
  43. package/bvh/bvhFileLoader.metadata.d.ts +8 -0
  44. package/bvh/bvhFileLoader.metadata.js +8 -0
  45. package/bvh/bvhFileLoader.metadata.js.map +1 -0
  46. package/bvh/bvhLoader.d.ts +14 -0
  47. package/bvh/bvhLoader.js +329 -0
  48. package/bvh/bvhLoader.js.map +1 -0
  49. package/bvh/bvhLoadingOptions.d.ts +9 -0
  50. package/bvh/bvhLoadingOptions.js +2 -0
  51. package/bvh/bvhLoadingOptions.js.map +1 -0
  52. package/bvh/index.d.ts +2 -0
  53. package/bvh/index.js +4 -0
  54. package/bvh/index.js.map +1 -0
  55. package/bvh/license.md +21 -0
  56. package/dynamic.d.ts +5 -0
  57. package/dynamic.js +57 -0
  58. package/dynamic.js.map +1 -0
  59. package/glTF/1.0/glTFBinaryExtension.d.ts +16 -0
  60. package/glTF/1.0/glTFBinaryExtension.js +65 -0
  61. package/glTF/1.0/glTFBinaryExtension.js.map +1 -0
  62. package/glTF/1.0/glTFLoader.d.ts +144 -0
  63. package/glTF/1.0/glTFLoader.js +1841 -0
  64. package/glTF/1.0/glTFLoader.js.map +1 -0
  65. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -0
  66. package/glTF/1.0/glTFLoaderInterfaces.js +96 -0
  67. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -0
  68. package/glTF/1.0/glTFLoaderUtils.d.ts +71 -0
  69. package/glTF/1.0/glTFLoaderUtils.js +255 -0
  70. package/glTF/1.0/glTFLoaderUtils.js.map +1 -0
  71. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +13 -0
  72. package/glTF/1.0/glTFMaterialsCommonExtension.js +131 -0
  73. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -0
  74. package/glTF/1.0/index.d.ts +5 -0
  75. package/glTF/1.0/index.js +6 -0
  76. package/glTF/1.0/index.js.map +1 -0
  77. package/glTF/2.0/Extensions/EXT_lights_ies.d.ts +41 -0
  78. package/glTF/2.0/Extensions/EXT_lights_ies.js +84 -0
  79. package/glTF/2.0/Extensions/EXT_lights_ies.js.map +1 -0
  80. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +48 -0
  81. package/glTF/2.0/Extensions/EXT_lights_image_based.js +116 -0
  82. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -0
  83. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.d.ts +43 -0
  84. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js +69 -0
  85. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js.map +1 -0
  86. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +39 -0
  87. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +82 -0
  88. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -0
  89. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +39 -0
  90. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +51 -0
  91. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -0
  92. package/glTF/2.0/Extensions/EXT_texture_avif.d.ts +34 -0
  93. package/glTF/2.0/Extensions/EXT_texture_avif.js +39 -0
  94. package/glTF/2.0/Extensions/EXT_texture_avif.js.map +1 -0
  95. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +33 -0
  96. package/glTF/2.0/Extensions/EXT_texture_webp.js +38 -0
  97. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -0
  98. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +48 -0
  99. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +63 -0
  100. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -0
  101. package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +47 -0
  102. package/glTF/2.0/Extensions/KHR_animation_pointer.data.d.ts +1 -0
  103. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +239 -0
  104. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -0
  105. package/glTF/2.0/Extensions/KHR_animation_pointer.js +78 -0
  106. package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -0
  107. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +47 -0
  108. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +93 -0
  109. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -0
  110. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +352 -0
  111. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +1700 -0
  112. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -0
  113. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +33 -0
  114. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +20 -0
  115. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -0
  116. package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +3 -0
  117. package/glTF/2.0/Extensions/KHR_interactivity/index.js +4 -0
  118. package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -0
  119. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +70 -0
  120. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +450 -0
  121. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -0
  122. package/glTF/2.0/Extensions/KHR_interactivity.d.ts +38 -0
  123. package/glTF/2.0/Extensions/KHR_interactivity.js +151 -0
  124. package/glTF/2.0/Extensions/KHR_interactivity.js.map +1 -0
  125. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +41 -0
  126. package/glTF/2.0/Extensions/KHR_lights_punctual.js +92 -0
  127. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -0
  128. package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +42 -0
  129. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js +61 -0
  130. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js.map +1 -0
  131. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +43 -0
  132. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -0
  133. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -0
  134. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +43 -0
  135. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js +95 -0
  136. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js.map +1 -0
  137. package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +43 -0
  138. package/glTF/2.0/Extensions/KHR_materials_dispersion.js +60 -0
  139. package/glTF/2.0/Extensions/KHR_materials_dispersion.js.map +1 -0
  140. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +42 -0
  141. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +52 -0
  142. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -0
  143. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +46 -0
  144. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -0
  145. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -0
  146. package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +42 -0
  147. package/glTF/2.0/Extensions/KHR_materials_iridescence.js +71 -0
  148. package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -0
  149. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +42 -0
  150. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +81 -0
  151. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -0
  152. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +43 -0
  153. package/glTF/2.0/Extensions/KHR_materials_sheen.js +85 -0
  154. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -0
  155. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +42 -0
  156. package/glTF/2.0/Extensions/KHR_materials_specular.js +85 -0
  157. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -0
  158. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +42 -0
  159. package/glTF/2.0/Extensions/KHR_materials_transmission.js +306 -0
  160. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -0
  161. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +42 -0
  162. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -0
  163. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -0
  164. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +112 -0
  165. package/glTF/2.0/Extensions/KHR_materials_variants.js +263 -0
  166. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -0
  167. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +43 -0
  168. package/glTF/2.0/Extensions/KHR_materials_volume.js +86 -0
  169. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -0
  170. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +29 -0
  171. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -0
  172. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -0
  173. package/glTF/2.0/Extensions/KHR_node_hoverability.d.ts +31 -0
  174. package/glTF/2.0/Extensions/KHR_node_hoverability.js +190 -0
  175. package/glTF/2.0/Extensions/KHR_node_hoverability.js.map +1 -0
  176. package/glTF/2.0/Extensions/KHR_node_selectability.d.ts +30 -0
  177. package/glTF/2.0/Extensions/KHR_node_selectability.js +124 -0
  178. package/glTF/2.0/Extensions/KHR_node_selectability.js.map +1 -0
  179. package/glTF/2.0/Extensions/KHR_node_visibility.d.ts +30 -0
  180. package/glTF/2.0/Extensions/KHR_node_visibility.js +69 -0
  181. package/glTF/2.0/Extensions/KHR_node_visibility.js.map +1 -0
  182. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +33 -0
  183. package/glTF/2.0/Extensions/KHR_texture_basisu.js +38 -0
  184. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -0
  185. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +37 -0
  186. package/glTF/2.0/Extensions/KHR_texture_transform.js +59 -0
  187. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -0
  188. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +39 -0
  189. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +48 -0
  190. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -0
  191. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +56 -0
  192. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +227 -0
  193. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -0
  194. package/glTF/2.0/Extensions/MSFT_lod.d.ts +104 -0
  195. package/glTF/2.0/Extensions/MSFT_lod.js +338 -0
  196. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -0
  197. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +27 -0
  198. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +41 -0
  199. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -0
  200. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +27 -0
  201. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +42 -0
  202. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -0
  203. package/glTF/2.0/Extensions/dynamic.d.ts +4 -0
  204. package/glTF/2.0/Extensions/dynamic.js +156 -0
  205. package/glTF/2.0/Extensions/dynamic.js.map +1 -0
  206. package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +45 -0
  207. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +101 -0
  208. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -0
  209. package/glTF/2.0/Extensions/index.d.ts +39 -0
  210. package/glTF/2.0/Extensions/index.js +41 -0
  211. package/glTF/2.0/Extensions/index.js.map +1 -0
  212. package/glTF/2.0/Extensions/objectModelMapping.d.ts +289 -0
  213. package/glTF/2.0/Extensions/objectModelMapping.js +828 -0
  214. package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -0
  215. package/glTF/2.0/glTFLoader.d.ts +429 -0
  216. package/glTF/2.0/glTFLoader.js +2408 -0
  217. package/glTF/2.0/glTFLoader.js.map +1 -0
  218. package/glTF/2.0/glTFLoaderAnimation.d.ts +42 -0
  219. package/glTF/2.0/glTFLoaderAnimation.js +80 -0
  220. package/glTF/2.0/glTFLoaderAnimation.js.map +1 -0
  221. package/glTF/2.0/glTFLoaderExtension.d.ts +165 -0
  222. package/glTF/2.0/glTFLoaderExtension.js +2 -0
  223. package/glTF/2.0/glTFLoaderExtension.js.map +1 -0
  224. package/glTF/2.0/glTFLoaderExtensionRegistry.d.ts +25 -0
  225. package/glTF/2.0/glTFLoaderExtensionRegistry.js +33 -0
  226. package/glTF/2.0/glTFLoaderExtensionRegistry.js.map +1 -0
  227. package/glTF/2.0/glTFLoaderInterfaces.d.ts +257 -0
  228. package/glTF/2.0/glTFLoaderInterfaces.js +2 -0
  229. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -0
  230. package/glTF/2.0/index.d.ts +6 -0
  231. package/glTF/2.0/index.js +8 -0
  232. package/glTF/2.0/index.js.map +1 -0
  233. package/glTF/glTFFileLoader.d.ts +516 -0
  234. package/glTF/glTFFileLoader.js +968 -0
  235. package/glTF/glTFFileLoader.js.map +1 -0
  236. package/glTF/glTFFileLoader.metadata.d.ts +15 -0
  237. package/glTF/glTFFileLoader.metadata.js +18 -0
  238. package/glTF/glTFFileLoader.metadata.js.map +1 -0
  239. package/glTF/glTFValidation.d.ts +29 -0
  240. package/glTF/glTFValidation.js +126 -0
  241. package/glTF/glTFValidation.js.map +1 -0
  242. package/glTF/index.d.ts +5 -0
  243. package/glTF/index.js +7 -0
  244. package/glTF/index.js.map +1 -0
  245. package/index.d.ts +5 -0
  246. package/index.js +7 -0
  247. package/index.js.map +1 -0
  248. package/legacy/legacy-bvhFileLoader.d.ts +1 -0
  249. package/legacy/legacy-bvhFileLoader.js +16 -0
  250. package/legacy/legacy-bvhFileLoader.js.map +1 -0
  251. package/legacy/legacy-glTF.d.ts +2 -0
  252. package/legacy/legacy-glTF.js +19 -0
  253. package/legacy/legacy-glTF.js.map +1 -0
  254. package/legacy/legacy-glTF1.d.ts +2 -0
  255. package/legacy/legacy-glTF1.js +16 -0
  256. package/legacy/legacy-glTF1.js.map +1 -0
  257. package/legacy/legacy-glTF1FileLoader.d.ts +2 -0
  258. package/legacy/legacy-glTF1FileLoader.js +4 -0
  259. package/legacy/legacy-glTF1FileLoader.js.map +1 -0
  260. package/legacy/legacy-glTF2.d.ts +2 -0
  261. package/legacy/legacy-glTF2.js +35 -0
  262. package/legacy/legacy-glTF2.js.map +1 -0
  263. package/legacy/legacy-glTF2FileLoader.d.ts +2 -0
  264. package/legacy/legacy-glTF2FileLoader.js +4 -0
  265. package/legacy/legacy-glTF2FileLoader.js.map +1 -0
  266. package/legacy/legacy-glTFFileLoader.d.ts +3 -0
  267. package/legacy/legacy-glTFFileLoader.js +5 -0
  268. package/legacy/legacy-glTFFileLoader.js.map +1 -0
  269. package/legacy/legacy-objFileLoader.d.ts +1 -0
  270. package/legacy/legacy-objFileLoader.js +16 -0
  271. package/legacy/legacy-objFileLoader.js.map +1 -0
  272. package/legacy/legacy-stlFileLoader.d.ts +1 -0
  273. package/legacy/legacy-stlFileLoader.js +16 -0
  274. package/legacy/legacy-stlFileLoader.js.map +1 -0
  275. package/legacy/legacy.d.ts +7 -0
  276. package/legacy/legacy.js +10 -0
  277. package/legacy/legacy.js.map +1 -0
  278. package/license.md +71 -0
  279. package/package.json +49 -0
  280. package/readme.md +23 -0
@@ -0,0 +1,8 @@
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
+ export * from "./glTFLoader.js";
3
+ export * from "./glTFLoaderExtension.js";
4
+ export * from "./glTFLoaderExtensionRegistry.js";
5
+ export * from "./glTFLoaderInterfaces.js";
6
+ export * from "./glTFLoaderAnimation.js";
7
+ export * from "./Extensions/index.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./glTFLoader\";\r\nexport * from \"./glTFLoaderExtension\";\r\nexport * from \"./glTFLoaderExtensionRegistry\";\r\nexport * from \"./glTFLoaderInterfaces\";\r\nexport * from \"./glTFLoaderAnimation\";\r\nexport * from \"./Extensions/index\";\r\n"]}
@@ -0,0 +1,516 @@
1
+ import type * as GLTF2 from "babylonjs-gltf2interface";
2
+ import type { Nullable } from "@babylonjs/core/types.js";
3
+ import { Observable } from "@babylonjs/core/Misc/observable.js";
4
+ import type { Camera } from "@babylonjs/core/Cameras/camera.js";
5
+ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
+ import type { Material } from "@babylonjs/core/Materials/material.js";
7
+ import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
8
+ import type { ISceneLoaderPluginFactory, ISceneLoaderPluginAsync, ISceneLoaderProgressEvent, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from "@babylonjs/core/Loading/sceneLoader.js";
9
+ import { AssetContainer } from "@babylonjs/core/assetContainer.js";
10
+ import type { Scene, IDisposable } from "@babylonjs/core/scene.js";
11
+ import type { WebRequest } from "@babylonjs/core/Misc/webRequest.js";
12
+ import type { IFileRequest } from "@babylonjs/core/Misc/fileRequest.js";
13
+ import type { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
14
+ import { GLTFFileLoaderMetadata } from "./glTFFileLoader.metadata.js";
15
+ import type { LoadFileError } from "@babylonjs/core/Misc/fileTools.js";
16
+ import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
17
+ /**
18
+ * Defines options for glTF loader extensions. This interface is extended by specific extensions.
19
+ */
20
+ export interface GLTFLoaderExtensionOptions extends Record<string, Record<string, unknown> | undefined> {
21
+ }
22
+ declare module "@babylonjs/core/Loading/sceneLoader.js" {
23
+ interface SceneLoaderPluginOptions {
24
+ /**
25
+ * Defines options for the glTF loader.
26
+ */
27
+ [GLTFFileLoaderMetadata.name]: Partial<GLTFLoaderOptions>;
28
+ }
29
+ }
30
+ /**
31
+ * Mode that determines the coordinate system to use.
32
+ */
33
+ export declare enum GLTFLoaderCoordinateSystemMode {
34
+ /**
35
+ * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
36
+ */
37
+ AUTO = 0,
38
+ /**
39
+ * Sets the useRightHandedSystem flag on the scene.
40
+ */
41
+ FORCE_RIGHT_HANDED = 1
42
+ }
43
+ /**
44
+ * Mode that determines what animations will start.
45
+ */
46
+ export declare enum GLTFLoaderAnimationStartMode {
47
+ /**
48
+ * No animation will start.
49
+ */
50
+ NONE = 0,
51
+ /**
52
+ * The first animation will start.
53
+ */
54
+ FIRST = 1,
55
+ /**
56
+ * All animations will start.
57
+ */
58
+ ALL = 2
59
+ }
60
+ /**
61
+ * Interface that contains the data for the glTF asset.
62
+ */
63
+ export interface IGLTFLoaderData {
64
+ /**
65
+ * The object that represents the glTF JSON.
66
+ */
67
+ json: object;
68
+ /**
69
+ * The BIN chunk of a binary glTF.
70
+ */
71
+ bin: Nullable<IDataBuffer>;
72
+ }
73
+ /**
74
+ * Interface for extending the loader.
75
+ */
76
+ export interface IGLTFLoaderExtension {
77
+ /**
78
+ * The name of this extension.
79
+ */
80
+ readonly name: string;
81
+ /**
82
+ * Defines whether this extension is enabled.
83
+ */
84
+ enabled: boolean;
85
+ /**
86
+ * Defines the order of this extension.
87
+ * The loader sorts the extensions using these values when loading.
88
+ */
89
+ order?: number;
90
+ }
91
+ /**
92
+ * Loader state.
93
+ */
94
+ export declare enum GLTFLoaderState {
95
+ /**
96
+ * The asset is loading.
97
+ */
98
+ LOADING = 0,
99
+ /**
100
+ * The asset is ready for rendering.
101
+ */
102
+ READY = 1,
103
+ /**
104
+ * The asset is completely loaded.
105
+ */
106
+ COMPLETE = 2
107
+ }
108
+ /** @internal */
109
+ export interface IGLTFLoader extends IDisposable {
110
+ importMeshAsync: (meshesNames: string | readonly string[] | null | undefined, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<ISceneLoaderAsyncResult>;
111
+ loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
112
+ }
113
+ /**
114
+ * Adds default/implicit options to extension specific options.
115
+ */
116
+ type DefaultExtensionOptions<BaseExtensionOptions> = {
117
+ /**
118
+ * Defines if the extension is enabled
119
+ */
120
+ enabled?: boolean;
121
+ } & BaseExtensionOptions;
122
+ declare abstract class GLTFLoaderOptions {
123
+ protected copyFrom(options?: Partial<Readonly<GLTFLoaderOptions>>): void;
124
+ /**
125
+ * Raised when the asset has been parsed
126
+ */
127
+ abstract onParsed?: ((loaderData: IGLTFLoaderData) => void) | undefined;
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 load node animations. Defaults to true.
138
+ * NOTE: The animation of this node will still load if the node is also a joint of a skin and `loadSkins` is true.
139
+ */
140
+ loadNodeAnimations: boolean;
141
+ /**
142
+ * Defines if the loader should load skins. Defaults to true.
143
+ */
144
+ loadSkins: boolean;
145
+ /**
146
+ * Defines if the loader should load morph targets. Defaults to true.
147
+ */
148
+ loadMorphTargets: boolean;
149
+ /**
150
+ * Defines if the loader should compile materials before raising the success callback. Defaults to false.
151
+ */
152
+ compileMaterials: boolean;
153
+ /**
154
+ * Defines if the loader should also compile materials with clip planes. Defaults to false.
155
+ */
156
+ useClipPlane: boolean;
157
+ /**
158
+ * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
159
+ */
160
+ compileShadowGenerators: boolean;
161
+ /**
162
+ * Defines if the Alpha blended materials are only applied as coverage.
163
+ * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
164
+ * If true, no extra effects are applied to transparent pixels.
165
+ */
166
+ transparencyAsCoverage: boolean;
167
+ /**
168
+ * Defines if the loader should use range requests when load binary glTF files from HTTP.
169
+ * Enabling will disable offline support and glTF validator.
170
+ * Defaults to false.
171
+ */
172
+ useRangeRequests: boolean;
173
+ /**
174
+ * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
175
+ */
176
+ createInstances: boolean;
177
+ /**
178
+ * 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.
179
+ */
180
+ alwaysComputeBoundingBox: boolean;
181
+ /**
182
+ * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
183
+ */
184
+ loadAllMaterials: boolean;
185
+ /**
186
+ * If true, load only the materials defined in the file. Defaults to false.
187
+ */
188
+ loadOnlyMaterials: boolean;
189
+ /**
190
+ * If true, do not load any materials defined in the file. Defaults to false.
191
+ */
192
+ skipMaterials: boolean;
193
+ /**
194
+ * 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.
195
+ */
196
+ useSRGBBuffers: boolean;
197
+ /**
198
+ * When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.
199
+ */
200
+ targetFps: number;
201
+ /**
202
+ * Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using `skin.skeleton`. Defaults to false.
203
+ * Set this to true if loading assets with invalid `skin.skeleton` values.
204
+ */
205
+ alwaysComputeSkeletonRootNode: boolean;
206
+ /**
207
+ * If true, the loader will derive the name for Babylon textures from the glTF texture name, image name, or image url. Defaults to false.
208
+ * Note that it is possible for multiple Babylon textures to share the same name when the Babylon textures load from the same glTF texture or image.
209
+ */
210
+ useGltfTextureNames: boolean;
211
+ /**
212
+ * Function called before loading a url referenced by the asset.
213
+ * @param url url referenced by the asset
214
+ * @returns Async url to load
215
+ */
216
+ preprocessUrlAsync: (url: string) => Promise<string>;
217
+ /**
218
+ * Defines the node to use as the root of the hierarchy when loading the scene (default: undefined). If not defined, a root node will be automatically created.
219
+ * You can also pass null if you don't want a root node to be created.
220
+ */
221
+ customRootNode?: Nullable<TransformNode>;
222
+ /**
223
+ * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
224
+ * 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, ...)
225
+ */
226
+ abstract onMeshLoaded?: ((mesh: AbstractMesh) => void) | undefined;
227
+ /**
228
+ * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.
229
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh
230
+ */
231
+ abstract onSkinLoaded?: ((node: TransformNode, skinnedNode: TransformNode) => void) | undefined;
232
+ /**
233
+ * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
234
+ */
235
+ abstract onTextureLoaded?: ((texture: BaseTexture) => void) | undefined;
236
+ /**
237
+ * Callback raised when the loader creates a material after parsing the glTF properties of the material.
238
+ */
239
+ abstract onMaterialLoaded?: ((material: Material) => void) | undefined;
240
+ /**
241
+ * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
242
+ */
243
+ abstract onCameraLoaded?: ((camera: Camera) => void) | undefined;
244
+ /**
245
+ * Defines options for glTF extensions.
246
+ */
247
+ extensionOptions: {
248
+ [Extension in keyof GLTFLoaderExtensionOptions]?: {
249
+ [Option in keyof DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>]: DefaultExtensionOptions<GLTFLoaderExtensionOptions[Extension]>[Option];
250
+ };
251
+ };
252
+ }
253
+ /**
254
+ * File loader for loading glTF files into a scene.
255
+ */
256
+ export declare class GLTFFileLoader extends GLTFLoaderOptions implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
257
+ /** @internal */
258
+ static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;
259
+ /** @internal */
260
+ static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;
261
+ /**
262
+ * Creates a new glTF file loader.
263
+ * @param options The options for the loader
264
+ */
265
+ constructor(options?: Partial<Readonly<GLTFLoaderOptions>>);
266
+ /**
267
+ * Raised when the asset has been parsed
268
+ */
269
+ onParsedObservable: Observable<IGLTFLoaderData>;
270
+ private _onParsedObserver;
271
+ /**
272
+ * Raised when the asset has been parsed
273
+ */
274
+ set onParsed(callback: ((loaderData: IGLTFLoaderData) => void) | undefined);
275
+ /**
276
+ * 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.
277
+ * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
278
+ * Defaults to true.
279
+ * @internal
280
+ */
281
+ static IncrementalLoading: boolean;
282
+ /**
283
+ * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
284
+ * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
285
+ * @internal
286
+ */
287
+ static HomogeneousCoordinates: boolean;
288
+ /**
289
+ * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
290
+ * 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, ...)
291
+ */
292
+ readonly onMeshLoadedObservable: Observable<AbstractMesh>;
293
+ private _onMeshLoadedObserver;
294
+ /**
295
+ * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
296
+ * 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, ...)
297
+ */
298
+ set onMeshLoaded(callback: ((mesh: AbstractMesh) => void) | undefined);
299
+ /**
300
+ * Observable raised when the loader creates a skin after parsing the glTF properties of the skin node.
301
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh
302
+ * @param node - the transform node that corresponds to the original glTF skin node used for animations
303
+ * @param skinnedNode - the transform node that is the skinned mesh itself or the parent of the skinned meshes
304
+ */
305
+ readonly onSkinLoadedObservable: Observable<{
306
+ node: TransformNode;
307
+ skinnedNode: TransformNode;
308
+ }>;
309
+ private _onSkinLoadedObserver;
310
+ /**
311
+ * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.
312
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh
313
+ */
314
+ set onSkinLoaded(callback: ((node: TransformNode, skinnedNode: TransformNode) => void) | undefined);
315
+ /**
316
+ * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
317
+ */
318
+ readonly onTextureLoadedObservable: Observable<BaseTexture>;
319
+ private _onTextureLoadedObserver;
320
+ /**
321
+ * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
322
+ */
323
+ set onTextureLoaded(callback: ((texture: BaseTexture) => void) | undefined);
324
+ /**
325
+ * Observable raised when the loader creates a material after parsing the glTF properties of the material.
326
+ */
327
+ readonly onMaterialLoadedObservable: Observable<Material>;
328
+ private _onMaterialLoadedObserver;
329
+ /**
330
+ * Callback raised when the loader creates a material after parsing the glTF properties of the material.
331
+ */
332
+ set onMaterialLoaded(callback: ((material: Material) => void) | undefined);
333
+ /**
334
+ * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
335
+ */
336
+ readonly onCameraLoadedObservable: Observable<Camera>;
337
+ private _onCameraLoadedObserver;
338
+ /**
339
+ * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
340
+ */
341
+ set onCameraLoaded(callback: ((camera: Camera) => void) | undefined);
342
+ /**
343
+ * Observable raised when the asset is completely loaded, immediately before the loader is disposed.
344
+ * For assets with LODs, raised when all of the LODs are complete.
345
+ * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
346
+ */
347
+ readonly onCompleteObservable: Observable<void>;
348
+ private _onCompleteObserver;
349
+ /**
350
+ * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
351
+ * For assets with LODs, raised when all of the LODs are complete.
352
+ * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
353
+ */
354
+ set onComplete(callback: () => void);
355
+ /**
356
+ * Observable raised when an error occurs.
357
+ */
358
+ readonly onErrorObservable: Observable<any>;
359
+ private _onErrorObserver;
360
+ /**
361
+ * Callback raised when an error occurs.
362
+ */
363
+ set onError(callback: (reason: any) => void);
364
+ /**
365
+ * Observable raised after the loader is disposed.
366
+ */
367
+ readonly onDisposeObservable: Observable<void>;
368
+ private _onDisposeObserver;
369
+ /**
370
+ * Callback raised after the loader is disposed.
371
+ */
372
+ set onDispose(callback: () => void);
373
+ /**
374
+ * Observable raised after a loader extension is created.
375
+ * Set additional options for a loader extension in this event.
376
+ */
377
+ readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
378
+ private _onExtensionLoadedObserver;
379
+ /**
380
+ * Callback raised after a loader extension is created.
381
+ */
382
+ set onExtensionLoaded(callback: (extension: IGLTFLoaderExtension) => void);
383
+ /**
384
+ * Defines if the loader logging is enabled.
385
+ */
386
+ get loggingEnabled(): boolean;
387
+ set loggingEnabled(value: boolean);
388
+ /**
389
+ * Defines if the loader should capture performance counters.
390
+ */
391
+ get capturePerformanceCounters(): boolean;
392
+ set capturePerformanceCounters(value: boolean);
393
+ /**
394
+ * Defines if the loader should validate the asset.
395
+ */
396
+ validate: boolean;
397
+ /**
398
+ * Observable raised after validation when validate is set to true. The event data is the result of the validation.
399
+ */
400
+ readonly onValidatedObservable: Observable<GLTF2.IGLTFValidationResults>;
401
+ private _onValidatedObserver;
402
+ /**
403
+ * Callback raised after a loader extension is created.
404
+ */
405
+ set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void);
406
+ private _loader;
407
+ private _state;
408
+ private _progressCallback?;
409
+ private _requests;
410
+ /**
411
+ * Name of the loader ("gltf")
412
+ */
413
+ readonly name: "gltf";
414
+ /** @internal */
415
+ readonly extensions: {
416
+ readonly ".gltf": {
417
+ readonly isBinary: false;
418
+ readonly mimeType: "model/gltf+json";
419
+ };
420
+ readonly ".glb": {
421
+ readonly isBinary: true;
422
+ readonly mimeType: "model/gltf-binary";
423
+ };
424
+ };
425
+ /**
426
+ * Disposes the loader, releases resources during load, and cancels any outstanding requests.
427
+ */
428
+ dispose(): void;
429
+ /**
430
+ * @internal
431
+ */
432
+ loadFile(scene: Scene, fileOrUrl: File | string | ArrayBufferView, rootUrl: string, onSuccess: (data: unknown, responseURL?: string) => void, onProgress?: (ev: ISceneLoaderProgressEvent) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, name?: string): Nullable<IFileRequest>;
433
+ private _loadBinary;
434
+ /**
435
+ * @internal
436
+ */
437
+ importMeshAsync(meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
438
+ /**
439
+ * @internal
440
+ */
441
+ loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
442
+ /**
443
+ * @internal
444
+ */
445
+ loadAssetContainerAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
446
+ /**
447
+ * @internal
448
+ */
449
+ canDirectLoad(data: string): boolean;
450
+ /**
451
+ * @internal
452
+ */
453
+ directLoad(scene: Scene, data: string): Promise<object>;
454
+ /**
455
+ * The callback that allows custom handling of the root url based on the response url.
456
+ * @param rootUrl the original root url
457
+ * @param responseURL the response url if available
458
+ * @returns the new root url
459
+ */
460
+ rewriteRootURL?(rootUrl: string, responseURL?: string): string;
461
+ /** @internal */
462
+ createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
463
+ /**
464
+ * The loader state or null if the loader is not active.
465
+ */
466
+ get loaderState(): Nullable<GLTFLoaderState>;
467
+ /**
468
+ * Observable raised when the loader state changes.
469
+ */
470
+ onLoaderStateChangedObservable: Observable<Nullable<GLTFLoaderState>>;
471
+ /**
472
+ * Returns a promise that resolves when the asset is completely loaded.
473
+ * @returns a promise that resolves when the asset is completely loaded.
474
+ */
475
+ whenCompleteAsync(): Promise<void>;
476
+ /**
477
+ * @internal
478
+ */
479
+ _setState(state: GLTFLoaderState): void;
480
+ /**
481
+ * @internal
482
+ */
483
+ _loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
484
+ private _onProgress;
485
+ private _validate;
486
+ private _getLoader;
487
+ private _parseJson;
488
+ private _unpackBinaryAsync;
489
+ private _unpackBinaryV1Async;
490
+ private _unpackBinaryV2Async;
491
+ private static _parseVersion;
492
+ private static _compareVersion;
493
+ private static readonly _logSpaces;
494
+ private _logIndentLevel;
495
+ private _loggingEnabled;
496
+ /** @internal */
497
+ _log: (message: string) => void;
498
+ /**
499
+ * @internal
500
+ */
501
+ _logOpen(message: string): void;
502
+ /** @internal */
503
+ _logClose(): void;
504
+ private _logEnabled;
505
+ private _logDisabled;
506
+ private _capturePerformanceCounters;
507
+ /** @internal */
508
+ _startPerformanceCounter: (counterName: string) => void;
509
+ /** @internal */
510
+ _endPerformanceCounter: (counterName: string) => void;
511
+ private _startPerformanceCounterEnabled;
512
+ private _startPerformanceCounterDisabled;
513
+ private _endPerformanceCounterEnabled;
514
+ private _endPerformanceCounterDisabled;
515
+ }
516
+ export {};