@babylonjs/viewer 7.40.1-alpha → 7.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) 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 +193 -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 +351 -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 +202 -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 +28 -19
  158. package/readme.md +28 -28
  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 +22 -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 +41 -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 +672 -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/assets/photoStudio.env +0 -0
  193. package/dist/babylon-viewer.esm.js +0 -2
  194. package/dist/babylon-viewer.esm.js.map +0 -1
  195. package/dist/babylon-viewer.esm.min.js +0 -2
  196. package/dist/babylon-viewer.esm.min.js.map +0 -1
  197. package/dist/chunks/EXT_lights_ies-gxFyrTPG.esm.min.js +0 -2
  198. package/dist/chunks/EXT_lights_ies-gxFyrTPG.esm.min.js.map +0 -1
  199. package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js +0 -84
  200. package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js.map +0 -1
  201. package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js +0 -2
  202. package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js.map +0 -1
  203. package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js +0 -171
  204. package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js.map +0 -1
  205. package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js +0 -2
  206. package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js.map +0 -1
  207. package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js +0 -86
  208. package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js.map +0 -1
  209. package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js +0 -2
  210. package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js.map +0 -1
  211. package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js +0 -134
  212. package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js.map +0 -1
  213. package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js +0 -44
  214. package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js.map +0 -1
  215. package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js +0 -2
  216. package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js.map +0 -1
  217. package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js +0 -2
  218. package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js.map +0 -1
  219. package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js +0 -43
  220. package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js.map +0 -1
  221. package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js +0 -64
  222. package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js.map +0 -1
  223. package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js +0 -2
  224. package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js.map +0 -1
  225. package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js +0 -352
  226. package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js.map +0 -1
  227. package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js +0 -2
  228. package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js.map +0 -1
  229. package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js +0 -617
  230. package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js.map +0 -1
  231. package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js +0 -2
  232. package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js.map +0 -1
  233. package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js +0 -2
  234. package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js.map +0 -1
  235. package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js +0 -4033
  236. package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js.map +0 -1
  237. package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js +0 -581
  238. package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js.map +0 -1
  239. package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js +0 -2
  240. package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js.map +0 -1
  241. package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js +0 -2
  242. package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js.map +0 -1
  243. package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js +0 -65
  244. package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js.map +0 -1
  245. package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js +0 -2
  246. package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js.map +0 -1
  247. package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js +0 -96
  248. package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js.map +0 -1
  249. package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js +0 -2
  250. package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js.map +0 -1
  251. package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js +0 -97
  252. package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js.map +0 -1
  253. package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js +0 -62
  256. package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js +0 -55
  258. package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js +0 -64
  262. package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js.map +0 -1
  263. package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js +0 -2
  264. package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js.map +0 -1
  265. package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js +0 -2
  266. package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js.map +0 -1
  267. package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js +0 -72
  268. package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js.map +0 -1
  269. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js +0 -81
  272. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js +0 -85
  274. package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js.map +0 -1
  275. package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js +0 -2
  276. package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js.map +0 -1
  277. package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js +0 -75
  280. package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js +0 -307
  282. package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js +0 -74
  286. package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js +0 -2
  290. package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js.map +0 -1
  291. package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js +0 -262
  292. package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js.map +0 -1
  293. package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js +0 -87
  294. package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js.map +0 -1
  295. package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js +0 -2
  296. package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js.map +0 -1
  297. package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js +0 -2
  298. package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js.map +0 -1
  299. package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js +0 -26
  300. package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js.map +0 -1
  301. package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js +0 -2
  302. package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js +0 -39
  304. package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js.map +0 -1
  305. package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js +0 -2
  306. package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js.map +0 -1
  307. package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js +0 -46
  308. package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js.map +0 -1
  309. package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js +0 -2
  310. package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js.map +0 -1
  311. package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js +0 -43
  312. package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js.map +0 -1
  313. package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js +0 -63
  314. package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js.map +0 -1
  315. package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js +0 -2
  316. package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js.map +0 -1
  317. package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js +0 -2
  318. package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js.map +0 -1
  319. package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js +0 -51
  320. package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js.map +0 -1
  321. package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js +0 -2207
  322. package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js.map +0 -1
  323. package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js +0 -2
  324. package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js.map +0 -1
  325. package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js +0 -337
  326. package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js.map +0 -1
  327. package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js +0 -2
  328. package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js.map +0 -1
  329. package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js +0 -2
  330. package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js.map +0 -1
  331. package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js +0 -46
  332. package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js.map +0 -1
  333. package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js +0 -47
  334. package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js.map +0 -1
  335. package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js +0 -2
  336. package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js.map +0 -1
  337. package/dist/chunks/animationGroup-BR3zskS8.esm.js +0 -2482
  338. package/dist/chunks/animationGroup-BR3zskS8.esm.js.map +0 -1
  339. package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js +0 -2
  340. package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js.map +0 -1
  341. package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js +0 -2
  342. package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js.map +0 -1
  343. package/dist/chunks/assetContainer-cm8rvay3.esm.js +0 -1720
  344. package/dist/chunks/assetContainer-cm8rvay3.esm.js.map +0 -1
  345. package/dist/chunks/audioEngine-Cx5dB73O.esm.js +0 -305
  346. package/dist/chunks/audioEngine-Cx5dB73O.esm.js.map +0 -1
  347. package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js +0 -2
  348. package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js.map +0 -1
  349. package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js +0 -2
  350. package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js.map +0 -1
  351. package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js +0 -114
  352. package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js.map +0 -1
  353. package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js +0 -2
  354. package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js.map +0 -1
  355. package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js +0 -600
  356. package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js.map +0 -1
  357. package/dist/chunks/dds-BDOPTCsA.esm.min.js +0 -2
  358. package/dist/chunks/dds-BDOPTCsA.esm.min.js.map +0 -1
  359. package/dist/chunks/dds-BYrGO6eI.esm.js +0 -540
  360. package/dist/chunks/dds-BYrGO6eI.esm.js.map +0 -1
  361. package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js +0 -2
  362. package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js.map +0 -1
  363. package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js +0 -88
  364. package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js.map +0 -1
  365. package/dist/chunks/decalFragment-07cq9QvS.esm.min.js +0 -2
  366. package/dist/chunks/decalFragment-07cq9QvS.esm.min.js.map +0 -1
  367. package/dist/chunks/decalFragment-B16Nfnl3.esm.js +0 -18
  368. package/dist/chunks/decalFragment-B16Nfnl3.esm.js.map +0 -1
  369. package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js +0 -2
  370. package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js.map +0 -1
  371. package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js +0 -2
  372. package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js.map +0 -1
  373. package/dist/chunks/default.fragment-C3Pectqi.esm.js +0 -515
  374. package/dist/chunks/default.fragment-C3Pectqi.esm.js.map +0 -1
  375. package/dist/chunks/default.fragment-D3LhG5le.esm.js +0 -446
  376. package/dist/chunks/default.fragment-D3LhG5le.esm.js.map +0 -1
  377. package/dist/chunks/default.vertex-CPx_2Z0S.esm.js +0 -181
  378. package/dist/chunks/default.vertex-CPx_2Z0S.esm.js.map +0 -1
  379. package/dist/chunks/default.vertex-CVMUuXku.esm.js +0 -202
  380. package/dist/chunks/default.vertex-CVMUuXku.esm.js.map +0 -1
  381. package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js +0 -2
  382. package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js.map +0 -1
  383. package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js +0 -2
  384. package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js.map +0 -1
  385. package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js +0 -2
  386. package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js.map +0 -1
  387. package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js +0 -2
  388. package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js.map +0 -1
  389. package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js +0 -15
  390. package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js.map +0 -1
  391. package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.js +0 -13
  392. package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.js.map +0 -1
  393. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  394. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  395. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  396. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  397. package/dist/chunks/dumpTools-CPmY0U7D.esm.js +0 -200
  398. package/dist/chunks/dumpTools-CPmY0U7D.esm.js.map +0 -1
  399. package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js +0 -2
  400. package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js.map +0 -1
  401. package/dist/chunks/engine-BqSrdURz.esm.min.js +0 -2
  402. package/dist/chunks/engine-BqSrdURz.esm.min.js.map +0 -1
  403. package/dist/chunks/engine-D_GgT2Nf.esm.js +0 -2216
  404. package/dist/chunks/engine-D_GgT2Nf.esm.js.map +0 -1
  405. package/dist/chunks/engine.common-CN1Lug5p.esm.js +0 -1162
  406. package/dist/chunks/engine.common-CN1Lug5p.esm.js.map +0 -1
  407. package/dist/chunks/engine.common-DgiXKhLy.esm.min.js +0 -2
  408. package/dist/chunks/engine.common-DgiXKhLy.esm.min.js.map +0 -1
  409. package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js +0 -2
  410. package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js.map +0 -1
  411. package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js +0 -64
  412. package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js.map +0 -1
  413. package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js +0 -382
  414. package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js.map +0 -1
  415. package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js +0 -2
  416. package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js.map +0 -1
  417. package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js +0 -1683
  418. package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js.map +0 -1
  419. package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js +0 -2
  420. package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js.map +0 -1
  421. package/dist/chunks/fogFragment-5YT33bDn.esm.js +0 -102
  422. package/dist/chunks/fogFragment-5YT33bDn.esm.js.map +0 -1
  423. package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js +0 -2
  424. package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js.map +0 -1
  425. package/dist/chunks/fogFragment-CLENZGuB.esm.js +0 -101
  426. package/dist/chunks/fogFragment-CLENZGuB.esm.js.map +0 -1
  427. package/dist/chunks/fogFragment-D9dudohA.esm.min.js +0 -2
  428. package/dist/chunks/fogFragment-D9dudohA.esm.min.js.map +0 -1
  429. package/dist/chunks/fresnelFunction-BkO99b6C.esm.js +0 -12
  430. package/dist/chunks/fresnelFunction-BkO99b6C.esm.js.map +0 -1
  431. package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js +0 -2
  432. package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js.map +0 -1
  433. package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js +0 -2
  434. package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js.map +0 -1
  435. package/dist/chunks/glTFLoader-IEHRfiUn.esm.js +0 -7586
  436. package/dist/chunks/glTFLoader-IEHRfiUn.esm.js.map +0 -1
  437. package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js +0 -77
  438. package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js.map +0 -1
  439. package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.js +0 -2
  440. package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.js.map +0 -1
  441. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  442. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  443. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  444. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  445. package/dist/chunks/harmonicsFunctions-B5QCEZvF.esm.js +0 -34
  446. package/dist/chunks/harmonicsFunctions-B5QCEZvF.esm.js.map +0 -1
  447. package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js +0 -2
  448. package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js.map +0 -1
  449. package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js +0 -2
  450. package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js.map +0 -1
  451. package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js +0 -35
  452. package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js.map +0 -1
  453. package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js +0 -2
  454. package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js.map +0 -1
  455. package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js +0 -253
  456. package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js.map +0 -1
  457. package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js +0 -2
  458. package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js.map +0 -1
  459. package/dist/chunks/helperFunctions-BatAhE6u.esm.js +0 -108
  460. package/dist/chunks/helperFunctions-BatAhE6u.esm.js.map +0 -1
  461. package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js +0 -2
  462. package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js.map +0 -1
  463. package/dist/chunks/helperFunctions-vbA-oTJx.esm.js +0 -80
  464. package/dist/chunks/helperFunctions-vbA-oTJx.esm.js.map +0 -1
  465. package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js +0 -2
  466. package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js.map +0 -1
  467. package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js +0 -189
  468. package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js.map +0 -1
  469. package/dist/chunks/index-BHIM4QBr.esm.min.js +0 -57
  470. package/dist/chunks/index-BHIM4QBr.esm.min.js.map +0 -1
  471. package/dist/chunks/index-CtkZLm9J.esm.js +0 -74717
  472. package/dist/chunks/index-CtkZLm9J.esm.js.map +0 -1
  473. package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js +0 -814
  474. package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js.map +0 -1
  475. package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js +0 -2
  476. package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js.map +0 -1
  477. package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js +0 -35
  478. package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js.map +0 -1
  479. package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js +0 -11
  480. package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js.map +0 -1
  481. package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js +0 -2
  482. package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js.map +0 -1
  483. package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js +0 -2
  484. package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js.map +0 -1
  485. package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js +0 -2
  486. package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js.map +0 -1
  487. package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js +0 -77
  488. package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js.map +0 -1
  489. package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js +0 -81
  490. package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js.map +0 -1
  491. package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js +0 -2
  492. package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js.map +0 -1
  493. package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js +0 -11
  494. package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js.map +0 -1
  495. package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js +0 -2
  496. package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js.map +0 -1
  497. package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js +0 -2
  498. package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js.map +0 -1
  499. package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js +0 -11
  500. package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js.map +0 -1
  501. package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js +0 -2
  502. package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js.map +0 -1
  503. package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js +0 -26
  504. package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js.map +0 -1
  505. package/dist/chunks/objFileLoader-Cda8pwUd.esm.js +0 -1338
  506. package/dist/chunks/objFileLoader-Cda8pwUd.esm.js.map +0 -1
  507. package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js +0 -2
  508. package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js.map +0 -1
  509. package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js +0 -2
  510. package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js.map +0 -1
  511. package/dist/chunks/oitFragment-Bz1w36ia.esm.js +0 -1078
  512. package/dist/chunks/oitFragment-Bz1w36ia.esm.js.map +0 -1
  513. package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js +0 -2
  514. package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js.map +0 -1
  515. package/dist/chunks/oitFragment-DiuTTpNa.esm.js +0 -1240
  516. package/dist/chunks/oitFragment-DiuTTpNa.esm.js.map +0 -1
  517. package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js +0 -2
  518. package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js.map +0 -1
  519. package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js +0 -2
  520. package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js.map +0 -1
  521. package/dist/chunks/pass.fragment-CD3_26yo.esm.js +0 -15
  522. package/dist/chunks/pass.fragment-CD3_26yo.esm.js.map +0 -1
  523. package/dist/chunks/pass.fragment-DfeELUEn.esm.js +0 -15
  524. package/dist/chunks/pass.fragment-DfeELUEn.esm.js.map +0 -1
  525. package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js +0 -2
  526. package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js.map +0 -1
  527. package/dist/chunks/pbr.fragment-C1qko419.esm.min.js +0 -2
  528. package/dist/chunks/pbr.fragment-C1qko419.esm.min.js.map +0 -1
  529. package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js +0 -3232
  530. package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js.map +0 -1
  531. package/dist/chunks/pbr.fragment-lt62m8b7.esm.js +0 -3273
  532. package/dist/chunks/pbr.fragment-lt62m8b7.esm.js.map +0 -1
  533. package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js +0 -339
  534. package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js.map +0 -1
  535. package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js +0 -2
  536. package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js.map +0 -1
  537. package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js +0 -2
  538. package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js.map +0 -1
  539. package/dist/chunks/pbr.vertex-DopP5mYu.esm.js +0 -214
  540. package/dist/chunks/pbr.vertex-DopP5mYu.esm.js.map +0 -1
  541. package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js +0 -2
  542. package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js.map +0 -1
  543. package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js +0 -20
  544. package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js.map +0 -1
  545. package/dist/chunks/rawTexture-78KJgWfq.esm.js +0 -191
  546. package/dist/chunks/rawTexture-78KJgWfq.esm.js.map +0 -1
  547. package/dist/chunks/rawTexture-CCCnj14W.esm.min.js +0 -2
  548. package/dist/chunks/rawTexture-CCCnj14W.esm.min.js.map +0 -1
  549. package/dist/chunks/ray-CfhmGTmj.esm.js +0 -946
  550. package/dist/chunks/ray-CfhmGTmj.esm.js.map +0 -1
  551. package/dist/chunks/ray-Du89cGmz.esm.min.js +0 -2
  552. package/dist/chunks/ray-Du89cGmz.esm.min.js.map +0 -1
  553. package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js +0 -13
  554. package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js.map +0 -1
  555. package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js +0 -13
  556. package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js.map +0 -1
  557. package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js +0 -2
  558. package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js.map +0 -1
  559. package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js +0 -2
  560. package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js.map +0 -1
  561. package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js +0 -13
  562. package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js.map +0 -1
  563. package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js +0 -2
  564. package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js.map +0 -1
  565. package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js +0 -13
  566. package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js.map +0 -1
  567. package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js +0 -2
  568. package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js.map +0 -1
  569. package/dist/chunks/splatFileLoader-BnaOhITn.esm.js +0 -3379
  570. package/dist/chunks/splatFileLoader-BnaOhITn.esm.js.map +0 -1
  571. package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js +0 -2
  572. package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js.map +0 -1
  573. package/dist/chunks/spotLight-Ca0-j1Op.esm.js +0 -701
  574. package/dist/chunks/spotLight-Ca0-j1Op.esm.js.map +0 -1
  575. package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js +0 -2
  576. package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js.map +0 -1
  577. package/dist/chunks/standardMaterial-DKyaZtcm.esm.js +0 -1805
  578. package/dist/chunks/standardMaterial-DKyaZtcm.esm.js.map +0 -1
  579. package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js +0 -2
  580. package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js.map +0 -1
  581. package/dist/chunks/stlFileLoader-CDv97liE.esm.js +0 -238
  582. package/dist/chunks/stlFileLoader-CDv97liE.esm.js.map +0 -1
  583. package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js +0 -2
  584. package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js.map +0 -1
  585. package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js +0 -349
  586. package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js.map +0 -1
  587. package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js +0 -2
  588. package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js.map +0 -1
  589. package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js +0 -3848
  590. package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js.map +0 -1
  591. package/dist/chunks/thinEngine-pihAbdON.esm.min.js +0 -2
  592. package/dist/chunks/thinEngine-pihAbdON.esm.min.js.map +0 -1
  593. package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js +0 -2
  594. package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js.map +0 -1
  595. package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js +0 -314
  596. package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js.map +0 -1
  597. package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js +0 -2
  598. package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js.map +0 -1
  599. package/dist/chunks/vertexColorMixing-DKVusFas.esm.js +0 -522
  600. package/dist/chunks/vertexColorMixing-DKVusFas.esm.js.map +0 -1
  601. package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js +0 -412
  602. package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js.map +0 -1
  603. package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js +0 -2
  604. package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js.map +0 -1
  605. package/dist/chunks/webgpuEngine-COis70hT.esm.js +0 -11533
  606. package/dist/chunks/webgpuEngine-COis70hT.esm.js.map +0 -1
  607. package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.js +0 -2
  608. package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.js.map +0 -1
  609. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  610. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  611. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  612. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  613. package/lib/index.d.ts +0 -559
  614. package/lib/index.js +0 -2083
  615. package/lib/index.js.map +0 -1
