@babylonjs/viewer 7.40.4-alpha → 7.40.4

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 (619) 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-B7tVMCka.esm.min.js +0 -2
  198. package/dist/chunks/EXT_lights_ies-B7tVMCka.esm.min.js.map +0 -1
  199. package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js +0 -84
  200. package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js.map +0 -1
  201. package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js +0 -2
  202. package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js.map +0 -1
  203. package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js +0 -171
  204. package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js.map +0 -1
  205. package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js +0 -86
  206. package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js.map +0 -1
  207. package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js +0 -2
  208. package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js.map +0 -1
  209. package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js +0 -2
  210. package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js.map +0 -1
  211. package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js +0 -134
  212. package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js.map +0 -1
  213. package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js +0 -44
  214. package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js.map +0 -1
  215. package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js +0 -2
  216. package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js.map +0 -1
  217. package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js +0 -43
  218. package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js.map +0 -1
  219. package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js +0 -2
  220. package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js.map +0 -1
  221. package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js +0 -64
  222. package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js.map +0 -1
  223. package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js +0 -2
  224. package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js.map +0 -1
  225. package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js +0 -352
  226. package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js.map +0 -1
  227. package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js +0 -2
  228. package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js.map +0 -1
  229. package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js +0 -610
  230. package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js.map +0 -1
  231. package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js +0 -2
  232. package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js.map +0 -1
  233. package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js +0 -2
  234. package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js.map +0 -1
  235. package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js +0 -4033
  236. package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js.map +0 -1
  237. package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js +0 -2
  238. package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js.map +0 -1
  239. package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js +0 -581
  240. package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js.map +0 -1
  241. package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js +0 -65
  242. package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js.map +0 -1
  243. package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js +0 -2
  244. package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js.map +0 -1
  245. package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js +0 -2
  246. package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js.map +0 -1
  247. package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js +0 -96
  248. package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js.map +0 -1
  249. package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js +0 -97
  250. package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js +0 -62
  256. package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js +0 -55
  258. package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js +0 -2
  262. package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js.map +0 -1
  263. package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js +0 -64
  264. package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js.map +0 -1
  265. package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js +0 -2
  266. package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js.map +0 -1
  267. package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js +0 -72
  268. package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js.map +0 -1
  269. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js +0 -81
  270. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js.map +0 -1
  271. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js +0 -2
  272. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js.map +0 -1
  273. package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js +0 -2
  274. package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js.map +0 -1
  275. package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js +0 -85
  276. package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js.map +0 -1
  277. package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js +0 -75
  278. package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js.map +0 -1
  279. package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js +0 -2
  280. package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js.map +0 -1
  281. package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js +0 -307
  282. package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js +0 -2
  286. package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js.map +0 -1
  287. package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js +0 -74
  288. package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js.map +0 -1
  289. package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js +0 -2
  290. package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js.map +0 -1
  291. package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js +0 -262
  292. package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js.map +0 -1
  293. package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js +0 -2
  294. package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js.map +0 -1
  295. package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js +0 -87
  296. package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js.map +0 -1
  297. package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js +0 -26
  298. package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js.map +0 -1
  299. package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js +0 -2
  300. package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js.map +0 -1
  301. package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js +0 -39
  302. package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js.map +0 -1
  303. package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js +0 -2
  304. package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js.map +0 -1
  305. package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js +0 -46
  306. package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js.map +0 -1
  307. package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js +0 -2
  308. package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js.map +0 -1
  309. package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js +0 -2
  310. package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js.map +0 -1
  311. package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js +0 -43
  312. package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js.map +0 -1
  313. package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js +0 -63
  314. package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js.map +0 -1
  315. package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js +0 -2
  316. package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js.map +0 -1
  317. package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js +0 -51
  318. package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js.map +0 -1
  319. package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js +0 -2
  320. package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js.map +0 -1
  321. package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js +0 -2201
  322. package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js.map +0 -1
  323. package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js +0 -2
  324. package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js.map +0 -1
  325. package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js +0 -337
  326. package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js.map +0 -1
  327. package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js +0 -2
  328. package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js.map +0 -1
  329. package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js +0 -2
  330. package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js.map +0 -1
  331. package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js +0 -46
  332. package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js.map +0 -1
  333. package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js +0 -2
  334. package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js.map +0 -1
  335. package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js +0 -47
  336. package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js.map +0 -1
  337. package/dist/chunks/animationGroup-B1YyqoTa.esm.js +0 -2482
  338. package/dist/chunks/animationGroup-B1YyqoTa.esm.js.map +0 -1
  339. package/dist/chunks/animationGroup-C9C7qST_.esm.min.js +0 -2
  340. package/dist/chunks/animationGroup-C9C7qST_.esm.min.js.map +0 -1
  341. package/dist/chunks/assetContainer-BzlRl_4x.esm.js +0 -1720
  342. package/dist/chunks/assetContainer-BzlRl_4x.esm.js.map +0 -1
  343. package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js +0 -2
  344. package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js.map +0 -1
  345. package/dist/chunks/audioEngine-BZB34VjD.esm.js +0 -305
  346. package/dist/chunks/audioEngine-BZB34VjD.esm.js.map +0 -1
  347. package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js +0 -2
  348. package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js.map +0 -1
  349. package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js +0 -2
  350. package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js.map +0 -1
  351. package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js +0 -114
  352. package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js.map +0 -1
  353. package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js +0 -2
  354. package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js.map +0 -1
  355. package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js +0 -600
  356. package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js.map +0 -1
  357. package/dist/chunks/dds-C1QgDMMC.esm.min.js +0 -2
  358. package/dist/chunks/dds-C1QgDMMC.esm.min.js.map +0 -1
  359. package/dist/chunks/dds-zApWiwah.esm.js +0 -540
  360. package/dist/chunks/dds-zApWiwah.esm.js.map +0 -1
  361. package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js +0 -88
  362. package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js.map +0 -1
  363. package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js +0 -2
  364. package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js.map +0 -1
  365. package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js +0 -2
  366. package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js.map +0 -1
  367. package/dist/chunks/decalFragment-DqgT4NiX.esm.js +0 -18
  368. package/dist/chunks/decalFragment-DqgT4NiX.esm.js.map +0 -1
  369. package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js +0 -2
  370. package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js.map +0 -1
  371. package/dist/chunks/default.fragment-C8lcinV9.esm.js +0 -446
  372. package/dist/chunks/default.fragment-C8lcinV9.esm.js.map +0 -1
  373. package/dist/chunks/default.fragment-De3FJCJD.esm.js +0 -515
  374. package/dist/chunks/default.fragment-De3FJCJD.esm.js.map +0 -1
  375. package/dist/chunks/default.fragment-b__nAv93.esm.min.js +0 -2
  376. package/dist/chunks/default.fragment-b__nAv93.esm.min.js.map +0 -1
  377. package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js +0 -2
  378. package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js.map +0 -1
  379. package/dist/chunks/default.vertex-CD2qxrmB.esm.js +0 -190
  380. package/dist/chunks/default.vertex-CD2qxrmB.esm.js.map +0 -1
  381. package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js +0 -2
  382. package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js.map +0 -1
  383. package/dist/chunks/default.vertex-DRHq60qX.esm.js +0 -211
  384. package/dist/chunks/default.vertex-DRHq60qX.esm.js.map +0 -1
  385. package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js +0 -2
  386. package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js.map +0 -1
  387. package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js +0 -2
  388. package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js.map +0 -1
  389. package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js +0 -13
  390. package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js.map +0 -1
  391. package/dist/chunks/defaultUboDeclaration-xxIrKyXf.esm.js +0 -15
  392. package/dist/chunks/defaultUboDeclaration-xxIrKyXf.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-BOVGklo2.esm.min.js +0 -2
  398. package/dist/chunks/dumpTools-BOVGklo2.esm.min.js.map +0 -1
  399. package/dist/chunks/dumpTools-Dy-fD64p.esm.js +0 -200
  400. package/dist/chunks/dumpTools-Dy-fD64p.esm.js.map +0 -1
  401. package/dist/chunks/engine-CBGABL2W.esm.min.js +0 -2
  402. package/dist/chunks/engine-CBGABL2W.esm.min.js.map +0 -1
  403. package/dist/chunks/engine-D9Sn-BC6.esm.js +0 -2213
  404. package/dist/chunks/engine-D9Sn-BC6.esm.js.map +0 -1
  405. package/dist/chunks/engine.common-BM1GAef8.esm.js +0 -1162
  406. package/dist/chunks/engine.common-BM1GAef8.esm.js.map +0 -1
  407. package/dist/chunks/engine.common-xMH7x2b0.esm.min.js +0 -2
  408. package/dist/chunks/engine.common-xMH7x2b0.esm.min.js.map +0 -1
  409. package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js +0 -2
  410. package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js.map +0 -1
  411. package/dist/chunks/envTextureLoader-DT_xwrde.esm.js +0 -64
  412. package/dist/chunks/envTextureLoader-DT_xwrde.esm.js.map +0 -1
  413. package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js +0 -2
  414. package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js.map +0 -1
  415. package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js +0 -382
  416. package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js.map +0 -1
  417. package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js +0 -2
  418. package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js.map +0 -1
  419. package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js +0 -1683
  420. package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js.map +0 -1
  421. package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js +0 -2
  422. package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js.map +0 -1
  423. package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js +0 -2
  424. package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js.map +0 -1
  425. package/dist/chunks/fogFragment-DANl-YQk.esm.js +0 -102
  426. package/dist/chunks/fogFragment-DANl-YQk.esm.js.map +0 -1
  427. package/dist/chunks/fogFragment-DptoygQ5.esm.js +0 -101
  428. package/dist/chunks/fogFragment-DptoygQ5.esm.js.map +0 -1
  429. package/dist/chunks/fresnelFunction-3-z89NGn.esm.js +0 -12
  430. package/dist/chunks/fresnelFunction-3-z89NGn.esm.js.map +0 -1
  431. package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js +0 -2
  432. package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js.map +0 -1
  433. package/dist/chunks/glTFLoader-Qw5JObwf.esm.js +0 -7658
  434. package/dist/chunks/glTFLoader-Qw5JObwf.esm.js.map +0 -1
  435. package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js +0 -2
  436. package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js.map +0 -1
  437. package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js +0 -77
  438. package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js.map +0 -1
  439. package/dist/chunks/glTFLoaderAnimation-DnTkRibM.esm.min.js +0 -2
  440. package/dist/chunks/glTFLoaderAnimation-DnTkRibM.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-19PWyV81.esm.js +0 -34
  446. package/dist/chunks/harmonicsFunctions-19PWyV81.esm.js.map +0 -1
  447. package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js +0 -35
  448. package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js.map +0 -1
  449. package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js +0 -2
  450. package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js.map +0 -1
  451. package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js +0 -2
  452. package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js.map +0 -1
  453. package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js +0 -2
  454. package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js.map +0 -1
  455. package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js +0 -253
  456. package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js.map +0 -1
  457. package/dist/chunks/helperFunctions-CNCeKea7.esm.js +0 -81
  458. package/dist/chunks/helperFunctions-CNCeKea7.esm.js.map +0 -1
  459. package/dist/chunks/helperFunctions-Crs36Q3w.esm.js +0 -109
  460. package/dist/chunks/helperFunctions-Crs36Q3w.esm.js.map +0 -1
  461. package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js +0 -2
  462. package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js.map +0 -1
  463. package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js +0 -2
  464. package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js.map +0 -1
  465. package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js +0 -189
  466. package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js.map +0 -1
  467. package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js +0 -2
  468. package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js.map +0 -1
  469. package/dist/chunks/index-5L5wXyrx.esm.js +0 -74870
  470. package/dist/chunks/index-5L5wXyrx.esm.js.map +0 -1
  471. package/dist/chunks/index-B5KLkjYm.esm.min.js +0 -57
  472. package/dist/chunks/index-B5KLkjYm.esm.min.js.map +0 -1
  473. package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js +0 -814
  474. package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js.map +0 -1
  475. package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js +0 -2
  476. package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js.map +0 -1
  477. package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js +0 -35
  478. package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js.map +0 -1
  479. package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js +0 -11
  480. package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js.map +0 -1
  481. package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js +0 -2
  482. package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js.map +0 -1
  483. package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js +0 -2
  484. package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js.map +0 -1
  485. package/dist/chunks/logDepthVertex-BOepIJij.esm.js +0 -77
  486. package/dist/chunks/logDepthVertex-BOepIJij.esm.js.map +0 -1
  487. package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js +0 -2
  488. package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js.map +0 -1
  489. package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js +0 -81
  490. package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js.map +0 -1
  491. package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js +0 -2
  492. package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js.map +0 -1
  493. package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js +0 -11
  494. package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js.map +0 -1
  495. package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js +0 -2
  496. package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js.map +0 -1
  497. package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js +0 -11
  498. package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js.map +0 -1
  499. package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.js +0 -2
  500. package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.js.map +0 -1
  501. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +0 -119
  502. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +0 -1
  503. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +0 -2
  504. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +0 -1
  505. package/dist/chunks/meshUboDeclaration-BWuUYN5-.esm.js +0 -26
  506. package/dist/chunks/meshUboDeclaration-BWuUYN5-.esm.js.map +0 -1
  507. package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js +0 -2
  508. package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js.map +0 -1
  509. package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js +0 -2
  510. package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js.map +0 -1
  511. package/dist/chunks/objFileLoader-BjHr-pn1.esm.js +0 -1338
  512. package/dist/chunks/objFileLoader-BjHr-pn1.esm.js.map +0 -1
  513. package/dist/chunks/oitFragment-BypZDJVo.esm.min.js +0 -2
  514. package/dist/chunks/oitFragment-BypZDJVo.esm.min.js.map +0 -1
  515. package/dist/chunks/oitFragment-D3g8w3hO.esm.js +0 -1078
  516. package/dist/chunks/oitFragment-D3g8w3hO.esm.js.map +0 -1
  517. package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js +0 -2
  518. package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js.map +0 -1
  519. package/dist/chunks/oitFragment-tQJLudg5.esm.js +0 -1240
  520. package/dist/chunks/oitFragment-tQJLudg5.esm.js.map +0 -1
  521. package/dist/chunks/pass.fragment-C8CWeVkM.esm.js +0 -15
  522. package/dist/chunks/pass.fragment-C8CWeVkM.esm.js.map +0 -1
  523. package/dist/chunks/pass.fragment-CSK2ynPe.esm.js +0 -15
  524. package/dist/chunks/pass.fragment-CSK2ynPe.esm.js.map +0 -1
  525. package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js +0 -2
  526. package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js.map +0 -1
  527. package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js +0 -2
  528. package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js.map +0 -1
  529. package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js +0 -3269
  530. package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js.map +0 -1
  531. package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js +0 -2
  532. package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js.map +0 -1
  533. package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js +0 -3222
  534. package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js.map +0 -1
  535. package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js +0 -2
  536. package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js.map +0 -1
  537. package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js +0 -223
  538. package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js.map +0 -1
  539. package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js +0 -2
  540. package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js.map +0 -1
  541. package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js +0 -2
  542. package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js.map +0 -1
  543. package/dist/chunks/pbr.vertex-oQpu2zia.esm.js +0 -348
  544. package/dist/chunks/pbr.vertex-oQpu2zia.esm.js.map +0 -1
  545. package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js +0 -20
  546. package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js.map +0 -1
  547. package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js +0 -2
  548. package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js.map +0 -1
  549. package/dist/chunks/rawTexture-BVf9vm87.esm.js +0 -191
  550. package/dist/chunks/rawTexture-BVf9vm87.esm.js.map +0 -1
  551. package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js +0 -2
  552. package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js.map +0 -1
  553. package/dist/chunks/ray-BLVbie8S.esm.min.js +0 -2
  554. package/dist/chunks/ray-BLVbie8S.esm.min.js.map +0 -1
  555. package/dist/chunks/ray-C7H9vp-x.esm.js +0 -946
  556. package/dist/chunks/ray-C7H9vp-x.esm.js.map +0 -1
  557. package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js +0 -2
  558. package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js.map +0 -1
  559. package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js +0 -13
  560. package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js.map +0 -1
  561. package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js +0 -2
  562. package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js.map +0 -1
  563. package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js +0 -13
  564. package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js.map +0 -1
  565. package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js +0 -13
  566. package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js.map +0 -1
  567. package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js +0 -13
  568. package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js.map +0 -1
  569. package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js +0 -2
  570. package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js.map +0 -1
  571. package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js +0 -2
  572. package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js.map +0 -1
  573. package/dist/chunks/splatFileLoader-BkExyfY6.esm.js +0 -3379
  574. package/dist/chunks/splatFileLoader-BkExyfY6.esm.js.map +0 -1
  575. package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js +0 -2
  576. package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js.map +0 -1
  577. package/dist/chunks/spotLight-CFGRpcFc.esm.js +0 -701
  578. package/dist/chunks/spotLight-CFGRpcFc.esm.js.map +0 -1
  579. package/dist/chunks/spotLight-z5HIEQmM.esm.min.js +0 -2
  580. package/dist/chunks/spotLight-z5HIEQmM.esm.min.js.map +0 -1
  581. package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js +0 -2
  582. package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js.map +0 -1
  583. package/dist/chunks/standardMaterial-BJzDZ72T.esm.js +0 -1806
  584. package/dist/chunks/standardMaterial-BJzDZ72T.esm.js.map +0 -1
  585. package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js +0 -2
  586. package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js.map +0 -1
  587. package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js +0 -238
  588. package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js.map +0 -1
  589. package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js +0 -2
  590. package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js.map +0 -1
  591. package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js +0 -349
  592. package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js.map +0 -1
  593. package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js +0 -2
  594. package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js.map +0 -1
  595. package/dist/chunks/thinEngine-DGyFDxzW.esm.js +0 -3853
  596. package/dist/chunks/thinEngine-DGyFDxzW.esm.js.map +0 -1
  597. package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js +0 -2
  598. package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js.map +0 -1
  599. package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js +0 -314
  600. package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js.map +0 -1
  601. package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js +0 -2
  602. package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js.map +0 -1
  603. package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js +0 -421
  604. package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js.map +0 -1
  605. package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js +0 -531
  606. package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js.map +0 -1
  607. package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js +0 -2
  608. package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js.map +0 -1
  609. package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js +0 -11538
  610. package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js.map +0 -1
  611. package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.js +0 -2
  612. package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.js.map +0 -1
  613. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  614. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  615. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  616. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  617. package/lib/index.d.ts +0 -591
  618. package/lib/index.js +0 -2165
  619. package/lib/index.js.map +0 -1
