@babylonjs/viewer 7.26.3-alpha → 7.26.3

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 (578) hide show
  1. package/configuration/configuration.d.ts +107 -0
  2. package/configuration/configuration.js +16 -0
  3. package/configuration/configuration.js.map +1 -0
  4. package/configuration/configurationCompatibility.d.ts +8 -0
  5. package/configuration/configurationCompatibility.js +66 -0
  6. package/configuration/configurationCompatibility.js.map +1 -0
  7. package/configuration/configurationContainer.d.ts +10 -0
  8. package/configuration/configurationContainer.js +10 -0
  9. package/configuration/configurationContainer.js.map +1 -0
  10. package/configuration/globals.d.ts +6 -0
  11. package/configuration/globals.js +18 -0
  12. package/configuration/globals.js.map +1 -0
  13. package/configuration/index.d.ts +2 -0
  14. package/configuration/index.js +4 -0
  15. package/configuration/index.js.map +1 -0
  16. package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
  17. package/configuration/interfaces/cameraConfiguration.js +2 -0
  18. package/configuration/interfaces/cameraConfiguration.js.map +1 -0
  19. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
  20. package/configuration/interfaces/colorGradingConfiguration.js +2 -0
  21. package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
  22. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
  23. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
  24. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
  25. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
  26. package/configuration/interfaces/environmentMapConfiguration.js +2 -0
  27. package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
  28. package/configuration/interfaces/groundConfiguration.d.ts +24 -0
  29. package/configuration/interfaces/groundConfiguration.js +2 -0
  30. package/configuration/interfaces/groundConfiguration.js.map +1 -0
  31. package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
  32. package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
  33. package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
  34. package/configuration/interfaces/index.d.ts +15 -0
  35. package/configuration/interfaces/index.js +16 -0
  36. package/configuration/interfaces/index.js.map +1 -0
  37. package/configuration/interfaces/lightConfiguration.d.ts +60 -0
  38. package/configuration/interfaces/lightConfiguration.js +2 -0
  39. package/configuration/interfaces/lightConfiguration.js.map +1 -0
  40. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
  41. package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
  42. package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
  43. package/configuration/interfaces/modelConfiguration.d.ts +65 -0
  44. package/configuration/interfaces/modelConfiguration.js +2 -0
  45. package/configuration/interfaces/modelConfiguration.js.map +1 -0
  46. package/configuration/interfaces/observersConfiguration.d.ts +5 -0
  47. package/configuration/interfaces/observersConfiguration.js +2 -0
  48. package/configuration/interfaces/observersConfiguration.js.map +1 -0
  49. package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
  50. package/configuration/interfaces/sceneConfiguration.js +2 -0
  51. package/configuration/interfaces/sceneConfiguration.js.map +1 -0
  52. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
  53. package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
  54. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
  55. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
  56. package/configuration/interfaces/skyboxConfiguration.js +2 -0
  57. package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
  58. package/configuration/interfaces/templateConfiguration.d.ts +67 -0
  59. package/configuration/interfaces/templateConfiguration.js +2 -0
  60. package/configuration/interfaces/templateConfiguration.js.map +1 -0
  61. package/configuration/interfaces/vrConfiguration.d.ts +16 -0
  62. package/configuration/interfaces/vrConfiguration.js +2 -0
  63. package/configuration/interfaces/vrConfiguration.js.map +1 -0
  64. package/configuration/loader.d.ts +4 -0
  65. package/configuration/loader.js +17 -0
  66. package/configuration/loader.js.map +1 -0
  67. package/configuration/mappers.d.ts +43 -0
  68. package/configuration/mappers.js +192 -0
  69. package/configuration/mappers.js.map +1 -0
  70. package/configuration/renderOnlyLoader.d.ts +33 -0
  71. package/configuration/renderOnlyLoader.js +162 -0
  72. package/configuration/renderOnlyLoader.js.map +1 -0
  73. package/configuration/types/default.d.ts +6 -0
  74. package/configuration/types/default.js +121 -0
  75. package/configuration/types/default.js.map +1 -0
  76. package/configuration/types/environmentMap.d.ts +5 -0
  77. package/configuration/types/environmentMap.js +14 -0
  78. package/configuration/types/environmentMap.js.map +1 -0
  79. package/configuration/types/extended.d.ts +6 -0
  80. package/configuration/types/extended.js +317 -0
  81. package/configuration/types/extended.js.map +1 -0
  82. package/configuration/types/index.d.ts +14 -0
  83. package/configuration/types/index.js +51 -0
  84. package/configuration/types/index.js.map +1 -0
  85. package/configuration/types/minimal.d.ts +6 -0
  86. package/configuration/types/minimal.js +43 -0
  87. package/configuration/types/minimal.js.map +1 -0
  88. package/configuration/types/renderOnlyDefault.d.ts +30 -0
  89. package/configuration/types/renderOnlyDefault.js +31 -0
  90. package/configuration/types/renderOnlyDefault.js.map +1 -0
  91. package/configuration/types/shadowLight.d.ts +9 -0
  92. package/configuration/types/shadowLight.js +64 -0
  93. package/configuration/types/shadowLight.js.map +1 -0
  94. package/helper/index.d.ts +29 -0
  95. package/helper/index.js +66 -0
  96. package/helper/index.js.map +1 -0
  97. package/index.d.ts +30 -0
  98. package/index.js +46 -0
  99. package/index.js.map +1 -0
  100. package/initializer.d.ts +11 -0
  101. package/initializer.js +35 -0
  102. package/initializer.js.map +1 -0
  103. package/interfaces.d.ts +5 -0
  104. package/interfaces.js +7 -0
  105. package/interfaces.js.map +1 -0
  106. package/labs/environmentSerializer.d.ts +126 -0
  107. package/labs/environmentSerializer.js +191 -0
  108. package/labs/environmentSerializer.js.map +1 -0
  109. package/labs/texture.d.ts +183 -0
  110. package/labs/texture.js +350 -0
  111. package/labs/texture.js.map +1 -0
  112. package/labs/viewerLabs.d.ts +51 -0
  113. package/labs/viewerLabs.js +134 -0
  114. package/labs/viewerLabs.js.map +1 -0
  115. package/loader/modelLoader.d.ts +56 -0
  116. package/loader/modelLoader.js +199 -0
  117. package/loader/modelLoader.js.map +1 -0
  118. package/loader/plugins/applyMaterialConfig.d.ts +12 -0
  119. package/loader/plugins/applyMaterialConfig.js +16 -0
  120. package/loader/plugins/applyMaterialConfig.js.map +1 -0
  121. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
  122. package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
  123. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
  124. package/loader/plugins/index.d.ts +19 -0
  125. package/loader/plugins/index.js +44 -0
  126. package/loader/plugins/index.js.map +1 -0
  127. package/loader/plugins/loaderPlugin.d.ts +24 -0
  128. package/loader/plugins/loaderPlugin.js +2 -0
  129. package/loader/plugins/loaderPlugin.js.map +1 -0
  130. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
  131. package/loader/plugins/msftLodLoaderPlugin.js +21 -0
  132. package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
  133. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
  134. package/loader/plugins/telemetryLoaderPlugin.js +36 -0
  135. package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
  136. package/managers/observablesManager.d.ts +66 -0
  137. package/managers/observablesManager.js +35 -0
  138. package/managers/observablesManager.js.map +1 -0
  139. package/managers/sceneManager.d.ts +245 -0
  140. package/managers/sceneManager.js +1375 -0
  141. package/managers/sceneManager.js.map +1 -0
  142. package/managers/telemetryManager.d.ts +78 -0
  143. package/managers/telemetryManager.js +117 -0
  144. package/managers/telemetryManager.js.map +1 -0
  145. package/model/modelAnimation.d.ts +215 -0
  146. package/model/modelAnimation.js +237 -0
  147. package/model/modelAnimation.js.map +1 -0
  148. package/model/viewerModel.d.ts +233 -0
  149. package/model/viewerModel.js +673 -0
  150. package/model/viewerModel.js.map +1 -0
  151. package/optimizer/custom/extended.d.ts +13 -0
  152. package/optimizer/custom/extended.js +101 -0
  153. package/optimizer/custom/extended.js.map +1 -0
  154. package/optimizer/custom/index.d.ts +9 -0
  155. package/optimizer/custom/index.js +26 -0
  156. package/optimizer/custom/index.js.map +1 -0
  157. package/package.json +27 -17
  158. package/readme.md +21 -35
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +21 -0
  167. package/templating/plugins/hdButtonPlugin.js.map +1 -0
  168. package/templating/plugins/printButton.d.ts +9 -0
  169. package/templating/plugins/printButton.js +40 -0
  170. package/templating/plugins/printButton.js.map +1 -0
  171. package/templating/templateManager.d.ts +197 -0
  172. package/templating/templateManager.js +561 -0
  173. package/templating/templateManager.js.map +1 -0
  174. package/templating/viewerTemplatePlugin.d.ts +21 -0
  175. package/templating/viewerTemplatePlugin.js +69 -0
  176. package/templating/viewerTemplatePlugin.js.map +1 -0
  177. package/viewer/defaultViewer.d.ts +130 -0
  178. package/viewer/defaultViewer.js +675 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/dist/babylon-viewer.esm.js +0 -2
  193. package/dist/babylon-viewer.esm.js.map +0 -1
  194. package/dist/babylon-viewer.esm.min.js +0 -2
  195. package/dist/babylon-viewer.esm.min.js.map +0 -1
  196. package/dist/chunks/EXT_lights_image_based-CX9xWDUc.esm.min.js +0 -2
  197. package/dist/chunks/EXT_lights_image_based-CX9xWDUc.esm.min.js.map +0 -1
  198. package/dist/chunks/EXT_lights_image_based-D2376Rhk.esm.js +0 -171
  199. package/dist/chunks/EXT_lights_image_based-D2376Rhk.esm.js.map +0 -1
  200. package/dist/chunks/EXT_mesh_gpu_instancing-COx3jzFo.esm.js +0 -86
  201. package/dist/chunks/EXT_mesh_gpu_instancing-COx3jzFo.esm.js.map +0 -1
  202. package/dist/chunks/EXT_mesh_gpu_instancing-DucZlyik.esm.min.js +0 -2
  203. package/dist/chunks/EXT_mesh_gpu_instancing-DucZlyik.esm.min.js.map +0 -1
  204. package/dist/chunks/EXT_meshopt_compression-CYrBmER6.esm.js +0 -134
  205. package/dist/chunks/EXT_meshopt_compression-CYrBmER6.esm.js.map +0 -1
  206. package/dist/chunks/EXT_meshopt_compression-RcQCBtJG.esm.min.js +0 -2
  207. package/dist/chunks/EXT_meshopt_compression-RcQCBtJG.esm.min.js.map +0 -1
  208. package/dist/chunks/EXT_texture_avif-BhIxh8Y2.esm.min.js +0 -2
  209. package/dist/chunks/EXT_texture_avif-BhIxh8Y2.esm.min.js.map +0 -1
  210. package/dist/chunks/EXT_texture_avif-Ca5z5sd4.esm.js +0 -44
  211. package/dist/chunks/EXT_texture_avif-Ca5z5sd4.esm.js.map +0 -1
  212. package/dist/chunks/EXT_texture_webp-BqckITjY.esm.js +0 -43
  213. package/dist/chunks/EXT_texture_webp-BqckITjY.esm.js.map +0 -1
  214. package/dist/chunks/EXT_texture_webp-CkyuNFGt.esm.min.js +0 -2
  215. package/dist/chunks/EXT_texture_webp-CkyuNFGt.esm.min.js.map +0 -1
  216. package/dist/chunks/ExtrasAsMetadata-B5tcWWcU.esm.js +0 -64
  217. package/dist/chunks/ExtrasAsMetadata-B5tcWWcU.esm.js.map +0 -1
  218. package/dist/chunks/ExtrasAsMetadata-DXurtCTq.esm.min.js +0 -2
  219. package/dist/chunks/ExtrasAsMetadata-DXurtCTq.esm.min.js.map +0 -1
  220. package/dist/chunks/KHR_animation_pointer--IiYfSMj.esm.min.js +0 -2
  221. package/dist/chunks/KHR_animation_pointer--IiYfSMj.esm.min.js.map +0 -1
  222. package/dist/chunks/KHR_animation_pointer-DfN1Ew0i.esm.js +0 -343
  223. package/dist/chunks/KHR_animation_pointer-DfN1Ew0i.esm.js.map +0 -1
  224. package/dist/chunks/KHR_draco_mesh_compression-CRrH0RjE.esm.js +0 -610
  225. package/dist/chunks/KHR_draco_mesh_compression-CRrH0RjE.esm.js.map +0 -1
  226. package/dist/chunks/KHR_draco_mesh_compression-Dx3wBJzh.esm.min.js +0 -2
  227. package/dist/chunks/KHR_draco_mesh_compression-Dx3wBJzh.esm.min.js.map +0 -1
  228. package/dist/chunks/KHR_interactivity-BhxUQ3Nl.esm.min.js +0 -2
  229. package/dist/chunks/KHR_interactivity-BhxUQ3Nl.esm.min.js.map +0 -1
  230. package/dist/chunks/KHR_interactivity-DHimeDac.esm.js +0 -4033
  231. package/dist/chunks/KHR_interactivity-DHimeDac.esm.js.map +0 -1
  232. package/dist/chunks/KHR_lights_punctual-CKLPiVPx.esm.js +0 -1253
  233. package/dist/chunks/KHR_lights_punctual-CKLPiVPx.esm.js.map +0 -1
  234. package/dist/chunks/KHR_lights_punctual-Dl3Xt0qH.esm.min.js +0 -2
  235. package/dist/chunks/KHR_lights_punctual-Dl3Xt0qH.esm.min.js.map +0 -1
  236. package/dist/chunks/KHR_materials_anisotropy-BlKga02r.esm.min.js +0 -2
  237. package/dist/chunks/KHR_materials_anisotropy-BlKga02r.esm.min.js.map +0 -1
  238. package/dist/chunks/KHR_materials_anisotropy-D_vFuzc0.esm.js +0 -64
  239. package/dist/chunks/KHR_materials_anisotropy-D_vFuzc0.esm.js.map +0 -1
  240. package/dist/chunks/KHR_materials_clearcoat-2P7-x3fR.esm.js +0 -96
  241. package/dist/chunks/KHR_materials_clearcoat-2P7-x3fR.esm.js.map +0 -1
  242. package/dist/chunks/KHR_materials_clearcoat-JLop7Kfg.esm.min.js +0 -2
  243. package/dist/chunks/KHR_materials_clearcoat-JLop7Kfg.esm.min.js.map +0 -1
  244. package/dist/chunks/KHR_materials_diffuse_transmission-BJY5giTc.esm.min.js +0 -2
  245. package/dist/chunks/KHR_materials_diffuse_transmission-BJY5giTc.esm.min.js.map +0 -1
  246. package/dist/chunks/KHR_materials_diffuse_transmission-DwFIB9fg.esm.js +0 -97
  247. package/dist/chunks/KHR_materials_diffuse_transmission-DwFIB9fg.esm.js.map +0 -1
  248. package/dist/chunks/KHR_materials_dispersion-5ELsBp34.esm.min.js +0 -2
  249. package/dist/chunks/KHR_materials_dispersion-5ELsBp34.esm.min.js.map +0 -1
  250. package/dist/chunks/KHR_materials_dispersion-CFS1T2yw.esm.js +0 -62
  251. package/dist/chunks/KHR_materials_dispersion-CFS1T2yw.esm.js.map +0 -1
  252. package/dist/chunks/KHR_materials_emissive_strength-BjBRYGm9.esm.js +0 -55
  253. package/dist/chunks/KHR_materials_emissive_strength-BjBRYGm9.esm.js.map +0 -1
  254. package/dist/chunks/KHR_materials_emissive_strength-CPQefGT0.esm.min.js +0 -2
  255. package/dist/chunks/KHR_materials_emissive_strength-CPQefGT0.esm.min.js.map +0 -1
  256. package/dist/chunks/KHR_materials_ior-COc1f40R.esm.min.js +0 -2
  257. package/dist/chunks/KHR_materials_ior-COc1f40R.esm.min.js.map +0 -1
  258. package/dist/chunks/KHR_materials_ior-DA7pWw9x.esm.js +0 -64
  259. package/dist/chunks/KHR_materials_ior-DA7pWw9x.esm.js.map +0 -1
  260. package/dist/chunks/KHR_materials_iridescence-C5zkC2Qa.esm.min.js +0 -2
  261. package/dist/chunks/KHR_materials_iridescence-C5zkC2Qa.esm.min.js.map +0 -1
  262. package/dist/chunks/KHR_materials_iridescence-CmvJW1oh.esm.js +0 -72
  263. package/dist/chunks/KHR_materials_iridescence-CmvJW1oh.esm.js.map +0 -1
  264. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-7VdedH19.esm.js +0 -81
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-7VdedH19.esm.js.map +0 -1
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-CDCzt8M3.esm.min.js +0 -2
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-CDCzt8M3.esm.min.js.map +0 -1
  268. package/dist/chunks/KHR_materials_sheen-BFHRryyJ.esm.js +0 -85
  269. package/dist/chunks/KHR_materials_sheen-BFHRryyJ.esm.js.map +0 -1
  270. package/dist/chunks/KHR_materials_sheen-Dr_bKj0V.esm.min.js +0 -2
  271. package/dist/chunks/KHR_materials_sheen-Dr_bKj0V.esm.min.js.map +0 -1
  272. package/dist/chunks/KHR_materials_specular-CMp7dQ3N.esm.js +0 -75
  273. package/dist/chunks/KHR_materials_specular-CMp7dQ3N.esm.js.map +0 -1
  274. package/dist/chunks/KHR_materials_specular-Do-bJ9Tz.esm.min.js +0 -2
  275. package/dist/chunks/KHR_materials_specular-Do-bJ9Tz.esm.min.js.map +0 -1
  276. package/dist/chunks/KHR_materials_transmission-C8Na2aOr.esm.min.js +0 -2
  277. package/dist/chunks/KHR_materials_transmission-C8Na2aOr.esm.min.js.map +0 -1
  278. package/dist/chunks/KHR_materials_transmission-DiAYQhUP.esm.js +0 -307
  279. package/dist/chunks/KHR_materials_transmission-DiAYQhUP.esm.js.map +0 -1
  280. package/dist/chunks/KHR_materials_unlit-AqTZLxcL.esm.min.js +0 -2
  281. package/dist/chunks/KHR_materials_unlit-AqTZLxcL.esm.min.js.map +0 -1
  282. package/dist/chunks/KHR_materials_unlit-CwaIOdG_.esm.js +0 -74
  283. package/dist/chunks/KHR_materials_unlit-CwaIOdG_.esm.js.map +0 -1
  284. package/dist/chunks/KHR_materials_variants--8JMISBO.esm.js +0 -238
  285. package/dist/chunks/KHR_materials_variants--8JMISBO.esm.js.map +0 -1
  286. package/dist/chunks/KHR_materials_variants-CY2ksNW8.esm.min.js +0 -2
  287. package/dist/chunks/KHR_materials_variants-CY2ksNW8.esm.min.js.map +0 -1
  288. package/dist/chunks/KHR_materials_volume-16xOP2pG.esm.js +0 -87
  289. package/dist/chunks/KHR_materials_volume-16xOP2pG.esm.js.map +0 -1
  290. package/dist/chunks/KHR_materials_volume-eVBmT7Py.esm.min.js +0 -2
  291. package/dist/chunks/KHR_materials_volume-eVBmT7Py.esm.min.js.map +0 -1
  292. package/dist/chunks/KHR_mesh_quantization-CzxT4LfP.esm.min.js +0 -2
  293. package/dist/chunks/KHR_mesh_quantization-CzxT4LfP.esm.min.js.map +0 -1
  294. package/dist/chunks/KHR_mesh_quantization-DXlvMjPl.esm.js +0 -26
  295. package/dist/chunks/KHR_mesh_quantization-DXlvMjPl.esm.js.map +0 -1
  296. package/dist/chunks/KHR_texture_basisu-DwyvsvjH.esm.js +0 -43
  297. package/dist/chunks/KHR_texture_basisu-DwyvsvjH.esm.js.map +0 -1
  298. package/dist/chunks/KHR_texture_basisu-_W9Br-Jl.esm.min.js +0 -2
  299. package/dist/chunks/KHR_texture_basisu-_W9Br-Jl.esm.min.js.map +0 -1
  300. package/dist/chunks/KHR_texture_transform-BrggkZGk.esm.min.js +0 -2
  301. package/dist/chunks/KHR_texture_transform-BrggkZGk.esm.min.js.map +0 -1
  302. package/dist/chunks/KHR_texture_transform-C86eLMga.esm.js +0 -63
  303. package/dist/chunks/KHR_texture_transform-C86eLMga.esm.js.map +0 -1
  304. package/dist/chunks/KHR_xmp_json_ld-B4kyQRbU.esm.js +0 -51
  305. package/dist/chunks/KHR_xmp_json_ld-B4kyQRbU.esm.js.map +0 -1
  306. package/dist/chunks/KHR_xmp_json_ld-C3CU_p-l.esm.min.js +0 -2
  307. package/dist/chunks/KHR_xmp_json_ld-C3CU_p-l.esm.min.js.map +0 -1
  308. package/dist/chunks/MSFT_audio_emitter-B3Ta8qMN.esm.min.js +0 -2
  309. package/dist/chunks/MSFT_audio_emitter-B3Ta8qMN.esm.min.js.map +0 -1
  310. package/dist/chunks/MSFT_audio_emitter-D8nIcuBy.esm.js +0 -2236
  311. package/dist/chunks/MSFT_audio_emitter-D8nIcuBy.esm.js.map +0 -1
  312. package/dist/chunks/MSFT_lod-CEIzxRis.esm.js +0 -337
  313. package/dist/chunks/MSFT_lod-CEIzxRis.esm.js.map +0 -1
  314. package/dist/chunks/MSFT_lod-DZOikD8t.esm.min.js +0 -2
  315. package/dist/chunks/MSFT_lod-DZOikD8t.esm.min.js.map +0 -1
  316. package/dist/chunks/MSFT_minecraftMesh-B7vBtMTM.esm.js +0 -46
  317. package/dist/chunks/MSFT_minecraftMesh-B7vBtMTM.esm.js.map +0 -1
  318. package/dist/chunks/MSFT_minecraftMesh-DQCCOSGW.esm.min.js +0 -2
  319. package/dist/chunks/MSFT_minecraftMesh-DQCCOSGW.esm.min.js.map +0 -1
  320. package/dist/chunks/MSFT_sRGBFactors-ApBMqY9Y.esm.min.js +0 -2
  321. package/dist/chunks/MSFT_sRGBFactors-ApBMqY9Y.esm.min.js.map +0 -1
  322. package/dist/chunks/MSFT_sRGBFactors-DCyPuGAW.esm.js +0 -47
  323. package/dist/chunks/MSFT_sRGBFactors-DCyPuGAW.esm.js.map +0 -1
  324. package/dist/chunks/assetContainer-4Y8qxrkP.esm.min.js +0 -2
  325. package/dist/chunks/assetContainer-4Y8qxrkP.esm.min.js.map +0 -1
  326. package/dist/chunks/assetContainer-yduDDAg5.esm.js +0 -1598
  327. package/dist/chunks/assetContainer-yduDDAg5.esm.js.map +0 -1
  328. package/dist/chunks/audioEngine-B2lVczv1.esm.js +0 -305
  329. package/dist/chunks/audioEngine-B2lVczv1.esm.js.map +0 -1
  330. package/dist/chunks/audioEngine-BdTR6pZz.esm.min.js +0 -2
  331. package/dist/chunks/audioEngine-BdTR6pZz.esm.min.js.map +0 -1
  332. package/dist/chunks/bakedVertexAnimation-DVAdtwv1.esm.min.js +0 -2
  333. package/dist/chunks/bakedVertexAnimation-DVAdtwv1.esm.min.js.map +0 -1
  334. package/dist/chunks/bakedVertexAnimation-DeNM3h2Z.esm.js +0 -119
  335. package/dist/chunks/bakedVertexAnimation-DeNM3h2Z.esm.js.map +0 -1
  336. package/dist/chunks/basisTextureLoader-B0x2JhtN.esm.min.js +0 -2
  337. package/dist/chunks/basisTextureLoader-B0x2JhtN.esm.min.js.map +0 -1
  338. package/dist/chunks/basisTextureLoader-kG8CWoCn.esm.js +0 -600
  339. package/dist/chunks/basisTextureLoader-kG8CWoCn.esm.js.map +0 -1
  340. package/dist/chunks/dds-B4XmtkSp.esm.js +0 -540
  341. package/dist/chunks/dds-B4XmtkSp.esm.js.map +0 -1
  342. package/dist/chunks/dds-DeNz8hS-.esm.min.js +0 -2
  343. package/dist/chunks/dds-DeNz8hS-.esm.min.js.map +0 -1
  344. package/dist/chunks/ddsTextureLoader-BjLEbHHS.esm.js +0 -88
  345. package/dist/chunks/ddsTextureLoader-BjLEbHHS.esm.js.map +0 -1
  346. package/dist/chunks/ddsTextureLoader-D9FHqe-R.esm.min.js +0 -2
  347. package/dist/chunks/ddsTextureLoader-D9FHqe-R.esm.min.js.map +0 -1
  348. package/dist/chunks/decalFragment-BRIy9zMn.esm.min.js +0 -2
  349. package/dist/chunks/decalFragment-BRIy9zMn.esm.min.js.map +0 -1
  350. package/dist/chunks/decalFragment-DjXy6GUY.esm.js +0 -18
  351. package/dist/chunks/decalFragment-DjXy6GUY.esm.js.map +0 -1
  352. package/dist/chunks/default.fragment-BaBj8oN2.esm.js +0 -515
  353. package/dist/chunks/default.fragment-BaBj8oN2.esm.js.map +0 -1
  354. package/dist/chunks/default.fragment-C77QNDVC.esm.js +0 -449
  355. package/dist/chunks/default.fragment-C77QNDVC.esm.js.map +0 -1
  356. package/dist/chunks/default.fragment-CzYoM-ST.esm.min.js +0 -2
  357. package/dist/chunks/default.fragment-CzYoM-ST.esm.min.js.map +0 -1
  358. package/dist/chunks/default.fragment-D2M5EU_o.esm.min.js +0 -2
  359. package/dist/chunks/default.fragment-D2M5EU_o.esm.min.js.map +0 -1
  360. package/dist/chunks/default.vertex-BMMLYJyE.esm.min.js +0 -2
  361. package/dist/chunks/default.vertex-BMMLYJyE.esm.min.js.map +0 -1
  362. package/dist/chunks/default.vertex-CI6v3Y74.esm.js +0 -199
  363. package/dist/chunks/default.vertex-CI6v3Y74.esm.js.map +0 -1
  364. package/dist/chunks/default.vertex-DS3Btklm.esm.js +0 -180
  365. package/dist/chunks/default.vertex-DS3Btklm.esm.js.map +0 -1
  366. package/dist/chunks/default.vertex-sG6vJK6V.esm.min.js +0 -2
  367. package/dist/chunks/default.vertex-sG6vJK6V.esm.min.js.map +0 -1
  368. package/dist/chunks/defaultUboDeclaration-CfEdjUu2.esm.js +0 -15
  369. package/dist/chunks/defaultUboDeclaration-CfEdjUu2.esm.js.map +0 -1
  370. package/dist/chunks/defaultUboDeclaration-EXGQjmeR.esm.min.js +0 -2
  371. package/dist/chunks/defaultUboDeclaration-EXGQjmeR.esm.min.js.map +0 -1
  372. package/dist/chunks/defaultUboDeclaration-Qio0jGUO.esm.min.js +0 -2
  373. package/dist/chunks/defaultUboDeclaration-Qio0jGUO.esm.min.js.map +0 -1
  374. package/dist/chunks/defaultUboDeclaration-tUtq3goK.esm.js +0 -13
  375. package/dist/chunks/defaultUboDeclaration-tUtq3goK.esm.js.map +0 -1
  376. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  377. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  378. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  379. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  380. package/dist/chunks/dumpTools-BxY8w25M.esm.js +0 -400
  381. package/dist/chunks/dumpTools-BxY8w25M.esm.js.map +0 -1
  382. package/dist/chunks/dumpTools-Che-gwG7.esm.min.js +0 -2
  383. package/dist/chunks/dumpTools-Che-gwG7.esm.min.js.map +0 -1
  384. package/dist/chunks/engine-06Wd-_3h.esm.min.js +0 -2
  385. package/dist/chunks/engine-06Wd-_3h.esm.min.js.map +0 -1
  386. package/dist/chunks/engine-wEbS27-R.esm.js +0 -2174
  387. package/dist/chunks/engine-wEbS27-R.esm.js.map +0 -1
  388. package/dist/chunks/engine.common-BxiwlBr3.esm.min.js +0 -2
  389. package/dist/chunks/engine.common-BxiwlBr3.esm.min.js.map +0 -1
  390. package/dist/chunks/engine.common-DRFOWS2A.esm.js +0 -1088
  391. package/dist/chunks/engine.common-DRFOWS2A.esm.js.map +0 -1
  392. package/dist/chunks/envTextureLoader-Deb8hyWv.esm.js +0 -64
  393. package/dist/chunks/envTextureLoader-Deb8hyWv.esm.js.map +0 -1
  394. package/dist/chunks/envTextureLoader-nt7RB7jF.esm.min.js +0 -2
  395. package/dist/chunks/envTextureLoader-nt7RB7jF.esm.min.js.map +0 -1
  396. package/dist/chunks/environmentTextureTools-CnU6sdsm.esm.js +0 -382
  397. package/dist/chunks/environmentTextureTools-CnU6sdsm.esm.js.map +0 -1
  398. package/dist/chunks/environmentTextureTools-CqxQLfVS.esm.min.js +0 -2
  399. package/dist/chunks/environmentTextureTools-CqxQLfVS.esm.min.js.map +0 -1
  400. package/dist/chunks/exrTextureLoader-DgqYue7c.esm.min.js +0 -2
  401. package/dist/chunks/exrTextureLoader-DgqYue7c.esm.min.js.map +0 -1
  402. package/dist/chunks/exrTextureLoader-au_729k4.esm.js +0 -1682
  403. package/dist/chunks/exrTextureLoader-au_729k4.esm.js.map +0 -1
  404. package/dist/chunks/fogFragment-8tEI-kPW.esm.min.js +0 -2
  405. package/dist/chunks/fogFragment-8tEI-kPW.esm.min.js.map +0 -1
  406. package/dist/chunks/fogFragment-CULs-7PE.esm.js +0 -102
  407. package/dist/chunks/fogFragment-CULs-7PE.esm.js.map +0 -1
  408. package/dist/chunks/fresnelFunction-B4KI4E8h.esm.js +0 -12
  409. package/dist/chunks/fresnelFunction-B4KI4E8h.esm.js.map +0 -1
  410. package/dist/chunks/fresnelFunction-CeLpSg7g.esm.min.js +0 -2
  411. package/dist/chunks/fresnelFunction-CeLpSg7g.esm.min.js.map +0 -1
  412. package/dist/chunks/glTFLoader-BSsxhX_B.esm.js +0 -7552
  413. package/dist/chunks/glTFLoader-BSsxhX_B.esm.js.map +0 -1
  414. package/dist/chunks/glTFLoader-Cdf6EEh4.esm.min.js +0 -2
  415. package/dist/chunks/glTFLoader-Cdf6EEh4.esm.min.js.map +0 -1
  416. package/dist/chunks/glTFLoaderAnimation-KvPgN70Y.esm.min.js +0 -2
  417. package/dist/chunks/glTFLoaderAnimation-KvPgN70Y.esm.min.js.map +0 -1
  418. package/dist/chunks/glTFLoaderAnimation-vK1xPOOh.esm.js +0 -77
  419. package/dist/chunks/glTFLoaderAnimation-vK1xPOOh.esm.js.map +0 -1
  420. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  421. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  422. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  423. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  424. package/dist/chunks/harmonicsFunctions-CnvdxOXs.esm.min.js +0 -2
  425. package/dist/chunks/harmonicsFunctions-CnvdxOXs.esm.min.js.map +0 -1
  426. package/dist/chunks/harmonicsFunctions-CwZrA_es.esm.js +0 -34
  427. package/dist/chunks/harmonicsFunctions-CwZrA_es.esm.js.map +0 -1
  428. package/dist/chunks/harmonicsFunctions-D23NP4_R.esm.min.js +0 -2
  429. package/dist/chunks/harmonicsFunctions-D23NP4_R.esm.min.js.map +0 -1
  430. package/dist/chunks/harmonicsFunctions-DWAunDBq.esm.js +0 -35
  431. package/dist/chunks/harmonicsFunctions-DWAunDBq.esm.js.map +0 -1
  432. package/dist/chunks/hdrTextureLoader-BBszpiSE.esm.js +0 -252
  433. package/dist/chunks/hdrTextureLoader-BBszpiSE.esm.js.map +0 -1
  434. package/dist/chunks/hdrTextureLoader-DlqeGac5.esm.min.js +0 -2
  435. package/dist/chunks/hdrTextureLoader-DlqeGac5.esm.min.js.map +0 -1
  436. package/dist/chunks/helperFunctions-B-IxnCCi.esm.js +0 -108
  437. package/dist/chunks/helperFunctions-B-IxnCCi.esm.js.map +0 -1
  438. package/dist/chunks/helperFunctions-BJn_zA2T.esm.js +0 -80
  439. package/dist/chunks/helperFunctions-BJn_zA2T.esm.js.map +0 -1
  440. package/dist/chunks/helperFunctions-CdXvdI3d.esm.min.js +0 -2
  441. package/dist/chunks/helperFunctions-CdXvdI3d.esm.min.js.map +0 -1
  442. package/dist/chunks/helperFunctions-Cz2oFjJD.esm.min.js +0 -2
  443. package/dist/chunks/helperFunctions-Cz2oFjJD.esm.min.js.map +0 -1
  444. package/dist/chunks/index-DEZD8qGB.esm.min.js +0 -57
  445. package/dist/chunks/index-DEZD8qGB.esm.min.js.map +0 -1
  446. package/dist/chunks/index-rM42Fwtd.esm.js +0 -73922
  447. package/dist/chunks/index-rM42Fwtd.esm.js.map +0 -1
  448. package/dist/chunks/ktxTextureLoader-5XE4saqV.esm.min.js +0 -2
  449. package/dist/chunks/ktxTextureLoader-5XE4saqV.esm.min.js.map +0 -1
  450. package/dist/chunks/ktxTextureLoader-CzOXMl46.esm.js +0 -814
  451. package/dist/chunks/ktxTextureLoader-CzOXMl46.esm.js.map +0 -1
  452. package/dist/chunks/logDepthDeclaration-C1e5P6MP.esm.min.js +0 -2
  453. package/dist/chunks/logDepthDeclaration-C1e5P6MP.esm.min.js.map +0 -1
  454. package/dist/chunks/logDepthDeclaration-CP73F-Ht.esm.min.js +0 -2
  455. package/dist/chunks/logDepthDeclaration-CP73F-Ht.esm.min.js.map +0 -1
  456. package/dist/chunks/logDepthDeclaration-Cpcs5duV.esm.js +0 -20
  457. package/dist/chunks/logDepthDeclaration-Cpcs5duV.esm.js.map +0 -1
  458. package/dist/chunks/logDepthDeclaration-tZj2QrWI.esm.js +0 -35
  459. package/dist/chunks/logDepthDeclaration-tZj2QrWI.esm.js.map +0 -1
  460. package/dist/chunks/logDepthVertex-BHds0cL7.esm.min.js +0 -2
  461. package/dist/chunks/logDepthVertex-BHds0cL7.esm.min.js.map +0 -1
  462. package/dist/chunks/logDepthVertex-C77H-mUN.esm.js +0 -77
  463. package/dist/chunks/logDepthVertex-C77H-mUN.esm.js.map +0 -1
  464. package/dist/chunks/logDepthVertex-CRCv55t1.esm.min.js +0 -2
  465. package/dist/chunks/logDepthVertex-CRCv55t1.esm.min.js.map +0 -1
  466. package/dist/chunks/logDepthVertex-D71T3PUi.esm.js +0 -488
  467. package/dist/chunks/logDepthVertex-D71T3PUi.esm.js.map +0 -1
  468. package/dist/chunks/mainUVVaryingDeclaration-DH5Gw79d.esm.min.js +0 -2
  469. package/dist/chunks/mainUVVaryingDeclaration-DH5Gw79d.esm.min.js.map +0 -1
  470. package/dist/chunks/mainUVVaryingDeclaration-DjaUAU9d.esm.js +0 -11
  471. package/dist/chunks/mainUVVaryingDeclaration-DjaUAU9d.esm.js.map +0 -1
  472. package/dist/chunks/meshUboDeclaration-Dfhjtzfu.esm.js +0 -24
  473. package/dist/chunks/meshUboDeclaration-Dfhjtzfu.esm.js.map +0 -1
  474. package/dist/chunks/meshUboDeclaration-JuXAHT9v.esm.min.js +0 -2
  475. package/dist/chunks/meshUboDeclaration-JuXAHT9v.esm.min.js.map +0 -1
  476. package/dist/chunks/objFileLoader-7U6Dolv_.esm.js +0 -1280
  477. package/dist/chunks/objFileLoader-7U6Dolv_.esm.js.map +0 -1
  478. package/dist/chunks/objFileLoader-_Uh3sl5M.esm.min.js +0 -2
  479. package/dist/chunks/objFileLoader-_Uh3sl5M.esm.min.js.map +0 -1
  480. package/dist/chunks/oitFragment-B761cGSz.esm.js +0 -1150
  481. package/dist/chunks/oitFragment-B761cGSz.esm.js.map +0 -1
  482. package/dist/chunks/oitFragment-BEyzdlIX.esm.min.js +0 -2
  483. package/dist/chunks/oitFragment-BEyzdlIX.esm.min.js.map +0 -1
  484. package/dist/chunks/oitFragment-BJxddGxd.esm.min.js +0 -2
  485. package/dist/chunks/oitFragment-BJxddGxd.esm.min.js.map +0 -1
  486. package/dist/chunks/oitFragment-DxRU43Qk.esm.js +0 -1210
  487. package/dist/chunks/oitFragment-DxRU43Qk.esm.js.map +0 -1
  488. package/dist/chunks/pass.fragment-BezLFEaR.esm.min.js +0 -2
  489. package/dist/chunks/pass.fragment-BezLFEaR.esm.min.js.map +0 -1
  490. package/dist/chunks/pass.fragment-CI0Hbebv.esm.min.js +0 -2
  491. package/dist/chunks/pass.fragment-CI0Hbebv.esm.min.js.map +0 -1
  492. package/dist/chunks/pass.fragment-CKuTIGRc.esm.js +0 -15
  493. package/dist/chunks/pass.fragment-CKuTIGRc.esm.js.map +0 -1
  494. package/dist/chunks/pass.fragment-M4VAGwSP.esm.js +0 -15
  495. package/dist/chunks/pass.fragment-M4VAGwSP.esm.js.map +0 -1
  496. package/dist/chunks/pbr.fragment-BnTARhOZ.esm.js +0 -3165
  497. package/dist/chunks/pbr.fragment-BnTARhOZ.esm.js.map +0 -1
  498. package/dist/chunks/pbr.fragment-CFwXu2ZW.esm.min.js +0 -2
  499. package/dist/chunks/pbr.fragment-CFwXu2ZW.esm.min.js.map +0 -1
  500. package/dist/chunks/pbr.fragment-CZH3Z6Fz.esm.min.js +0 -2
  501. package/dist/chunks/pbr.fragment-CZH3Z6Fz.esm.min.js.map +0 -1
  502. package/dist/chunks/pbr.fragment-DXb2YUXa.esm.js +0 -3219
  503. package/dist/chunks/pbr.fragment-DXb2YUXa.esm.js.map +0 -1
  504. package/dist/chunks/pbr.vertex-B0UjdSCd.esm.min.js +0 -2
  505. package/dist/chunks/pbr.vertex-B0UjdSCd.esm.min.js.map +0 -1
  506. package/dist/chunks/pbr.vertex-BK-SOy7u.esm.js +0 -210
  507. package/dist/chunks/pbr.vertex-BK-SOy7u.esm.js.map +0 -1
  508. package/dist/chunks/pbr.vertex-BU96l1oL.esm.js +0 -335
  509. package/dist/chunks/pbr.vertex-BU96l1oL.esm.js.map +0 -1
  510. package/dist/chunks/pbr.vertex-BqZLjnyL.esm.min.js +0 -2
  511. package/dist/chunks/pbr.vertex-BqZLjnyL.esm.min.js.map +0 -1
  512. package/dist/chunks/postprocess.vertex-BXwgd-7B.esm.min.js +0 -2
  513. package/dist/chunks/postprocess.vertex-BXwgd-7B.esm.min.js.map +0 -1
  514. package/dist/chunks/postprocess.vertex-BbvDeWLH.esm.min.js +0 -2
  515. package/dist/chunks/postprocess.vertex-BbvDeWLH.esm.min.js.map +0 -1
  516. package/dist/chunks/postprocess.vertex-Ck5Z_51x.esm.js +0 -20
  517. package/dist/chunks/postprocess.vertex-Ck5Z_51x.esm.js.map +0 -1
  518. package/dist/chunks/postprocess.vertex-pT9f0tdJ.esm.js +0 -18
  519. package/dist/chunks/postprocess.vertex-pT9f0tdJ.esm.js.map +0 -1
  520. package/dist/chunks/rawTexture-1Rq8qsxm.esm.min.js +0 -2
  521. package/dist/chunks/rawTexture-1Rq8qsxm.esm.min.js.map +0 -1
  522. package/dist/chunks/rawTexture-D_BRK-o8.esm.js +0 -191
  523. package/dist/chunks/rawTexture-D_BRK-o8.esm.js.map +0 -1
  524. package/dist/chunks/rgbdDecode.fragment-BGF4g1hZ.esm.js +0 -17
  525. package/dist/chunks/rgbdDecode.fragment-BGF4g1hZ.esm.js.map +0 -1
  526. package/dist/chunks/rgbdDecode.fragment-C2vWUMvk.esm.js +0 -17
  527. package/dist/chunks/rgbdDecode.fragment-C2vWUMvk.esm.js.map +0 -1
  528. package/dist/chunks/rgbdDecode.fragment-Cf7oe5zh.esm.min.js +0 -2
  529. package/dist/chunks/rgbdDecode.fragment-Cf7oe5zh.esm.min.js.map +0 -1
  530. package/dist/chunks/rgbdDecode.fragment-CkuXLnPU.esm.min.js +0 -2
  531. package/dist/chunks/rgbdDecode.fragment-CkuXLnPU.esm.min.js.map +0 -1
  532. package/dist/chunks/rgbdEncode.fragment-D1q7KpIB.esm.min.js +0 -2
  533. package/dist/chunks/rgbdEncode.fragment-D1q7KpIB.esm.min.js.map +0 -1
  534. package/dist/chunks/rgbdEncode.fragment-DziyA8SH.esm.js +0 -17
  535. package/dist/chunks/rgbdEncode.fragment-DziyA8SH.esm.js.map +0 -1
  536. package/dist/chunks/rgbdEncode.fragment-EbVo_OS3.esm.min.js +0 -2
  537. package/dist/chunks/rgbdEncode.fragment-EbVo_OS3.esm.min.js.map +0 -1
  538. package/dist/chunks/rgbdEncode.fragment-O0WkfdaA.esm.js +0 -17
  539. package/dist/chunks/rgbdEncode.fragment-O0WkfdaA.esm.js.map +0 -1
  540. package/dist/chunks/splatFileLoader-Civo1vlZ.esm.min.js +0 -2
  541. package/dist/chunks/splatFileLoader-Civo1vlZ.esm.min.js.map +0 -1
  542. package/dist/chunks/splatFileLoader-D3Gb0TOq.esm.js +0 -3202
  543. package/dist/chunks/splatFileLoader-D3Gb0TOq.esm.js.map +0 -1
  544. package/dist/chunks/standardMaterial-C4ytj3UV.esm.min.js +0 -2
  545. package/dist/chunks/standardMaterial-C4ytj3UV.esm.min.js.map +0 -1
  546. package/dist/chunks/standardMaterial-Ds152YtF.esm.js +0 -1809
  547. package/dist/chunks/standardMaterial-Ds152YtF.esm.js.map +0 -1
  548. package/dist/chunks/stlFileLoader-DEyXKGGV.esm.js +0 -237
  549. package/dist/chunks/stlFileLoader-DEyXKGGV.esm.js.map +0 -1
  550. package/dist/chunks/stlFileLoader-O0L9MhOP.esm.min.js +0 -2
  551. package/dist/chunks/stlFileLoader-O0L9MhOP.esm.min.js.map +0 -1
  552. package/dist/chunks/tgaTextureLoader-2LzCuq-y.esm.min.js +0 -2
  553. package/dist/chunks/tgaTextureLoader-2LzCuq-y.esm.min.js.map +0 -1
  554. package/dist/chunks/tgaTextureLoader-C1ZPR3Z6.esm.js +0 -349
  555. package/dist/chunks/tgaTextureLoader-C1ZPR3Z6.esm.js.map +0 -1
  556. package/dist/chunks/thinEngine-DMsfsUJl.esm.min.js +0 -2
  557. package/dist/chunks/thinEngine-DMsfsUJl.esm.min.js.map +0 -1
  558. package/dist/chunks/thinEngine-Ka7-uzzY.esm.js +0 -3721
  559. package/dist/chunks/thinEngine-Ka7-uzzY.esm.js.map +0 -1
  560. package/dist/chunks/thinInstanceMesh-CnqlNkHp.esm.js +0 -314
  561. package/dist/chunks/thinInstanceMesh-CnqlNkHp.esm.js.map +0 -1
  562. package/dist/chunks/thinInstanceMesh-DvDlskuJ.esm.min.js +0 -2
  563. package/dist/chunks/thinInstanceMesh-DvDlskuJ.esm.min.js.map +0 -1
  564. package/dist/chunks/vertexColorMixing-6-uBAQ55.esm.js +0 -528
  565. package/dist/chunks/vertexColorMixing-6-uBAQ55.esm.js.map +0 -1
  566. package/dist/chunks/vertexColorMixing-BCQLn981.esm.min.js +0 -2
  567. package/dist/chunks/vertexColorMixing-BCQLn981.esm.min.js.map +0 -1
  568. package/dist/chunks/webgpuEngine-DWUcPn9n.esm.min.js +0 -2
  569. package/dist/chunks/webgpuEngine-DWUcPn9n.esm.min.js.map +0 -1
  570. package/dist/chunks/webgpuEngine-_VOc_CYS.esm.js +0 -11170
  571. package/dist/chunks/webgpuEngine-_VOc_CYS.esm.js.map +0 -1
  572. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  573. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  574. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  575. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  576. package/lib/index.d.ts +0 -281
  577. package/lib/index.js +0 -965
  578. package/lib/index.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{ab as e,af as t,b5 as s,T as n,b6 as i,t as r,aJ as a,aL as o,b7 as l,$ as h,b8 as d,aM as c,R as u,b9 as _,A as m,s as p,E as g,ba as f,aH as b,bb as y,L as A,a1 as v,C as x,bc as M,bd as T,Z as w,be as C,V as O,q as R,ah as S,bf as E,bg as k,bh as P,bi as L,bj as I,bk as N,w as D,aF as B,aE as $,ak as F,bl as U,M as V,aK as G,bm as W,u as X,a2 as Y,Q as Z,j as K,aQ as z,p as j,bn as q,bo as H,bp as J,aG as Q}from"./index-DEZD8qGB.esm.min.js";import{R as ee}from"./rawTexture-1Rq8qsxm.esm.min.js";import{A as te}from"./assetContainer-4Y8qxrkP.esm.min.js";import{n as se}from"./glTFLoaderAnimation-KvPgN70Y.esm.min.js";class ne{constructor(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this.rotationSpeed=.5,this.keysRotateLeft=[],this.keysRotateRight=[],this.keysRotateUp=[],this.keysRotateDown=[],this._keys=new Array}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((()=>{this._keys.length=0})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((t=>{const s=t.event;if(!s.metaKey)if(t.type===i.KEYDOWN){if(-1!==this.keysUp.indexOf(s.keyCode)||-1!==this.keysDown.indexOf(s.keyCode)||-1!==this.keysLeft.indexOf(s.keyCode)||-1!==this.keysRight.indexOf(s.keyCode)||-1!==this.keysUpward.indexOf(s.keyCode)||-1!==this.keysDownward.indexOf(s.keyCode)||-1!==this.keysRotateLeft.indexOf(s.keyCode)||-1!==this.keysRotateRight.indexOf(s.keyCode)||-1!==this.keysRotateUp.indexOf(s.keyCode)||-1!==this.keysRotateDown.indexOf(s.keyCode)){-1===this._keys.indexOf(s.keyCode)&&this._keys.push(s.keyCode),e||s.preventDefault()}}else if(-1!==this.keysUp.indexOf(s.keyCode)||-1!==this.keysDown.indexOf(s.keyCode)||-1!==this.keysLeft.indexOf(s.keyCode)||-1!==this.keysRight.indexOf(s.keyCode)||-1!==this.keysUpward.indexOf(s.keyCode)||-1!==this.keysDownward.indexOf(s.keyCode)||-1!==this.keysRotateLeft.indexOf(s.keyCode)||-1!==this.keysRotateRight.indexOf(s.keyCode)||-1!==this.keysRotateUp.indexOf(s.keyCode)||-1!==this.keysRotateDown.indexOf(s.keyCode)){const t=this._keys.indexOf(s.keyCode);t>=0&&this._keys.splice(t,1),e||s.preventDefault()}})))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t<this._keys.length;t++){const s=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysLeft.indexOf(s)?e._localDirection.copyFromFloats(-n,0,0):-1!==this.keysUp.indexOf(s)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysRight.indexOf(s)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysDown.indexOf(s)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUpward.indexOf(s)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDownward.indexOf(s)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRotateLeft.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y-=this._getLocalRotation()):-1!==this.keysRotateRight.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y+=this._getLocalRotation()):-1!==this.keysRotateUp.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x-=this._getLocalRotation()):-1!==this.keysRotateDown.indexOf(s)&&(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x+=this._getLocalRotation()),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),r.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){const e=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*e}}e([t()],ne.prototype,"keysUp",void 0),e([t()],ne.prototype,"keysUpward",void 0),e([t()],ne.prototype,"keysDown",void 0),e([t()],ne.prototype,"keysDownward",void 0),e([t()],ne.prototype,"keysLeft",void 0),e([t()],ne.prototype,"keysRight",void 0),e([t()],ne.prototype,"rotationSpeed",void 0),e([t()],ne.prototype,"keysRotateLeft",void 0),e([t()],ne.prototype,"keysRotateRight",void 0),e([t()],ne.prototype,"keysRotateUp",void 0),e([t()],ne.prototype,"keysRotateDown",void 0),s.FreeCameraKeyboardMoveInput=ne;class ie{constructor(e=!0){this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this._previousPosition=null,this.onPointerMovedObservable=new a,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),s=t.getInputElement();this._pointerInput||(this._pointerInput=n=>{const i=n.event,r="touch"===i.pointerType;if(!this.touchEnabled&&r)return;if(n.type!==o.POINTERMOVE&&-1===this.buttons.indexOf(i.button))return;const a=i.target;if(n.type===o.POINTERDOWN){if(r&&-1!==this._activePointerId||!r&&-1!==this._currentActiveButton)return;this._activePointerId=i.pointerId;try{a?.setPointerCapture(i.pointerId)}catch(e){}-1===this._currentActiveButton&&(this._currentActiveButton=i.button),this._previousPosition={x:i.clientX,y:i.clientY},e||(i.preventDefault(),s&&s.focus()),t.isPointerLock&&this._onMouseMove&&this._onMouseMove(n.event)}else if(n.type===o.POINTERUP){if(r&&this._activePointerId!==i.pointerId||!r&&this._currentActiveButton!==i.button)return;try{a?.releasePointerCapture(i.pointerId)}catch(e){}this._currentActiveButton=-1,this._previousPosition=null,e||i.preventDefault(),this._activePointerId=-1}else if(n.type===o.POINTERMOVE&&(this._activePointerId===i.pointerId||!r))if(t.isPointerLock&&this._onMouseMove)this._onMouseMove(n.event);else if(this._previousPosition){const t=this.camera._calculateHandednessMultiplier(),s=(i.clientX-this._previousPosition.x)*t,n=i.clientY-this._previousPosition.y;this._allowCameraRotation&&(this.camera.cameraRotation.y+=s/this.angularSensibility,this.camera.cameraRotation.x+=n/this.angularSensibility),this.onPointerMovedObservable.notifyObservers({offsetX:s,offsetY:n}),this._previousPosition={x:i.clientX,y:i.clientY},e||i.preventDefault()}}),this._onMouseMove=s=>{if(!t.isPointerLock)return;const n=this.camera._calculateHandednessMultiplier(),i=s.movementX*n;this.camera.cameraRotation.y+=i/this.angularSensibility;const r=s.movementY;this.camera.cameraRotation.x+=r/this.angularSensibility,this._previousPosition=null,e||s.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,o.POINTERDOWN|o.POINTERUP|o.POINTERMOVE),s&&(this._contextMenuBind=e=>this.onContextMenu(e),s.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(e){e.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}}e([t()],ie.prototype,"buttons",void 0),e([t()],ie.prototype,"angularSensibility",void 0),s.FreeCameraMouseInput=ie;class re{constructor(){this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new a,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==o.POINTERWHEEL)return;const s=t.event,n=s.deltaMode===l.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*n*s.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*n*s.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*n*s.deltaZ/this._normalize,s.preventDefault&&(e||s.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,o.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}}var ae,oe,le,he;e([t()],re.prototype,"wheelPrecisionX",void 0),e([t()],re.prototype,"wheelPrecisionY",void 0),e([t()],re.prototype,"wheelPrecisionZ",void 0),function(e){e[e.MoveRelative=0]="MoveRelative",e[e.RotateRelative=1]="RotateRelative",e[e.MoveScene=2]="MoveScene"}(ae||(ae={}));class de extends re{constructor(){super(...arguments),this._moveRelative=r.Zero(),this._rotateRelative=r.Zero(),this._moveScene=r.Zero(),this._wheelXAction=ae.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=ae.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(e){null===e&&this._wheelXAction!==ae.MoveRelative||(this._wheelXAction=ae.MoveRelative,this._wheelXActionCoordinate=e)}get wheelXMoveRelative(){return this._wheelXAction!==ae.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(e){null===e&&this._wheelYAction!==ae.MoveRelative||(this._wheelYAction=ae.MoveRelative,this._wheelYActionCoordinate=e)}get wheelYMoveRelative(){return this._wheelYAction!==ae.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(e){null===e&&this._wheelZAction!==ae.MoveRelative||(this._wheelZAction=ae.MoveRelative,this._wheelZActionCoordinate=e)}get wheelZMoveRelative(){return this._wheelZAction!==ae.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(e){null===e&&this._wheelXAction!==ae.RotateRelative||(this._wheelXAction=ae.RotateRelative,this._wheelXActionCoordinate=e)}get wheelXRotateRelative(){return this._wheelXAction!==ae.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(e){null===e&&this._wheelYAction!==ae.RotateRelative||(this._wheelYAction=ae.RotateRelative,this._wheelYActionCoordinate=e)}get wheelYRotateRelative(){return this._wheelYAction!==ae.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(e){null===e&&this._wheelZAction!==ae.RotateRelative||(this._wheelZAction=ae.RotateRelative,this._wheelZActionCoordinate=e)}get wheelZRotateRelative(){return this._wheelZAction!==ae.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(e){null===e&&this._wheelXAction!==ae.MoveScene||(this._wheelXAction=ae.MoveScene,this._wheelXActionCoordinate=e)}get wheelXMoveScene(){return this._wheelXAction!==ae.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(e){null===e&&this._wheelYAction!==ae.MoveScene||(this._wheelYAction=ae.MoveScene,this._wheelYActionCoordinate=e)}get wheelYMoveScene(){return this._wheelYAction!==ae.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(e){null===e&&this._wheelZAction!==ae.MoveScene||(this._wheelZAction=ae.MoveScene,this._wheelZActionCoordinate=e)}get wheelZMoveScene(){return this._wheelZAction!==ae.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){if(0===this._wheelDeltaX&&0===this._wheelDeltaY&&0==this._wheelDeltaZ)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const e=h.Zero();this.camera.getViewMatrix().invertToRef(e);const t=r.Zero();r.TransformNormalToRef(this._moveRelative,e,t),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(t),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(e,t,s){if(0===e)return;if(null===t||null===s)return;let n=null;switch(t){case ae.MoveRelative:n=this._moveRelative;break;case ae.RotateRelative:n=this._rotateRelative;break;case ae.MoveScene:n=this._moveScene}switch(s){case 0:n.set(e,0,0);break;case 1:n.set(0,e,0);break;case 2:n.set(0,0,e)}}}e([t()],de.prototype,"wheelXMoveRelative",null),e([t()],de.prototype,"wheelYMoveRelative",null),e([t()],de.prototype,"wheelZMoveRelative",null),e([t()],de.prototype,"wheelXRotateRelative",null),e([t()],de.prototype,"wheelYRotateRelative",null),e([t()],de.prototype,"wheelZRotateRelative",null),e([t()],de.prototype,"wheelXMoveScene",null),e([t()],de.prototype,"wheelYMoveScene",null),e([t()],de.prototype,"wheelZMoveScene",null),s.FreeCameraMouseWheelInput=de;class ce{constructor(e=!1){this.allowMouse=e,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this.singleFingerRotate=!1,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=n.IsSafari()}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments);let t=null;if(void 0===this._pointerInput&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=s=>{const n=s.event,i="mouse"===n.pointerType||this._isSafari&&void 0===n.pointerType;if(this.allowMouse||!i)if(s.type===o.POINTERDOWN){if(e||n.preventDefault(),this._pointerPressed.push(n.pointerId),1!==this._pointerPressed.length)return;t={x:n.clientX,y:n.clientY}}else if(s.type===o.POINTERUP){e||n.preventDefault();const s=this._pointerPressed.indexOf(n.pointerId);if(-1===s)return;if(this._pointerPressed.splice(s,1),0!=s)return;t=null,this._offsetX=null,this._offsetY=null}else if(s.type===o.POINTERMOVE){if(e||n.preventDefault(),!t)return;if(0!=this._pointerPressed.indexOf(n.pointerId))return;this._offsetX=n.clientX-t.x,this._offsetY=-(n.clientY-t.y)}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,o.POINTERDOWN|o.POINTERUP|o.POINTERMOVE),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){if(null===this._offsetX||null===this._offsetY)return;if(0===this._offsetX&&0===this._offsetY)return;const e=this.camera,t=e._calculateHandednessMultiplier();e.cameraRotation.y=t*this._offsetX/this.touchAngularSensibility;if(this.singleFingerRotate&&1===this._pointerPressed.length||!this.singleFingerRotate&&this._pointerPressed.length>1)e.cameraRotation.x=-this._offsetY/this.touchAngularSensibility;else{const t=e._computeLocalCameraSpeed(),s=new r(0,0,0!==this.touchMoveSensibility?t*this._offsetY/this.touchMoveSensibility:0);h.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(r.TransformCoordinates(s,e._cameraRotationMatrix))}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}}e([t()],ce.prototype,"touchAngularSensibility",void 0),e([t()],ce.prototype,"touchMoveSensibility",void 0),s.FreeCameraTouchInput=ce;class ue extends d{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new ne),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new ie(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new de,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new ce),this}clear(){super.clear(),this._mouseInput=null}}class _e extends _{get angularSensibility(){const e=this.inputs.attached.mouse;return e?e.angularSensibility:0}set angularSensibility(e){const t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)}get keysUp(){const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysUpward(){const e=this.inputs.attached.keyboard;return e?e.keysUpward:[]}set keysUpward(e){const t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)}get keysDown(){const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysDownward(){const e=this.inputs.attached.keyboard;return e?e.keysDownward:[]}set keysDownward(e){const t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)}get keysLeft(){const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get keysRotateLeft(){const e=this.inputs.attached.keyboard;return e?e.keysRotateLeft:[]}set keysRotateLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateLeft=e)}get keysRotateRight(){const e=this.inputs.attached.keyboard;return e?e.keysRotateRight:[]}set keysRotateRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateRight=e)}get keysRotateUp(){const e=this.inputs.attached.keyboard;return e?e.keysRotateUp:[]}set keysRotateUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateUp=e)}get keysRotateDown(){const e=this.inputs.attached.keyboard;return e?e.keysRotateDown:[]}set keysRotateDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateDown=e)}constructor(e,t,s,n=!0){super(e,t,s,n),this.ellipsoid=new r(.5,1,.5),this.ellipsoidOffset=new r(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this._needMoveForGravity=!1,this._oldPosition=r.Zero(),this._diffPosition=r.Zero(),this._newPosition=r.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(e,t,s=null)=>{this._newPosition.copyFrom(t),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>m.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&s&&this.onCollide(s))},this.inputs=new ue(this),this.inputs.addKeyboard().addMouse()}attachControl(e,t){t=n.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new r(0,0,0),this.cameraRotation=new p(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(e){this._collisionMask=isNaN(e)?-1:e}_collideWithWorld(e){let t;t=this.parent?r.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position,t.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const s=this.getScene().collisionCoordinator;this._collider||(this._collider=s.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let n=e;this.applyGravity&&(n=e.add(this.getScene().gravity)),s.getNewPosition(this._oldPosition,n,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=r.Zero(),this._transformedDirection=r.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(e){this._needMoveForGravity=e}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}}e([c()],_e.prototype,"ellipsoid",void 0),e([c()],_e.prototype,"ellipsoidOffset",void 0),e([t()],_e.prototype,"checkCollisions",void 0),e([t()],_e.prototype,"applyGravity",void 0),u("BABYLON.FreeCamera",_e);class me{getClassName(){return"TargetedAnimation"}serialize(){const e={};return e.animation=this.animation.serialize(),e.targetId=this.target.id,e}}class pe{get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this.syncWithMask(!0))}syncWithMask(e=!1){if(this.mask||e){this._numActiveAnimatables=0;for(let e=0;e<this._animatables.length;++e){const t=this._animatables[e];!this.mask||this.mask.disabled||this.mask.retainsTarget(t.target.name)?(this._numActiveAnimatables++,t.paused&&t.restart()):t.paused||t.pause()}}else this._numActiveAnimatables=this._targetedAnimations.length}removeUnmaskedAnimations(){if(this.mask&&!this.mask.disabled){for(let e=0;e<this._animatables.length;++e){const t=this._animatables[e];this.mask.retainsTarget(t.target.name)||(t.stop(),this._animatables.splice(e,1),--e)}for(let e=0;e<this._targetedAnimations.length;e++){const t=this._targetedAnimations[e];this.mask.retainsTarget(t.target.name)||(this._targetedAnimations.splice(e,1),--e)}}}get from(){return this._from}set from(e){if(this._from!==e){this._from=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].fromFrame=this._from}}}get to(){return this._to}set to(e){if(this._to!==e){this._to=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].toFrame=this._to}}}get isStarted(){return this._isStarted}get isPlaying(){return this._isStarted&&!this._isPaused}get speedRatio(){return this._speedRatio}set speedRatio(e){if(this._speedRatio!==e){this._speedRatio=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].speedRatio=this._speedRatio}}}get loopAnimation(){return this._loopAnimation}set loopAnimation(e){if(this._loopAnimation!==e){this._loopAnimation=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].loopAnimation=this._loopAnimation}}}get isAdditive(){return this._isAdditive}set isAdditive(e){if(this._isAdditive!==e){this._isAdditive=e;for(let e=0;e<this._animatables.length;e++){this._animatables[e].isAdditive=this._isAdditive}}}get weight(){return this._weight}set weight(e){this._weight!==e&&(this._weight=e,this.setWeightForAllAnimatables(this._weight))}get targetedAnimations(){return this._targetedAnimations}get animatables(){return this._animatables}get children(){return this._targetedAnimations}get playOrder(){return this._playOrder}set playOrder(e){if(this._playOrder!==e&&(this._playOrder=e,this._animatables.length>0)){for(let e=0;e<this._animatables.length;e++)this._animatables[e].playOrder=this._playOrder;this._scene.sortActiveAnimatables()}}get enableBlending(){return this._enableBlending}set enableBlending(e){if(this._enableBlending!==e&&(this._enableBlending=e,null!==e))for(let t=0;t<this._targetedAnimations.length;++t)this._targetedAnimations[t].animation.enableBlending=e}get blendingSpeed(){return this._blendingSpeed}set blendingSpeed(e){if(this._blendingSpeed!==e&&(this._blendingSpeed=e,null!==e))for(let t=0;t<this._targetedAnimations.length;++t)this._targetedAnimations[t].animation.blendingSpeed=e}getLength(e,t){e=e??this._from;return((t=t??this._to)-e)/(this.targetedAnimations[0].animation.framePerSecond*this._speedRatio)}static MergeAnimationGroups(e,t=!0,s=!1,n){if(0===e.length)return null;n=n??e[0].weight;let i=Number.MAX_VALUE,r=-Number.MAX_VALUE;if(s)for(const t of e)t.from<i&&(i=t.from),t.to>r&&(r=t.to);const a=new pe(e[0].name+"_merged",e[0]._scene,n);for(const n of e){s&&n.normalize(i,r);for(const e of n.targetedAnimations)a.addTargetedAnimation(e.animation,e.target);t&&n.dispose()}return a}constructor(e,t=null,s=-1,n=0){this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this._weight=-1,this._playOrder=0,this._enableBlending=null,this._blendingSpeed=null,this._numActiveAnimatables=0,this._shouldStart=!0,this._parentContainer=null,this.onAnimationEndObservable=new a,this.onAnimationLoopObservable=new a,this.onAnimationGroupLoopObservable=new a,this.onAnimationGroupEndObservable=new a,this.onAnimationGroupPauseObservable=new a,this.onAnimationGroupPlayObservable=new a,this.metadata=null,this._mask=null,this._animationLoopFlags=[],this._scene=t||g.LastCreatedScene,this._weight=s,this._playOrder=n,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}addTargetedAnimation(e,t){const s=new me;s.animation=e,s.target=t;const n=e.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),null!==this._enableBlending&&(e.enableBlending=this._enableBlending),null!==this._blendingSpeed&&(e.blendingSpeed=this._blendingSpeed),this._targetedAnimations.push(s),this._shouldStart=!0,s}removeTargetedAnimation(e){for(let t=this._targetedAnimations.length-1;t>-1;t--){this._targetedAnimations[t].animation===e&&this._targetedAnimations.splice(t,1)}}normalize(e=null,t=null){null==e&&(e=this._from),null==t&&(t=this._to);for(let s=0;s<this._targetedAnimations.length;s++){const n=this._targetedAnimations[s].animation.getKeys(),i=n[0],r=n[n.length-1];if(i.frame>e){const t={frame:e,value:i.value,inTangent:i.inTangent,outTangent:i.outTangent,interpolation:i.interpolation};n.splice(0,0,t)}if(r.frame<t){const e={frame:t,value:r.value,inTangent:r.inTangent,outTangent:r.outTangent,interpolation:r.interpolation};n.push(e)}}return this._from=e,this._to=t,this}_processLoop(e,t,s){e.onAnimationLoop=()=>{this.onAnimationLoopObservable.notifyObservers(t),this._animationLoopFlags[s]||(this._animationLoopFlags[s]=!0,this._animationLoopCount++,this._animationLoopCount===this._numActiveAnimatables&&(this.onAnimationGroupLoopObservable.notifyObservers(this),this._animationLoopCount=0,this._animationLoopFlags.length=0))}}start(e=!1,t=1,s,n,i){if(this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=e,this._shouldStart=!1,this._animationLoopCount=0,this._animationLoopFlags.length=0;for(let r=0;r<this._targetedAnimations.length;r++){const a=this._targetedAnimations[r],o=this._scene.beginDirectAnimation(a.target,[a.animation],void 0!==s?s:this._from,void 0!==n?n:this._to,e,t,void 0,void 0,void 0!==i?i:this._isAdditive);o.weight=this._weight,o.playOrder=this._playOrder,o.onAnimationEnd=()=>{this.onAnimationEndObservable.notifyObservers(a),this._checkAnimationGroupEnded(o)},this._processLoop(o,a,r),this._animatables.push(o)}return this.syncWithMask(),this._scene.sortActiveAnimatables(),this._speedRatio=t,this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}pause(){if(!this._isStarted)return this;this._isPaused=!0;for(let e=0;e<this._animatables.length;e++){this._animatables[e].pause()}return this.onAnimationGroupPauseObservable.notifyObservers(this),this}play(e){return this.isStarted&&this._animatables.length&&!this._shouldStart?(void 0!==e&&(this.loopAnimation=e),this.restart()):(this.stop(),this.start(e,this._speedRatio)),this}reset(){if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(!0),this;for(let e=0;e<this._animatables.length;e++){this._animatables[e].reset()}return this}restart(){if(!this._isStarted)return this;for(let e=0;e<this._animatables.length;e++){this._animatables[e].restart()}return this.syncWithMask(),this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}stop(e=!1){if(!this._isStarted)return this;const t=this._animatables.slice();for(let s=0;s<t.length;s++)t[s].stop(void 0,void 0,!0,e);let s=0;for(let t=0;t<this._scene._activeAnimatables.length;t++){const n=this._scene._activeAnimatables[t];n._runtimeAnimations.length>0?this._scene._activeAnimatables[s++]=n:e&&this._checkAnimationGroupEnded(n,e)}return this._scene._activeAnimatables.length=s,this._isStarted=!1,this}setWeightForAllAnimatables(e){for(let t=0;t<this._animatables.length;t++){this._animatables[t].weight=e}return this}syncAllAnimationsWith(e){for(let t=0;t<this._animatables.length;t++){this._animatables[t].syncWith(e)}return this}goToFrame(e){if(!this._isStarted)return this;for(let t=0;t<this._animatables.length;t++){this._animatables[t].goToFrame(e)}return this}getCurrentFrame(){return this.animatables[0]?.masterFrame||0}dispose(){this.isStarted&&this.stop(),this._targetedAnimations.length=0,this._animatables.length=0;const e=this._scene.animationGroups.indexOf(this);if(e>-1&&this._scene.animationGroups.splice(e,1),this._parentContainer){const e=this._parentContainer.animationGroups.indexOf(this);e>-1&&this._parentContainer.animationGroups.splice(e,1),this._parentContainer=null}this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()}_checkAnimationGroupEnded(e,t=!1){const s=this._animatables.indexOf(e);s>-1&&this._animatables.splice(s,1),0===this._animatables.length&&(this._isStarted=!1,t||this.onAnimationGroupEndObservable.notifyObservers(this))}clone(e,t,s=!1){const n=new pe(e||this.name,this._scene,this._weight,this._playOrder);n._from=this.from,n._to=this.to,n._speedRatio=this.speedRatio,n._loopAnimation=this.loopAnimation,n._isAdditive=this.isAdditive,n._enableBlending=this.enableBlending,n._blendingSpeed=this.blendingSpeed,n.metadata=this.metadata,n.mask=this.mask;for(const e of this._targetedAnimations)n.addTargetedAnimation(s?e.animation.clone():e.animation,t?t(e.target):e.target);return n}serialize(){const e={};e.name=this.name,e.from=this.from,e.to=this.to,e.speedRatio=this.speedRatio,e.loopAnimation=this.loopAnimation,e.isAdditive=this.isAdditive,e.weight=this.weight,e.playOrder=this.playOrder,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,e.targetedAnimations=[];for(let t=0;t<this.targetedAnimations.length;t++){const s=this.targetedAnimations[t];e.targetedAnimations[t]=s.serialize()}return f&&f.HasTags(this)&&(e.tags=f.GetTags(this)),this.metadata&&(e.metadata=this.metadata),e}static Parse(e,t){const s=new pe(e.name,t,e.weight,e.playOrder);for(let n=0;n<e.targetedAnimations.length;n++){const i=e.targetedAnimations[n],r=b.Parse(i.animation),a=i.targetId;if("influence"===i.animation.property){const e=t.getMorphTargetById(a);e&&s.addTargetedAnimation(r,e)}else{const e=t.getNodeById(a);null!=e&&s.addTargetedAnimation(r,e)}}return f&&f.AddTagsTo(s,e.tags),null!==e.from&&null!==e.to&&s.normalize(e.from,e.to),void 0!==e.speedRatio&&(s._speedRatio=e.speedRatio),void 0!==e.loopAnimation&&(s._loopAnimation=e.loopAnimation),void 0!==e.isAdditive&&(s._isAdditive=e.isAdditive),void 0!==e.weight&&(s._weight=e.weight),void 0!==e.playOrder&&(s._playOrder=e.playOrder),void 0!==e.enableBlending&&(s._enableBlending=e.enableBlending),void 0!==e.blendingSpeed&&(s._blendingSpeed=e.blendingSpeed),void 0!==e.metadata&&(s.metadata=e.metadata),s}static MakeAnimationAdditive(e,t,s,n=!1,i){let r;r="object"==typeof t?t:{referenceFrame:t,range:s,cloneOriginalAnimationGroup:n,clonedAnimationName:i};let a=e;r.cloneOriginalAnimationGroup&&(a=e.clone(r.clonedAnimationGroupName||a.name));const o=a.targetedAnimations;for(let e=0;e<o.length;e++){const t=o[e];t.animation=b.MakeAnimationAdditive(t.animation,r)}if(a.isAdditive=!0,r.clipKeys){let e=Number.MAX_VALUE,t=-Number.MAX_VALUE;const s=a.targetedAnimations;for(let n=0;n<s.length;n++){const i=s[n].animation.getKeys();e>i[0].frame&&(e=i[0].frame),t<i[i.length-1].frame&&(t=i[i.length-1].frame)}a._from=e,a._to=t}return a}static ClipKeys(e,t,s,n,i){const r=e.clone(n||e.name);return pe.ClipKeysInPlace(r,t,s,i)}static ClipKeysInPlace(e,t,s,n){return pe.ClipInPlace(e,t,s,n,!1)}static ClipFrames(e,t,s,n,i){const r=e.clone(n||e.name);return pe.ClipFramesInPlace(r,t,s,i)}static ClipFramesInPlace(e,t,s,n){return pe.ClipInPlace(e,t,s,n,!0)}static ClipInPlace(e,t,s,n,i=!1){let r=Number.MAX_VALUE,a=-Number.MAX_VALUE;const o=e.targetedAnimations;for(let e=0;e<o.length;e++){const l=o[e],h=n?l.animation:l.animation.clone();i&&(h.createKeyForFrame(t),h.createKeyForFrame(s));const d=h.getKeys(),c=[];let u=Number.MAX_VALUE;for(let e=0;e<d.length;e++){const n=d[e];if(!i&&e>=t&&e<=s||i&&n.frame>=t&&n.frame<=s){const e={frame:n.frame,value:n.value.clone?n.value.clone():n.value,inTangent:n.inTangent,outTangent:n.outTangent,interpolation:n.interpolation,lockedTangent:n.lockedTangent};u===Number.MAX_VALUE&&(u=e.frame),e.frame-=u,c.push(e)}}0!==c.length?(r>c[0].frame&&(r=c[0].frame),a<c[c.length-1].frame&&(a=c[c.length-1].frame),h.setKeys(c,!0),l.animation=h):(o.splice(e,1),e--)}return e._from=r,e._to=a,e}getClassName(){return"AnimationGroup"}toString(e){let t="Name: "+this.name;return t+=", type: "+this.getClassName(),e&&(t+=", from: "+this._from,t+=", to: "+this._to,t+=", isStarted: "+this._isStarted,t+=", speedRatio: "+this._speedRatio,t+=", targetedAnimations length: "+this._targetedAnimations.length,t+=", animatables length: "+this._animatables),t}}class ge{get useTextureToStoreBoneMatrices(){return this._useTextureToStoreBoneMatrices}set useTextureToStoreBoneMatrices(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}get isUsingTextureForMatrices(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones}get uniqueId(){return this._uniqueId}constructor(e,t,s){this.name=e,this.id=t,this.bones=[],this.needInitialSkinMatrix=!1,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=h.Identity(),this._currentRenderId=-1,this._ranges={},this._absoluteTransformIsDirty=!0,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._parentContainer=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new a,this.bones=[],this._scene=s||g.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;const n=this._scene.getEngine().getCaps();this._canUseTextureForBones=n.textureFloat&&n.maxVertexTextureImageUnits>0}getClassName(){return"Skeleton"}getChildren(){return this.bones.filter((e=>!e.getParent()))}getTransformMatrices(e){if(this.needInitialSkinMatrix){if(!e)throw new Error("getTransformMatrices: When using the needInitialSkinMatrix flag, a mesh must be provided");return e._bonesTransformMatrices||this.prepare(!0),e._bonesTransformMatrices}return this._transformMatrices&&!this._isDirty||this.prepare(!this._transformMatrices),this._transformMatrices}getTransformMatrixTexture(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture}getScene(){return this._scene}toString(e){let t=`Name: ${this.name}, nBones: ${this.bones.length}`;if(t+=`, nAnimationRanges: ${this._ranges?Object.keys(this._ranges).length:"none"}`,e){t+=", Ranges: {";let e=!0;for(const s in this._ranges)e&&(t+=", ",e=!1),t+=s;t+="}"}return t}getBoneIndexByName(e){for(let t=0,s=this.bones.length;t<s;t++)if(this.bones[t].name===e)return t;return-1}createAnimationRange(e,t,s){if(!this._ranges[e]){this._ranges[e]=new y(e,t,s);for(let n=0,i=this.bones.length;n<i;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].createRange(e,t,s)}}deleteAnimationRange(e,t=!0){for(let s=0,n=this.bones.length;s<n;s++)this.bones[s].animations[0]&&this.bones[s].animations[0].deleteRange(e,t);this._ranges[e]=null}getAnimationRange(e){return this._ranges[e]||null}getAnimationRanges(){const e=[];let t;for(t in this._ranges)e.push(this._ranges[t]);return e}copyAnimationRange(e,t,s=!1){if(this._ranges[t]||!e.getAnimationRange(t))return!1;let n=!0;const i=this._getHighestAnimationFrame()+1,r={},a=e.bones;let o,l;for(l=0,o=a.length;l<o;l++)r[a[l].name]=a[l];this.bones.length!==a.length&&(A.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${a.length}`),n=!1);const h=s&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(l=0,o=this.bones.length;l<o;l++){const e=this.bones[l].name,a=r[e];a?n=n&&this.bones[l].copyAnimationRange(a,t,i,s,h):(A.Warn("copyAnimationRange: not same rig, missing source bone "+e),n=!1)}const d=e.getAnimationRange(t);return d&&(this._ranges[t]=new y(t,d.from+i,d.to+i)),n}returnToRest(){for(const e of this.bones)-1!==e._index&&e.returnToRest()}_getHighestAnimationFrame(){let e=0;for(let t=0,s=this.bones.length;t<s;t++)if(this.bones[t].animations[0]){const s=this.bones[t].animations[0].getHighestFrame();e<s&&(e=s)}return e}beginAnimation(e,t,s,n){const i=this.getAnimationRange(e);return i?this._scene.beginAnimation(this,i.from,i.to,t,s,n):null}static MakeAnimationAdditive(e,t=0,s){const n=e.getAnimationRange(s);if(!n)return null;const i=e._scene.getAllAnimatablesByTarget(e);let r=null;for(let e=0;e<i.length;e++){const t=i[e];if(t.fromFrame===n?.from&&t.toFrame===n?.to){r=t;break}}const a=e.getAnimatables();for(let e=0;e<a.length;e++){const n=a[e].animations;if(n)for(let e=0;e<n.length;e++)b.MakeAnimationAdditive(n[e],t,s)}return r&&(r.isAdditive=!0),e}_markAsDirty(){this._isDirty=!0,this._absoluteTransformIsDirty=!0}_registerMeshWithPoseMatrix(e){this._meshesWithPoseMatrix.push(e)}_unregisterMeshWithPoseMatrix(e){const t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)}_computeTransformMatrices(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(let s=0;s<this.bones.length;s++){const n=this.bones[s];n._childUpdateId++;const i=n.getParent();if(i?n.getLocalMatrix().multiplyToRef(i.getFinalMatrix(),n.getFinalMatrix()):t?n.getLocalMatrix().multiplyToRef(t,n.getFinalMatrix()):n.getFinalMatrix().copyFrom(n.getLocalMatrix()),-1!==n._index){const t=null===n._index?s:n._index;n.getAbsoluteInverseBindMatrix().multiplyToArray(n.getFinalMatrix(),e,16*t)}}this._identity.copyToArray(e,16*this.bones.length)}prepare(e=!1){if(!e){const e=this.getScene().getRenderId();if(this._currentRenderId===e)return;this._currentRenderId=e}if(this._numBonesWithLinkedTransformNode>0)for(const e of this.bones)if(e._linkedTransformNode){const t=e._linkedTransformNode;e.position=t.position,t.rotationQuaternion?e.rotationQuaternion=t.rotationQuaternion:e.rotation=t.rotation,e.scaling=t.scaling}if(this.needInitialSkinMatrix)for(const e of this._meshesWithPoseMatrix){const t=e.getPoseMatrix();let s=this._isDirty;if(e._bonesTransformMatrices&&e._bonesTransformMatrices.length===16*(this.bones.length+1)||(e._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1)),s=!0),s){if(this._synchronizedWithMesh!==e){this._synchronizedWithMesh=e;for(const e of this.bones)if(!e.getParent()){e.getBindMatrix().multiplyToRef(t,v.Matrix[1]),e._updateAbsoluteBindMatrices(v.Matrix[1])}if(this.isUsingTextureForMatrices){const t=4*(this.bones.length+1);e._transformMatrixTexture&&e._transformMatrixTexture.getSize().width===t||(e._transformMatrixTexture&&e._transformMatrixTexture.dispose(),e._transformMatrixTexture=ee.CreateRGBATexture(e._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,x.TEXTURE_NEAREST_SAMPLINGMODE,x.TEXTURETYPE_FLOAT))}}this._computeTransformMatrices(e._bonesTransformMatrices,t),this.isUsingTextureForMatrices&&e._transformMatrixTexture&&e._transformMatrixTexture.update(e._bonesTransformMatrices)}}else{if(!this._isDirty)return;this._transformMatrices&&this._transformMatrices.length===16*(this.bones.length+1)||(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=ee.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,x.TEXTURE_NEAREST_SAMPLINGMODE,x.TEXTURETYPE_FLOAT))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices)}this._isDirty=!1}getAnimatables(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(let e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables}clone(e,t){const s=new ge(e,t||e,this._scene);s.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let e=0;e<this.bones.length;e++){const t=this.bones[e];let n=null;const i=t.getParent();if(i){const e=this.bones.indexOf(i);n=s.bones[e]}const r=new M(t.name,s,n,t.getBindMatrix().clone(),t.getRestMatrix().clone());r._index=t._index,t._linkedTransformNode&&r.linkTransformNode(t._linkedTransformNode),T.DeepCopy(t.animations,r.animations)}if(this._ranges){s._ranges={};for(const e in this._ranges){const t=this._ranges[e];t&&(s._ranges[e]=t.clone())}}return this._isDirty=!0,s.prepare(!0),s}enableBlending(e=.01){this.bones.forEach((t=>{t.animations.forEach((t=>{t.enableBlending=!0,t.blendingSpeed=e}))}))}dispose(){if(this._meshesWithPoseMatrix.length=0,this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._parentContainer){const e=this._parentContainer.skeletons.indexOf(this);e>-1&&this._parentContainer.skeletons.splice(e,1),this._parentContainer=null}this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)}serialize(){const e={};e.name=this.name,e.id=this.id,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let t=0;t<this.bones.length;t++){const s=this.bones[t],n=s.getParent(),i={parentBoneIndex:n?this.bones.indexOf(n):-1,index:s.getIndex(),name:s.name,id:s.id,matrix:s.getBindMatrix().asArray(),rest:s.getRestMatrix().asArray(),linkedTransformNodeId:s.getTransformNode()?.id};e.bones.push(i),s.length&&(i.length=s.length),s.metadata&&(i.metadata=s.metadata),s.animations&&s.animations.length>0&&(i.animation=s.animations[0].serialize()),e.ranges=[];for(const t in this._ranges){const s=this._ranges[t];if(!s)continue;const n={};n.name=t,n.from=s.from,n.to=s.to,e.ranges.push(n)}}return e}static Parse(e,t){const s=new ge(e.name,e.id,t);let n;for(e.dimensionsAtRest&&(s.dimensionsAtRest=r.FromArray(e.dimensionsAtRest)),s.needInitialSkinMatrix=e.needInitialSkinMatrix,n=0;n<e.bones.length;n++){const t=e.bones[n],i=e.bones[n].index;let r=null;t.parentBoneIndex>-1&&(r=s.bones[t.parentBoneIndex]);const a=t.rest?h.FromArray(t.rest):null,o=new M(t.name,s,r,h.FromArray(t.matrix),a,null,i);void 0!==t.id&&null!==t.id&&(o.id=t.id),t.length&&(o.length=t.length),t.metadata&&(o.metadata=t.metadata),t.animation&&o.animations.push(b.Parse(t.animation)),void 0!==t.linkedTransformNodeId&&null!==t.linkedTransformNodeId&&(s._hasWaitingData=!0,o._waitingTransformNodeId=t.linkedTransformNodeId)}if(e.ranges)for(n=0;n<e.ranges.length;n++){const t=e.ranges[n];s.createAnimationRange(t.name,t.from,t.to)}return s}computeAbsoluteMatrices(e=!1){(this._absoluteTransformIsDirty||e)&&(this.bones[0].computeAbsoluteMatrices(),this._absoluteTransformIsDirty=!1)}computeAbsoluteTransforms(e=!1){this.computeAbsoluteMatrices(e)}getPoseMatrix(){let e=null;return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e}sortBones(){const e=[],t=new Array(this.bones.length);for(let s=0;s<this.bones.length;s++)this._sortBones(s,e,t);this.bones=e}_sortBones(e,t,s){if(s[e])return;s[e]=!0;const n=this.bones[e];if(!n)return;void 0===n._index&&(n._index=e);const i=n.getParent();i&&this._sortBones(this.bones.indexOf(i),t,s),t.push(n)}setCurrentPoseAsRest(){this.bones.forEach((e=>{e.setCurrentPoseAsRest()}))}}class fe{get influence(){return this._influence}set influence(e){if(this._influence===e)return;const t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}get animationPropertiesOverride(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}constructor(e,t=0,s=null){this.name=e,this.animations=[],this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uniqueId=0,this.onInfluenceChanged=new a,this._onDataLayoutChanged=new a,this._animationPropertiesOverride=null,this._scene=s||g.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}get uniqueId(){return this._uniqueId}get hasPositions(){return!!this._positions}get hasNormals(){return!!this._normals}get hasTangents(){return!!this._tangents}get hasUVs(){return!!this._uvs}setPositions(e){const t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)}getPositions(){return this._positions}setNormals(e){const t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)}getNormals(){return this._normals}setTangents(e){const t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)}getTangents(){return this._tangents}setUVs(e){const t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)}getUVs(){return this._uvs}clone(){const e=w.Clone((()=>new fe(this.name,this.influence,this._scene)),this);return e._positions=this._positions,e._normals=this._normals,e._tangents=this._tangents,e._uvs=this._uvs,e}serialize(){const e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),w.AppendSerializedAnimations(this,e),e}getClassName(){return"MorphTarget"}static Parse(e,t){const s=new fe(e.name,e.influence);if(s.setPositions(e.positions),null!=e.id&&(s.id=e.id),e.normals&&s.setNormals(e.normals),e.tangents&&s.setTangents(e.tangents),e.uvs&&s.setUVs(e.uvs),e.animations){for(let t=0;t<e.animations.length;t++){const n=e.animations[t],i=C("BABYLON.Animation");i&&s.animations.push(i.Parse(n))}e.autoAnimate&&t&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1)}return s}static FromMesh(e,t,s){t||(t=e.name);const n=new fe(t,s,e.getScene());return n.setPositions(e.getVerticesData(O.PositionKind)),e.isVerticesDataPresent(O.NormalKind)&&n.setNormals(e.getVerticesData(O.NormalKind)),e.isVerticesDataPresent(O.TangentKind)&&n.setTangents(e.getVerticesData(O.TangentKind)),e.isVerticesDataPresent(O.UVKind)&&n.setUVs(e.getVerticesData(O.UVKind)),n}}e([t()],fe.prototype,"id",void 0);class be extends R{get depth(){return this._depth}constructor(e,t,s,n,i,r,a=!0,o=!1,l=R.TRILINEAR_SAMPLINGMODE,h=x.TEXTURETYPE_UNSIGNED_INT,d){super(null,r,!a,o),this.format=i,this._texture=r.getEngine().createRawTexture2DArray(e,t,s,n,i,a,o,l,null,h,d),this._depth=n,this.is2DArray=!0}update(e){this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)}static CreateRGBATexture(e,t,s,n,i,r=!0,a=!1,o=x.TEXTURE_TRILINEAR_SAMPLINGMODE,l=x.TEXTURETYPE_UNSIGNED_INT){return new be(e,t,s,n,x.TEXTUREFORMAT_RGBA,i,r,a,o,l)}}class ye{set areUpdatesFrozen(e){e?this._blockCounter++:(this._blockCounter--,this._blockCounter<=0&&(this._blockCounter=0,this._syncActiveTargets(!0)))}get areUpdatesFrozen(){return this._blockCounter>0}constructor(e=null){if(this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new S(16),this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this._canUseTextureForTargets=!1,this._blockCounter=0,this._textureVertexStride=0,this._textureWidth=0,this._textureHeight=1,this._parentContainer=null,this.optimizeInfluencers=!0,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,this._numMaxInfluencers=0,this._useTextureToStoreTargets=!0,e||(e=g.LastCreatedScene),this._scene=e,this._scene){this._scene.addMorphTargetManager(this),this._uniqueId=this._scene.getUniqueId();const e=this._scene.getEngine().getCaps();this._canUseTextureForTargets=e.canUseGLVertexID&&e.textureFloat&&e.maxVertexTextureImageUnits>0&&e.texture2DArrayMaxLayerCount>1}}get numMaxInfluencers(){return this._numMaxInfluencers}set numMaxInfluencers(e){this._numMaxInfluencers!==e&&(this._numMaxInfluencers=e,this._syncActiveTargets(!0))}get uniqueId(){return this._uniqueId}get vertexCount(){return this._vertexCount}get supportsNormals(){return this._supportsNormals&&this.enableNormalMorphing}get supportsTangents(){return this._supportsTangents&&this.enableTangentMorphing}get supportsUVs(){return this._supportsUVs&&this.enableUVMorphing}get numTargets(){return this._targets.length}get numInfluencers(){return this._activeTargets.length}get influences(){return this._influences}get useTextureToStoreTargets(){return this._useTextureToStoreTargets}set useTextureToStoreTargets(e){this._useTextureToStoreTargets=e}get isUsingTextureForTargets(){return ye.EnableTextureStorage&&this.useTextureToStoreTargets&&this._canUseTextureForTargets&&!this._scene?.getEngine().getCaps().disableMorphTargetTexture}getActiveTarget(e){return this._activeTargets.data[e]}getTarget(e){return this._targets[e]}getTargetByName(e){for(const t of this._targets)if(t.name===e)return t;return null}addTarget(e){this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add((e=>{this._syncActiveTargets(e)}))),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add((()=>{this._syncActiveTargets(!0)}))),this._syncActiveTargets(!0)}removeTarget(e){const t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0)),this._scene&&this._scene.stopAnimation(e)}_bind(e){e.setFloat3("morphTargetTextureInfo",this._textureVertexStride,this._textureWidth,this._textureHeight),e.setFloatArray("morphTargetTextureIndices",this._morphTargetTextureIndices),e.setTexture("morphTargets",this._targetStoreTexture),e.setInt("morphTargetCount",this.numInfluencers)}clone(){const e=new ye(this._scene);for(const t of this._targets)e.addTarget(t.clone());return e.enableNormalMorphing=this.enableNormalMorphing,e.enableTangentMorphing=this.enableTangentMorphing,e.enableUVMorphing=this.enableUVMorphing,e}serialize(){const e={};e.id=this.uniqueId,e.targets=[];for(const t of this._targets)e.targets.push(t.serialize());return e}_syncActiveTargets(e){if(this.areUpdatesFrozen)return;let t=0;this._activeTargets.reset(),this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._vertexCount=0,this._scene&&this._targets.length>this._scene.getEngine().getCaps().texture2DArrayMaxLayerCount&&(this.useTextureToStoreTargets=!1),this._morphTargetTextureIndices&&this._morphTargetTextureIndices.length===this._targets.length||(this._morphTargetTextureIndices=new Float32Array(this._targets.length));let s=-1;for(const e of this._targets){if(s++,0===e.influence&&this.optimizeInfluencers)continue;if(this._activeTargets.length>=ye.MaxActiveMorphTargetsInVertexAttributeMode&&!this.isUsingTextureForTargets)break;this._activeTargets.push(e),this._morphTargetTextureIndices[t]=s,this._tempInfluences[t++]=e.influence,this._supportsNormals=this._supportsNormals&&e.hasNormals,this._supportsTangents=this._supportsTangents&&e.hasTangents,this._supportsUVs=this._supportsUVs&&e.hasUVs;const n=e.getPositions();if(n){const e=n.length/3;if(0===this._vertexCount)this._vertexCount=e;else if(this._vertexCount!==e)return void A.Error("Incompatible target. Targets must all have the same vertices count.")}}this._morphTargetTextureIndices.length!==t&&(this._morphTargetTextureIndices=this._morphTargetTextureIndices.slice(0,t)),this._influences&&this._influences.length===t||(this._influences=new Float32Array(t));for(let e=0;e<t;e++)this._influences[e]=this._tempInfluences[e];e&&this.synchronize()}synchronize(){if(this._scene&&!this.areUpdatesFrozen){if(this.isUsingTextureForTargets&&(this._vertexCount||this.numMaxInfluencers>0)){this._textureVertexStride=1,this._supportsNormals&&this._textureVertexStride++,this._supportsTangents&&this._textureVertexStride++,this._supportsUVs&&this._textureVertexStride++,this._textureWidth=this._vertexCount*this._textureVertexStride||1,this._textureHeight=1;const e=this._scene.getEngine().getCaps().maxTextureSize;this._textureWidth>e&&(this._textureHeight=Math.ceil(this._textureWidth/e),this._textureWidth=e);let t=!0;if(this._targetStoreTexture){const e=this._targetStoreTexture.getSize();e.width===this._textureWidth&&e.height===this._textureHeight&&this._targetStoreTexture.depth===this._targets.length&&(t=!1)}if(t){this._targetStoreTexture&&this._targetStoreTexture.dispose();const e=this._targets.length,t=new Float32Array(e*this._textureWidth*this._textureHeight*4);let s=0;for(let n=0;n<e;n++){const e=this._targets[n],i=e.getPositions(),r=e.getNormals(),a=e.getUVs(),o=e.getTangents();if(!i)return void(0===n&&A.Error("Invalid morph target. Target must have positions."));s=n*this._textureWidth*this._textureHeight*4;for(let e=0;e<this._vertexCount;e++)t[s]=i[3*e],t[s+1]=i[3*e+1],t[s+2]=i[3*e+2],s+=4,this._supportsNormals&&r&&(t[s]=r[3*e],t[s+1]=r[3*e+1],t[s+2]=r[3*e+2],s+=4),this._supportsUVs&&a&&(t[s]=a[2*e],t[s+1]=a[2*e+1],s+=4),this._supportsTangents&&o&&(t[s]=o[3*e],t[s+1]=o[3*e+1],t[s+2]=o[3*e+2],s+=4)}this._targetStoreTexture=be.CreateRGBATexture(t,this._textureWidth,this._textureHeight,e,this._scene,!1,!1,x.TEXTURE_NEAREST_SAMPLINGMODE,x.TEXTURETYPE_FLOAT)}}for(const e of this._scene.meshes)e.morphTargetManager===this&&e._syncGeometryWithMorphTargetManager()}}dispose(){if(this._targetStoreTexture&&this._targetStoreTexture.dispose(),this._targetStoreTexture=null,this._scene){if(this._scene.removeMorphTargetManager(this),this._parentContainer){const e=this._parentContainer.morphTargetManagers.indexOf(this);e>-1&&this._parentContainer.morphTargetManagers.splice(e,1),this._parentContainer=null}for(const e of this._targets)this._scene.stopAnimation(e)}}static Parse(e,t){const s=new ye(t);s._uniqueId=e.id;for(const n of e.targets)s.addTarget(fe.Parse(n,t));return s}}ye.EnableTextureStorage=!0,ye.MaxActiveMorphTargetsInVertexAttributeMode=8;class Ae{constructor(e){this.byteOffset=0,this.buffer=e}loadAsync(e){return this.buffer.readAsync(this.byteOffset,e).then((e=>{this._dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),this._dataByteOffset=0}))}readUint32(){const e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e}readUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t}readString(e){return E(this.readUint8Array(e))}skipBytes(e){this._dataByteOffset+=e,this.byteOffset+=e}}function ve(e,t,s,n){const i={externalResourceFunction:n};return s&&(i.uri="file:"===t?s:t+s),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,i):GLTFValidator.validateString(e,i)}function xe(){const e=[];onmessage=t=>{const s=t.data;switch(s.id){case"init":importScripts(s.url);break;case"validate":ve(s.data,s.rootUrl,s.fileName,(t=>new Promise(((s,n)=>{const i=e.length;e.push({resolve:s,reject:n}),postMessage({id:"getExternalResource",index:i,uri:t})})))).then((e=>{postMessage({id:"validate.resolve",value:e})}),(e=>{postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[s.index].resolve(s.value);break;case"getExternalResource.reject":e[s.index].reject(s.reason)}}}class Me{static ValidateAsync(e,t,s,i){return"function"==typeof Worker?new Promise(((r,a)=>{const o=`${ve}(${xe})()`,l=URL.createObjectURL(new Blob([o],{type:"application/javascript"})),h=new Worker(l),d=e=>{h.removeEventListener("error",d),h.removeEventListener("message",c),a(e)},c=e=>{const t=e.data;switch(t.id){case"getExternalResource":i(t.uri).then((e=>{h.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])}),(e=>{h.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":h.removeEventListener("error",d),h.removeEventListener("message",c),r(t.value),h.terminate();break;case"validate.reject":h.removeEventListener("error",d),h.removeEventListener("message",c),a(t.reason),h.terminate()}};if(h.addEventListener("error",d),h.addEventListener("message",c),h.postMessage({id:"init",url:n.GetBabylonScriptURL(this.Configuration.url)}),ArrayBuffer.isView(e)){const n=e.slice();h.postMessage({id:"validate",data:n,rootUrl:t,fileName:s},[n.buffer])}else h.postMessage({id:"validate",data:e,rootUrl:t,fileName:s})})):(this._LoadScriptPromise||(this._LoadScriptPromise=n.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((()=>ve(e,t,s,i))))}}function Te(e,t,s){try{return Promise.resolve(new Uint8Array(e,t,s))}catch(e){return Promise.reject(e)}}Me.Configuration={url:`${n._DefaultCdnUrl}/gltf_validator.js`},function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(oe||(oe={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(le||(le={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(he||(he={}));class we{constructor(){this.coordinateSystemMode=oe.AUTO,this.animationStartMode=le.FIRST,this.loadNodeAnimations=!0,this.loadSkins=!0,this.loadMorphTargets=!0,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.preprocessUrlAsync=e=>Promise.resolve(e),this.extensionOptions={}}copyFrom(e){e&&(this.onParsed=e.onParsed,this.coordinateSystemMode=e.coordinateSystemMode??this.coordinateSystemMode,this.animationStartMode=e.animationStartMode??this.animationStartMode,this.loadNodeAnimations=e.loadNodeAnimations??this.loadNodeAnimations,this.loadSkins=e.loadSkins??this.loadSkins,this.loadMorphTargets=e.loadMorphTargets??this.loadMorphTargets,this.compileMaterials=e.compileMaterials??this.compileMaterials,this.useClipPlane=e.useClipPlane??this.useClipPlane,this.compileShadowGenerators=e.compileShadowGenerators??this.compileShadowGenerators,this.transparencyAsCoverage=e.transparencyAsCoverage??this.transparencyAsCoverage,this.useRangeRequests=e.useRangeRequests??this.useRangeRequests,this.createInstances=e.createInstances??this.createInstances,this.alwaysComputeBoundingBox=e.alwaysComputeBoundingBox??this.alwaysComputeBoundingBox,this.loadAllMaterials=e.loadAllMaterials??this.loadAllMaterials,this.loadOnlyMaterials=e.loadOnlyMaterials??this.loadOnlyMaterials,this.skipMaterials=e.skipMaterials??this.skipMaterials,this.useSRGBBuffers=e.useSRGBBuffers??this.useSRGBBuffers,this.targetFps=e.targetFps??this.targetFps,this.alwaysComputeSkeletonRootNode=e.alwaysComputeSkeletonRootNode??this.alwaysComputeSkeletonRootNode,this.preprocessUrlAsync=e.preprocessUrlAsync??this.preprocessUrlAsync,this.customRootNode=e.customRootNode,this.onMeshLoaded=e.onMeshLoaded,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onCameraLoaded=e.onCameraLoaded,this.extensionOptions=e.extensionOptions??this.extensionOptions)}}class Ce extends we{constructor(e){super(),this.onParsedObservable=new a,this.onMeshLoadedObservable=new a,this.onSkinLoadedObservable=new a,this.onTextureLoadedObservable=new a,this.onMaterialLoadedObservable=new a,this.onCameraLoadedObservable=new a,this.onCompleteObservable=new a,this.onErrorObservable=new a,this.onDisposeObservable=new a,this.onExtensionLoadedObservable=new a,this.validate=!1,this.onValidatedObservable=new a,this._loader=null,this._state=null,this._requests=new Array,this.name=k.name,this.extensions=k.extensions,this.onLoaderStateChangedObservable=new a,this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled,this.copyFrom(e)}set onParsed(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))}set onMeshLoaded(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))}set onSkinLoaded(e){this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add((t=>e(t.node,t.skinnedNode))))}set onTextureLoaded(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))}set onMaterialLoaded(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))}set onCameraLoaded(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))}set onComplete(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)}set onError(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onExtensionLoaded(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)}get loggingEnabled(){return this._loggingEnabled}set loggingEnabled(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)}get capturePerformanceCounters(){return this._capturePerformanceCounters}set capturePerformanceCounters(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))}set onValidated(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)}dispose(){this._loader&&(this._loader.dispose(),this._loader=null);for(const e of this._requests)e.abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=e=>Promise.resolve(e),this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()}loadFile(e,t,s,i,r,o,l,h){if(ArrayBuffer.isView(t))return this._loadBinary(e,t,s,i,l,h),null;this._progressCallback=r;const d=t.name||n.GetFilename(t);if(o){if(this.useRangeRequests){this.validate&&A.Warn("glTF validation is not supported when range requests are enabled");const s={abort:()=>{},onCompleteObservable:new a},n={readAsync:(s,n)=>new Promise(((i,r)=>{this._loadFile(e,t,(e=>{i(new Uint8Array(e))}),!0,(e=>{r(e)}),(e=>{e.setRequestHeader("Range",`bytes=${s}-${s+n-1}`)}))})),byteLength:0};return this._unpackBinaryAsync(new Ae(n)).then((e=>{s.onCompleteObservable.notifyObservers(s),i(e)}),l?e=>l(void 0,e):void 0),s}return this._loadFile(e,t,(t=>{this._validate(e,new Uint8Array(t,0,t.byteLength),s,d),this._unpackBinaryAsync(new Ae({readAsync:(e,s)=>Te(t,e,s),byteLength:t.byteLength})).then((e=>{i(e)}),l?e=>l(void 0,e):void 0)}),!0,l)}return this._loadFile(e,t,(t=>{try{this._validate(e,t,s,d),i({json:this._parseJson(t)})}catch{l&&l()}}),!1,l)}_loadBinary(e,t,s,n,i,r){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s,r),this._unpackBinaryAsync(new Ae({readAsync:(e,s)=>function(e,t,s){try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+s>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,s))}catch(e){return Promise.reject(e)}}(t,e,s),byteLength:t.byteLength})).then((e=>{n(e)}),i?e=>i(void 0,e):void 0)}importMeshAsync(e,t,s,n,i,r){return Promise.resolve().then((()=>(this.onParsedObservable.notifyObservers(s),this.onParsedObservable.clear(),this._log(`Loading ${r||""}`),this._loader=this._getLoader(s),this._loader.importMeshAsync(e,t,null,s,n,i,r))))}loadAsync(e,t,s,n,i){return Promise.resolve().then((()=>(this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t),this._loader.loadAsync(e,t,s,n,i))))}loadAssetContainerAsync(e,t,s,n,i){return Promise.resolve().then((()=>{this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t);const r=new te(e),a=[];this.onMaterialLoadedObservable.add((e=>{a.push(e)}));const o=[];this.onTextureLoadedObservable.add((e=>{o.push(e)}));const l=[];this.onCameraLoadedObservable.add((e=>{l.push(e)}));const h=[];return this.onMeshLoadedObservable.add((e=>{e.morphTargetManager&&h.push(e.morphTargetManager)})),this._loader.importMeshAsync(null,e,r,t,s,n,i).then((e=>(Array.prototype.push.apply(r.geometries,e.geometries),Array.prototype.push.apply(r.meshes,e.meshes),Array.prototype.push.apply(r.particleSystems,e.particleSystems),Array.prototype.push.apply(r.skeletons,e.skeletons),Array.prototype.push.apply(r.animationGroups,e.animationGroups),Array.prototype.push.apply(r.materials,a),Array.prototype.push.apply(r.textures,o),Array.prototype.push.apply(r.lights,e.lights),Array.prototype.push.apply(r.transformNodes,e.transformNodes),Array.prototype.push.apply(r.cameras,l),Array.prototype.push.apply(r.morphTargetManagers,h),r)))}))}canDirectLoad(e){return k.canDirectLoad(e)}directLoad(e,t){if(t.startsWith("base64,"+P)||t.startsWith(";base64,"+P)||t.startsWith("application/octet-stream;base64,"+P)||t.startsWith("model/gltf-binary;base64,"+P)){const s=L(t);return this._validate(e,new Uint8Array(s,0,s.byteLength)),this._unpackBinaryAsync(new Ae({readAsync:(e,t)=>Te(s,e,t),byteLength:s.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})}createPlugin(e){return new Ce(e[k.name])}get loaderState(){return this._state}whenCompleteAsync(){return new Promise(((e,t)=>{this.onCompleteObservable.addOnce((()=>{e()})),this.onErrorObservable.addOnce((e=>{t(e)}))}))}_setState(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(he[this._state]))}_loadFile(e,t,s,n,i,r){const a=e._loadFile(t,s,(e=>{this._onProgress(e,a)}),!0,n,i,r);return a.onCompleteObservable.add((()=>{a._lengthComputable=!0,a._total=a._loaded})),this._requests.push(a),a}_onProgress(e,t){if(!this._progressCallback)return;t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;let s=!0,n=0,i=0;for(const e of this._requests){if(void 0===e._lengthComputable||void 0===e._loaded||void 0===e._total)return;s=s&&e._lengthComputable,n+=e._loaded,i+=e._total}this._progressCallback({lengthComputable:s,loaded:n,total:s?i:0})}_validate(e,t,s="",i=""){this.validate&&(this._startPerformanceCounter("Validate JSON"),Me.ValidateAsync(t,s,i,(t=>this.preprocessUrlAsync(s+t).then((t=>e._loadFileAsync(t,void 0,!0,!0).then((e=>new Uint8Array(e,0,e.byteLength))))))).then((e=>{this._endPerformanceCounter("Validate JSON"),this.onValidatedObservable.notifyObservers(e),this.onValidatedObservable.clear()}),(e=>{this._endPerformanceCounter("Validate JSON"),n.Warn(`Failed to validate: ${e.message}`),this.onValidatedObservable.clear()})))}_getLoader(e){const t=e.json.asset||{};this._log(`Asset version: ${t.version}`),t.minVersion&&this._log(`Asset minimum version: ${t.minVersion}`),t.generator&&this._log(`Asset generator: ${t.generator}`);const s=Ce._parseVersion(t.version);if(!s)throw new Error("Invalid version: "+t.version);if(void 0!==t.minVersion){const e=Ce._parseVersion(t.minVersion);if(!e)throw new Error("Invalid minimum version: "+t.minVersion);if(Ce._compareVersion(e,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+t.minVersion)}const n={1:Ce._CreateGLTF1Loader,2:Ce._CreateGLTF2Loader}[s.major];if(!n)throw new Error("Unsupported version: "+t.version);return n(this)}_parseJson(e){this._startPerformanceCounter("Parse JSON"),this._log(`JSON length: ${e.length}`);const t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t}_unpackBinaryAsync(e){return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((()=>{const t=e.readUint32();if(1179937895!==t)throw new I("Unexpected magic: "+t,N.GLTFLoaderUnexpectedMagicError);const s=e.readUint32();this.loggingEnabled&&this._log(`Binary version: ${s}`);const n=e.readUint32();let i;switch(this.useRangeRequests||n===e.buffer.byteLength||A.Warn(`Length in header does not match actual data length: ${n} != ${e.buffer.byteLength}`),s){case 1:i=this._unpackBinaryV1Async(e,n);break;case 2:i=this._unpackBinaryV2Async(e,n);break;default:throw new Error("Unsupported version: "+s)}return this._endPerformanceCounter("Unpack Binary"),i}))}_unpackBinaryV1Async(e,t){const s=e.readUint32(),n=e.readUint32();if(0!==n)throw new Error(`Unexpected content format: ${n}`);const i=t-e.byteOffset,r={json:this._parseJson(e.readString(s)),bin:null};if(0!==i){const t=e.byteOffset;r.bin={readAsync:(s,n)=>e.buffer.readAsync(t+s,n),byteLength:i}}return Promise.resolve(r)}_unpackBinaryV2Async(e,t){const s=1313821514,n=5130562,i=e.readUint32();if(e.readUint32()!==s)throw new Error("First chunk format is not JSON");return e.byteOffset+i===t?e.loadAsync(i).then((()=>({json:this._parseJson(e.readString(i)),bin:null}))):e.loadAsync(i+8).then((()=>{const r={json:this._parseJson(e.readString(i)),bin:null},a=()=>{const i=e.readUint32();switch(e.readUint32()){case s:throw new Error("Unexpected JSON chunk");case n:{const t=e.byteOffset;r.bin={readAsync:(s,n)=>e.buffer.readAsync(t+s,n),byteLength:i},e.skipBytes(i);break}default:e.skipBytes(i)}return e.byteOffset!==t?e.loadAsync(8).then(a):Promise.resolve(r)};return a()}))}static _parseVersion(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};const t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null}static _compareVersion(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0}_logOpen(e){this._log(e),this._logIndentLevel++}_logClose(){--this._logIndentLevel}_logEnabled(e){const t=Ce._logSpaces.substring(0,2*this._logIndentLevel);A.Log(`${t}${e}`)}_logDisabled(e){}_startPerformanceCounterEnabled(e){n.StartPerformanceCounter(e)}_startPerformanceCounterDisabled(e){}_endPerformanceCounterEnabled(e){n.EndPerformanceCounter(e)}_endPerformanceCounterDisabled(e){}}function Oe(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,s)=>(Object.keys(s).forEach((n=>{const i=e[n],r=s[n];Array.isArray(i)&&Array.isArray(r)?e[n]=i.concat(...r):t(i)&&t(r)?e[n]=Oe(i,r):e[n]=r})),e)),{})}Ce.IncrementalLoading=!0,Ce.HomogeneousCoordinates=!1,Ce._logSpaces=" ",D(new Ce);class Re{static Get(e,t,s){if(!t||null==s||!t[s])throw new Error(`${e}: Failed to find index (${s})`);return t[s]}static TryGet(e,t){return e&&null!=t&&e[t]?e[t]:null}static Assign(e){if(e)for(let t=0;t<e.length;t++)e[t].index=t}}class Se{static RegisterExtension(e,t){B(e,!1,t)}static UnregisterExtension(e){return $(e)}get gltf(){if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf}get bin(){return this._bin}get parent(){return this._parent}get babylonScene(){if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene}get rootBabylonMesh(){return this._rootBabylonMesh}get rootUrl(){return this._rootUrl}constructor(e){this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._parent=e}dispose(){this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach((e=>e.dispose&&e.dispose())),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())}importMeshAsync(e,t,s,n,i,r,a=""){return Promise.resolve().then((()=>{this._babylonScene=t,this._assetContainer=s,this._loadData(n);let r=null;if(e){const t={};if(this._gltf.nodes)for(const e of this._gltf.nodes)e.name&&(t[e.name]=e.index);r=(e instanceof Array?e:[e]).map((e=>{const s=t[e];if(void 0===s)throw new Error(`Failed to find node '${e}'`);return s}))}return this._loadAsync(i,a,r,(()=>({meshes:this._getMeshes(),particleSystems:[],skeletons:this._getSkeletons(),animationGroups:this._getAnimationGroups(),lights:this._babylonLights,transformNodes:this._getTransformNodes(),geometries:this._getGeometries(),spriteManagers:[]})))}))}loadAsync(e,t,s,n,i=""){return Promise.resolve().then((()=>(this._babylonScene=e,this._loadData(t),this._loadAsync(s,i,null,(()=>{})))))}_loadAsync(e,t,s,i){return Promise.resolve().then((async()=>{this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:`${e}${Date.now()}/`,this._fileName=t,this._allMaterialsDirtyRequired=!1,await this._loadExtensionsAsync();const r=`${he[he.LOADING]} => ${he[he.READY]}`,a=`${he[he.LOADING]} => ${he[he.COMPLETE]}`;this._parent._startPerformanceCounter(r),this._parent._startPerformanceCounter(a),this._parent._setState(he.LOADING),this._extensionsOnLoading();const o=new Array,l=this._babylonScene.blockMaterialDirtyMechanism;if(this._babylonScene.blockMaterialDirtyMechanism=!0,!this.parent.loadOnlyMaterials)if(s)o.push(this.loadSceneAsync("/nodes",{nodes:s,index:-1}));else if(null!=this._gltf.scene||this._gltf.scenes&&this._gltf.scenes[0]){const e=Re.Get("/scene",this._gltf.scenes,this._gltf.scene||0);o.push(this.loadSceneAsync(`/scenes/${e.index}`,e))}if(!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(let e=0;e<this._gltf.materials.length;++e){const t=this._gltf.materials[e],s="/materials/"+e,n=F.TriangleFillMode;o.push(this._loadMaterialAsync(s,t,null,n,(()=>{})))}this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=l:this._babylonScene._forceBlockMaterialDirtyMechanism(l),this._parent.compileMaterials&&o.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&o.push(this._compileShadowGeneratorsAsync());return Promise.all(o).then((()=>(this._rootBabylonMesh&&this._rootBabylonMesh!==this._parent.customRootNode&&this._rootBabylonMesh.setEnabled(!0),this._extensionsOnReady(),this._parent._setState(he.READY),this._startAnimations(),i()))).then((e=>(this._parent._endPerformanceCounter(r),n.SetImmediate((()=>{this._disposed||Promise.all(this._completePromises).then((()=>{this._parent._endPerformanceCounter(a),this._parent._setState(he.COMPLETE),this._parent.onCompleteObservable.notifyObservers(void 0),this._parent.onCompleteObservable.clear(),this.dispose()}),(e=>{this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()}))})),e)))})).catch((e=>{throw this._disposed||(this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()),e}))}_loadData(e){if(this._gltf=e.json,this._setupData(),e.bin){const t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){const s=t[0];(s.byteLength<e.bin.byteLength-3||s.byteLength>e.bin.byteLength)&&A.Warn(`Binary buffer length (${s.byteLength}) from JSON does not match chunk length (${e.bin.byteLength})`),this._bin=e.bin}else A.Warn("Unexpected BIN chunk")}}_setupData(){if(Re.Assign(this._gltf.accessors),Re.Assign(this._gltf.animations),Re.Assign(this._gltf.buffers),Re.Assign(this._gltf.bufferViews),Re.Assign(this._gltf.cameras),Re.Assign(this._gltf.images),Re.Assign(this._gltf.materials),Re.Assign(this._gltf.meshes),Re.Assign(this._gltf.nodes),Re.Assign(this._gltf.samplers),Re.Assign(this._gltf.scenes),Re.Assign(this._gltf.skins),Re.Assign(this._gltf.textures),this._gltf.nodes){const e={};for(const t of this._gltf.nodes)if(t.children)for(const s of t.children)e[s]=t.index;const t=this._createRootNode();for(const s of this._gltf.nodes){const n=e[s.index];s.parent=void 0===n?t:this._gltf.nodes[n]}}}async _loadExtensionsAsync(){const e=[];if(U.forEach(((t,s)=>{!1===this.parent.extensionOptions[s]?.enabled?t.isGLTFExtension&&this.isExtensionUsed(s)&&A.Warn(`Extension ${s} is used but has been explicitly disabled.`):t.isGLTFExtension&&!this.isExtensionUsed(s)||e.push((async()=>{const e=await t.factory(this);return e.name!==s&&A.Warn(`The name of the glTF loader extension instance does not match the registered name: ${e.name} !== ${s}`),this._parent.onExtensionLoadedObservable.notifyObservers(e),e})())})),this._extensions.push(...await Promise.all(e)),this._extensions.sort(((e,t)=>(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE))),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired)for(const e of this._gltf.extensionsRequired){if(!this._extensions.some((t=>t.name===e&&t.enabled))){if(!1===this.parent.extensionOptions[e]?.enabled)throw new Error(`Required extension ${e} is disabled`);throw new Error(`Required extension ${e} is not available`)}}}_createRootNode(){if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;const e=new V("__root__",this._babylonScene);this._rootBabylonMesh=e,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);const t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case oe.AUTO:this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],Se._LoadTransform(t,this._rootBabylonMesh));break;case oe.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`)}return this._parent.onMeshLoadedObservable.notifyObservers(e),t}loadSceneAsync(e,t){const s=this._extensionsLoadSceneAsync(e,t);if(s)return s;const n=new Array;if(this.logOpen(`${e} ${t.name||""}`),t.nodes)for(const s of t.nodes){const t=Re.Get(`${e}/nodes/${s}`,this._gltf.nodes,s);n.push(this.loadNodeAsync(`/nodes/${t.index}`,t,(e=>{e.parent=this._rootBabylonMesh})))}for(const e of this._postSceneLoadActions)e();return n.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(n).then((()=>{}))}_forEachPrimitive(e,t){if(e._primitiveBabylonMeshes)for(const s of e._primitiveBabylonMeshes)t(s)}_getGeometries(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,(t=>{const s=t.geometry;s&&-1===e.indexOf(s)&&e.push(s)}));return e}_getMeshes(){const e=[];this._rootBabylonMesh instanceof G&&e.push(this._rootBabylonMesh);const t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,(t=>{e.push(t)}));return e}_getTransformNodes(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)s._babylonTransformNode&&"TransformNode"===s._babylonTransformNode.getClassName()&&e.push(s._babylonTransformNode),s._babylonTransformNodeForSkin&&e.push(s._babylonTransformNodeForSkin);return e}_getSkeletons(){const e=[],t=this._gltf.skins;if(t)for(const s of t)s._data&&e.push(s._data.babylonSkeleton);return e}_getAnimationGroups(){const e=[],t=this._gltf.animations;if(t)for(const s of t)s._babylonAnimationGroup&&e.push(s._babylonAnimationGroup);return e}_startAnimations(){switch(this._parent.animationStartMode){case le.NONE:break;case le.FIRST:{const e=this._getAnimationGroups();0!==e.length&&e[0].start(!0);break}case le.ALL:{const e=this._getAnimationGroups();for(const t of e)t.start(!0);break}default:return void A.Error(`Invalid animation start mode (${this._parent.animationStartMode})`)}}loadNodeAsync(e,t,s=()=>{}){const n=this._extensionsLoadNodeAsync(e,t,s);if(n)return n;if(t._babylonTransformNode)throw new Error(`${e}: Invalid recursive node hierarchy`);const i=new Array;this.logOpen(`${e} ${t.name||""}`);const r=n=>{if(Se.AddPointerMetadata(n,e),Se._LoadTransform(t,n),null!=t.camera){const s=Re.Get(`${e}/camera`,this._gltf.cameras,t.camera);i.push(this.loadCameraAsync(`/cameras/${s.index}`,s,(e=>{e.parent=n})))}if(t.children)for(const s of t.children){const t=Re.Get(`${e}/children/${s}`,this._gltf.nodes,s);i.push(this.loadNodeAsync(`/nodes/${t.index}`,t,(e=>{e.parent=n})))}s(n)},a=null!=t.mesh,o=this._parent.loadSkins&&null!=t.skin;if(!a||o){const e=t.name||`node${t.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const s=new W(e,this._babylonScene);s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==t.mesh?t._babylonTransformNode=s:t._babylonTransformNodeForSkin=s,r(s)}if(a)if(o){const s=Re.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${s.index}`,t,s,(s=>{const n=t._babylonTransformNodeForSkin;s.metadata=Oe(n.metadata,s.metadata||{});const r=Re.Get(`${e}/skin`,this._gltf.skins,t.skin);i.push(this._loadSkinAsync(`/skins/${r.index}`,t,r,(e=>{this._forEachPrimitive(t,(t=>{t.skeleton=e})),this._postSceneLoadActions.push((()=>{if(null!=r.skeleton){const e=Re.Get(`/skins/${r.index}/skeleton`,this._gltf.nodes,r.skeleton).parent;t.index===e.index?s.parent=n.parent:s.parent=e._babylonTransformNode}else s.parent=this._rootBabylonMesh;this._parent.onSkinLoadedObservable.notifyObservers({node:n,skinnedNode:s})}))})))})))}else{const s=Re.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${s.index}`,t,s,r))}return this.logClose(),Promise.all(i).then((()=>(this._forEachPrimitive(t,(e=>{e.geometry&&e.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)})),t._babylonTransformNode)))}_loadMeshAsync(e,t,s,n){const i=s.primitives;if(!i||!i.length)throw new Error(`${e}: Primitives are missing`);null==i[0].index&&Re.Assign(i);const r=new Array;this.logOpen(`${e} ${s.name||""}`);const a=t.name||`node${t.index}`;if(1===i.length){const n=s.primitives[0];r.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,a,t,s,n,(e=>{t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new W(a,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(const n of i)r.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,`${a}_primitive${n.index}`,t,s,n,(e=>{e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}return n(t._babylonTransformNode),this.logClose(),Promise.all(r).then((()=>t._babylonTransformNode))}_loadMeshPrimitiveAsync(e,t,s,n,i,r){const a=this._extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,r);if(a)return a;this.logOpen(`${e}`);const o=0===this._disableInstancedMesh&&this._parent.createInstances&&null==s.skin&&!n.primitives[0].targets;let l,h;if(o&&i._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,l=i._instanceData.babylonSourceMesh.createInstance(t),l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,h=i._instanceData.promise;else{const r=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;const a=new V(t,this._babylonScene);a._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.sideOrientation=this._babylonScene.useRightHandedSystem?F.CounterClockWiseSideOrientation:F.ClockWiseSideOrientation,this._createMorphTargets(e,s,n,i,a),r.push(this._loadVertexDataAsync(e,i,a).then((t=>this._loadMorphTargetsAsync(e,i,a,t).then((()=>{this._disposed||(this._babylonScene._blockEntityCollection=!!this._assetContainer,t.applyToMesh(a),t._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1)})))));const d=Se._GetDrawMode(e,i.mode);if(null==i.material){let e=this._defaultBabylonMaterialData[d];e||(e=this._createDefaultMaterial("__GLTFLoader._default",d),this._parent.onMaterialLoadedObservable.notifyObservers(e),this._defaultBabylonMaterialData[d]=e),a.material=e}else if(!this.parent.skipMaterials){const t=Re.Get(`${e}/material`,this._gltf.materials,i.material);r.push(this._loadMaterialAsync(`/materials/${t.index}`,t,a,d,(e=>{a.material=e})))}h=Promise.all(r),o&&(i._instanceData={babylonSourceMesh:a,promise:h}),l=a}return Se.AddPointerMetadata(l,e),this._parent.onMeshLoadedObservable.notifyObservers(l),r(l),this.logClose(),h.then((()=>l))}_loadVertexDataAsync(e,t,s){const n=this._extensionsLoadVertexDataAsync(e,t,s);if(n)return n;const i=t.attributes;if(!i)throw new Error(`${e}: Attributes are missing`);const r=new Array,a=new X(s.name,this._babylonScene);if(null==t.indices)s.isUnIndexed=!0;else{const s=Re.Get(`${e}/indices`,this._gltf.accessors,t.indices);r.push(this._loadIndicesAccessorAsync(`/accessors/${s.index}`,s).then((e=>{a.setIndices(e)})))}const o=(t,n,o)=>{if(null==i[t])return;s._delayInfo=s._delayInfo||[],-1===s._delayInfo.indexOf(n)&&s._delayInfo.push(n);const l=Re.Get(`${e}/attributes/${t}`,this._gltf.accessors,i[t]);r.push(this._loadVertexAccessorAsync(`/accessors/${l.index}`,l,n).then((e=>{if(e.getKind()===O.PositionKind&&!this.parent.alwaysComputeBoundingBox&&!s.skeleton&&l.min&&l.max){const e=v.Vector3[0].copyFromFloats(...l.min),t=v.Vector3[1].copyFromFloats(...l.max);if(l.normalized&&5126!==l.componentType){let s=1;switch(l.componentType){case 5120:s=127;break;case 5121:s=255;break;case 5122:s=32767;break;case 5123:s=65535}const n=1/s;e.scaleInPlace(n),t.scaleInPlace(n)}a._boundingInfo=new Q(e,t),a.useBoundingInfoFromGeometry=!0}a.setVerticesBuffer(e,l.count)}))),n==O.MatricesIndicesExtraKind&&(s.numBoneInfluencers=8),o&&o(l)};return o("POSITION",O.PositionKind),o("NORMAL",O.NormalKind),o("TANGENT",O.TangentKind),o("TEXCOORD_0",O.UVKind),o("TEXCOORD_1",O.UV2Kind),o("TEXCOORD_2",O.UV3Kind),o("TEXCOORD_3",O.UV4Kind),o("TEXCOORD_4",O.UV5Kind),o("TEXCOORD_5",O.UV6Kind),o("JOINTS_0",O.MatricesIndicesKind),o("WEIGHTS_0",O.MatricesWeightsKind),o("JOINTS_1",O.MatricesIndicesExtraKind),o("WEIGHTS_1",O.MatricesWeightsExtraKind),o("COLOR_0",O.ColorKind,(e=>{"VEC4"===e.type&&(s.hasVertexAlpha=!0)})),Promise.all(r).then((()=>a))}_createMorphTargets(e,t,s,n,i){if(!n.targets||!this._parent.loadMorphTargets)return;if(null==t._numMorphTargets)t._numMorphTargets=n.targets.length;else if(n.targets.length!==t._numMorphTargets)throw new Error(`${e}: Primitives do not have the same number of targets`);const r=s.extras?s.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,i.morphTargetManager=new ye(this._babylonScene),i.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,i.morphTargetManager.areUpdatesFrozen=!0;for(let e=0;e<n.targets.length;e++){const n=t.weights?t.weights[e]:s.weights?s.weights[e]:0,a=r?r[e]:`morphTarget${e}`;i.morphTargetManager.addTarget(new fe(a,n,i.getScene()))}}_loadMorphTargetsAsync(e,t,s,n){if(!t.targets||!this._parent.loadMorphTargets)return Promise.resolve();const i=new Array,r=s.morphTargetManager;for(let s=0;s<r.numTargets;s++){const a=r.getTarget(s);i.push(this._loadMorphTargetVertexDataAsync(`${e}/targets/${s}`,n,t.targets[s],a))}return Promise.all(i).then((()=>{r.areUpdatesFrozen=!1}))}_loadMorphTargetVertexDataAsync(e,t,s,n){const i=new Array,r=(n,r,a)=>{if(null==s[n])return;const o=t.getVertexBuffer(r);if(!o)return;const l=Re.Get(`${e}/${n}`,this._gltf.accessors,s[n]);i.push(this._loadFloatAccessorAsync(`/accessors/${l.index}`,l).then((e=>{a(o,e)})))};return r("POSITION",O.PositionKind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(t.length,((e,n)=>{s[n]=t[n]+e})),n.setPositions(s)})),r("NORMAL",O.NormalKind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(s.length,((e,n)=>{s[n]=t[n]+e})),n.setNormals(s)})),r("TANGENT",O.TangentKind,((e,t)=>{const s=new Float32Array(t.length/3*4);let i=0;e.forEach(t.length/3*4,((e,n)=>{(n+1)%4!=0&&(s[i]=t[i]+e,i++)})),n.setTangents(s)})),Promise.all(i).then((()=>{}))}static _LoadTransform(e,t){if(null!=e.skin)return;let s=r.Zero(),n=Y.Identity(),i=r.One();if(e.matrix){h.FromArray(e.matrix).decompose(i,n,s)}else e.translation&&(s=r.FromArray(e.translation)),e.rotation&&(n=Y.FromArray(e.rotation)),e.scale&&(i=r.FromArray(e.scale));t.position=s,t.rotationQuaternion=n,t.scaling=i}_loadSkinAsync(e,t,s,n){if(!this._parent.loadSkins)return Promise.resolve();const i=this._extensionsLoadSkinAsync(e,t,s);if(i)return i;if(s._data)return n(s._data.babylonSkeleton),s._data.promise;const r=`skeleton${s.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const a=new ge(s.name||r,r,this._babylonScene);a._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,s,a);const o=this._loadSkinInverseBindMatricesDataAsync(e,s).then((e=>{this._updateBoneMatrices(a,e)}));return s._data={babylonSkeleton:a,promise:o},n(a),o}_loadBones(e,t,s){if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){const s=this._findSkeletonRootNode(`${e}/joints`,t.joints);if(s)if(void 0===t.skeleton)t.skeleton=s.index;else{const n=(e,t)=>{for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1},i=Re.Get(`${e}/skeleton`,this._gltf.nodes,t.skeleton);i===s||n(i,s)||(A.Warn(`${e}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`),t.skeleton=s.index)}else A.Warn(`${e}: Failed to find common root`)}const n={};for(const i of t.joints){const r=Re.Get(`${e}/joints/${i}`,this._gltf.nodes,i);this._loadBone(r,t,s,n)}}_findSkeletonRootNode(e,t){if(0===t.length)return null;const s={};for(const n of t){const t=[];let i=Re.Get(`${e}/${n}`,this._gltf.nodes,n);for(;-1!==i.index;)t.unshift(i),i=i.parent;s[n]=t}let n=null;for(let e=0;;++e){let i=s[t[0]];if(e>=i.length)return n;const r=i[e];for(let a=1;a<t.length;++a)if(i=s[t[a]],e>=i.length||r!==i[e])return n;n=r}}_loadBone(e,t,s,n){e._isJoint=!0;let i=n[e.index];if(i)return i;let r=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?r=this._loadBone(e.parent,t,s,n):void 0!==t.skeleton&&A.Warn(`/skins/${t.index}/skeleton: Skeleton node is not a common root`));const a=t.joints.indexOf(e.index);return i=new M(e.name||`joint${e.index}`,s,r,this._getNodeMatrix(e),null,null,a),n[e.index]=i,this._postSceneLoadActions.push((()=>{i.linkTransformNode(e._babylonTransformNode)})),i}_loadSkinInverseBindMatricesDataAsync(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);const s=Re.Get(`${e}/inverseBindMatrices`,this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync(`/accessors/${s.index}`,s)}_updateBoneMatrices(e,t){for(const s of e.bones){const e=h.Identity(),n=s._index;t&&-1!==n&&(h.FromArrayToRef(t,16*n,e),e.invertToRef(e));const i=s.getParent();i&&e.multiplyToRef(i.getAbsoluteInverseBindMatrix(),e),s.updateMatrix(e,!1,!1),s._updateAbsoluteBindMatrices(void 0,!1)}}_getNodeMatrix(e){return e.matrix?h.FromArray(e.matrix):h.Compose(e.scale?r.FromArray(e.scale):r.One(),e.rotation?Y.FromArray(e.rotation):Y.Identity(),e.translation?r.FromArray(e.translation):r.Zero())}loadCameraAsync(e,t,s=()=>{}){const n=this._extensionsLoadCameraAsync(e,t,s);if(n)return n;const i=new Array;this.logOpen(`${e} ${t.name||""}`),this._babylonScene._blockEntityCollection=!!this._assetContainer;const a=new _e(t.name||`camera${t.index}`,r.Zero(),this._babylonScene,!1);switch(a._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.ignoreParentScaling=!0,t._babylonCamera=a,a.rotation.set(0,Math.PI,0),t.type){case"perspective":{const s=t.perspective;if(!s)throw new Error(`${e}: Camera perspective properties are missing`);a.fov=s.yfov,a.minZ=s.znear,a.maxZ=s.zfar||0;break}case"orthographic":if(!t.orthographic)throw new Error(`${e}: Camera orthographic properties are missing`);a.mode=Z.ORTHOGRAPHIC_CAMERA,a.orthoLeft=-t.orthographic.xmag,a.orthoRight=t.orthographic.xmag,a.orthoBottom=-t.orthographic.ymag,a.orthoTop=t.orthographic.ymag,a.minZ=t.orthographic.znear,a.maxZ=t.orthographic.zfar;break;default:throw new Error(`${e}: Invalid camera type (${t.type})`)}return Se.AddPointerMetadata(a,e),this._parent.onCameraLoadedObservable.notifyObservers(a),s(a),this.logClose(),Promise.all(i).then((()=>a))}_loadAnimationsAsync(){const e=this._gltf.animations;if(!e)return Promise.resolve();const t=new Array;for(let s=0;s<e.length;s++){const n=e[s];t.push(this.loadAnimationAsync(`/animations/${n.index}`,n).then((e=>{0===e.targetedAnimations.length&&e.dispose()})))}return Promise.all(t).then((()=>{}))}loadAnimationAsync(e,t){const s=this._extensionsLoadAnimationAsync(e,t);if(s)return s;this._babylonScene._blockEntityCollection=!!this._assetContainer;const n=new pe(t.name||`animation${t.index}`,this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=n;const i=new Array;Re.Assign(t.channels),Re.Assign(t.samplers);for(const s of t.channels)i.push(this._loadAnimationChannelAsync(`${e}/channels/${s.index}`,e,t,s,((e,t)=>{e.animations=e.animations||[],e.animations.push(t),n.addTargetedAnimation(t,e)})));return Promise.all(i).then((()=>(n.normalize(0),n)))}_loadAnimationChannelAsync(e,t,s,n,i){const r=this._extensionsLoadAnimationChannelAsync(e,t,s,n,i);if(r)return r;if(null==n.target.node)return Promise.resolve();const a=Re.Get(`${e}/target/node`,this._gltf.nodes,n.target.node),o=n.target.path,l="weights"===o;if(l&&!a._numMorphTargets||!l&&!a._babylonTransformNode)return Promise.resolve();if(!this._parent.loadNodeAnimations&&!l&&!a._isJoint)return Promise.resolve();let h;switch(o){case"translation":h=se.translation;break;case"rotation":h=se.rotation;break;case"scale":h=se.scale;break;case"weights":h=se.weights;break;default:throw new Error(`${e}/target/path: Invalid value (${n.target.path})`)}const d={object:a,info:h};return this._loadAnimationChannelFromTargetInfoAsync(e,t,s,n,d,i)}_loadAnimationChannelFromTargetInfoAsync(e,t,s,n,i,r){const a=this.parent.targetFps,o=1/a,l=Re.Get(`${e}/sampler`,s.samplers,n.sampler);return this._loadAnimationSamplerAsync(`${t}/samplers/${n.sampler}`,l).then((e=>{let t=0;const l=i.object,h=i.info;for(const i of h){const h=i.getStride(l),d=e.input,c=e.output,u=new Array(d.length);let _=0;switch(e.interpolation){case"STEP":for(let e=0;e<d.length;e++){const t=i.getValue(l,c,_,1);_+=h,u[e]={frame:d[e]*a,value:t,interpolation:1}}break;case"CUBICSPLINE":for(let e=0;e<d.length;e++){const t=i.getValue(l,c,_,o);_+=h;const s=i.getValue(l,c,_,1);_+=h;const n=i.getValue(l,c,_,o);_+=h,u[e]={frame:d[e]*a,inTangent:t,value:s,outTangent:n}}break;case"LINEAR":for(let e=0;e<d.length;e++){const t=i.getValue(l,c,_,1);_+=h,u[e]={frame:d[e]*a,value:t}}}if(_>0){const e=`${s.name||`animation${s.index}`}_channel${n.index}_${t}`;i.buildAnimations(l,e,a,u,((e,s)=>{++t,r(e,s)}))}}}))}_loadAnimationSamplerAsync(e,t){if(t._data)return t._data;const s=t.interpolation||"LINEAR";switch(s){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(`${e}/interpolation: Invalid value (${t.interpolation})`)}const n=Re.Get(`${e}/input`,this._gltf.accessors,t.input),i=Re.Get(`${e}/output`,this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync(`/accessors/${n.index}`,n),this._loadFloatAccessorAsync(`/accessors/${i.index}`,i)]).then((([e,t])=>({input:e,interpolation:s,output:t}))),t._data}loadBufferAsync(e,t,s,n){const i=this._extensionsLoadBufferAsync(e,t,s,n);if(i)return i;if(!t._data)if(t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{if(!this._bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((t=>{try{return new Uint8Array(t.buffer,t.byteOffset+s,n)}catch(t){throw new Error(`${e}: ${t.message}`)}}))}loadBufferViewAsync(e,t){const s=this._extensionsLoadBufferViewAsync(e,t);if(s)return s;if(t._data)return t._data;const n=Re.Get(`${e}/buffer`,this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync(`/buffers/${n.index}`,n,t.byteOffset||0,t.byteLength),t._data}_loadAccessorAsync(e,t,s){if(t._data)return t._data;const n=Se._GetNumComponents(e,t.type),i=n*O.GetTypeByteLength(t.componentType),r=n*t.count;if(null==t.bufferView)t._data=Promise.resolve(new s(r));else{const a=Re.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${a.index}`,a).then((o=>{if(5126!==t.componentType||t.normalized||a.byteStride&&a.byteStride!==i){const e=new s(r);return O.ForEach(o,t.byteOffset||0,a.byteStride||i,n,t.componentType,e.length,t.normalized||!1,((t,s)=>{e[s]=t})),e}return Se._GetTypedArray(e,t.componentType,o,t.byteOffset,r)}))}if(t.sparse){const r=t.sparse;t._data=t._data.then((a=>{const o=a,l=Re.Get(`${e}/sparse/indices/bufferView`,this._gltf.bufferViews,r.indices.bufferView),h=Re.Get(`${e}/sparse/values/bufferView`,this._gltf.bufferViews,r.values.bufferView);return Promise.all([this.loadBufferViewAsync(`/bufferViews/${l.index}`,l),this.loadBufferViewAsync(`/bufferViews/${h.index}`,h)]).then((([a,l])=>{const h=Se._GetTypedArray(`${e}/sparse/indices`,r.indices.componentType,a,r.indices.byteOffset,r.count),d=n*r.count;let c;if(5126!==t.componentType||t.normalized){const a=Se._GetTypedArray(`${e}/sparse/values`,t.componentType,l,r.values.byteOffset,d);c=new s(d),O.ForEach(a,0,i,n,t.componentType,c.length,t.normalized||!1,((e,t)=>{c[t]=e}))}else c=Se._GetTypedArray(`${e}/sparse/values`,t.componentType,l,r.values.byteOffset,d);let u=0;for(let e=0;e<h.length;e++){let t=h[e]*n;for(let e=0;e<n;e++)o[t++]=c[u++]}return o}))}))}return t._data}_loadFloatAccessorAsync(e,t){return this._loadAccessorAsync(e,t,Float32Array)}_loadIndicesAccessorAsync(e,t){if("SCALAR"!==t.type)throw new Error(`${e}/type: Invalid value ${t.type}`);if(5121!==t.componentType&&5123!==t.componentType&&5125!==t.componentType)throw new Error(`${e}/componentType: Invalid value ${t.componentType}`);if(t._data)return t._data;if(t.sparse){const s=Se._GetTypedArrayConstructor(`${e}/componentType`,t.componentType);t._data=this._loadAccessorAsync(e,t,s)}else{const s=Re.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${s.index}`,s).then((s=>Se._GetTypedArray(e,t.componentType,s,t.byteOffset,t.count)))}return t._data}_loadVertexBufferViewAsync(e){if(e._babylonBuffer)return e._babylonBuffer;const t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync(`/bufferViews/${e.index}`,e).then((e=>new K(t,e,!1))),e._babylonBuffer}_loadVertexAccessorAsync(e,t,s){if(t._babylonVertexBuffer?.[s])return t._babylonVertexBuffer[s];t._babylonVertexBuffer||(t._babylonVertexBuffer={});const n=this._babylonScene.getEngine();if(t.sparse||null==t.bufferView)t._babylonVertexBuffer[s]=this._loadFloatAccessorAsync(e,t).then((e=>new O(n,e,s,!1)));else{const i=Re.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._babylonVertexBuffer[s]=this._loadVertexBufferViewAsync(i).then((r=>{const a=Se._GetNumComponents(e,t.type);return new O(n,r,s,!1,void 0,i.byteStride,void 0,t.byteOffset,a,t.componentType,t.normalized,!0,void 0,!0)}))}return t._babylonVertexBuffer[s]}_loadMaterialMetallicRoughnessPropertiesAsync(e,t,s){if(!(s instanceof z))throw new Error(`${e}: Material type not supported`);const n=new Array;return t&&(t.baseColorFactor?(s.albedoColor=j.FromArray(t.baseColorFactor),s.alpha=t.baseColorFactor[3]):s.albedoColor=j.White(),s.metallic=null==t.metallicFactor?1:t.metallicFactor,s.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&n.push(this.loadTextureInfoAsync(`${e}/baseColorTexture`,t.baseColorTexture,(e=>{e.name=`${s.name} (Base Color)`,s.albedoTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/metallicRoughnessTexture`,t.metallicRoughnessTexture,(e=>{e.name=`${s.name} (Metallic Roughness)`,s.metallicTexture=e}))),s.useMetallnessFromMetallicTextureBlue=!0,s.useRoughnessFromMetallicTextureGreen=!0,s.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(n).then((()=>{}))}_loadMaterialAsync(e,t,s,n,i=()=>{}){const r=this._extensionsLoadMaterialAsync(e,t,s,n,i);if(r)return r;t._data=t._data||{};let a=t._data[n];if(!a){this.logOpen(`${e} ${t.name||""}`);const s=this.createMaterial(e,t,n);a={babylonMaterial:s,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(e,t,s)},t._data[n]=a,Se.AddPointerMetadata(s,e),this._parent.onMaterialLoadedObservable.notifyObservers(s),this.logClose()}return s&&(a.babylonMeshes.push(s),s.onDisposeObservable.addOnce((()=>{const e=a.babylonMeshes.indexOf(s);-1!==e&&a.babylonMeshes.splice(e,1)}))),i(a.babylonMaterial),a.promise.then((()=>a.babylonMaterial))}_createDefaultMaterial(e,t){this._babylonScene._blockEntityCollection=!!this._assetContainer;const s=new z(e,this._babylonScene);return s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,s.fillMode=t,s.enableSpecularAntiAliasing=!0,s.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,s.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,s.transparencyMode=z.PBRMATERIAL_OPAQUE,s.metallic=1,s.roughness=1,s}createMaterial(e,t,s){const n=this._extensionsCreateMaterial(e,t,s);if(n)return n;const i=t.name||`material${t.index}`;return this._createDefaultMaterial(i,s)}loadMaterialPropertiesAsync(e,t,s){const n=this._extensionsLoadMaterialPropertiesAsync(e,t,s);if(n)return n;const i=new Array;return i.push(this.loadMaterialBasePropertiesAsync(e,t,s)),t.pbrMetallicRoughness&&i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${e}/pbrMetallicRoughness`,t.pbrMetallicRoughness,s)),this.loadMaterialAlphaProperties(e,t,s),Promise.all(i).then((()=>{}))}loadMaterialBasePropertiesAsync(e,t,s){if(!(s instanceof z))throw new Error(`${e}: Material type not supported`);const n=new Array;return s.emissiveColor=t.emissiveFactor?j.FromArray(t.emissiveFactor):new j(0,0,0),t.doubleSided&&(s.backFaceCulling=!1,s.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/normalTexture`,t.normalTexture,(e=>{e.name=`${s.name} (Normal)`,s.bumpTexture=e}))),s.invertNormalMapX=!this._babylonScene.useRightHandedSystem,s.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&s.bumpTexture&&(s.bumpTexture.level=t.normalTexture.scale),s.forceIrradianceInFragment=!0),t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/occlusionTexture`,t.occlusionTexture,(e=>{e.name=`${s.name} (Occlusion)`,s.ambientTexture=e}))),s.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(s.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&n.push(this.loadTextureInfoAsync(`${e}/emissiveTexture`,t.emissiveTexture,(e=>{e.name=`${s.name} (Emissive)`,s.emissiveTexture=e}))),Promise.all(n).then((()=>{}))}loadMaterialAlphaProperties(e,t,s){if(!(s instanceof z))throw new Error(`${e}: Material type not supported`);switch(t.alphaMode||"OPAQUE"){case"OPAQUE":s.transparencyMode=z.PBRMATERIAL_OPAQUE,s.alpha=1;break;case"MASK":s.transparencyMode=z.PBRMATERIAL_ALPHATEST,s.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,s.albedoTexture&&(s.albedoTexture.hasAlpha=!0);break;case"BLEND":s.transparencyMode=z.PBRMATERIAL_ALPHABLEND,s.albedoTexture&&(s.albedoTexture.hasAlpha=!0,s.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(`${e}/alphaMode: Invalid value (${t.alphaMode})`)}}loadTextureInfoAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureInfoAsync(e,t,s);if(n)return n;if(this.logOpen(`${e}`),t.texCoord>=6)throw new Error(`${e}/texCoord: Invalid value (${t.texCoord})`);const i=Re.Get(`${e}/index`,this._gltf.textures,t.index);i._textureInfo=t;const r=this._loadTextureAsync(`/textures/${t.index}`,i,(n=>{n.coordinatesIndex=t.texCoord||0,Se.AddPointerMetadata(n,e),this._parent.onTextureLoadedObservable.notifyObservers(n),s(n)}));return this.logClose(),r}_loadTextureAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureAsync(e,t,s);if(n)return n;this.logOpen(`${e} ${t.name||""}`);const i=null==t.sampler?Se.DefaultSampler:Re.Get(`${e}/sampler`,this._gltf.samplers,t.sampler),r=Re.Get(`${e}/source`,this._gltf.images,t.source),a=this._createTextureAsync(e,i,r,s,void 0,!t._textureInfo.nonColorData);return this.logClose(),a}_createTextureAsync(e,t,s,n=()=>{},i,r){const a=this._loadSampler(`/samplers/${t.index}`,t),o=new Array,l=new q;this._babylonScene._blockEntityCollection=!!this._assetContainer;const h={noMipmap:a.noMipMaps,invertY:!1,samplingMode:a.samplingMode,onLoad:()=>{this._disposed||l.resolve()},onError:(t,s)=>{this._disposed||l.reject(new Error(`${e}: ${s&&s.message?s.message:t||"Failed to load texture"}`))},mimeType:s.mimeType,loaderOptions:i,useSRGBBuffer:!!r&&this._parent.useSRGBBuffers},d=new R(null,this._babylonScene,h);return d._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,o.push(l.promise),o.push(this.loadImageAsync(`/images/${s.index}`,s).then((e=>{const t=s.uri||`${this._fileName}#image${s.index}`,n=`data:${this._uniqueRootUrl}${t}`;d.updateURL(n,e)}))),d.wrapU=a.wrapU,d.wrapV=a.wrapV,n(d),Promise.all(o).then((()=>d))}_loadSampler(e,t){return t._data||(t._data={noMipMaps:9728===t.minFilter||9729===t.minFilter,samplingMode:Se._GetTextureSamplingMode(e,t),wrapU:Se._GetTextureWrapMode(`${e}/wrapS`,t.wrapS),wrapV:Se._GetTextureWrapMode(`${e}/wrapT`,t.wrapT)}),t._data}loadImageAsync(e,t){if(!t._data){if(this.logOpen(`${e} ${t.name||""}`),t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{const s=Re.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}this.logClose()}return t._data}loadUriAsync(e,t,s){const n=this._extensionsLoadUriAsync(e,t,s);if(n)return n;if(!Se._ValidateUri(s))throw new Error(`${e}: '${s}' is invalid`);if(H(s)){const t=new Uint8Array(L(s));return this.log(`${e}: Decoded ${s.substring(0,64)}... (${t.length} bytes)`),Promise.resolve(t)}return this.log(`${e}: Loading ${s}`),this._parent.preprocessUrlAsync(this._rootUrl+s).then((t=>new Promise(((n,i)=>{this._parent._loadFile(this._babylonScene,t,(t=>{this._disposed||(this.log(`${e}: Loaded ${s} (${t.byteLength} bytes)`),n(new Uint8Array(t)))}),!0,(t=>{i(new J(`${e}: Failed to load '${s}'${t?": "+t.status+" "+t.statusText:""}`,t))}))}))))}static AddPointerMetadata(e,t){e.metadata=e.metadata||{};const s=e._internalMetadata=e._internalMetadata||{},n=s.gltf=s.gltf||{};(n.pointers=n.pointers||[]).push(t)}static _GetTextureWrapMode(e,t){switch(t=null==t?10497:t){case 33071:return R.CLAMP_ADDRESSMODE;case 33648:return R.MIRROR_ADDRESSMODE;case 10497:return R.WRAP_ADDRESSMODE;default:return A.Warn(`${e}: Invalid value (${t})`),R.WRAP_ADDRESSMODE}}static _GetTextureSamplingMode(e,t){const s=null==t.magFilter?9729:t.magFilter,n=null==t.minFilter?9987:t.minFilter;if(9729===s)switch(n){case 9728:return R.LINEAR_NEAREST;case 9729:return R.LINEAR_LINEAR;case 9984:return R.LINEAR_NEAREST_MIPNEAREST;case 9985:return R.LINEAR_LINEAR_MIPNEAREST;case 9986:return R.LINEAR_NEAREST_MIPLINEAR;case 9987:return R.LINEAR_LINEAR_MIPLINEAR;default:return A.Warn(`${e}/minFilter: Invalid value (${n})`),R.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==s&&A.Warn(`${e}/magFilter: Invalid value (${s})`),n){case 9728:return R.NEAREST_NEAREST;case 9729:return R.NEAREST_LINEAR;case 9984:return R.NEAREST_NEAREST_MIPNEAREST;case 9985:return R.NEAREST_LINEAR_MIPNEAREST;case 9986:return R.NEAREST_NEAREST_MIPLINEAR;case 9987:return R.NEAREST_LINEAR_MIPLINEAR;default:return A.Warn(`${e}/minFilter: Invalid value (${n})`),R.NEAREST_NEAREST_MIPNEAREST}}static _GetTypedArrayConstructor(e,t){switch(t){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`${e}: Invalid component type ${t}`)}}static _GetTypedArray(e,t,s,n,i){const r=s.buffer;n=s.byteOffset+(n||0);const a=Se._GetTypedArrayConstructor(`${e}/componentType`,t),o=O.GetTypeByteLength(t);return n%o!=0?(A.Warn(`${e}: Copying buffer as byte offset (${n}) is not a multiple of component type byte length (${o})`),new a(r.slice(n,n+i*o),0)):new a(r,n,i)}static _GetNumComponents(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error(`${e}: Invalid type (${t})`)}static _ValidateUri(e){return n.IsBase64(e)||-1===e.indexOf("..")}static _GetDrawMode(e,t){switch(null==t&&(t=4),t){case 0:return F.PointListDrawMode;case 1:return F.LineListDrawMode;case 2:return F.LineLoopDrawMode;case 3:return F.LineStripDrawMode;case 4:return F.TriangleFillMode;case 5:return F.TriangleStripDrawMode;case 6:return F.TriangleFanDrawMode}throw new Error(`${e}: Invalid mesh primitive mode (${t})`)}_compileMaterialsAsync(){this._parent._startPerformanceCounter("Compile materials");const e=new Array;if(this._gltf.materials)for(const t of this._gltf.materials)if(t._data)for(const s in t._data){const n=t._data[s];for(const t of n.babylonMeshes){t.computeWorldMatrix(!0);const s=n.babylonMaterial;e.push(s.forceCompilationAsync(t)),e.push(s.forceCompilationAsync(t,{useInstances:!0})),this._parent.useClipPlane&&(e.push(s.forceCompilationAsync(t,{clipPlane:!0})),e.push(s.forceCompilationAsync(t,{clipPlane:!0,useInstances:!0})))}}return Promise.all(e).then((()=>{this._parent._endPerformanceCounter("Compile materials")}))}_compileShadowGeneratorsAsync(){this._parent._startPerformanceCounter("Compile shadow generators");const e=new Array,t=this._babylonScene.lights;for(const s of t){const t=s.getShadowGenerator();t&&e.push(t.forceCompilationAsync())}return Promise.all(e).then((()=>{this._parent._endPerformanceCounter("Compile shadow generators")}))}_forEachExtensions(e){for(const t of this._extensions)t.enabled&&e(t)}_applyExtensions(e,t,s){for(const n of this._extensions)if(n.enabled){const i=`${n.name}.${t}`,r=e;r._activeLoaderExtensionFunctions=r._activeLoaderExtensionFunctions||{};const a=r._activeLoaderExtensionFunctions;if(!a[i]){a[i]=!0;try{const e=s(n);if(e)return e}finally{delete a[i]}}}return null}_extensionsOnLoading(){this._forEachExtensions((e=>e.onLoading&&e.onLoading()))}_extensionsOnReady(){this._forEachExtensions((e=>e.onReady&&e.onReady()))}_extensionsLoadSceneAsync(e,t){return this._applyExtensions(t,"loadScene",(s=>s.loadSceneAsync&&s.loadSceneAsync(e,t)))}_extensionsLoadNodeAsync(e,t,s){return this._applyExtensions(t,"loadNode",(n=>n.loadNodeAsync&&n.loadNodeAsync(e,t,s)))}_extensionsLoadCameraAsync(e,t,s){return this._applyExtensions(t,"loadCamera",(n=>n.loadCameraAsync&&n.loadCameraAsync(e,t,s)))}_extensionsLoadVertexDataAsync(e,t,s){return this._applyExtensions(t,"loadVertexData",(n=>n._loadVertexDataAsync&&n._loadVertexDataAsync(e,t,s)))}_extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,r){return this._applyExtensions(i,"loadMeshPrimitive",(a=>a._loadMeshPrimitiveAsync&&a._loadMeshPrimitiveAsync(e,t,s,n,i,r)))}_extensionsLoadMaterialAsync(e,t,s,n,i){return this._applyExtensions(t,"loadMaterial",(r=>r._loadMaterialAsync&&r._loadMaterialAsync(e,t,s,n,i)))}_extensionsCreateMaterial(e,t,s){return this._applyExtensions(t,"createMaterial",(n=>n.createMaterial&&n.createMaterial(e,t,s)))}_extensionsLoadMaterialPropertiesAsync(e,t,s){return this._applyExtensions(t,"loadMaterialProperties",(n=>n.loadMaterialPropertiesAsync&&n.loadMaterialPropertiesAsync(e,t,s)))}_extensionsLoadTextureInfoAsync(e,t,s){return this._applyExtensions(t,"loadTextureInfo",(n=>n.loadTextureInfoAsync&&n.loadTextureInfoAsync(e,t,s)))}_extensionsLoadTextureAsync(e,t,s){return this._applyExtensions(t,"loadTexture",(n=>n._loadTextureAsync&&n._loadTextureAsync(e,t,s)))}_extensionsLoadAnimationAsync(e,t){return this._applyExtensions(t,"loadAnimation",(s=>s.loadAnimationAsync&&s.loadAnimationAsync(e,t)))}_extensionsLoadAnimationChannelAsync(e,t,s,n,i){return this._applyExtensions(s,"loadAnimationChannel",(r=>r._loadAnimationChannelAsync&&r._loadAnimationChannelAsync(e,t,s,n,i)))}_extensionsLoadSkinAsync(e,t,s){return this._applyExtensions(s,"loadSkin",(n=>n._loadSkinAsync&&n._loadSkinAsync(e,t,s)))}_extensionsLoadUriAsync(e,t,s){return this._applyExtensions(t,"loadUri",(n=>n._loadUriAsync&&n._loadUriAsync(e,t,s)))}_extensionsLoadBufferViewAsync(e,t){return this._applyExtensions(t,"loadBufferView",(s=>s.loadBufferViewAsync&&s.loadBufferViewAsync(e,t)))}_extensionsLoadBufferAsync(e,t,s,n){return this._applyExtensions(t,"loadBuffer",(i=>i.loadBufferAsync&&i.loadBufferAsync(e,t,s,n)))}static LoadExtensionAsync(e,t,s,n){if(!t.extensions)return null;const i=t.extensions[s];return i?n(`${e}/extensions/${s}`,i):null}static LoadExtraAsync(e,t,s,n){if(!t.extras)return null;const i=t.extras[s];return i?n(`${e}/extras/${s}`,i):null}isExtensionUsed(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)}logOpen(e){this._parent._logOpen(e)}logClose(){this._parent._logClose()}log(e){this._parent._log(e)}startPerformanceCounter(e){this._parent._startPerformanceCounter(e)}endPerformanceCounter(e){this._parent._endPerformanceCounter(e)}}Se.DefaultSampler={index:-1},Ce._CreateGLTF2Loader=e=>new Se(e);export{Re as ArrayItem,Ce as GLTFFileLoader,Se as GLTFLoader};
2
- //# sourceMappingURL=glTFLoader-Cdf6EEh4.esm.min.js.map