@@ -0,0 +1,783 @@
1
+ import { Engine } from "@babylonjs/core/Engines/engine.js";
2
+ import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader.js";
3
+ import { RenderingManager } from "@babylonjs/core/Rendering/renderingManager.js";
4
+ import { Tools } from "@babylonjs/core/Misc/tools.js";
5
+ import { Effect } from "@babylonjs/core/Materials/effect.js";
6
+ import { processConfigurationCompatibility } from "../configuration/configurationCompatibility.js";
7
+ import { ConfigurationContainer } from "../configuration/configurationContainer.js";
8
+ import { viewerGlobals } from "../configuration/globals.js";
9
+ import { RenderOnlyConfigurationLoader } from "../configuration/renderOnlyLoader.js";
10
+ // eslint-disable-next-line import/no-internal-modules
11
+ import { deepmerge } from "../helper/index.js";
12
+ import { ModelLoader } from "../loader/modelLoader.js";
13
+ import { ObservablesManager } from "../managers/observablesManager.js";
14
+ import { SceneManager } from "../managers/sceneManager.js";
15
+ import { telemetryManager } from "../managers/telemetryManager.js";
16
+ import { viewerManager } from "./viewerManager.js";
17
+ import "@babylonjs/core/Misc/observable.extensions.js";
18
+ import { Logger } from "@babylonjs/core/Misc/logger.js";
19
+ /**
20
+ * The AbstractViewer is the center of Babylon's viewer.
21
+ * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
22
+ */
23
+ var AbstractViewer = /** @class */ (function () {
24
+ function AbstractViewer(containerElement, initialConfiguration) {
25
+ if (initialConfiguration === void 0) { initialConfiguration = {}; }
26
+ var _this = this;
27
+ this.containerElement = containerElement;
28
+ /**
29
+ * A flag that controls whether or not the render loop should be executed
30
+ */
31
+ this.runRenderLoop = true;
32
+ /**
33
+ * is this viewer disposed?
34
+ */
35
+ this._isDisposed = false;
36
+ this._hdToggled = false;
37
+ this._vrToggled = false;
38
+ this._vrModelRepositioning = 0;
39
+ this._vrScale = 1;
40
+ this._vrInit = false;
41
+ /**
42
+ * The resize function that will be registered with the window object
43
+ */
44
+ this._resize = function () {
45
+ // Only resize if Canvas is in the DOM
46
+ if (!_this.isCanvasInDOM()) {
47
+ return;
48
+ }
49
+ if (_this.canvas.clientWidth <= 0 || _this.canvas.clientHeight <= 0) {
50
+ return;
51
+ }
52
+ if (_this.configuration.engine && _this.configuration.engine.disableResize) {
53
+ return;
54
+ }
55
+ _this.engine.resize();
56
+ };
57
+ /**
58
+ * render loop that will be executed by the engine
59
+ * @param force
60
+ */
61
+ this._render = function (force) {
62
+ if (force === void 0) { force = false; }
63
+ if (force || (_this.sceneManager.scene && _this.sceneManager.scene.activeCamera)) {
64
+ if (_this.runRenderLoop || force) {
65
+ _this.engine.performanceMonitor.enable();
66
+ _this.sceneManager.scene.render();
67
+ _this.onFrameRenderedObservable.notifyObservers(_this);
68
+ }
69
+ else {
70
+ _this.engine.performanceMonitor.disable();
71
+ // update camera instead of rendering
72
+ _this.sceneManager.scene.activeCamera && _this.sceneManager.scene.activeCamera.update();
73
+ }
74
+ }
75
+ };
76
+ // if exists, use the container id. otherwise, generate a random string.
77
+ if (containerElement.id) {
78
+ this.baseId = containerElement.id;
79
+ }
80
+ else {
81
+ this.baseId = containerElement.id = "bjs" + Math.random().toString(32).substring(2, 10);
82
+ }
83
+ this._registeredOnBeforeRenderFunctions = [];
84
+ this._configurationContainer = new ConfigurationContainer();
85
+ this.observablesManager = new ObservablesManager();
86
+ this.modelLoader = new ModelLoader(this.observablesManager, this._configurationContainer);
87
+ RenderingManager.AUTOCLEAR = false;
88
+ // extend the configuration
89
+ this._configurationLoader = this.getConfigurationLoader();
90
+ this._configurationLoader.loadConfiguration(initialConfiguration, function (configuration) {
91
+ _this._onConfigurationLoaded(configuration);
92
+ });
93
+ this.onSceneInitObservable.add(function () {
94
+ _this.updateConfiguration();
95
+ });
96
+ this.onInitDoneObservable.add(function () {
97
+ _this._isInit = true;
98
+ _this.engine.runRenderLoop(_this._render);
99
+ });
100
+ this._prepareContainerElement();
101
+ // add this viewer to the viewer manager
102
+ viewerManager.addViewer(this);
103
+ }
104
+ Object.defineProperty(AbstractViewer.prototype, "onSceneInitObservable", {
105
+ // observables
106
+ /**
107
+ * Will notify when the scene was initialized
108
+ */
109
+ get: function () {
110
+ return this.observablesManager.onSceneInitObservable;
111
+ },
112
+ enumerable: false,
113
+ configurable: true
114
+ });
115
+ Object.defineProperty(AbstractViewer.prototype, "onEngineInitObservable", {
116
+ /**
117
+ * will notify when the engine was initialized
118
+ */
119
+ get: function () {
120
+ return this.observablesManager.onEngineInitObservable;
121
+ },
122
+ enumerable: false,
123
+ configurable: true
124
+ });
125
+ Object.defineProperty(AbstractViewer.prototype, "onModelAddedObservable", {
126
+ /**
127
+ * Will notify when a new model was added to the scene.
128
+ * Note that added does not necessarily mean loaded!
129
+ */
130
+ get: function () {
131
+ return this.observablesManager.onModelAddedObservable;
132
+ },
133
+ enumerable: false,
134
+ configurable: true
135
+ });
136
+ Object.defineProperty(AbstractViewer.prototype, "onModelLoadedObservable", {
137
+ /**
138
+ * will notify after every model load
139
+ */
140
+ get: function () {
141
+ return this.observablesManager.onModelLoadedObservable;
142
+ },
143
+ enumerable: false,
144
+ configurable: true
145
+ });
146
+ Object.defineProperty(AbstractViewer.prototype, "onModelLoadProgressObservable", {
147
+ /**
148
+ * will notify when any model notify of progress
149
+ */
150
+ get: function () {
151
+ return this.observablesManager.onModelLoadProgressObservable;
152
+ },
153
+ enumerable: false,
154
+ configurable: true
155
+ });
156
+ Object.defineProperty(AbstractViewer.prototype, "onModelLoadErrorObservable", {
157
+ /**
158
+ * will notify when any model load failed.
159
+ */
160
+ get: function () {
161
+ return this.observablesManager.onModelLoadErrorObservable;
162
+ },
163
+ enumerable: false,
164
+ configurable: true
165
+ });
166
+ Object.defineProperty(AbstractViewer.prototype, "onModelRemovedObservable", {
167
+ /**
168
+ * Will notify when a model was removed from the scene;
169
+ */
170
+ get: function () {
171
+ return this.observablesManager.onModelRemovedObservable;
172
+ },
173
+ enumerable: false,
174
+ configurable: true
175
+ });
176
+ Object.defineProperty(AbstractViewer.prototype, "onLoaderInitObservable", {
177
+ /**
178
+ * will notify when a new loader was initialized.
179
+ * Used mainly to know when a model starts loading.
180
+ */
181
+ get: function () {
182
+ return this.observablesManager.onLoaderInitObservable;
183
+ },
184
+ enumerable: false,
185
+ configurable: true
186
+ });
187
+ Object.defineProperty(AbstractViewer.prototype, "onInitDoneObservable", {
188
+ /**
189
+ * Observers registered here will be executed when the entire load process has finished.
190
+ */
191
+ get: function () {
192
+ return this.observablesManager.onViewerInitDoneObservable;
193
+ },
194
+ enumerable: false,
195
+ configurable: true
196
+ });
197
+ Object.defineProperty(AbstractViewer.prototype, "onFrameRenderedObservable", {
198
+ /**
199
+ * Functions added to this observable will be executed on each frame rendered.
200
+ */
201
+ get: function () {
202
+ return this.observablesManager.onFrameRenderedObservable;
203
+ },
204
+ enumerable: false,
205
+ configurable: true
206
+ });
207
+ Object.defineProperty(AbstractViewer.prototype, "onEnteringVRObservable", {
208
+ /**
209
+ * Observers registered here will be executed when VR more is entered.
210
+ */
211
+ get: function () {
212
+ return this.observablesManager.onEnteringVRObservable;
213
+ },
214
+ enumerable: false,
215
+ configurable: true
216
+ });
217
+ Object.defineProperty(AbstractViewer.prototype, "onExitingVRObservable", {
218
+ /**
219
+ * Observers registered here will be executed when VR mode is exited.
220
+ */
221
+ get: function () {
222
+ return this.observablesManager.onExitingVRObservable;
223
+ },
224
+ enumerable: false,
225
+ configurable: true
226
+ });
227
+ Object.defineProperty(AbstractViewer.prototype, "canvas", {
228
+ /**
229
+ * The (single) canvas of this viewer
230
+ */
231
+ get: function () {
232
+ return this._canvas;
233
+ },
234
+ enumerable: false,
235
+ configurable: true
236
+ });
237
+ Object.defineProperty(AbstractViewer.prototype, "configurationContainer", {
238
+ get: function () {
239
+ return this._configurationContainer;
240
+ },
241
+ enumerable: false,
242
+ configurable: true
243
+ });
244
+ // eslint-disable-next-line @typescript-eslint/naming-convention
245
+ AbstractViewer.prototype.getConfigurationLoader = function () {
246
+ return new RenderOnlyConfigurationLoader();
247
+ };
248
+ /**
249
+ * get the baseId of this viewer
250
+ * @returns the baseId of this viewer
251
+ */
252
+ AbstractViewer.prototype.getBaseId = function () {
253
+ return this.baseId;
254
+ };
255
+ /**
256
+ * Do we have a canvas to render on, and is it a part of the scene
257
+ * @returns true if the canvas is in the DOM
258
+ */
259
+ AbstractViewer.prototype.isCanvasInDOM = function () {
260
+ return !!this._canvas && !!this._canvas.parentElement;
261
+ };
262
+ Object.defineProperty(AbstractViewer.prototype, "renderInBackground", {
263
+ /**
264
+ * Is the engine currently set to render even when the page is in background
265
+ */
266
+ get: function () {
267
+ return this.engine && this.engine.renderEvenInBackground;
268
+ },
269
+ /**
270
+ * Set the viewer's background rendering flag.
271
+ */
272
+ set: function (value) {
273
+ if (this.engine) {
274
+ this.engine.renderEvenInBackground = value;
275
+ }
276
+ },
277
+ enumerable: false,
278
+ configurable: true
279
+ });
280
+ Object.defineProperty(AbstractViewer.prototype, "configuration", {
281
+ /**
282
+ * Get the configuration object. This is a reference only.
283
+ * The configuration can ONLY be updated using the updateConfiguration function.
284
+ * changing this object will have no direct effect on the scene.
285
+ */
286
+ get: function () {
287
+ return this._configurationContainer.configuration;
288
+ },
289
+ enumerable: false,
290
+ configurable: true
291
+ });
292
+ /**
293
+ * force resizing the engine.
294
+ */
295
+ AbstractViewer.prototype.forceResize = function () {
296
+ this._resize();
297
+ };
298
+ AbstractViewer.prototype.toggleHD = function () {
299
+ this._hdToggled = !this._hdToggled;
300
+ var scale = this._hdToggled ? Math.max(0.5, 1 / (window.devicePixelRatio || 2)) : 1;
301
+ this.engine.setHardwareScalingLevel(scale);
302
+ };
303
+ AbstractViewer.prototype.toggleVR = function () {
304
+ if (!this._vrInit) {
305
+ this._initVR();
306
+ }
307
+ if (this.sceneManager.vrHelper && !this.sceneManager.vrHelper.isInVRMode) {
308
+ // make sure the floor is set
309
+ if (this.sceneManager.environmentHelper && this.sceneManager.environmentHelper.ground) {
310
+ this.sceneManager.vrHelper.addFloorMesh(this.sceneManager.environmentHelper.ground);
311
+ }
312
+ this._vrToggled = true;
313
+ this.sceneManager.vrHelper.enterVR();
314
+ // position the vr camera to be in front of the object or wherever the user has configured it to be
315
+ if (this.sceneManager.vrHelper.currentVRCamera && this.sceneManager.vrHelper.currentVRCamera !== this.sceneManager.camera) {
316
+ if (this.configuration.vr && this.configuration.vr.cameraPosition !== undefined) {
317
+ this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(this.configuration.vr.cameraPosition.x, this.configuration.vr.cameraPosition.y, this.configuration.vr.cameraPosition.z);
318
+ }
319
+ else {
320
+ this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(0, this.sceneManager.vrHelper.currentVRCamera.position.y, -1);
321
+ }
322
+ this.sceneManager.vrHelper.currentVRCamera.rotationQuaternion &&
323
+ this.sceneManager.vrHelper.currentVRCamera.rotationQuaternion.copyFromFloats(0, 0, 0, 1);
324
+ // set the height of the model to be what the user has configured, or floating by default
325
+ if (this.configuration.vr && this.configuration.vr.modelHeightCorrection !== undefined) {
326
+ if (typeof this.configuration.vr.modelHeightCorrection === "number") {
327
+ this._vrModelRepositioning = this.configuration.vr.modelHeightCorrection;
328
+ }
329
+ else if (this.configuration.vr.modelHeightCorrection) {
330
+ this._vrModelRepositioning = this.sceneManager.vrHelper.currentVRCamera.position.y / 2;
331
+ }
332
+ else {
333
+ this._vrModelRepositioning = 0;
334
+ }
335
+ }
336
+ // scale the model
337
+ if (this.sceneManager.models.length) {
338
+ var boundingVectors = this.sceneManager.models[0].rootMesh.getHierarchyBoundingVectors();
339
+ var sizeVec = boundingVectors.max.subtract(boundingVectors.min);
340
+ var maxDimension = Math.max(sizeVec.x, sizeVec.y, sizeVec.z);
341
+ this._vrScale = 1 / maxDimension;
342
+ if (this.configuration.vr && this.configuration.vr.objectScaleFactor) {
343
+ this._vrScale *= this.configuration.vr.objectScaleFactor;
344
+ }
345
+ this.sceneManager.models[0].rootMesh.scaling.scaleInPlace(this._vrScale);
346
+ // reposition the object to "float" in front of the user
347
+ this.sceneManager.models[0].rootMesh.position.y += this._vrModelRepositioning;
348
+ this.sceneManager.models[0].rootMesh.rotationQuaternion = null;
349
+ }
350
+ // scale the environment to match the model
351
+ if (this.sceneManager.environmentHelper) {
352
+ this.sceneManager.environmentHelper.ground && this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(this._vrScale);
353
+ this.sceneManager.environmentHelper.skybox && this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(this._vrScale);
354
+ }
355
+ // post processing
356
+ if (this.sceneManager.defaultRenderingPipelineEnabled && this.sceneManager.defaultRenderingPipeline) {
357
+ this.sceneManager.defaultRenderingPipeline.imageProcessingEnabled = false;
358
+ this.sceneManager.defaultRenderingPipeline.prepare();
359
+ }
360
+ }
361
+ else {
362
+ this._vrModelRepositioning = 0;
363
+ }
364
+ }
365
+ else {
366
+ if (this.sceneManager.vrHelper) {
367
+ this.sceneManager.vrHelper.exitVR();
368
+ }
369
+ }
370
+ };
371
+ AbstractViewer.prototype._initVR = function () {
372
+ var _this = this;
373
+ if (this.sceneManager.vrHelper) {
374
+ this.observablesManager.onExitingVRObservable.add(function () {
375
+ if (_this._vrToggled) {
376
+ _this._vrToggled = false;
377
+ // undo the scaling of the model
378
+ if (_this.sceneManager.models.length) {
379
+ _this.sceneManager.models[0].rootMesh.scaling.scaleInPlace(1 / _this._vrScale);
380
+ _this.sceneManager.models[0].rootMesh.position.y -= _this._vrModelRepositioning;
381
+ }
382
+ // undo the scaling of the environment
383
+ if (_this.sceneManager.environmentHelper) {
384
+ _this.sceneManager.environmentHelper.ground && _this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(1 / _this._vrScale);
385
+ _this.sceneManager.environmentHelper.skybox && _this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(1 / _this._vrScale);
386
+ }
387
+ // post processing
388
+ if (_this.sceneManager.defaultRenderingPipelineEnabled && _this.sceneManager.defaultRenderingPipeline) {
389
+ _this.sceneManager.defaultRenderingPipeline.imageProcessingEnabled = true;
390
+ _this.sceneManager.defaultRenderingPipeline.prepare();
391
+ }
392
+ // clear set height and width
393
+ _this.canvas.removeAttribute("height");
394
+ _this.canvas.removeAttribute("width");
395
+ _this.engine.resize();
396
+ }
397
+ });
398
+ }
399
+ this._vrInit = true;
400
+ };
401
+ AbstractViewer.prototype._onConfigurationLoaded = function (configuration) {
402
+ var _this = this;
403
+ this._configurationContainer.configuration = deepmerge(this.configuration || {}, configuration);
404
+ if (this.configuration.observers) {
405
+ this._configureObservers(this.configuration.observers);
406
+ }
407
+ // TODO remove this after testing, as this is done in the updateConfiguration as well.
408
+ if (this.configuration.loaderPlugins) {
409
+ Object.keys(this.configuration.loaderPlugins).forEach(function (name) {
410
+ if (_this.configuration.loaderPlugins && _this.configuration.loaderPlugins[name]) {
411
+ _this.modelLoader.addPlugin(name);
412
+ }
413
+ });
414
+ }
415
+ this.observablesManager.onViewerInitStartedObservable.notifyObservers(this);
416
+ };
417
+ /**
418
+ * Force a single render loop execution.
419
+ */
420
+ AbstractViewer.prototype.forceRender = function () {
421
+ this._render(true);
422
+ };
423
+ /**
424
+ * Takes a screenshot of the scene and returns it as a base64 encoded png.
425
+ * @param callback optional callback that will be triggered when screenshot is done.
426
+ * @param width Optional screenshot width (default to 512).
427
+ * @param height Optional screenshot height (default to 512).
428
+ * @returns a promise with the screenshot data
429
+ */
430
+ AbstractViewer.prototype.takeScreenshot = function (callback, width, height) {
431
+ var _this = this;
432
+ if (width === void 0) { width = 0; }
433
+ if (height === void 0) { height = 0; }
434
+ width = width || this.canvas.clientWidth;
435
+ height = height || this.canvas.clientHeight;
436
+ // Create the screenshot
437
+ return new Promise(function (resolve, reject) {
438
+ try {
439
+ Tools.CreateScreenshot(_this.engine, _this.sceneManager.camera, { width: width, height: height }, function (data) {
440
+ if (callback) {
441
+ callback(data);
442
+ }
443
+ resolve(data);
444
+ });
445
+ }
446
+ catch (e) {
447
+ reject(e);
448
+ }
449
+ });
450
+ };
451
+ /**
452
+ * Update the current viewer configuration with new values.
453
+ * Only provided information will be updated, old configuration values will be kept.
454
+ * If this.configuration was manually changed, you can trigger this function with no parameters,
455
+ * and the entire configuration will be updated.
456
+ * @param newConfiguration the partial configuration to update or a URL to a JSON holding the updated configuration
457
+ *
458
+ */
459
+ AbstractViewer.prototype.updateConfiguration = function (newConfiguration) {
460
+ var _this = this;
461
+ if (newConfiguration === void 0) { newConfiguration = this.configuration; }
462
+ if (typeof newConfiguration === "string") {
463
+ Tools.LoadFile(newConfiguration, function (data) {
464
+ try {
465
+ var newData = JSON.parse(data.toString());
466
+ return _this.updateConfiguration(newData);
467
+ }
468
+ catch (e) {
469
+ Logger.Log("Error parsing file " + newConfiguration);
470
+ }
471
+ }, undefined, undefined, undefined, function (error) {
472
+ Logger.Log(["Error parsing file " + newConfiguration, error]);
473
+ });
474
+ }
475
+ else {
476
+ //backcompat
477
+ processConfigurationCompatibility(newConfiguration);
478
+ // update this.configuration with the new data
479
+ this._configurationContainer.configuration = deepmerge(this.configuration || {}, newConfiguration);
480
+ this.sceneManager.updateConfiguration(newConfiguration);
481
+ // observers in configuration
482
+ if (newConfiguration.observers) {
483
+ this._configureObservers(newConfiguration.observers);
484
+ }
485
+ if (newConfiguration.loaderPlugins) {
486
+ Object.keys(newConfiguration.loaderPlugins).forEach(function (name) {
487
+ if (newConfiguration.loaderPlugins && newConfiguration.loaderPlugins[name]) {
488
+ _this.modelLoader.addPlugin(name);
489
+ }
490
+ });
491
+ }
492
+ }
493
+ };
494
+ /**
495
+ * this is used to register native functions using the configuration object.
496
+ * This will configure the observers.
497
+ * @param observersConfiguration observers configuration
498
+ */
499
+ AbstractViewer.prototype._configureObservers = function (observersConfiguration) {
500
+ if (observersConfiguration.onEngineInit) {
501
+ this.onEngineInitObservable.add(window[observersConfiguration.onEngineInit]);
502
+ }
503
+ else {
504
+ if (observersConfiguration.onEngineInit === "" && this.configuration.observers && this.configuration.observers.onEngineInit) {
505
+ this.onEngineInitObservable.removeCallback(window[this.configuration.observers.onEngineInit]);
506
+ }
507
+ }
508
+ if (observersConfiguration.onSceneInit) {
509
+ this.onSceneInitObservable.add(window[observersConfiguration.onSceneInit]);
510
+ }
511
+ else {
512
+ if (observersConfiguration.onSceneInit === "" && this.configuration.observers && this.configuration.observers.onSceneInit) {
513
+ this.onSceneInitObservable.removeCallback(window[this.configuration.observers.onSceneInit]);
514
+ }
515
+ }
516
+ if (observersConfiguration.onModelLoaded) {
517
+ this.onModelLoadedObservable.add(window[observersConfiguration.onModelLoaded]);
518
+ }
519
+ else {
520
+ if (observersConfiguration.onModelLoaded === "" && this.configuration.observers && this.configuration.observers.onModelLoaded) {
521
+ this.onModelLoadedObservable.removeCallback(window[this.configuration.observers.onModelLoaded]);
522
+ }
523
+ }
524
+ };
525
+ /**
526
+ * Dispose the entire viewer including the scene and the engine
527
+ */
528
+ AbstractViewer.prototype.dispose = function () {
529
+ if (this._isDisposed) {
530
+ return;
531
+ }
532
+ window.removeEventListener("resize", this._resize);
533
+ if (this.sceneManager) {
534
+ if (this.sceneManager.scene && this.sceneManager.scene.activeCamera) {
535
+ this.sceneManager.scene.activeCamera.detachControl();
536
+ }
537
+ this.sceneManager.dispose();
538
+ }
539
+ this._fpsTimeoutInterval && clearInterval(this._fpsTimeoutInterval);
540
+ this.observablesManager.dispose();
541
+ this.modelLoader.dispose();
542
+ if (this.engine) {
543
+ this.engine.dispose();
544
+ }
545
+ viewerManager.removeViewer(this);
546
+ this._isDisposed = true;
547
+ };
548
+ /**
549
+ * This function will execute when the HTML templates finished initializing.
550
+ * It should initialize the engine and continue execution.
551
+ *
552
+ * @returns The viewer object will be returned after the object was loaded.
553
+ */
554
+ AbstractViewer.prototype._onTemplatesLoaded = function () {
555
+ return Promise.resolve(this);
556
+ };
557
+ /**
558
+ * This will force the creation of an engine and a scene.
559
+ * It will also load a model if preconfigured.
560
+ * But first - it will load the extendible onTemplateLoaded()!
561
+ * @returns A promise that will resolve when the template was loaded
562
+ */
563
+ AbstractViewer.prototype._onTemplateLoaded = function () {
564
+ var _this = this;
565
+ // check if viewer was disposed right after created
566
+ if (this._isDisposed) {
567
+ return Promise.reject("viewer was disposed");
568
+ }
569
+ return this._onTemplatesLoaded().then(function () {
570
+ var autoLoad = typeof _this.configuration.model === "string" || (_this.configuration.model && _this.configuration.model.url);
571
+ return _this._initEngine()
572
+ .then(function (engine) {
573
+ return _this.onEngineInitObservable.notifyObserversWithPromise(engine);
574
+ })
575
+ .then(function () {
576
+ _this._initTelemetryEvents();
577
+ if (autoLoad) {
578
+ return _this.loadModel(_this.configuration.model)
579
+ .catch(function () { })
580
+ .then(function () {
581
+ return _this.sceneManager.scene;
582
+ });
583
+ }
584
+ else {
585
+ return _this.sceneManager.scene || _this.sceneManager.initScene(_this.configuration.scene);
586
+ }
587
+ })
588
+ .then(function () {
589
+ return _this.onInitDoneObservable.notifyObserversWithPromise(_this);
590
+ })
591
+ .catch(function (e) {
592
+ Tools.Warn(e.toString());
593
+ return _this;
594
+ });
595
+ });
596
+ };
597
+ /**
598
+ * Initialize the engine. Returns a promise in case async calls are needed.
599
+ *
600
+ * @protected
601
+ * @returns {Promise<Engine>}
602
+ * @memberof Viewer
603
+ */
604
+ AbstractViewer.prototype._initEngine = function () {
605
+ // init custom shaders
606
+ this._injectCustomShaders();
607
+ //let canvasElement = this.templateManager.getCanvas();
608
+ if (!this.canvas) {
609
+ return Promise.reject("Canvas element not found!");
610
+ }
611
+ var config = this.configuration.engine || {};
612
+ // TDO enable further configuration
613
+ // check for webgl2 support, force-disable if needed.
614
+ if (viewerGlobals.disableWebGL2Support) {
615
+ config.engineOptions = config.engineOptions || {};
616
+ config.engineOptions.disableWebGL2Support = true;
617
+ }
618
+ if (this.configuration["3dCommerceCertified"]) {
619
+ config.engineOptions = config.engineOptions || {};
620
+ config.engineOptions.forceSRGBBufferSupportState = true;
621
+ var loader = SceneLoader.GetPluginForExtension(".gltf");
622
+ if (loader) {
623
+ loader.transparencyAsCoverage = true;
624
+ }
625
+ SceneLoader.OnPluginActivatedObservable.add(function (plugin) {
626
+ if (plugin.name === "gltf") {
627
+ var loader_1 = plugin;
628
+ loader_1.transparencyAsCoverage = true;
629
+ }
630
+ });
631
+ }
632
+ this.engine = new Engine(this.canvas, !!config.antialiasing, config.engineOptions);
633
+ if (!config.disableResize) {
634
+ window.addEventListener("resize", this._resize);
635
+ }
636
+ if (this.configuration.engine) {
637
+ if (this.configuration.engine.adaptiveQuality) {
638
+ var scale = Math.max(0.5, 1 / (window.devicePixelRatio || 2));
639
+ this.engine.setHardwareScalingLevel(scale);
640
+ }
641
+ if (this.configuration.engine.hdEnabled) {
642
+ this.toggleHD();
643
+ }
644
+ }
645
+ // create a new template manager for this viewer
646
+ this.sceneManager = new SceneManager(this.engine, this._configurationContainer, this.observablesManager);
647
+ return Promise.resolve(this.engine);
648
+ };
649
+ /**
650
+ * Initialize a model loading. The returned object (a ViewerModel object) will be loaded in the background.
651
+ * The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
652
+ *
653
+ * @param modelConfig model configuration to use when loading the model.
654
+ * @param clearScene should the scene be cleared before loading this model
655
+ * @returns a ViewerModel object that is not yet fully loaded.
656
+ */
657
+ AbstractViewer.prototype.initModel = function (modelConfig, clearScene) {
658
+ var _this = this;
659
+ if (clearScene === void 0) { clearScene = true; }
660
+ var configuration;
661
+ if (typeof modelConfig === "string") {
662
+ configuration = {
663
+ url: modelConfig,
664
+ };
665
+ }
666
+ else if (modelConfig instanceof File) {
667
+ configuration = {
668
+ file: modelConfig,
669
+ root: "file:",
670
+ };
671
+ }
672
+ else {
673
+ configuration = modelConfig;
674
+ }
675
+ if (!configuration.url && !configuration.file) {
676
+ throw new Error("no model provided");
677
+ }
678
+ if (clearScene) {
679
+ this.sceneManager.clearScene(true, false);
680
+ }
681
+ //merge the configuration for future models:
682
+ if (this.configuration.model && typeof this.configuration.model === "object") {
683
+ var globalConfig = deepmerge({}, this.configuration.model);
684
+ configuration = deepmerge(globalConfig, configuration);
685
+ if (modelConfig instanceof File) {
686
+ configuration.file = modelConfig;
687
+ }
688
+ }
689
+ else {
690
+ this.configuration.model = configuration;
691
+ }
692
+ this._isLoading = true;
693
+ var model = this.modelLoader.load(configuration);
694
+ this.lastUsedLoader = model.loader;
695
+ model.onLoadErrorObservable.add(function (errorObject) {
696
+ _this.onModelLoadErrorObservable.notifyObserversWithPromise(errorObject);
697
+ });
698
+ model.onLoadProgressObservable.add(function (progressEvent) {
699
+ _this.onModelLoadProgressObservable.notifyObserversWithPromise(progressEvent);
700
+ });
701
+ this.onLoaderInitObservable.notifyObserversWithPromise(this.lastUsedLoader);
702
+ model.onLoadedObservable.add(function () {
703
+ _this._isLoading = false;
704
+ });
705
+ return model;
706
+ };
707
+ /**
708
+ * load a model using the provided configuration.
709
+ * This function, as opposed to initModel, will return a promise that resolves when the model is loaded, and rejects with error.
710
+ * If you want to attach to the observables of the model, use initModel instead.
711
+ *
712
+ * @param modelConfig the model configuration or URL to load.
713
+ * @param clearScene Should the scene be cleared before loading the model
714
+ * @returns a Promise the fulfills when the model finished loading successfully.
715
+ */
716
+ AbstractViewer.prototype.loadModel = function (modelConfig, clearScene) {
717
+ var _this = this;
718
+ if (clearScene === void 0) { clearScene = true; }
719
+ if (this._isLoading) {
720
+ // We can decide here whether or not to cancel the lst load, but the developer can do that.
721
+ return Promise.reject("another model is curently being loaded.");
722
+ }
723
+ return Promise.resolve(this.sceneManager.scene)
724
+ .then(function (scene) {
725
+ if (!scene) {
726
+ return _this.sceneManager.initScene(_this.configuration.scene);
727
+ }
728
+ return scene;
729
+ })
730
+ .then(function () {
731
+ var model = _this.initModel(modelConfig, clearScene);
732
+ return new Promise(function (resolve, reject) {
733
+ // at this point, configuration.model is an object, not a string
734
+ model.onLoadedObservable.add(function () {
735
+ resolve(model);
736
+ });
737
+ model.onLoadErrorObservable.add(function (error) {
738
+ reject(error);
739
+ });
740
+ });
741
+ });
742
+ };
743
+ AbstractViewer.prototype._initTelemetryEvents = function () {
744
+ var _this = this;
745
+ telemetryManager.broadcast("Engine Capabilities", this.baseId, this.engine.getCaps());
746
+ telemetryManager.broadcast("Platform Details", this.baseId, {
747
+ userAgent: navigator.userAgent,
748
+ platform: navigator.platform,
749
+ });
750
+ telemetryManager.flushWebGLErrors(this.engine, this.baseId);
751
+ var trackFPS = function () {
752
+ telemetryManager.broadcast("Current FPS", _this.baseId, { fps: _this.engine.getFps() });
753
+ };
754
+ trackFPS();
755
+ // Track the FPS again after 60 seconds
756
+ this._fpsTimeoutInterval = window.setInterval(trackFPS, 60 * 1000);
757
+ };
758
+ /**
759
+ * Injects all the spectre shader in the babylon shader store
760
+ */
761
+ AbstractViewer.prototype._injectCustomShaders = function () {
762
+ var customShaders = this.configuration.customShaders;
763
+ // Inject all the spectre shader in the babylon shader store.
764
+ if (!customShaders) {
765
+ return;
766
+ }
767
+ if (customShaders.shaders) {
768
+ Object.keys(customShaders.shaders).forEach(function (key) {
769
+ // typescript considers a callback "unsafe", so... '!'
770
+ Effect.ShadersStore[key] = customShaders.shaders[key];
771
+ });
772
+ }
773
+ if (customShaders.includes) {
774
+ Object.keys(customShaders.includes).forEach(function (key) {
775
+ // typescript considers a callback "unsafe", so... '!'
776
+ Effect.IncludesShadersStore[key] = customShaders.includes[key];
777
+ });
778
+ }
779
+ };
780
+ return AbstractViewer;
781
+ }());
782
+ export { AbstractViewer };
783
+ //# sourceMappingURL=viewer.js.map