@@ -0,0 +1,1375 @@
1
+ import { getConfigurationKey } from "../configuration/configuration.js";
2
+ import { ModelState } from "../model/viewerModel.js";
3
+ import { extendClassWithConfig, deepmerge } from "../helper/index.js";
4
+ import { ViewerLabs } from "../labs/viewerLabs.js";
5
+ import { getCustomOptimizerByName } from "../optimizer/custom/index.js";
6
+ import { Observable } from "@babylonjs/core/Misc/observable.js";
7
+ import { SceneOptimizer, SceneOptimizerOptions } from "@babylonjs/core/Misc/sceneOptimizer.js";
8
+ import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera.js";
9
+ import { Light } from "@babylonjs/core/Lights/light.js";
10
+ import { EnvironmentHelper } from "@babylonjs/core/Helpers/environmentHelper.js";
11
+ import { Color3, Quaternion, Vector3, Axis, Matrix } from "@babylonjs/core/Maths/math.js";
12
+ import { DefaultRenderingPipeline } from "@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js";
13
+ import { Animation } from "@babylonjs/core/Animations/index.js";
14
+ import { AnimationPropertiesOverride } from "@babylonjs/core/Animations/animationPropertiesOverride.js";
15
+ import { RenderTargetTexture } from "@babylonjs/core/Materials/Textures/renderTargetTexture.js";
16
+ import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
17
+ import { ShadowLight } from "@babylonjs/core/Lights/shadowLight.js";
18
+ import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture.js";
19
+ import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight.js";
20
+ import { Scalar } from "@babylonjs/core/Maths/math.scalar.js";
21
+ import { CreatePlane } from "@babylonjs/core/Meshes/Builders/planeBuilder.js";
22
+ import { Tags } from "@babylonjs/core/Misc/tags.js";
23
+ import { Scene } from "@babylonjs/core/scene.js";
24
+ import { ShadowGenerator } from "@babylonjs/core/Lights/Shadows/shadowGenerator.js";
25
+ import { Constants } from "@babylonjs/core/Engines/constants.js";
26
+ import "@babylonjs/core/Audio/audioSceneComponent.js";
27
+ import "@babylonjs/core/Helpers/sceneHelpers.js";
28
+ import "@babylonjs/core/Misc/observable.extensions.js";
29
+ var SceneManager = /** @class */ (function () {
30
+ function SceneManager(_engine, _configurationContainer, _observablesManager) {
31
+ var _this = this;
32
+ this._engine = _engine;
33
+ this._configurationContainer = _configurationContainer;
34
+ this._observablesManager = _observablesManager;
35
+ this._white = Color3.White();
36
+ this._forceShadowUpdate = false;
37
+ this._processShadows = true;
38
+ this._groundEnabled = true;
39
+ this._groundMirrorEnabled = true;
40
+ this._defaultRenderingPipelineEnabled = false;
41
+ this._globalConfiguration = {};
42
+ this._defaultRenderingPipelineShouldBuild = true;
43
+ // default from rendering pipeline
44
+ this._bloomEnabled = false;
45
+ // default from rendering pipeline
46
+ this._fxaaEnabled = false;
47
+ this._focusOnModel = function (model) {
48
+ var boundingInfo = model.rootMesh.getHierarchyBoundingVectors(true);
49
+ var sizeVec = boundingInfo.max.subtract(boundingInfo.min);
50
+ var halfSizeVec = sizeVec.scale(0.5);
51
+ var center = boundingInfo.min.add(halfSizeVec);
52
+ _this.camera.setTarget(center);
53
+ _this.camera.alpha = (_this._globalConfiguration.camera && _this._globalConfiguration.camera.alpha) || _this.camera.alpha;
54
+ _this.camera.beta = (_this._globalConfiguration.camera && _this._globalConfiguration.camera.beta) || _this.camera.beta;
55
+ _this.camera.radius = (_this._globalConfiguration.camera && _this._globalConfiguration.camera.radius) || _this.camera.radius;
56
+ var sceneDiagonalLenght = sizeVec.length();
57
+ if (isFinite(sceneDiagonalLenght)) {
58
+ _this.camera.upperRadiusLimit = sceneDiagonalLenght * 4;
59
+ }
60
+ if (_this._configurationContainer.configuration) {
61
+ _this._configureEnvironment(_this._configurationContainer.configuration.skybox, _this._configurationContainer.configuration.ground);
62
+ }
63
+ /*this.scene.lights.filter(light => light instanceof ShadowLight).forEach(light => {
64
+ // casting ais safe, due to the constraints tested before
65
+ (<ShadowLight>light).setDirectionToTarget(center);
66
+ });*/
67
+ };
68
+ this._cameraBehaviorMapping = {};
69
+ this.models = [];
70
+ this.onCameraConfiguredObservable = new Observable();
71
+ this.onLightsConfiguredObservable = new Observable();
72
+ this.onModelsConfiguredObservable = new Observable();
73
+ this.onSceneConfiguredObservable = new Observable();
74
+ this.onSceneInitObservable = new Observable(undefined, true);
75
+ this.onSceneOptimizerConfiguredObservable = new Observable();
76
+ this.onEnvironmentConfiguredObservable = new Observable();
77
+ this.onVRConfiguredObservable = new Observable();
78
+ //this._viewer.onEngineInitObservable.add(() => {
79
+ this._handleHardwareLimitations();
80
+ //});
81
+ this.onSceneInitObservable.add(function (scene) {
82
+ _this.scene.animationPropertiesOverride = _this.scene.animationPropertiesOverride || new AnimationPropertiesOverride();
83
+ _this.labs = new ViewerLabs(scene);
84
+ var updateShadows = function () {
85
+ for (var _i = 0, _a = _this.scene.lights; _i < _a.length; _i++) {
86
+ var light = _a[_i];
87
+ var generators = light.getShadowGenerators();
88
+ if (generators) {
89
+ // Processing shadows if animates
90
+ var iterator = generators.values();
91
+ for (var key = iterator.next(); key.done !== true; key = iterator.next()) {
92
+ var generator = key.value;
93
+ var shadowMap = generator.getShadowMap();
94
+ if (shadowMap) {
95
+ shadowMap.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
96
+ }
97
+ }
98
+ }
99
+ }
100
+ };
101
+ scene.registerBeforeRender(function () {
102
+ if (_this._forceShadowUpdate || (scene.animatables && scene.animatables.length > 0)) {
103
+ // make sure all models are loaded
104
+ updateShadows();
105
+ _this._forceShadowUpdate = false;
106
+ }
107
+ else if (!_this.models.every(function (model) {
108
+ if (!model.shadowsRenderedAfterLoad) {
109
+ model.shadowsRenderedAfterLoad = true;
110
+ return false;
111
+ }
112
+ return model.state === ModelState.COMPLETE && !model.currentAnimation;
113
+ })) {
114
+ updateShadows();
115
+ }
116
+ });
117
+ return _this._observablesManager && _this._observablesManager.onSceneInitObservable.notifyObserversWithPromise(_this.scene);
118
+ });
119
+ if (this._observablesManager) {
120
+ this._observablesManager.onModelLoadedObservable.add(function (model) {
121
+ for (var _i = 0, _a = _this.scene.lights; _i < _a.length; _i++) {
122
+ var light = _a[_i];
123
+ var generators = light.getShadowGenerators();
124
+ if (generators) {
125
+ // Processing shadows if animates
126
+ var iterator = generators.values();
127
+ for (var key = iterator.next(); key.done !== true; key = iterator.next()) {
128
+ var generator = key.value;
129
+ var shadowMap = generator.getShadowMap();
130
+ if (shadowMap) {
131
+ shadowMap.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
132
+ }
133
+ }
134
+ }
135
+ }
136
+ _this._focusOnModel(model);
137
+ });
138
+ this._observablesManager.onModelAddedObservable.add(function (model) {
139
+ _this.models.push(model);
140
+ });
141
+ this._observablesManager.onModelRemovedObservable.add(function (model) {
142
+ _this.models.splice(_this.models.indexOf(model), 1);
143
+ });
144
+ }
145
+ }
146
+ Object.defineProperty(SceneManager.prototype, "defaultRenderingPipeline", {
147
+ get: function () {
148
+ return this._defaultRenderingPipeline;
149
+ },
150
+ enumerable: false,
151
+ configurable: true
152
+ });
153
+ Object.defineProperty(SceneManager.prototype, "vrHelper", {
154
+ get: function () {
155
+ return this._vrHelper;
156
+ },
157
+ enumerable: false,
158
+ configurable: true
159
+ });
160
+ Object.defineProperty(SceneManager.prototype, "isHdrSupported", {
161
+ /**
162
+ * Returns a boolean representing HDR support
163
+ */
164
+ get: function () {
165
+ return this._hdrSupport;
166
+ },
167
+ enumerable: false,
168
+ configurable: true
169
+ });
170
+ Object.defineProperty(SceneManager.prototype, "mainColor", {
171
+ /**
172
+ * Return the main color defined in the configuration.
173
+ */
174
+ get: function () {
175
+ return this._configurationContainer.mainColor;
176
+ },
177
+ enumerable: false,
178
+ configurable: true
179
+ });
180
+ Object.defineProperty(SceneManager.prototype, "reflectionColor", {
181
+ get: function () {
182
+ return this._configurationContainer.reflectionColor;
183
+ },
184
+ enumerable: false,
185
+ configurable: true
186
+ });
187
+ Object.defineProperty(SceneManager.prototype, "animationBlendingEnabled", {
188
+ get: function () {
189
+ return this.scene && this.scene.animationPropertiesOverride.enableBlending;
190
+ },
191
+ set: function (value) {
192
+ this.scene.animationPropertiesOverride.enableBlending = value;
193
+ },
194
+ enumerable: false,
195
+ configurable: true
196
+ });
197
+ Object.defineProperty(SceneManager.prototype, "observablesManager", {
198
+ get: function () {
199
+ return this._observablesManager;
200
+ },
201
+ enumerable: false,
202
+ configurable: true
203
+ });
204
+ Object.defineProperty(SceneManager.prototype, "processShadows", {
205
+ /**
206
+ * The flag defining whether shadows are rendered constantly or once.
207
+ */
208
+ get: function () {
209
+ return this._processShadows;
210
+ },
211
+ /**
212
+ * Should shadows be rendered every frame, or only once and stop.
213
+ * This can be used to optimize a scene.
214
+ *
215
+ * Not that the shadows will NOT disapear but will remain in place.
216
+ * @param process if true shadows will be updated once every frame. if false they will stop being updated.
217
+ */
218
+ set: function (process) {
219
+ var refreshType = process ? RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME : RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
220
+ for (var _i = 0, _a = this.scene.lights; _i < _a.length; _i++) {
221
+ var light = _a[_i];
222
+ var generators = light.getShadowGenerators();
223
+ if (generators) {
224
+ var iterator = generators.values();
225
+ for (var key = iterator.next(); key.done !== true; key = iterator.next()) {
226
+ var generator = key.value;
227
+ var shadowMap = generator.getShadowMap();
228
+ if (shadowMap) {
229
+ shadowMap.refreshRate = refreshType;
230
+ }
231
+ }
232
+ }
233
+ }
234
+ this._processShadows = process;
235
+ },
236
+ enumerable: false,
237
+ configurable: true
238
+ });
239
+ Object.defineProperty(SceneManager.prototype, "groundEnabled", {
240
+ get: function () {
241
+ return this._groundEnabled;
242
+ },
243
+ set: function (newValue) {
244
+ if (newValue === this._groundEnabled) {
245
+ return;
246
+ }
247
+ this._groundEnabled = newValue;
248
+ if (this.environmentHelper && this.environmentHelper.ground) {
249
+ this.environmentHelper.ground.setEnabled(this._groundEnabled);
250
+ }
251
+ },
252
+ enumerable: false,
253
+ configurable: true
254
+ });
255
+ Object.defineProperty(SceneManager.prototype, "groundMirrorEnabled", {
256
+ /**
257
+ * gets whether the reflection is disabled.
258
+ */
259
+ get: function () {
260
+ return this._groundMirrorEnabled;
261
+ },
262
+ /**
263
+ * sets whether the reflection is disabled.
264
+ */
265
+ set: function (value) {
266
+ if (this._groundMirrorEnabled === value) {
267
+ return;
268
+ }
269
+ this._groundMirrorEnabled = value;
270
+ if (this.environmentHelper && this.environmentHelper.groundMaterial && this.environmentHelper.groundMirror) {
271
+ if (!value) {
272
+ this.environmentHelper.groundMaterial.reflectionTexture = null;
273
+ }
274
+ else {
275
+ this.environmentHelper.groundMaterial.reflectionTexture = this.environmentHelper.groundMirror;
276
+ }
277
+ }
278
+ },
279
+ enumerable: false,
280
+ configurable: true
281
+ });
282
+ Object.defineProperty(SceneManager.prototype, "defaultRenderingPipelineEnabled", {
283
+ get: function () {
284
+ return this._defaultRenderingPipelineEnabled;
285
+ },
286
+ set: function (value) {
287
+ if (value === this._defaultRenderingPipelineEnabled) {
288
+ return;
289
+ }
290
+ this._defaultRenderingPipelineEnabled = value;
291
+ this._rebuildPostprocesses();
292
+ if (this._defaultRenderingPipeline) {
293
+ this._defaultRenderingPipelineShouldBuild = false;
294
+ this._defaultRenderingPipeline.prepare();
295
+ this.scene.imageProcessingConfiguration.applyByPostProcess = true;
296
+ }
297
+ },
298
+ enumerable: false,
299
+ configurable: true
300
+ });
301
+ /**
302
+ * Sets the engine flags to unlock all babylon features.
303
+ * Can also be configured using the scene.flags configuration object
304
+ */
305
+ SceneManager.prototype.unlockBabylonFeatures = function () {
306
+ this.scene.shadowsEnabled = true;
307
+ this.scene.particlesEnabled = true;
308
+ this.scene.postProcessesEnabled = true;
309
+ this.scene.collisionsEnabled = true;
310
+ this.scene.lightsEnabled = true;
311
+ this.scene.texturesEnabled = true;
312
+ this.scene.lensFlaresEnabled = true;
313
+ this.scene.proceduralTexturesEnabled = true;
314
+ this.scene.renderTargetsEnabled = true;
315
+ this.scene.spritesEnabled = true;
316
+ this.scene.skeletonsEnabled = true;
317
+ this.scene.audioEnabled = true;
318
+ };
319
+ /**
320
+ * initialize the scene. Calling this function again will dispose the old scene, if exists.
321
+ * @param sceneConfiguration the configuration of the scene
322
+ * @returns a promise that resolves when the scene is ready
323
+ */
324
+ SceneManager.prototype.initScene = function (sceneConfiguration) {
325
+ if (sceneConfiguration === void 0) { sceneConfiguration = {}; }
326
+ // if the scene exists, dispose it.
327
+ if (this.scene) {
328
+ this.scene.dispose();
329
+ }
330
+ // create a new scene
331
+ this.scene = new Scene(this._engine);
332
+ this._configurationContainer.scene = this.scene;
333
+ // set a default PBR material
334
+ if (!sceneConfiguration.defaultMaterial) {
335
+ var defaultMaterial = new PBRMaterial("defaultMaterial", this.scene);
336
+ defaultMaterial.reflectivityColor = new Color3(0.1, 0.1, 0.1);
337
+ defaultMaterial.microSurface = 0.6;
338
+ if (this.scene.defaultMaterial) {
339
+ this.scene.defaultMaterial.dispose();
340
+ }
341
+ this.scene.defaultMaterial = defaultMaterial;
342
+ }
343
+ this.scene.animationPropertiesOverride = new AnimationPropertiesOverride();
344
+ Animation.AllowMatricesInterpolation = true;
345
+ /*if (sceneConfiguration.glow) {
346
+ let options: Partial<IGlowLayerOptions> = {
347
+ mainTextureFixedSize: 512
348
+ };
349
+ if (typeof sceneConfiguration.glow === 'object') {
350
+ options = sceneConfiguration.glow
351
+ }
352
+ var gl = new GlowLayer("glow", this.scene, options);
353
+ }*/
354
+ return this.onSceneInitObservable.notifyObserversWithPromise(this.scene);
355
+ };
356
+ SceneManager.prototype.clearScene = function (clearModels, clearLights) {
357
+ if (clearModels === void 0) { clearModels = true; }
358
+ if (clearLights === void 0) { clearLights = false; }
359
+ if (clearModels) {
360
+ this.models.forEach(function (m) { return m.dispose(); });
361
+ this.models.length = 0;
362
+ }
363
+ if (clearLights) {
364
+ this.scene.lights.forEach(function (l) { return l.dispose(); });
365
+ }
366
+ };
367
+ /**
368
+ * This will update the scene's configuration, including camera, lights, environment.
369
+ * @param newConfiguration the delta that should be configured. This includes only the changes
370
+ */
371
+ SceneManager.prototype.updateConfiguration = function (newConfiguration) {
372
+ var _this = this;
373
+ if (this._configurationContainer) {
374
+ this._globalConfiguration = this._configurationContainer.configuration;
375
+ }
376
+ else {
377
+ this._globalConfiguration = newConfiguration;
378
+ }
379
+ // update scene configuration
380
+ if (newConfiguration.scene) {
381
+ this._configureScene(newConfiguration.scene);
382
+ }
383
+ // optimizer
384
+ if (newConfiguration.optimizer !== undefined) {
385
+ this._configureOptimizer(newConfiguration.optimizer);
386
+ }
387
+ // configure model
388
+ /*if (newConfiguration.model && typeof newConfiguration.model === 'object') {
389
+ this._configureModel(newConfiguration.model);
390
+ }*/
391
+ // lights
392
+ this._configureLights(newConfiguration.lights);
393
+ // environment
394
+ if (newConfiguration.skybox !== undefined || newConfiguration.ground !== undefined) {
395
+ this._configureEnvironment(newConfiguration.skybox, newConfiguration.ground);
396
+ }
397
+ // camera
398
+ this._configureCamera(newConfiguration.camera);
399
+ if (newConfiguration.environmentMap !== undefined) {
400
+ this._configureEnvironmentMap(newConfiguration.environmentMap);
401
+ }
402
+ if (newConfiguration.vr !== undefined) {
403
+ this._configureVR(newConfiguration.vr);
404
+ }
405
+ if (newConfiguration.lab) {
406
+ // rendering pipelines
407
+ if (newConfiguration.lab.defaultRenderingPipelines) {
408
+ var pipelineConfig = newConfiguration.lab.defaultRenderingPipelines;
409
+ if (typeof pipelineConfig === "boolean") {
410
+ this.defaultRenderingPipelineEnabled = pipelineConfig;
411
+ }
412
+ else {
413
+ this.defaultRenderingPipelineEnabled = true;
414
+ }
415
+ }
416
+ if (this.environmentHelper && newConfiguration.lab.environmentMainColor) {
417
+ var mainColor = new Color3(newConfiguration.lab.environmentMainColor.r, newConfiguration.lab.environmentMainColor.g, newConfiguration.lab.environmentMainColor.b);
418
+ this.environmentHelper.setMainColor(mainColor);
419
+ }
420
+ if (newConfiguration.lab.globalLightRotation !== undefined) {
421
+ // rotate all lights that are shadow lights
422
+ this.scene.lights
423
+ .filter(function (light) { return light instanceof ShadowLight; })
424
+ .forEach(function (light) {
425
+ // casting and '!' are safe, due to the constraints tested before
426
+ _this.labs.rotateShadowLight(light, newConfiguration.lab.globalLightRotation);
427
+ });
428
+ this._forceShadowUpdate = true;
429
+ }
430
+ }
431
+ if (this._defaultRenderingPipeline && this._defaultRenderingPipeline.imageProcessing) {
432
+ this._defaultRenderingPipeline.imageProcessing.fromLinearSpace = true;
433
+ }
434
+ if (this._defaultRenderingPipelineShouldBuild && this._defaultRenderingPipeline) {
435
+ this._defaultRenderingPipelineShouldBuild = false;
436
+ this._defaultRenderingPipeline.prepare();
437
+ }
438
+ };
439
+ SceneManager.prototype._rebuildPostprocesses = function (configuration) {
440
+ if (!this._defaultRenderingPipelineEnabled || !getConfigurationKey("scene.imageProcessingConfiguration.isEnabled", this._globalConfiguration)) {
441
+ if (this._defaultRenderingPipeline) {
442
+ this._defaultRenderingPipeline.dispose();
443
+ this._defaultRenderingPipeline = null;
444
+ this.scene.autoClearDepthAndStencil = true;
445
+ this.scene.autoClear = true;
446
+ this.scene.imageProcessingConfiguration.applyByPostProcess = false;
447
+ }
448
+ return;
449
+ }
450
+ var pipelineConfig = configuration || (this._globalConfiguration.lab && this._globalConfiguration.lab.defaultRenderingPipelines);
451
+ if (pipelineConfig) {
452
+ if (!this._defaultRenderingPipeline) {
453
+ // Create pipeline in manual mode to avoid triggering multiple shader compilations
454
+ this._defaultRenderingPipeline = new DefaultRenderingPipeline("default rendering pipeline", this._hdrSupport, this.scene, [this.camera], false);
455
+ }
456
+ this.scene.autoClear = false;
457
+ this.scene.autoClearDepthAndStencil = false;
458
+ this._defaultRenderingPipelineShouldBuild = true;
459
+ var bloomEnabled = this._bloomEnabled;
460
+ if (typeof pipelineConfig !== "boolean") {
461
+ extendClassWithConfig(this._defaultRenderingPipeline, pipelineConfig);
462
+ this._bloomEnabled = !!pipelineConfig.bloomEnabled;
463
+ this._fxaaEnabled = !!pipelineConfig.fxaaEnabled;
464
+ bloomEnabled = this._bloomEnabled && pipelineConfig.bloomWeight !== undefined && pipelineConfig.bloomWeight > 0;
465
+ this._defaultRenderingPipeline.bloomWeight = (pipelineConfig.bloomWeight !== undefined && pipelineConfig.bloomWeight) || this._defaultRenderingPipeline.bloomWeight;
466
+ }
467
+ this._defaultRenderingPipeline.bloomEnabled = bloomEnabled;
468
+ this._defaultRenderingPipeline.fxaaEnabled = this.fxaaEnabled;
469
+ }
470
+ };
471
+ Object.defineProperty(SceneManager.prototype, "bloomEnabled", {
472
+ get: function () {
473
+ return this._bloomEnabled;
474
+ },
475
+ set: function (value) {
476
+ if (this._bloomEnabled === value) {
477
+ return;
478
+ }
479
+ this._bloomEnabled = value;
480
+ this._rebuildPostprocesses();
481
+ if (this._defaultRenderingPipeline) {
482
+ this._defaultRenderingPipelineShouldBuild = false;
483
+ this._defaultRenderingPipeline.prepare();
484
+ this.scene.imageProcessingConfiguration.applyByPostProcess = true;
485
+ }
486
+ },
487
+ enumerable: false,
488
+ configurable: true
489
+ });
490
+ Object.defineProperty(SceneManager.prototype, "fxaaEnabled", {
491
+ get: function () {
492
+ return this._fxaaEnabled;
493
+ },
494
+ set: function (value) {
495
+ if (this._fxaaEnabled === value) {
496
+ return;
497
+ }
498
+ this._fxaaEnabled = value;
499
+ this._rebuildPostprocesses();
500
+ if (this._defaultRenderingPipeline) {
501
+ this._defaultRenderingPipelineShouldBuild = false;
502
+ this._defaultRenderingPipeline.prepare();
503
+ this.scene.imageProcessingConfiguration.applyByPostProcess = true;
504
+ }
505
+ },
506
+ enumerable: false,
507
+ configurable: true
508
+ });
509
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
510
+ SceneManager.prototype.setDefaultMaterial = function (sceneConfig) { };
511
+ /**
512
+ * internally configure the scene using the provided configuration.
513
+ * The scene will not be recreated, but just updated.
514
+ * @param sceneConfig the (new) scene configuration
515
+ */
516
+ SceneManager.prototype._configureScene = function (sceneConfig) {
517
+ // sanity check!
518
+ if (!this.scene) {
519
+ return;
520
+ }
521
+ var cc = sceneConfig.clearColor;
522
+ var oldcc = this.scene.clearColor;
523
+ if (cc) {
524
+ if (cc.r !== undefined) {
525
+ oldcc.r = cc.r;
526
+ }
527
+ if (cc.g !== undefined) {
528
+ oldcc.g = cc.g;
529
+ }
530
+ if (cc.b !== undefined) {
531
+ oldcc.b = cc.b;
532
+ }
533
+ if (cc.a !== undefined) {
534
+ oldcc.a = cc.a;
535
+ }
536
+ }
537
+ if (sceneConfig.assetsRootURL) {
538
+ this._assetsRootURL = sceneConfig.assetsRootURL;
539
+ }
540
+ // image processing configuration - optional.
541
+ if (sceneConfig.imageProcessingConfiguration) {
542
+ extendClassWithConfig(this.scene.imageProcessingConfiguration, sceneConfig.imageProcessingConfiguration);
543
+ }
544
+ //animation properties override
545
+ if (sceneConfig.animationPropertiesOverride) {
546
+ extendClassWithConfig(this.scene.animationPropertiesOverride, sceneConfig.animationPropertiesOverride);
547
+ }
548
+ if (sceneConfig.environmentTexture) {
549
+ if (!(this.scene.environmentTexture && this.scene.environmentTexture.url === sceneConfig.environmentTexture)) {
550
+ if (this.scene.environmentTexture && this.scene.environmentTexture.dispose) {
551
+ this.scene.environmentTexture.dispose();
552
+ }
553
+ var environmentTexture = CubeTexture.CreateFromPrefilteredData(sceneConfig.environmentTexture, this.scene);
554
+ this.scene.environmentTexture = environmentTexture;
555
+ }
556
+ }
557
+ if (sceneConfig.debug === true) {
558
+ this.scene.debugLayer.show();
559
+ }
560
+ else if (sceneConfig.debug === false) {
561
+ if (this.scene.debugLayer.isVisible()) {
562
+ this.scene.debugLayer.hide();
563
+ }
564
+ }
565
+ if (sceneConfig.disableHdr) {
566
+ this._handleHardwareLimitations(false);
567
+ }
568
+ else {
569
+ this._handleHardwareLimitations(true);
570
+ }
571
+ if (sceneConfig.renderInBackground !== undefined) {
572
+ this._engine.renderEvenInBackground = !!sceneConfig.renderInBackground;
573
+ }
574
+ var canvas = this._engine.getInputElement();
575
+ if (canvas) {
576
+ if (this.camera && sceneConfig.disableCameraControl) {
577
+ this.camera.detachControl();
578
+ }
579
+ else if (this.camera && sceneConfig.disableCameraControl === false) {
580
+ this.camera.attachControl();
581
+ }
582
+ }
583
+ this.setDefaultMaterial(sceneConfig);
584
+ if (sceneConfig.flags) {
585
+ extendClassWithConfig(this.scene, sceneConfig.flags);
586
+ }
587
+ this.onSceneConfiguredObservable.notifyObservers({
588
+ sceneManager: this,
589
+ object: this.scene,
590
+ newConfiguration: sceneConfig,
591
+ });
592
+ };
593
+ /**
594
+ * Configure the scene optimizer.
595
+ * The existing scene optimizer will be disposed and a new one will be created.
596
+ * @param optimizerConfig the (new) optimizer configuration
597
+ */
598
+ SceneManager.prototype._configureOptimizer = function (optimizerConfig) {
599
+ var _this = this;
600
+ if (typeof optimizerConfig === "boolean") {
601
+ if (this.sceneOptimizer) {
602
+ this.sceneOptimizer.stop();
603
+ this.sceneOptimizer.dispose();
604
+ delete this.sceneOptimizer;
605
+ }
606
+ if (optimizerConfig) {
607
+ this.sceneOptimizer = new SceneOptimizer(this.scene);
608
+ this.sceneOptimizer.start();
609
+ }
610
+ }
611
+ else {
612
+ var optimizerOptions = new SceneOptimizerOptions(optimizerConfig.targetFrameRate, optimizerConfig.trackerDuration);
613
+ // check for degradation
614
+ if (optimizerConfig.degradation) {
615
+ switch (optimizerConfig.degradation) {
616
+ case "low":
617
+ optimizerOptions = SceneOptimizerOptions.LowDegradationAllowed(optimizerConfig.targetFrameRate);
618
+ break;
619
+ case "moderate":
620
+ optimizerOptions = SceneOptimizerOptions.ModerateDegradationAllowed(optimizerConfig.targetFrameRate);
621
+ break;
622
+ case "hight":
623
+ optimizerOptions = SceneOptimizerOptions.HighDegradationAllowed(optimizerConfig.targetFrameRate);
624
+ break;
625
+ }
626
+ }
627
+ if (this.sceneOptimizer) {
628
+ this.sceneOptimizer.stop();
629
+ this.sceneOptimizer.dispose();
630
+ }
631
+ if (optimizerConfig.custom) {
632
+ var customOptimizer_1 = getCustomOptimizerByName(optimizerConfig.custom, optimizerConfig.improvementMode);
633
+ if (customOptimizer_1) {
634
+ optimizerOptions.addCustomOptimization(function () {
635
+ return customOptimizer_1(_this);
636
+ }, function () {
637
+ return "Babylon Viewer ".concat(optimizerConfig.custom, " custom optimization");
638
+ });
639
+ }
640
+ }
641
+ this.sceneOptimizer = new SceneOptimizer(this.scene, optimizerOptions, optimizerConfig.autoGeneratePriorities, optimizerConfig.improvementMode);
642
+ this.sceneOptimizer.start();
643
+ }
644
+ this.onSceneOptimizerConfiguredObservable.notifyObservers({
645
+ sceneManager: this,
646
+ object: this.sceneOptimizer,
647
+ newConfiguration: optimizerConfig,
648
+ });
649
+ };
650
+ /**
651
+ * configure all models using the configuration.
652
+ * @param modelConfiguration the configuration to use to reconfigure the models
653
+ */
654
+ /*protected _configureModel(modelConfiguration: Partial<IModelConfiguration>) {
655
+ this.models.forEach(model => {
656
+ model.updateConfiguration(modelConfiguration);
657
+ });
658
+
659
+ this.onModelsConfiguredObservable.notifyObservers({
660
+ sceneManager: this,
661
+ object: this.models,
662
+ newConfiguration: modelConfiguration
663
+ });
664
+ }*/
665
+ SceneManager.prototype._configureVR = function (vrConfig) {
666
+ var _this = this;
667
+ if (vrConfig.disabled) {
668
+ if (this._vrHelper) {
669
+ if (this._vrHelper.isInVRMode) {
670
+ this._vrHelper.exitVR();
671
+ }
672
+ this._vrHelper.dispose();
673
+ this._vrHelper = undefined;
674
+ }
675
+ return;
676
+ }
677
+ var vrOptions = deepmerge({
678
+ useCustomVRButton: true,
679
+ createDeviceOrientationCamera: false,
680
+ trackPosition: true,
681
+ }, vrConfig.vrOptions || {});
682
+ this._vrHelper = this.scene.createDefaultVRExperience(vrOptions);
683
+ if (!vrConfig.disableInteractions) {
684
+ this._vrHelper.enableInteractions();
685
+ }
686
+ if (!vrConfig.disableTeleportation) {
687
+ var floorMeshName = vrConfig.overrideFloorMeshName || "BackgroundPlane";
688
+ this._vrHelper.enableTeleportation({
689
+ floorMeshName: floorMeshName,
690
+ });
691
+ }
692
+ this._vrHelper.onEnteringVRObservable.add(function () {
693
+ if (_this._observablesManager) {
694
+ _this._observablesManager.onEnteringVRObservable.notifyObservers(_this);
695
+ }
696
+ });
697
+ this._vrHelper.onExitingVRObservable.add(function () {
698
+ if (_this._observablesManager) {
699
+ _this._observablesManager.onExitingVRObservable.notifyObservers(_this);
700
+ }
701
+ });
702
+ this.onVRConfiguredObservable.notifyObservers({
703
+ sceneManager: this,
704
+ object: this._vrHelper,
705
+ newConfiguration: vrConfig,
706
+ });
707
+ };
708
+ SceneManager.prototype._configureEnvironmentMap = function (environmentMapConfiguration) {
709
+ if (environmentMapConfiguration.texture) {
710
+ this.scene.environmentTexture = new CubeTexture(this._getAssetUrl(environmentMapConfiguration.texture), this.scene);
711
+ }
712
+ //sanity check
713
+ if (this.scene.environmentTexture) {
714
+ var rotatquatRotationionY = Quaternion.RotationAxis(Axis.Y, environmentMapConfiguration.rotationY || 0);
715
+ Matrix.FromQuaternionToRef(rotatquatRotationionY, this.scene.environmentTexture.getReflectionTextureMatrix());
716
+ }
717
+ // process mainColor changes:
718
+ if (environmentMapConfiguration.mainColor) {
719
+ this._configurationContainer.mainColor = this.mainColor || Color3.White();
720
+ var mc = environmentMapConfiguration.mainColor;
721
+ if (mc.r !== undefined) {
722
+ this.mainColor.r = mc.r;
723
+ }
724
+ if (mc.g !== undefined) {
725
+ this.mainColor.g = mc.g;
726
+ }
727
+ if (mc.b !== undefined) {
728
+ this.mainColor.b = mc.b;
729
+ }
730
+ this.reflectionColor.copyFrom(this.mainColor);
731
+ var environmentTint = getConfigurationKey("environmentMap.tintLevel", this._globalConfiguration) || 0;
732
+ // reflection color
733
+ this.reflectionColor.toLinearSpaceToRef(this.reflectionColor);
734
+ this.reflectionColor.scaleToRef(1 / this.scene.imageProcessingConfiguration.exposure, this.reflectionColor);
735
+ var tmpColor3 = Color3.Lerp(this._white, this.reflectionColor, environmentTint);
736
+ this.reflectionColor.copyFrom(tmpColor3);
737
+ //update the environment, if exists
738
+ if (this.environmentHelper) {
739
+ if (this.environmentHelper.groundMaterial) {
740
+ this.environmentHelper.groundMaterial._perceptualColor = this.mainColor;
741
+ }
742
+ if (this.environmentHelper.skyboxMaterial) {
743
+ this.environmentHelper.skyboxMaterial._perceptualColor = this.mainColor;
744
+ }
745
+ }
746
+ }
747
+ };
748
+ /**
749
+ * (Re) configure the camera. The camera will only be created once and from this point will only be reconfigured.
750
+ * @param cameraConfig the new camera configuration
751
+ */
752
+ SceneManager.prototype._configureCamera = function (cameraConfig) {
753
+ var _this = this;
754
+ if (cameraConfig === void 0) { cameraConfig = {}; }
755
+ if (!this.scene.activeCamera) {
756
+ // Inline scene.createDefaultCamera to reduce file size
757
+ // Dispose existing camera in replace mode.
758
+ if (this.scene.activeCamera) {
759
+ this.scene.activeCamera.dispose();
760
+ this.scene.activeCamera = null;
761
+ }
762
+ // Camera
763
+ if (!this.scene.activeCamera) {
764
+ var worldExtends = this.scene.getWorldExtends();
765
+ var worldSize = worldExtends.max.subtract(worldExtends.min);
766
+ var worldCenter = worldExtends.min.add(worldSize.scale(0.5));
767
+ var radius = worldSize.length() * 1.5;
768
+ // empty scene scenario!
769
+ if (!isFinite(radius)) {
770
+ radius = 1;
771
+ worldCenter.copyFromFloats(0, 0, 0);
772
+ }
773
+ var arcRotateCamera = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this.scene);
774
+ arcRotateCamera.lowerRadiusLimit = radius * 0.01;
775
+ arcRotateCamera.wheelPrecision = 100 / radius;
776
+ var camera = arcRotateCamera;
777
+ camera.minZ = radius * 0.01;
778
+ camera.maxZ = radius * 1000;
779
+ camera.speed = radius * 0.2;
780
+ this.scene.activeCamera = camera;
781
+ }
782
+ var canvas = this.scene.getEngine().getInputElement();
783
+ if (canvas) {
784
+ this.scene.activeCamera.attachControl();
785
+ }
786
+ this.camera = this.scene.activeCamera;
787
+ this.camera.setTarget(Vector3.Zero());
788
+ }
789
+ if (!this.camera) {
790
+ this.camera = this.scene.activeCamera;
791
+ }
792
+ if (cameraConfig.position) {
793
+ var newPosition = this.camera.position.clone();
794
+ extendClassWithConfig(newPosition, cameraConfig.position);
795
+ this.camera.setPosition(newPosition);
796
+ }
797
+ if (cameraConfig.target) {
798
+ var newTarget = this.camera.target.clone();
799
+ extendClassWithConfig(newTarget, cameraConfig.target);
800
+ this.camera.setTarget(newTarget);
801
+ } /*else if (this.models.length && !cameraConfig.disableAutoFocus) {
802
+ this._focusOnModel(this.models[0]);
803
+ }*/
804
+ if (cameraConfig.rotation) {
805
+ this.camera.rotationQuaternion = new Quaternion(cameraConfig.rotation.x || 0, cameraConfig.rotation.y || 0, cameraConfig.rotation.z || 0, cameraConfig.rotation.w || 0);
806
+ }
807
+ if (cameraConfig.behaviors) {
808
+ for (var name_1 in cameraConfig.behaviors) {
809
+ if (cameraConfig.behaviors[name_1] !== undefined) {
810
+ this._setCameraBehavior(name_1, cameraConfig.behaviors[name_1]);
811
+ }
812
+ }
813
+ }
814
+ var sceneExtends = this.scene.getWorldExtends(function (mesh) {
815
+ return !_this.environmentHelper || (mesh !== _this.environmentHelper.ground && mesh !== _this.environmentHelper.rootMesh && mesh !== _this.environmentHelper.skybox);
816
+ });
817
+ var sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);
818
+ var sceneDiagonalLength = sceneDiagonal.length();
819
+ if (isFinite(sceneDiagonalLength)) {
820
+ this.camera.upperRadiusLimit = sceneDiagonalLength * 4;
821
+ }
822
+ // sanity check!
823
+ if (this.scene.imageProcessingConfiguration) {
824
+ this.scene.imageProcessingConfiguration.colorCurvesEnabled = true;
825
+ this.scene.imageProcessingConfiguration.vignetteEnabled = true;
826
+ this.scene.imageProcessingConfiguration.toneMappingEnabled = !!getConfigurationKey("camera.toneMappingEnabled", this._globalConfiguration);
827
+ }
828
+ extendClassWithConfig(this.camera, cameraConfig);
829
+ this.onCameraConfiguredObservable.notifyObservers({
830
+ sceneManager: this,
831
+ object: this.camera,
832
+ newConfiguration: cameraConfig,
833
+ });
834
+ };
835
+ SceneManager.prototype._configureEnvironment = function (skyboxConifguration, groundConfiguration) {
836
+ var _this = this;
837
+ if (!skyboxConifguration && !groundConfiguration) {
838
+ if (this.environmentHelper) {
839
+ this.environmentHelper.dispose();
840
+ this.environmentHelper = undefined;
841
+ }
842
+ }
843
+ else {
844
+ var options = {
845
+ createGround: !!groundConfiguration && this._groundEnabled,
846
+ createSkybox: !!skyboxConifguration,
847
+ setupImageProcessing: false, // will be done at the scene level!,
848
+ };
849
+ // will that cause problems with model ground configuration?
850
+ /*if (model) {
851
+ const boundingInfo = model.rootMesh.getHierarchyBoundingVectors(true);
852
+ const sizeVec = boundingInfo.max.subtract(boundingInfo.min);
853
+ const halfSizeVec = sizeVec.scale(0.5);
854
+ const center = boundingInfo.min.add(halfSizeVec);
855
+ options.groundYBias = -center.y;
856
+ }*/
857
+ if (groundConfiguration) {
858
+ var groundConfig_1 = typeof groundConfiguration === "boolean" ? {} : groundConfiguration;
859
+ var groundSize = groundConfig_1.size || (typeof skyboxConifguration === "object" && skyboxConifguration.scale);
860
+ if (groundSize) {
861
+ options.groundSize = groundSize;
862
+ }
863
+ options.enableGroundShadow = groundConfiguration === true || groundConfig_1.receiveShadows;
864
+ if (groundConfig_1.shadowLevel !== undefined) {
865
+ options.groundShadowLevel = groundConfig_1.shadowLevel;
866
+ }
867
+ options.enableGroundMirror = !!groundConfig_1.mirror && this.groundMirrorEnabled;
868
+ if (groundConfig_1.texture) {
869
+ options.groundTexture = this._getAssetUrl(groundConfig_1.texture);
870
+ }
871
+ if (groundConfig_1.color) {
872
+ options.groundColor = new Color3(groundConfig_1.color.r, groundConfig_1.color.g, groundConfig_1.color.b);
873
+ }
874
+ if (groundConfig_1.opacity !== undefined) {
875
+ options.groundOpacity = groundConfig_1.opacity;
876
+ }
877
+ if (groundConfig_1.mirror) {
878
+ options.enableGroundMirror = true;
879
+ // to prevent undefines
880
+ if (typeof groundConfig_1.mirror === "object") {
881
+ if (groundConfig_1.mirror.amount !== undefined) {
882
+ options.groundMirrorAmount = groundConfig_1.mirror.amount;
883
+ }
884
+ if (groundConfig_1.mirror.sizeRatio !== undefined) {
885
+ options.groundMirrorSizeRatio = groundConfig_1.mirror.sizeRatio;
886
+ }
887
+ if (groundConfig_1.mirror.blurKernel !== undefined) {
888
+ options.groundMirrorBlurKernel = groundConfig_1.mirror.blurKernel;
889
+ }
890
+ if (groundConfig_1.mirror.fresnelWeight !== undefined) {
891
+ options.groundMirrorFresnelWeight = groundConfig_1.mirror.fresnelWeight;
892
+ }
893
+ if (groundConfig_1.mirror.fallOffDistance !== undefined) {
894
+ options.groundMirrorFallOffDistance = groundConfig_1.mirror.fallOffDistance;
895
+ }
896
+ if (this._defaultPipelineTextureType !== undefined) {
897
+ options.groundMirrorTextureType = this._defaultPipelineTextureType;
898
+ }
899
+ }
900
+ }
901
+ }
902
+ var postInitSkyboxMaterial = false;
903
+ if (skyboxConifguration) {
904
+ var conf = skyboxConifguration === true ? {} : skyboxConifguration;
905
+ if (conf.material && conf.material.imageProcessingConfiguration) {
906
+ options.setupImageProcessing = false; // will be configured later manually.
907
+ }
908
+ var skyboxSize = conf.scale;
909
+ if (skyboxSize) {
910
+ options.skyboxSize = skyboxSize;
911
+ }
912
+ options.sizeAuto = !options.skyboxSize;
913
+ if (conf.color) {
914
+ options.skyboxColor = new Color3(conf.color.r, conf.color.g, conf.color.b);
915
+ }
916
+ if (conf.cubeTexture && conf.cubeTexture.url) {
917
+ if (typeof conf.cubeTexture.url === "string") {
918
+ options.skyboxTexture = this._getAssetUrl(conf.cubeTexture.url);
919
+ }
920
+ else {
921
+ // init later!
922
+ postInitSkyboxMaterial = true;
923
+ }
924
+ }
925
+ if (conf.material) {
926
+ postInitSkyboxMaterial = true;
927
+ }
928
+ }
929
+ options.setupImageProcessing = false; // TMP
930
+ if (!this.environmentHelper) {
931
+ this.environmentHelper = new EnvironmentHelper(options, this.scene);
932
+ }
933
+ else {
934
+ // unlikely, but there might be a new scene! we need to dispose.
935
+ // get the scene used by the envHelper
936
+ var scene = this.environmentHelper.rootMesh.getScene();
937
+ // is it a different scene? Oh no!
938
+ if (scene !== this.scene) {
939
+ this.environmentHelper.dispose();
940
+ this.environmentHelper = new EnvironmentHelper(options, this.scene);
941
+ }
942
+ else {
943
+ // recreate the ground
944
+ if (this.environmentHelper.ground) {
945
+ this.environmentHelper.ground.dispose();
946
+ }
947
+ // recreate the skybox
948
+ if (this.environmentHelper.skybox) {
949
+ this.environmentHelper.skybox.dispose();
950
+ }
951
+ this.environmentHelper.updateOptions(options);
952
+ // update doesn't change the size of the skybox and ground, so we have to recreate!
953
+ //this.environmentHelper.dispose();
954
+ //this.environmentHelper = new EnvironmentHelper(options, this.scene);
955
+ }
956
+ }
957
+ if (this.environmentHelper.rootMesh && this._globalConfiguration.scene && this._globalConfiguration.scene.environmentRotationY !== undefined) {
958
+ this.environmentHelper.rootMesh.rotation.y = this._globalConfiguration.scene.environmentRotationY;
959
+ }
960
+ var groundConfig = typeof groundConfiguration === "boolean" ? {} : groundConfiguration;
961
+ if (this.environmentHelper.groundMaterial && groundConfig) {
962
+ this.environmentHelper.groundMaterial._perceptualColor = this.mainColor;
963
+ if (groundConfig.material) {
964
+ extendClassWithConfig(this.environmentHelper.groundMaterial, groundConfig.material);
965
+ }
966
+ if (this.environmentHelper.groundMirror) {
967
+ var mirrorClearColor = this.environmentHelper.groundMaterial._perceptualColor.toLinearSpace();
968
+ // TODO user camera exposure value to set the mirror clear color
969
+ var exposure = Math.pow(2.0, -this.scene.imageProcessingConfiguration.exposure) * Math.PI;
970
+ mirrorClearColor.scaleToRef(1 / exposure, mirrorClearColor);
971
+ this.environmentHelper.groundMirror.clearColor.r = Scalar.Clamp(mirrorClearColor.r);
972
+ this.environmentHelper.groundMirror.clearColor.g = Scalar.Clamp(mirrorClearColor.g);
973
+ this.environmentHelper.groundMirror.clearColor.b = Scalar.Clamp(mirrorClearColor.b);
974
+ this.environmentHelper.groundMirror.clearColor.a = 1;
975
+ if (!this.groundMirrorEnabled) {
976
+ this.environmentHelper.groundMaterial.reflectionTexture = null;
977
+ }
978
+ }
979
+ }
980
+ var skyboxMaterial = this.environmentHelper.skyboxMaterial;
981
+ if (skyboxMaterial) {
982
+ skyboxMaterial._perceptualColor = this.mainColor;
983
+ if (postInitSkyboxMaterial) {
984
+ if (typeof skyboxConifguration === "object" && skyboxConifguration.material) {
985
+ extendClassWithConfig(skyboxMaterial, skyboxConifguration.material);
986
+ }
987
+ }
988
+ }
989
+ }
990
+ this._observablesManager &&
991
+ this._observablesManager.onModelLoadedObservable.add(function (model) {
992
+ _this._updateGroundMirrorRenderList(model);
993
+ });
994
+ this.onEnvironmentConfiguredObservable.notifyObservers({
995
+ sceneManager: this,
996
+ object: this.environmentHelper,
997
+ newConfiguration: {
998
+ skybox: skyboxConifguration,
999
+ ground: groundConfiguration,
1000
+ },
1001
+ });
1002
+ };
1003
+ /**
1004
+ * configure the lights.
1005
+ * @param lightsConfiguration the (new) light(s) configuration
1006
+ */
1007
+ SceneManager.prototype._configureLights = function (lightsConfiguration) {
1008
+ var _this = this;
1009
+ if (lightsConfiguration === void 0) { lightsConfiguration = {}; }
1010
+ // sanity check!
1011
+ var lightKeys = Object.keys(lightsConfiguration).filter(function (name) { return name !== "globalRotation"; });
1012
+ if (!lightKeys.length) {
1013
+ if (!this.scene.lights.length) {
1014
+ new HemisphericLight("default light", Vector3.Up(), this.scene);
1015
+ }
1016
+ }
1017
+ else {
1018
+ var lightsAvailable_1 = this.scene.lights.map(function (light) { return light.name; });
1019
+ // compare to the global (!) configuration object and dispose unneeded:
1020
+ var lightsToConfigure_1 = Object.keys(this._globalConfiguration.lights || []);
1021
+ if (Object.keys(lightsToConfigure_1).length !== lightsAvailable_1.length) {
1022
+ lightsAvailable_1.forEach(function (lName) {
1023
+ if (lightsToConfigure_1.indexOf(lName) === -1) {
1024
+ _this.scene.getLightByName(lName).dispose();
1025
+ }
1026
+ });
1027
+ }
1028
+ lightKeys.forEach(function (name) {
1029
+ var lightConfig = { type: 0 };
1030
+ if (typeof lightsConfiguration[name] === "object") {
1031
+ lightConfig = lightsConfiguration[name];
1032
+ }
1033
+ if (typeof lightsConfiguration[name] === "number") {
1034
+ lightConfig.type = lightsConfiguration[name];
1035
+ }
1036
+ lightConfig.name = name;
1037
+ var light;
1038
+ // light is not already available
1039
+ if (lightsAvailable_1.indexOf(name) === -1) {
1040
+ var constructor = Light.GetConstructorFromName(lightConfig.type, lightConfig.name, _this.scene);
1041
+ if (!constructor) {
1042
+ return;
1043
+ }
1044
+ light = constructor();
1045
+ }
1046
+ else {
1047
+ // available? get it from the scene
1048
+ light = _this.scene.getLightByName(name);
1049
+ if (typeof lightsConfiguration[name] === "boolean") {
1050
+ lightConfig.type = light.getTypeID();
1051
+ }
1052
+ lightsAvailable_1 = lightsAvailable_1.filter(function (ln) { return ln !== name; });
1053
+ if (lightConfig.type !== undefined && light.getTypeID() !== lightConfig.type) {
1054
+ light.dispose();
1055
+ var constructor = Light.GetConstructorFromName(lightConfig.type, lightConfig.name, _this.scene);
1056
+ if (!constructor) {
1057
+ return;
1058
+ }
1059
+ light = constructor();
1060
+ }
1061
+ }
1062
+ // if config set the light to false, dispose it.
1063
+ if (lightsConfiguration[name] === false) {
1064
+ light.dispose();
1065
+ return;
1066
+ }
1067
+ //enabled
1068
+ var enabled = lightConfig.enabled !== undefined ? lightConfig.enabled : !lightConfig.disabled;
1069
+ light.setEnabled(enabled);
1070
+ extendClassWithConfig(light, lightConfig);
1071
+ //position. Some lights don't support shadows
1072
+ if (light instanceof ShadowLight) {
1073
+ // set default values
1074
+ light.shadowMinZ = light.shadowMinZ || 0.2;
1075
+ light.shadowMaxZ = Math.min(10, light.shadowMaxZ || 10); //large far clips reduce shadow depth precision
1076
+ if (lightConfig.target) {
1077
+ if (light.setDirectionToTarget) {
1078
+ var target = Vector3.Zero().copyFromFloats(lightConfig.target.x, lightConfig.target.y, lightConfig.target.z);
1079
+ light.setDirectionToTarget(target);
1080
+ }
1081
+ }
1082
+ else if (lightConfig.direction) {
1083
+ var direction = Vector3.Zero().copyFromFloats(lightConfig.direction.x, lightConfig.direction.y, lightConfig.direction.z);
1084
+ light.direction = direction;
1085
+ }
1086
+ var isShadowEnabled = false;
1087
+ if (light.getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {
1088
+ light.shadowFrustumSize = lightConfig.shadowFrustumSize || 2;
1089
+ isShadowEnabled = true;
1090
+ }
1091
+ else if (light.getTypeID() === Light.LIGHTTYPEID_SPOTLIGHT) {
1092
+ var spotLight = light;
1093
+ if (lightConfig.spotAngle !== undefined) {
1094
+ spotLight.angle = (lightConfig.spotAngle * Math.PI) / 180;
1095
+ }
1096
+ if (spotLight.angle && lightConfig.shadowFieldOfView) {
1097
+ spotLight.shadowAngleScale = lightConfig.shadowFieldOfView / spotLight.angle;
1098
+ }
1099
+ isShadowEnabled = true;
1100
+ }
1101
+ else if (light.getTypeID() === Light.LIGHTTYPEID_POINTLIGHT) {
1102
+ if (lightConfig.shadowFieldOfView) {
1103
+ light.shadowAngle = (lightConfig.shadowFieldOfView * Math.PI) / 180;
1104
+ }
1105
+ isShadowEnabled = true;
1106
+ }
1107
+ var shadowGenerator_1 = light.getShadowGenerator();
1108
+ if (isShadowEnabled && lightConfig.shadowEnabled && _this._maxShadows) {
1109
+ var bufferSize = lightConfig.shadowBufferSize || 256;
1110
+ if (!shadowGenerator_1) {
1111
+ shadowGenerator_1 = new ShadowGenerator(bufferSize, light);
1112
+ }
1113
+ var blurKernel = _this.getBlurKernel(light, bufferSize);
1114
+ shadowGenerator_1.bias = _this._shadowGeneratorBias;
1115
+ shadowGenerator_1.blurKernel = blurKernel;
1116
+ //override defaults
1117
+ extendClassWithConfig(shadowGenerator_1, lightConfig.shadowConfig || {});
1118
+ // add the focus meshes to the shadow list
1119
+ _this._observablesManager &&
1120
+ _this._observablesManager.onModelLoadedObservable.add(function (model) {
1121
+ _this._updateShadowRenderList(shadowGenerator_1, model);
1122
+ });
1123
+ //if (model) {
1124
+ _this._updateShadowRenderList(shadowGenerator_1);
1125
+ //}
1126
+ }
1127
+ else if (shadowGenerator_1) {
1128
+ shadowGenerator_1.dispose();
1129
+ }
1130
+ }
1131
+ });
1132
+ // render priority
1133
+ var globalLightsConfiguration = this._globalConfiguration.lights || {};
1134
+ Object.keys(globalLightsConfiguration)
1135
+ .sort()
1136
+ .forEach(function (name, idx) {
1137
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1138
+ // const configuration = globalLightsConfiguration[name];
1139
+ var light = _this.scene.getLightByName(name);
1140
+ // sanity check
1141
+ if (!light) {
1142
+ return;
1143
+ }
1144
+ light.renderPriority = -idx;
1145
+ });
1146
+ }
1147
+ this.onLightsConfiguredObservable.notifyObservers({
1148
+ sceneManager: this,
1149
+ object: this.scene.lights,
1150
+ newConfiguration: lightsConfiguration,
1151
+ });
1152
+ };
1153
+ SceneManager.prototype._updateShadowRenderList = function (shadowGenerator, model, resetList) {
1154
+ var focusMeshes = model ? model.meshes : this.scene.meshes;
1155
+ // add the focus meshes to the shadow list
1156
+ var shadownMap = shadowGenerator.getShadowMap();
1157
+ if (!shadownMap) {
1158
+ return;
1159
+ }
1160
+ if (resetList && shadownMap.renderList) {
1161
+ shadownMap.renderList.length = 0;
1162
+ }
1163
+ else {
1164
+ shadownMap.renderList = shadownMap.renderList || [];
1165
+ }
1166
+ for (var index = 0; index < focusMeshes.length; index++) {
1167
+ var mesh = focusMeshes[index];
1168
+ if (Tags.MatchesQuery(mesh, "castShadow") && shadownMap.renderList.indexOf(mesh) === -1) {
1169
+ shadownMap.renderList.push(mesh);
1170
+ }
1171
+ }
1172
+ if (!this._shadowGroundPlane) {
1173
+ if (shadowGenerator.useBlurCloseExponentialShadowMap) {
1174
+ var shadowGroundPlane = CreatePlane("shadowGroundPlane", { size: 100 }, this.scene);
1175
+ shadowGroundPlane.useVertexColors = false;
1176
+ //material isn't ever used in rendering, just used to set back face culling
1177
+ shadowGroundPlane.material = new PBRMaterial("shadowGroundPlaneMaterial", this.scene);
1178
+ shadowGroundPlane.material.backFaceCulling = false;
1179
+ shadowGroundPlane.rotation.x = Math.PI * 0.5;
1180
+ shadowGroundPlane.freezeWorldMatrix();
1181
+ this._shadowGroundPlane = shadowGroundPlane;
1182
+ this.scene.removeMesh(shadowGroundPlane);
1183
+ }
1184
+ }
1185
+ else {
1186
+ if (!shadowGenerator.useBlurCloseExponentialShadowMap) {
1187
+ this._shadowGroundPlane.dispose();
1188
+ this._shadowGroundPlane = null;
1189
+ }
1190
+ }
1191
+ if (this._shadowGroundPlane && shadownMap.renderList.indexOf(this._shadowGroundPlane) === -1) {
1192
+ shadownMap.renderList.push(this._shadowGroundPlane);
1193
+ }
1194
+ };
1195
+ SceneManager.prototype._updateGroundMirrorRenderList = function (model, resetList) {
1196
+ if (this.environmentHelper && this.environmentHelper.groundMirror && this.environmentHelper.groundMirror.renderList) {
1197
+ var focusMeshes = model ? model.meshes : this.scene.meshes;
1198
+ var renderList = this.environmentHelper.groundMirror.renderList;
1199
+ if (resetList) {
1200
+ renderList.length = 0;
1201
+ }
1202
+ for (var index = 0; index < focusMeshes.length; index++) {
1203
+ var mesh = focusMeshes[index];
1204
+ if (renderList.indexOf(mesh) === -1) {
1205
+ renderList.push(mesh);
1206
+ }
1207
+ }
1208
+ }
1209
+ };
1210
+ /**
1211
+ * Gets the shadow map blur kernel according to the light configuration.
1212
+ * @param light The light used to generate the shadows
1213
+ * @param bufferSize The size of the shadow map
1214
+ * @returns the kernel blur size
1215
+ */
1216
+ SceneManager.prototype.getBlurKernel = function (light, bufferSize) {
1217
+ var normalizedBlurKernel = 0.05; // TODO Should come from the config.
1218
+ if (light.getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {
1219
+ normalizedBlurKernel = normalizedBlurKernel / light.shadowFrustumSize;
1220
+ }
1221
+ else if (light.getTypeID() === Light.LIGHTTYPEID_POINTLIGHT) {
1222
+ normalizedBlurKernel = normalizedBlurKernel / light.shadowAngle;
1223
+ }
1224
+ else if (light.getTypeID() === Light.LIGHTTYPEID_SPOTLIGHT) {
1225
+ normalizedBlurKernel = normalizedBlurKernel / (light.angle * light.shadowAngleScale);
1226
+ }
1227
+ var minimumBlurKernel = 5 / (bufferSize / 256); //magic number that aims to keep away sawtooth shadows
1228
+ var blurKernel = Math.max(bufferSize * normalizedBlurKernel, minimumBlurKernel);
1229
+ return blurKernel;
1230
+ };
1231
+ /**
1232
+ * Alters render settings to reduce features based on hardware feature limitations
1233
+ * @param enableHDR Allows the viewer to run in HDR mode.
1234
+ */
1235
+ SceneManager.prototype._handleHardwareLimitations = function (enableHDR) {
1236
+ if (enableHDR === void 0) { enableHDR = true; }
1237
+ //flip rendering settings switches based on hardware support
1238
+ var maxVaryingRows = this._engine.getCaps().maxVaryingVectors;
1239
+ var maxFragmentSamplers = this._engine.getCaps().maxTexturesImageUnits;
1240
+ //shadows are disabled if there's not enough varyings for a single shadow
1241
+ if (maxVaryingRows < 8 || maxFragmentSamplers < 8) {
1242
+ this._maxShadows = 0;
1243
+ }
1244
+ else {
1245
+ this._maxShadows = 3;
1246
+ }
1247
+ //can we render to any >= 16-bit targets (required for HDR)
1248
+ var caps = this._engine.getCaps();
1249
+ var linearHalfFloatTargets = caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering;
1250
+ var linearFloatTargets = caps.textureFloatRender && caps.textureFloatLinearFiltering;
1251
+ this._hdrSupport = enableHDR && !!(linearFloatTargets || linearHalfFloatTargets);
1252
+ if (linearHalfFloatTargets) {
1253
+ this._defaultHighpTextureType = Constants.TEXTURETYPE_HALF_FLOAT;
1254
+ this._shadowGeneratorBias = 0.002;
1255
+ }
1256
+ else if (linearFloatTargets) {
1257
+ this._defaultHighpTextureType = Constants.TEXTURETYPE_FLOAT;
1258
+ this._shadowGeneratorBias = 0.001;
1259
+ }
1260
+ else {
1261
+ this._defaultHighpTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;
1262
+ this._shadowGeneratorBias = 0.001;
1263
+ }
1264
+ this._defaultPipelineTextureType = this._hdrSupport ? this._defaultHighpTextureType : Constants.TEXTURETYPE_UNSIGNED_BYTE;
1265
+ };
1266
+ /**
1267
+ * Dispose the entire viewer including the scene and the engine
1268
+ */
1269
+ SceneManager.prototype.dispose = function () {
1270
+ // this.onCameraConfiguredObservable.clear();
1271
+ this.onEnvironmentConfiguredObservable.clear();
1272
+ this.onLightsConfiguredObservable.clear();
1273
+ this.onModelsConfiguredObservable.clear();
1274
+ this.onSceneConfiguredObservable.clear();
1275
+ this.onSceneInitObservable.clear();
1276
+ this.onSceneOptimizerConfiguredObservable.clear();
1277
+ this.onVRConfiguredObservable.clear();
1278
+ if (this.sceneOptimizer) {
1279
+ this.sceneOptimizer.stop();
1280
+ this.sceneOptimizer.dispose();
1281
+ }
1282
+ if (this.environmentHelper) {
1283
+ this.environmentHelper.dispose();
1284
+ }
1285
+ this.models.forEach(function (model) {
1286
+ model.dispose();
1287
+ });
1288
+ if (this._defaultRenderingPipeline) {
1289
+ this._defaultRenderingPipeline.dispose();
1290
+ }
1291
+ this.models.length = 0;
1292
+ if (this.scene) {
1293
+ this.scene.dispose();
1294
+ }
1295
+ };
1296
+ /**
1297
+ * Get an environment asset url by using the configuration if the path is not absolute.
1298
+ * @param url Asset url
1299
+ * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
1300
+ */
1301
+ SceneManager.prototype._getAssetUrl = function (url) {
1302
+ var returnUrl = url;
1303
+ if (url && url.toLowerCase().indexOf("//") === -1) {
1304
+ if (!this._assetsRootURL) {
1305
+ // Tools.Warn("Please, specify the root url of your assets before loading the configuration (labs.environmentAssetsRootURL) or disable the background through the viewer options.");
1306
+ return url;
1307
+ }
1308
+ returnUrl = this._assetsRootURL + returnUrl;
1309
+ }
1310
+ return returnUrl;
1311
+ };
1312
+ SceneManager.prototype._setCameraBehavior = function (name, behaviorConfig) {
1313
+ var behavior;
1314
+ var type;
1315
+ if (typeof behaviorConfig === "object") {
1316
+ type = behaviorConfig.type;
1317
+ }
1318
+ else if (typeof behaviorConfig === "number") {
1319
+ type = behaviorConfig;
1320
+ }
1321
+ else {
1322
+ type = this._cameraBehaviorMapping[name];
1323
+ }
1324
+ if (type === undefined) {
1325
+ return;
1326
+ }
1327
+ var config = typeof behaviorConfig === "object" ? behaviorConfig : {};
1328
+ var enabled = true;
1329
+ if (typeof behaviorConfig === "boolean") {
1330
+ enabled = behaviorConfig;
1331
+ }
1332
+ // constructing behavior
1333
+ switch (type) {
1334
+ case 0 /* CameraBehavior.AUTOROTATION */:
1335
+ this.camera.useAutoRotationBehavior = enabled;
1336
+ behavior = this.camera.autoRotationBehavior;
1337
+ break;
1338
+ case 1 /* CameraBehavior.BOUNCING */:
1339
+ this.camera.useBouncingBehavior = enabled;
1340
+ behavior = this.camera.bouncingBehavior;
1341
+ break;
1342
+ case 2 /* CameraBehavior.FRAMING */:
1343
+ this.camera.useFramingBehavior = enabled;
1344
+ behavior = this.camera.framingBehavior;
1345
+ break;
1346
+ default:
1347
+ behavior = null;
1348
+ break;
1349
+ }
1350
+ if (behavior) {
1351
+ this._cameraBehaviorMapping[name] = type;
1352
+ if (typeof behaviorConfig === "object") {
1353
+ extendClassWithConfig(behavior, behaviorConfig);
1354
+ }
1355
+ }
1356
+ // post attach configuration. Some functionalities require the attached camera.
1357
+ switch (type) {
1358
+ case 0 /* CameraBehavior.AUTOROTATION */:
1359
+ break;
1360
+ case 1 /* CameraBehavior.BOUNCING */:
1361
+ break;
1362
+ case 2 /* CameraBehavior.FRAMING */:
1363
+ this._observablesManager &&
1364
+ this._observablesManager.onModelLoadedObservable.add(function (model) {
1365
+ if (config.zoomOnBoundingInfo) {
1366
+ behavior.zoomOnMeshHierarchy(model.rootMesh);
1367
+ }
1368
+ });
1369
+ break;
1370
+ }
1371
+ };
1372
+ return SceneManager;
1373
+ }());
1374
+ export { SceneManager };
1375
+ //# sourceMappingURL=sceneManager.js.map