@babylonjs/viewer 7.36.0-alpha → 7.36.0

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 (599) 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 +27 -18
  158. package/readme.md +21 -145
  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_image_based-C-0rlXT1.esm.js +0 -171
  198. package/dist/chunks/EXT_lights_image_based-C-0rlXT1.esm.js.map +0 -1
  199. package/dist/chunks/EXT_lights_image_based-Dj8Ni3d2.esm.min.js +0 -2
  200. package/dist/chunks/EXT_lights_image_based-Dj8Ni3d2.esm.min.js.map +0 -1
  201. package/dist/chunks/EXT_mesh_gpu_instancing-B1CyJu24.esm.js +0 -86
  202. package/dist/chunks/EXT_mesh_gpu_instancing-B1CyJu24.esm.js.map +0 -1
  203. package/dist/chunks/EXT_mesh_gpu_instancing-C8G_7QGm.esm.min.js +0 -2
  204. package/dist/chunks/EXT_mesh_gpu_instancing-C8G_7QGm.esm.min.js.map +0 -1
  205. package/dist/chunks/EXT_meshopt_compression-BWmdyggL.esm.js +0 -134
  206. package/dist/chunks/EXT_meshopt_compression-BWmdyggL.esm.js.map +0 -1
  207. package/dist/chunks/EXT_meshopt_compression-JpCGOf0s.esm.min.js +0 -2
  208. package/dist/chunks/EXT_meshopt_compression-JpCGOf0s.esm.min.js.map +0 -1
  209. package/dist/chunks/EXT_texture_avif-BnIzEc8i.esm.js +0 -44
  210. package/dist/chunks/EXT_texture_avif-BnIzEc8i.esm.js.map +0 -1
  211. package/dist/chunks/EXT_texture_avif-DPh64CjM.esm.min.js +0 -2
  212. package/dist/chunks/EXT_texture_avif-DPh64CjM.esm.min.js.map +0 -1
  213. package/dist/chunks/EXT_texture_webp-CFO4xL5G.esm.min.js +0 -2
  214. package/dist/chunks/EXT_texture_webp-CFO4xL5G.esm.min.js.map +0 -1
  215. package/dist/chunks/EXT_texture_webp-HqfTVHCZ.esm.js +0 -43
  216. package/dist/chunks/EXT_texture_webp-HqfTVHCZ.esm.js.map +0 -1
  217. package/dist/chunks/ExtrasAsMetadata-D97FCDjt.esm.js +0 -64
  218. package/dist/chunks/ExtrasAsMetadata-D97FCDjt.esm.js.map +0 -1
  219. package/dist/chunks/ExtrasAsMetadata-DdDksSpx.esm.min.js +0 -2
  220. package/dist/chunks/ExtrasAsMetadata-DdDksSpx.esm.min.js.map +0 -1
  221. package/dist/chunks/KHR_animation_pointer-BnDSBRgr.esm.js +0 -343
  222. package/dist/chunks/KHR_animation_pointer-BnDSBRgr.esm.js.map +0 -1
  223. package/dist/chunks/KHR_animation_pointer-CMxD_86V.esm.min.js +0 -2
  224. package/dist/chunks/KHR_animation_pointer-CMxD_86V.esm.min.js.map +0 -1
  225. package/dist/chunks/KHR_draco_mesh_compression-BMkcU19_.esm.min.js +0 -2
  226. package/dist/chunks/KHR_draco_mesh_compression-BMkcU19_.esm.min.js.map +0 -1
  227. package/dist/chunks/KHR_draco_mesh_compression-UAhzd3VK.esm.js +0 -617
  228. package/dist/chunks/KHR_draco_mesh_compression-UAhzd3VK.esm.js.map +0 -1
  229. package/dist/chunks/KHR_interactivity-BpeQ8Qyu.esm.min.js +0 -2
  230. package/dist/chunks/KHR_interactivity-BpeQ8Qyu.esm.min.js.map +0 -1
  231. package/dist/chunks/KHR_interactivity-DXk_MDm7.esm.js +0 -4033
  232. package/dist/chunks/KHR_interactivity-DXk_MDm7.esm.js.map +0 -1
  233. package/dist/chunks/KHR_lights_punctual-BPa3ZY-J.esm.js +0 -1253
  234. package/dist/chunks/KHR_lights_punctual-BPa3ZY-J.esm.js.map +0 -1
  235. package/dist/chunks/KHR_lights_punctual-D-OD_BpZ.esm.min.js +0 -2
  236. package/dist/chunks/KHR_lights_punctual-D-OD_BpZ.esm.min.js.map +0 -1
  237. package/dist/chunks/KHR_materials_anisotropy-BgE9FbOB.esm.js +0 -65
  238. package/dist/chunks/KHR_materials_anisotropy-BgE9FbOB.esm.js.map +0 -1
  239. package/dist/chunks/KHR_materials_anisotropy-DIPUTTRC.esm.min.js +0 -2
  240. package/dist/chunks/KHR_materials_anisotropy-DIPUTTRC.esm.min.js.map +0 -1
  241. package/dist/chunks/KHR_materials_clearcoat-BGx2Shdx.esm.min.js +0 -2
  242. package/dist/chunks/KHR_materials_clearcoat-BGx2Shdx.esm.min.js.map +0 -1
  243. package/dist/chunks/KHR_materials_clearcoat-Bn5CfrnP.esm.js +0 -96
  244. package/dist/chunks/KHR_materials_clearcoat-Bn5CfrnP.esm.js.map +0 -1
  245. package/dist/chunks/KHR_materials_diffuse_transmission-DPNdPWGd.esm.js +0 -97
  246. package/dist/chunks/KHR_materials_diffuse_transmission-DPNdPWGd.esm.js.map +0 -1
  247. package/dist/chunks/KHR_materials_diffuse_transmission-izEv0SNd.esm.min.js +0 -2
  248. package/dist/chunks/KHR_materials_diffuse_transmission-izEv0SNd.esm.min.js.map +0 -1
  249. package/dist/chunks/KHR_materials_dispersion-Bq7K1HEQ.esm.js +0 -62
  250. package/dist/chunks/KHR_materials_dispersion-Bq7K1HEQ.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_dispersion-DBWPH2hJ.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_dispersion-DBWPH2hJ.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_emissive_strength-6UcflbjA.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_emissive_strength-6UcflbjA.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_emissive_strength-CjYGiLcM.esm.js +0 -55
  256. package/dist/chunks/KHR_materials_emissive_strength-CjYGiLcM.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_ior-BAHeVsuR.esm.js +0 -64
  258. package/dist/chunks/KHR_materials_ior-BAHeVsuR.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_ior-CIju_urb.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_ior-CIju_urb.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_iridescence-9pWJBDfo.esm.js +0 -72
  262. package/dist/chunks/KHR_materials_iridescence-9pWJBDfo.esm.js.map +0 -1
  263. package/dist/chunks/KHR_materials_iridescence-BsLlyCTa.esm.min.js +0 -2
  264. package/dist/chunks/KHR_materials_iridescence-BsLlyCTa.esm.min.js.map +0 -1
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D8cATbuT.esm.min.js +0 -2
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D8cATbuT.esm.min.js.map +0 -1
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-OsmoCB7F.esm.js +0 -81
  268. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-OsmoCB7F.esm.js.map +0 -1
  269. package/dist/chunks/KHR_materials_sheen-BO1HQtbx.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_sheen-BO1HQtbx.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_sheen-Dg8CsPJs.esm.js +0 -85
  272. package/dist/chunks/KHR_materials_sheen-Dg8CsPJs.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_specular-CTzLPv_Y.esm.min.js +0 -2
  274. package/dist/chunks/KHR_materials_specular-CTzLPv_Y.esm.min.js.map +0 -1
  275. package/dist/chunks/KHR_materials_specular-yqxYY23C.esm.js +0 -75
  276. package/dist/chunks/KHR_materials_specular-yqxYY23C.esm.js.map +0 -1
  277. package/dist/chunks/KHR_materials_transmission-Cw-bawr9.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_transmission-Cw-bawr9.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_transmission-Drj_fyXz.esm.js +0 -307
  280. package/dist/chunks/KHR_materials_transmission-Drj_fyXz.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_unlit-CTHSnSN1.esm.js +0 -74
  282. package/dist/chunks/KHR_materials_unlit-CTHSnSN1.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_unlit-DW3Q3hX2.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_unlit-DW3Q3hX2.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_variants-9HpnP8WG.esm.js +0 -238
  286. package/dist/chunks/KHR_materials_variants-9HpnP8WG.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_variants-DrT2UCZI.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_variants-DrT2UCZI.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_volume-BTAz8V1X.esm.js +0 -87
  290. package/dist/chunks/KHR_materials_volume-BTAz8V1X.esm.js.map +0 -1
  291. package/dist/chunks/KHR_materials_volume-RWsAj4F0.esm.min.js +0 -2
  292. package/dist/chunks/KHR_materials_volume-RWsAj4F0.esm.min.js.map +0 -1
  293. package/dist/chunks/KHR_mesh_quantization-D9jnG818.esm.js +0 -26
  294. package/dist/chunks/KHR_mesh_quantization-D9jnG818.esm.js.map +0 -1
  295. package/dist/chunks/KHR_mesh_quantization-aISRxDNK.esm.min.js +0 -2
  296. package/dist/chunks/KHR_mesh_quantization-aISRxDNK.esm.min.js.map +0 -1
  297. package/dist/chunks/KHR_node_visibility-BkNPNj5W.esm.min.js +0 -2
  298. package/dist/chunks/KHR_node_visibility-BkNPNj5W.esm.min.js.map +0 -1
  299. package/dist/chunks/KHR_node_visibility-DC-3D7A5.esm.js +0 -46
  300. package/dist/chunks/KHR_node_visibility-DC-3D7A5.esm.js.map +0 -1
  301. package/dist/chunks/KHR_texture_basisu-B89JJbVs.esm.min.js +0 -2
  302. package/dist/chunks/KHR_texture_basisu-B89JJbVs.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_texture_basisu-D7ujO9Rh.esm.js +0 -43
  304. package/dist/chunks/KHR_texture_basisu-D7ujO9Rh.esm.js.map +0 -1
  305. package/dist/chunks/KHR_texture_transform-ClHuzCMo.esm.js +0 -63
  306. package/dist/chunks/KHR_texture_transform-ClHuzCMo.esm.js.map +0 -1
  307. package/dist/chunks/KHR_texture_transform-wJ7lDLeD.esm.min.js +0 -2
  308. package/dist/chunks/KHR_texture_transform-wJ7lDLeD.esm.min.js.map +0 -1
  309. package/dist/chunks/KHR_xmp_json_ld-BD6LnsUs.esm.min.js +0 -2
  310. package/dist/chunks/KHR_xmp_json_ld-BD6LnsUs.esm.min.js.map +0 -1
  311. package/dist/chunks/KHR_xmp_json_ld-CGzvQSvZ.esm.js +0 -51
  312. package/dist/chunks/KHR_xmp_json_ld-CGzvQSvZ.esm.js.map +0 -1
  313. package/dist/chunks/MSFT_audio_emitter-BwAwNx3E.esm.js +0 -2207
  314. package/dist/chunks/MSFT_audio_emitter-BwAwNx3E.esm.js.map +0 -1
  315. package/dist/chunks/MSFT_audio_emitter-CgEIerLr.esm.min.js +0 -2
  316. package/dist/chunks/MSFT_audio_emitter-CgEIerLr.esm.min.js.map +0 -1
  317. package/dist/chunks/MSFT_lod-D3GfTrFY.esm.min.js +0 -2
  318. package/dist/chunks/MSFT_lod-D3GfTrFY.esm.min.js.map +0 -1
  319. package/dist/chunks/MSFT_lod-IQnE7Mms.esm.js +0 -337
  320. package/dist/chunks/MSFT_lod-IQnE7Mms.esm.js.map +0 -1
  321. package/dist/chunks/MSFT_minecraftMesh-DTVxMcRf.esm.js +0 -46
  322. package/dist/chunks/MSFT_minecraftMesh-DTVxMcRf.esm.js.map +0 -1
  323. package/dist/chunks/MSFT_minecraftMesh-MdQ3Mfp_.esm.min.js +0 -2
  324. package/dist/chunks/MSFT_minecraftMesh-MdQ3Mfp_.esm.min.js.map +0 -1
  325. package/dist/chunks/MSFT_sRGBFactors-Bi_jHmjQ.esm.js +0 -47
  326. package/dist/chunks/MSFT_sRGBFactors-Bi_jHmjQ.esm.js.map +0 -1
  327. package/dist/chunks/MSFT_sRGBFactors-CeKsISP1.esm.min.js +0 -2
  328. package/dist/chunks/MSFT_sRGBFactors-CeKsISP1.esm.min.js.map +0 -1
  329. package/dist/chunks/animationGroup-BEk4nnn0.esm.js +0 -2482
  330. package/dist/chunks/animationGroup-BEk4nnn0.esm.js.map +0 -1
  331. package/dist/chunks/animationGroup-DVkE7Jrp.esm.min.js +0 -2
  332. package/dist/chunks/animationGroup-DVkE7Jrp.esm.min.js.map +0 -1
  333. package/dist/chunks/assetContainer-811yrzpt.esm.min.js +0 -2
  334. package/dist/chunks/assetContainer-811yrzpt.esm.min.js.map +0 -1
  335. package/dist/chunks/assetContainer-Ch1I3rtz.esm.js +0 -1720
  336. package/dist/chunks/assetContainer-Ch1I3rtz.esm.js.map +0 -1
  337. package/dist/chunks/audioEngine-D7yvul_r.esm.js +0 -305
  338. package/dist/chunks/audioEngine-D7yvul_r.esm.js.map +0 -1
  339. package/dist/chunks/audioEngine-k_PWuCZZ.esm.min.js +0 -2
  340. package/dist/chunks/audioEngine-k_PWuCZZ.esm.min.js.map +0 -1
  341. package/dist/chunks/bakedVertexAnimation-BmbcHNy2.esm.js +0 -114
  342. package/dist/chunks/bakedVertexAnimation-BmbcHNy2.esm.js.map +0 -1
  343. package/dist/chunks/bakedVertexAnimation-BxxWsZd7.esm.min.js +0 -2
  344. package/dist/chunks/bakedVertexAnimation-BxxWsZd7.esm.min.js.map +0 -1
  345. package/dist/chunks/basisTextureLoader-CDOgoy6w.esm.min.js +0 -2
  346. package/dist/chunks/basisTextureLoader-CDOgoy6w.esm.min.js.map +0 -1
  347. package/dist/chunks/basisTextureLoader-D-3r2N4B.esm.js +0 -600
  348. package/dist/chunks/basisTextureLoader-D-3r2N4B.esm.js.map +0 -1
  349. package/dist/chunks/dds-CuDk7jqp.esm.js +0 -540
  350. package/dist/chunks/dds-CuDk7jqp.esm.js.map +0 -1
  351. package/dist/chunks/dds-DotY7dzZ.esm.min.js +0 -2
  352. package/dist/chunks/dds-DotY7dzZ.esm.min.js.map +0 -1
  353. package/dist/chunks/ddsTextureLoader-CEvKdiZN.esm.min.js +0 -2
  354. package/dist/chunks/ddsTextureLoader-CEvKdiZN.esm.min.js.map +0 -1
  355. package/dist/chunks/ddsTextureLoader-DUU2aCSx.esm.js +0 -88
  356. package/dist/chunks/ddsTextureLoader-DUU2aCSx.esm.js.map +0 -1
  357. package/dist/chunks/decalFragment-DorRSt43.esm.min.js +0 -2
  358. package/dist/chunks/decalFragment-DorRSt43.esm.min.js.map +0 -1
  359. package/dist/chunks/decalFragment-usYEbFd1.esm.js +0 -18
  360. package/dist/chunks/decalFragment-usYEbFd1.esm.js.map +0 -1
  361. package/dist/chunks/default.fragment-B65JKmK4.esm.js +0 -433
  362. package/dist/chunks/default.fragment-B65JKmK4.esm.js.map +0 -1
  363. package/dist/chunks/default.fragment-DMzaV-1D.esm.min.js +0 -2
  364. package/dist/chunks/default.fragment-DMzaV-1D.esm.min.js.map +0 -1
  365. package/dist/chunks/default.fragment-DX272W_1.esm.js +0 -497
  366. package/dist/chunks/default.fragment-DX272W_1.esm.js.map +0 -1
  367. package/dist/chunks/default.fragment-cFVjQ581.esm.min.js +0 -2
  368. package/dist/chunks/default.fragment-cFVjQ581.esm.min.js.map +0 -1
  369. package/dist/chunks/default.vertex-ChbO_NCo.esm.js +0 -201
  370. package/dist/chunks/default.vertex-ChbO_NCo.esm.js.map +0 -1
  371. package/dist/chunks/default.vertex-CkX_3SHr.esm.min.js +0 -2
  372. package/dist/chunks/default.vertex-CkX_3SHr.esm.min.js.map +0 -1
  373. package/dist/chunks/default.vertex-F26iVD0U.esm.js +0 -181
  374. package/dist/chunks/default.vertex-F26iVD0U.esm.js.map +0 -1
  375. package/dist/chunks/default.vertex-Fvu87y_k.esm.min.js +0 -2
  376. package/dist/chunks/default.vertex-Fvu87y_k.esm.min.js.map +0 -1
  377. package/dist/chunks/defaultUboDeclaration-BwkC1FU3.esm.min.js +0 -2
  378. package/dist/chunks/defaultUboDeclaration-BwkC1FU3.esm.min.js.map +0 -1
  379. package/dist/chunks/defaultUboDeclaration-DF-55m45.esm.js +0 -15
  380. package/dist/chunks/defaultUboDeclaration-DF-55m45.esm.js.map +0 -1
  381. package/dist/chunks/defaultUboDeclaration-O2A-FLl7.esm.min.js +0 -2
  382. package/dist/chunks/defaultUboDeclaration-O2A-FLl7.esm.min.js.map +0 -1
  383. package/dist/chunks/defaultUboDeclaration-zED0FOi4.esm.js +0 -13
  384. package/dist/chunks/defaultUboDeclaration-zED0FOi4.esm.js.map +0 -1
  385. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  386. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  387. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  388. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  389. package/dist/chunks/dumpTools-BwNX1ze6.esm.js +0 -200
  390. package/dist/chunks/dumpTools-BwNX1ze6.esm.js.map +0 -1
  391. package/dist/chunks/dumpTools-C8tIU8Vg.esm.min.js +0 -2
  392. package/dist/chunks/dumpTools-C8tIU8Vg.esm.min.js.map +0 -1
  393. package/dist/chunks/engine-B5sg74E3.esm.min.js +0 -2
  394. package/dist/chunks/engine-B5sg74E3.esm.min.js.map +0 -1
  395. package/dist/chunks/engine-CP65EHPg.esm.js +0 -2204
  396. package/dist/chunks/engine-CP65EHPg.esm.js.map +0 -1
  397. package/dist/chunks/engine.common-BBoGnUNC.esm.js +0 -1162
  398. package/dist/chunks/engine.common-BBoGnUNC.esm.js.map +0 -1
  399. package/dist/chunks/engine.common-BkbsTiHo.esm.min.js +0 -2
  400. package/dist/chunks/engine.common-BkbsTiHo.esm.min.js.map +0 -1
  401. package/dist/chunks/envTextureLoader-B70arAfI.esm.js +0 -64
  402. package/dist/chunks/envTextureLoader-B70arAfI.esm.js.map +0 -1
  403. package/dist/chunks/envTextureLoader-DHhqK6FO.esm.min.js +0 -2
  404. package/dist/chunks/envTextureLoader-DHhqK6FO.esm.min.js.map +0 -1
  405. package/dist/chunks/environmentTextureTools-CGf47VK6.esm.min.js +0 -2
  406. package/dist/chunks/environmentTextureTools-CGf47VK6.esm.min.js.map +0 -1
  407. package/dist/chunks/environmentTextureTools-DdP3pU1V.esm.js +0 -382
  408. package/dist/chunks/environmentTextureTools-DdP3pU1V.esm.js.map +0 -1
  409. package/dist/chunks/exrTextureLoader-DHHr9kIC.esm.min.js +0 -2
  410. package/dist/chunks/exrTextureLoader-DHHr9kIC.esm.min.js.map +0 -1
  411. package/dist/chunks/exrTextureLoader-DUNRHpVI.esm.js +0 -1682
  412. package/dist/chunks/exrTextureLoader-DUNRHpVI.esm.js.map +0 -1
  413. package/dist/chunks/fogFragment-4XIiPNqC.esm.js +0 -102
  414. package/dist/chunks/fogFragment-4XIiPNqC.esm.js.map +0 -1
  415. package/dist/chunks/fogFragment-BH3nRhkR.esm.min.js +0 -2
  416. package/dist/chunks/fogFragment-BH3nRhkR.esm.min.js.map +0 -1
  417. package/dist/chunks/fogFragment-C86N7vRk.esm.min.js +0 -2
  418. package/dist/chunks/fogFragment-C86N7vRk.esm.min.js.map +0 -1
  419. package/dist/chunks/fogFragment-yxsCDlJx.esm.js +0 -101
  420. package/dist/chunks/fogFragment-yxsCDlJx.esm.js.map +0 -1
  421. package/dist/chunks/fresnelFunction-Bmm-eSsR.esm.js +0 -12
  422. package/dist/chunks/fresnelFunction-Bmm-eSsR.esm.js.map +0 -1
  423. package/dist/chunks/fresnelFunction-C6cm-reF.esm.min.js +0 -2
  424. package/dist/chunks/fresnelFunction-C6cm-reF.esm.min.js.map +0 -1
  425. package/dist/chunks/glTFLoader-8YeGkftV.esm.js +0 -7606
  426. package/dist/chunks/glTFLoader-8YeGkftV.esm.js.map +0 -1
  427. package/dist/chunks/glTFLoader-DwAY5NAM.esm.min.js +0 -2
  428. package/dist/chunks/glTFLoader-DwAY5NAM.esm.min.js.map +0 -1
  429. package/dist/chunks/glTFLoaderAnimation-BQZg3uE2.esm.js +0 -77
  430. package/dist/chunks/glTFLoaderAnimation-BQZg3uE2.esm.js.map +0 -1
  431. package/dist/chunks/glTFLoaderAnimation-CRdyA_ho.esm.min.js +0 -2
  432. package/dist/chunks/glTFLoaderAnimation-CRdyA_ho.esm.min.js.map +0 -1
  433. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  434. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  435. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  436. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  437. package/dist/chunks/harmonicsFunctions-BDWc7ugP.esm.js +0 -34
  438. package/dist/chunks/harmonicsFunctions-BDWc7ugP.esm.js.map +0 -1
  439. package/dist/chunks/harmonicsFunctions-D1m1tCiL.esm.min.js +0 -2
  440. package/dist/chunks/harmonicsFunctions-D1m1tCiL.esm.min.js.map +0 -1
  441. package/dist/chunks/harmonicsFunctions-DY83TD5F.esm.min.js +0 -2
  442. package/dist/chunks/harmonicsFunctions-DY83TD5F.esm.min.js.map +0 -1
  443. package/dist/chunks/harmonicsFunctions-RB1caKsW.esm.js +0 -35
  444. package/dist/chunks/harmonicsFunctions-RB1caKsW.esm.js.map +0 -1
  445. package/dist/chunks/hdrTextureLoader-BA2YCEkF.esm.min.js +0 -2
  446. package/dist/chunks/hdrTextureLoader-BA2YCEkF.esm.min.js.map +0 -1
  447. package/dist/chunks/hdrTextureLoader-BGoJncnK.esm.js +0 -252
  448. package/dist/chunks/hdrTextureLoader-BGoJncnK.esm.js.map +0 -1
  449. package/dist/chunks/helperFunctions-B66YuDfO.esm.js +0 -80
  450. package/dist/chunks/helperFunctions-B66YuDfO.esm.js.map +0 -1
  451. package/dist/chunks/helperFunctions-Bkbn03Eq.esm.js +0 -108
  452. package/dist/chunks/helperFunctions-Bkbn03Eq.esm.js.map +0 -1
  453. package/dist/chunks/helperFunctions-DpJHAvub.esm.min.js +0 -2
  454. package/dist/chunks/helperFunctions-DpJHAvub.esm.min.js.map +0 -1
  455. package/dist/chunks/helperFunctions-Q_6RS1S2.esm.min.js +0 -2
  456. package/dist/chunks/helperFunctions-Q_6RS1S2.esm.min.js.map +0 -1
  457. package/dist/chunks/index-B0XiE1FO.esm.js +0 -74245
  458. package/dist/chunks/index-B0XiE1FO.esm.js.map +0 -1
  459. package/dist/chunks/index-CMQ6hCSC.esm.min.js +0 -57
  460. package/dist/chunks/index-CMQ6hCSC.esm.min.js.map +0 -1
  461. package/dist/chunks/ktxTextureLoader-BUiE1iIn.esm.min.js +0 -2
  462. package/dist/chunks/ktxTextureLoader-BUiE1iIn.esm.min.js.map +0 -1
  463. package/dist/chunks/ktxTextureLoader-C2AIdCgA.esm.js +0 -814
  464. package/dist/chunks/ktxTextureLoader-C2AIdCgA.esm.js.map +0 -1
  465. package/dist/chunks/logDepthDeclaration-B5YDWGct.esm.js +0 -35
  466. package/dist/chunks/logDepthDeclaration-B5YDWGct.esm.js.map +0 -1
  467. package/dist/chunks/logDepthDeclaration-D6gM7_OR.esm.min.js +0 -2
  468. package/dist/chunks/logDepthDeclaration-D6gM7_OR.esm.min.js.map +0 -1
  469. package/dist/chunks/logDepthDeclaration-D7JeZYJs.esm.js +0 -11
  470. package/dist/chunks/logDepthDeclaration-D7JeZYJs.esm.js.map +0 -1
  471. package/dist/chunks/logDepthDeclaration-DcJYXBc-.esm.min.js +0 -2
  472. package/dist/chunks/logDepthDeclaration-DcJYXBc-.esm.min.js.map +0 -1
  473. package/dist/chunks/logDepthVertex-B--nEH5h.esm.js +0 -77
  474. package/dist/chunks/logDepthVertex-B--nEH5h.esm.js.map +0 -1
  475. package/dist/chunks/logDepthVertex-Bo9jtAiU.esm.js +0 -77
  476. package/dist/chunks/logDepthVertex-Bo9jtAiU.esm.js.map +0 -1
  477. package/dist/chunks/logDepthVertex-BuwnrjGN.esm.min.js +0 -2
  478. package/dist/chunks/logDepthVertex-BuwnrjGN.esm.min.js.map +0 -1
  479. package/dist/chunks/logDepthVertex-C7D6zwqe.esm.min.js +0 -2
  480. package/dist/chunks/logDepthVertex-C7D6zwqe.esm.min.js.map +0 -1
  481. package/dist/chunks/mainUVVaryingDeclaration-Bu2PCs0u.esm.min.js +0 -2
  482. package/dist/chunks/mainUVVaryingDeclaration-Bu2PCs0u.esm.min.js.map +0 -1
  483. package/dist/chunks/mainUVVaryingDeclaration-CQtdE5nF.esm.js +0 -11
  484. package/dist/chunks/mainUVVaryingDeclaration-CQtdE5nF.esm.js.map +0 -1
  485. package/dist/chunks/mainUVVaryingDeclaration-CkZTmKth.esm.js +0 -11
  486. package/dist/chunks/mainUVVaryingDeclaration-CkZTmKth.esm.js.map +0 -1
  487. package/dist/chunks/mainUVVaryingDeclaration-DjByoT5m.esm.min.js +0 -2
  488. package/dist/chunks/mainUVVaryingDeclaration-DjByoT5m.esm.min.js.map +0 -1
  489. package/dist/chunks/meshUboDeclaration-CNRdvK6C.esm.js +0 -24
  490. package/dist/chunks/meshUboDeclaration-CNRdvK6C.esm.js.map +0 -1
  491. package/dist/chunks/meshUboDeclaration-CfdypbbP.esm.min.js +0 -2
  492. package/dist/chunks/meshUboDeclaration-CfdypbbP.esm.min.js.map +0 -1
  493. package/dist/chunks/objFileLoader-CTIziUgW.esm.js +0 -1338
  494. package/dist/chunks/objFileLoader-CTIziUgW.esm.js.map +0 -1
  495. package/dist/chunks/objFileLoader-Dti6yw2W.esm.min.js +0 -2
  496. package/dist/chunks/objFileLoader-Dti6yw2W.esm.min.js.map +0 -1
  497. package/dist/chunks/oitFragment-B31nZLKF.esm.min.js +0 -2
  498. package/dist/chunks/oitFragment-B31nZLKF.esm.min.js.map +0 -1
  499. package/dist/chunks/oitFragment-BaR7MXfg.esm.js +0 -1210
  500. package/dist/chunks/oitFragment-BaR7MXfg.esm.js.map +0 -1
  501. package/dist/chunks/oitFragment-DTo1Zewh.esm.min.js +0 -2
  502. package/dist/chunks/oitFragment-DTo1Zewh.esm.min.js.map +0 -1
  503. package/dist/chunks/oitFragment-Dlmtl4rw.esm.js +0 -1051
  504. package/dist/chunks/oitFragment-Dlmtl4rw.esm.js.map +0 -1
  505. package/dist/chunks/pass.fragment-CEtxUJdg.esm.js +0 -15
  506. package/dist/chunks/pass.fragment-CEtxUJdg.esm.js.map +0 -1
  507. package/dist/chunks/pass.fragment-C_F6Emgn.esm.js +0 -15
  508. package/dist/chunks/pass.fragment-C_F6Emgn.esm.js.map +0 -1
  509. package/dist/chunks/pass.fragment-D6J2ZaiP.esm.min.js +0 -2
  510. package/dist/chunks/pass.fragment-D6J2ZaiP.esm.min.js.map +0 -1
  511. package/dist/chunks/pass.fragment-Dq1Ebjt-.esm.min.js +0 -2
  512. package/dist/chunks/pass.fragment-Dq1Ebjt-.esm.min.js.map +0 -1
  513. package/dist/chunks/pbr.fragment-7pZbGH4j.esm.min.js +0 -2
  514. package/dist/chunks/pbr.fragment-7pZbGH4j.esm.min.js.map +0 -1
  515. package/dist/chunks/pbr.fragment-Bjyf9L5u.esm.min.js +0 -2
  516. package/dist/chunks/pbr.fragment-Bjyf9L5u.esm.min.js.map +0 -1
  517. package/dist/chunks/pbr.fragment-D96q_d7U.esm.js +0 -3218
  518. package/dist/chunks/pbr.fragment-D96q_d7U.esm.js.map +0 -1
  519. package/dist/chunks/pbr.fragment-DwiLmRps.esm.js +0 -3165
  520. package/dist/chunks/pbr.fragment-DwiLmRps.esm.js.map +0 -1
  521. package/dist/chunks/pbr.vertex-CaKC7ZQw.esm.js +0 -214
  522. package/dist/chunks/pbr.vertex-CaKC7ZQw.esm.js.map +0 -1
  523. package/dist/chunks/pbr.vertex-D6L1V4oA.esm.min.js +0 -2
  524. package/dist/chunks/pbr.vertex-D6L1V4oA.esm.min.js.map +0 -1
  525. package/dist/chunks/pbr.vertex-NQJFxwsz.esm.min.js +0 -2
  526. package/dist/chunks/pbr.vertex-NQJFxwsz.esm.min.js.map +0 -1
  527. package/dist/chunks/pbr.vertex-zl-bgV9W.esm.js +0 -338
  528. package/dist/chunks/pbr.vertex-zl-bgV9W.esm.js.map +0 -1
  529. package/dist/chunks/postprocess.vertex-BGTUGDnQ.esm.min.js +0 -2
  530. package/dist/chunks/postprocess.vertex-BGTUGDnQ.esm.min.js.map +0 -1
  531. package/dist/chunks/postprocess.vertex-C-zpaK3h.esm.js +0 -20
  532. package/dist/chunks/postprocess.vertex-C-zpaK3h.esm.js.map +0 -1
  533. package/dist/chunks/rawTexture-BbbDtwVR.esm.min.js +0 -2
  534. package/dist/chunks/rawTexture-BbbDtwVR.esm.min.js.map +0 -1
  535. package/dist/chunks/rawTexture-C5rmF9gb.esm.js +0 -191
  536. package/dist/chunks/rawTexture-C5rmF9gb.esm.js.map +0 -1
  537. package/dist/chunks/rgbdDecode.fragment-CakmvodV.esm.min.js +0 -2
  538. package/dist/chunks/rgbdDecode.fragment-CakmvodV.esm.min.js.map +0 -1
  539. package/dist/chunks/rgbdDecode.fragment-CvYKqu39.esm.js +0 -17
  540. package/dist/chunks/rgbdDecode.fragment-CvYKqu39.esm.js.map +0 -1
  541. package/dist/chunks/rgbdDecode.fragment-DFkxPpRA.esm.js +0 -17
  542. package/dist/chunks/rgbdDecode.fragment-DFkxPpRA.esm.js.map +0 -1
  543. package/dist/chunks/rgbdDecode.fragment-YdIHAz7H.esm.min.js +0 -2
  544. package/dist/chunks/rgbdDecode.fragment-YdIHAz7H.esm.min.js.map +0 -1
  545. package/dist/chunks/rgbdEncode.fragment-C0fTyPK2.esm.js +0 -17
  546. package/dist/chunks/rgbdEncode.fragment-C0fTyPK2.esm.js.map +0 -1
  547. package/dist/chunks/rgbdEncode.fragment-CH0DT_u7.esm.min.js +0 -2
  548. package/dist/chunks/rgbdEncode.fragment-CH0DT_u7.esm.min.js.map +0 -1
  549. package/dist/chunks/rgbdEncode.fragment-DFMrcC9e.esm.min.js +0 -2
  550. package/dist/chunks/rgbdEncode.fragment-DFMrcC9e.esm.min.js.map +0 -1
  551. package/dist/chunks/rgbdEncode.fragment-xiVfo40O.esm.js +0 -17
  552. package/dist/chunks/rgbdEncode.fragment-xiVfo40O.esm.js.map +0 -1
  553. package/dist/chunks/splatFileLoader-BxCBgUIf.esm.js +0 -3947
  554. package/dist/chunks/splatFileLoader-BxCBgUIf.esm.js.map +0 -1
  555. package/dist/chunks/splatFileLoader-zwiLbtie.esm.min.js +0 -2
  556. package/dist/chunks/splatFileLoader-zwiLbtie.esm.min.js.map +0 -1
  557. package/dist/chunks/standardMaterial-CzgWV2aN.esm.js +0 -1805
  558. package/dist/chunks/standardMaterial-CzgWV2aN.esm.js.map +0 -1
  559. package/dist/chunks/standardMaterial-DjwIHmDD.esm.min.js +0 -2
  560. package/dist/chunks/standardMaterial-DjwIHmDD.esm.min.js.map +0 -1
  561. package/dist/chunks/stlFileLoader-BZ9DHTQ6.esm.js +0 -238
  562. package/dist/chunks/stlFileLoader-BZ9DHTQ6.esm.js.map +0 -1
  563. package/dist/chunks/stlFileLoader-Dc-CVC8a.esm.min.js +0 -2
  564. package/dist/chunks/stlFileLoader-Dc-CVC8a.esm.min.js.map +0 -1
  565. package/dist/chunks/tgaTextureLoader-DYjWiRyu.esm.js +0 -349
  566. package/dist/chunks/tgaTextureLoader-DYjWiRyu.esm.js.map +0 -1
  567. package/dist/chunks/tgaTextureLoader-x7GxoHtb.esm.min.js +0 -2
  568. package/dist/chunks/tgaTextureLoader-x7GxoHtb.esm.min.js.map +0 -1
  569. package/dist/chunks/thinEngine-5Pa6QbP6.esm.min.js +0 -2
  570. package/dist/chunks/thinEngine-5Pa6QbP6.esm.min.js.map +0 -1
  571. package/dist/chunks/thinEngine-B0O1HeNw.esm.js +0 -3812
  572. package/dist/chunks/thinEngine-B0O1HeNw.esm.js.map +0 -1
  573. package/dist/chunks/thinInstanceMesh-BU_q_IZy.esm.min.js +0 -2
  574. package/dist/chunks/thinInstanceMesh-BU_q_IZy.esm.min.js.map +0 -1
  575. package/dist/chunks/thinInstanceMesh-GmIu2FgY.esm.js +0 -314
  576. package/dist/chunks/thinInstanceMesh-GmIu2FgY.esm.js.map +0 -1
  577. package/dist/chunks/vertexColorMixing-BI7UZNV0.esm.js +0 -522
  578. package/dist/chunks/vertexColorMixing-BI7UZNV0.esm.js.map +0 -1
  579. package/dist/chunks/vertexColorMixing-CDHo-Mfr.esm.min.js +0 -2
  580. package/dist/chunks/vertexColorMixing-CDHo-Mfr.esm.min.js.map +0 -1
  581. package/dist/chunks/vertexColorMixing-D0neNeA0.esm.min.js +0 -2
  582. package/dist/chunks/vertexColorMixing-D0neNeA0.esm.min.js.map +0 -1
  583. package/dist/chunks/vertexColorMixing-DwnB7bJ5.esm.js +0 -412
  584. package/dist/chunks/vertexColorMixing-DwnB7bJ5.esm.js.map +0 -1
  585. package/dist/chunks/webgpuEngine-Bp2hPOvC.esm.min.js +0 -2
  586. package/dist/chunks/webgpuEngine-Bp2hPOvC.esm.min.js.map +0 -1
  587. package/dist/chunks/webgpuEngine-D3OXJ2yl.esm.js +0 -11502
  588. package/dist/chunks/webgpuEngine-D3OXJ2yl.esm.js.map +0 -1
  589. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  590. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  591. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  592. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  593. package/docs/ViewerDefault.jpg +0 -0
  594. package/docs/ViewerParts.jpg +0 -0
  595. package/docs/ViewerSlots.jpg +0 -0
  596. package/docs/ViewerStyled.jpg +0 -0
  597. package/lib/index.d.ts +0 -534
  598. package/lib/index.js +0 -1939
  599. package/lib/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"splatFileLoader-zwiLbtie.esm.min.js","sources":["../../../../../dev/core/dist/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js","../../../../../dev/core/dist/Shaders/gaussianSplatting.fragment.js","../../../../../dev/core/dist/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js","../../../../../dev/core/dist/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js","../../../../../dev/core/dist/Shaders/ShadersInclude/gaussianSplatting.js","../../../../../dev/core/dist/Shaders/gaussianSplatting.vertex.js","../../../../../dev/core/dist/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js","../../../../../dev/core/dist/ShadersWGSL/gaussianSplatting.fragment.js","../../../../../dev/core/dist/ShadersWGSL/ShadersInclude/gaussianSplatting.js","../../../../../dev/core/dist/ShadersWGSL/gaussianSplatting.vertex.js","../../../../../dev/core/dist/Materials/GaussianSplatting/gaussianSplattingMaterial.js","../../../../../dev/core/dist/Maths/math.scalar.js","../../../../../dev/core/dist/Meshes/GaussianSplatting/gaussianSplattingMesh.js","../../../../../dev/core/dist/Culling/ray.core.js","../../../../../dev/core/dist/Particles/pointsCloudSystem.js","../../../../../dev/loaders/dist/SPLAT/splatFileLoader.js","../../../../../dev/core/dist/Particles/cloudPoint.js","../../../../../dev/core/dist/Culling/ray.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./logDepthFragment\";\nimport \"./fogFragment\";\nconst name = \"gaussianSplattingFragmentDeclaration\";\nconst shader = `vec4 gaussianColor(vec4 inColor)\n{float A=-dot(vPosition,vPosition);if (A<-4.0) discard;float B=exp(A)*inColor.a;\n#include<logDepthFragment>\nvec3 color=inColor.rgb;\n#ifdef FOG\n#include<fogFragment>\n#endif\nreturn vec4(color,B);}\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingFragmentDeclaration = { name, shader };\n//# sourceMappingURL=gaussianSplattingFragmentDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplattingFragmentDeclaration>\nvoid main () { \n#include<clipPlaneFragment>\ngl_FragColor=gaussianColor(vColor);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingPixelShader = { name, shader };\n//# sourceMappingURL=gaussianSplatting.fragment.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"gaussianSplattingVertexDeclaration\";\nconst shader = `attribute vec2 position;uniform mat4 view;uniform mat4 projection;uniform mat4 world;`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexDeclaration = { name, shader };\n//# sourceMappingURL=gaussianSplattingVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneUboDeclaration\";\nimport \"./meshUboDeclaration\";\nconst name = \"gaussianSplattingUboDeclaration\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute vec2 position;`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingUboDeclaration = { name, shader };\n//# sourceMappingURL=gaussianSplattingUboDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"gaussianSplatting\";\nconst shader = `#if !defined(WEBGL2) && !defined(WEBGPU) && !defined(NATIVE)\nmat3 transpose(mat3 matrix) {return mat3(matrix[0][0],matrix[1][0],matrix[2][0],\nmatrix[0][1],matrix[1][1],matrix[2][1],\nmatrix[0][2],matrix[1][2],matrix[2][2]);}\n#endif\nvec2 getDataUV(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return vec2((x+0.5)/textureSize.x,(y+0.5)/textureSize.y);}\nstruct Splat {vec4 center;vec4 color;vec4 covA;vec4 covB;};Splat readSplat(float splatIndex)\n{Splat splat;vec2 splatUV=getDataUV(splatIndex,dataTextureSize);splat.center=texture2D(centersTexture,splatUV);splat.color=texture2D(colorsTexture,splatUV);splat.covA=texture2D(covariancesATexture,splatUV)*splat.center.w;splat.covB=texture2D(covariancesBTexture,splatUV)*splat.center.w;return splat;}\nvec4 gaussianSplatting(vec2 meshPos,vec3 worldPos,vec2 scale,vec3 covA,vec3 covB,mat4 worldMatrix,mat4 viewMatrix,mat4 projectionMatrix)\n{mat4 modelView=viewMatrix*worldMatrix;vec4 camspace=viewMatrix*vec4(worldPos,1.);vec4 pos2d=projectionMatrix*camspace;float bounds=1.2*pos2d.w;if (pos2d.z<-pos2d.w || pos2d.x<-bounds || pos2d.x>bounds\n|| pos2d.y<-bounds || pos2d.y>bounds) {return vec4(0.0,0.0,2.0,1.0);}\nmat3 Vrk=mat3(\ncovA.x,covA.y,covA.z,\ncovA.y,covB.x,covB.y,\ncovA.z,covB.y,covB.z\n);mat3 J=mat3(\nfocal.x/camspace.z,0.,-(focal.x*camspace.x)/(camspace.z*camspace.z),\n0.,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),\n0.,0.,0.\n);mat3 invy=mat3(1,0,0,0,-1,0,0,0,1);mat3 T=invy*transpose(mat3(modelView))*J;mat3 cov2d=transpose(T)*Vrk*T;float mid=(cov2d[0][0]+cov2d[1][1])/2.0;float radius=length(vec2((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));float lambda1=mid+radius,lambda2=mid-radius;if (lambda2<0.0)\n{return vec4(0.0,0.0,2.0,1.0);}\nvec2 diagonalVector=normalize(vec2(cov2d[0][1],lambda1-cov2d[0][0]));vec2 majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;vec2 minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2(diagonalVector.y,-diagonalVector.x);vec2 vCenter=vec2(pos2d);return vec4(\nvCenter \n+ ((meshPos.x*majorAxis\n+ meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,pos2d.zw);}`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplatting = { name, shader };\n//# sourceMappingURL=gaussianSplatting.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/gaussianSplattingVertexDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<__decl__gaussianSplattingVertex>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute float splatIndex;uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;varying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplatting>\nvoid main () {Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position;gl_Position=gaussianSplatting(position,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexShader = { name, shader };\n//# sourceMappingURL=gaussianSplatting.vertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./logDepthFragment\";\nimport \"./fogFragment\";\nconst name = \"gaussianSplattingFragmentDeclaration\";\nconst shader = `fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f\n{var A : f32=-dot(inPosition,inPosition);if (A>-4.0)\n{var B: f32=exp(A)*inColor.a;\n#include<logDepthFragment>\nvar color: vec3f=inColor.rgb;\n#ifdef FOG\n#include<fogFragment>\n#endif\nreturn vec4f(color,B);} else {return vec4f(0.0);}}\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingFragmentDeclarationWGSL = { name, shader };\n//# sourceMappingURL=gaussianSplattingFragmentDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplattingFragmentDeclaration>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nfragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingPixelShaderWGSL = { name, shader };\n//# sourceMappingURL=gaussianSplatting.fragment.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"gaussianSplatting\";\nconst shader = `fn getDataUV(index: f32,dataTextureSize: vec2f)->vec2<f32> {let y: f32=floor(index/dataTextureSize.x);let x: f32=index-y*dataTextureSize.x;return vec2f((x+0.5),(y+0.5));}\nstruct Splat {center: vec4f,\ncolor: vec4f,\ncovA: vec4f,\ncovB: vec4f,};fn readSplat(splatIndex: f32,dataTextureSize: vec2f)->Splat {var splat: Splat;let splatUV=getDataUV(splatIndex,dataTextureSize);let splatUVi32=vec2<i32>(i32(splatUV.x),i32(splatUV.y));splat.center=textureLoad(centersTexture,splatUVi32,0);splat.color=textureLoad(colorsTexture,splatUVi32,0);splat.covA=textureLoad(covariancesATexture,splatUVi32,0)*splat.center.w;splat.covB=textureLoad(covariancesBTexture,splatUVi32,0)*splat.center.w;return splat;}\nfn gaussianSplatting(\nmeshPos: vec2<f32>,\nworldPos: vec3<f32>,\nscale: vec2<f32>,\ncovA: vec3<f32>,\ncovB: vec3<f32>,\nworldMatrix: mat4x4<f32>,\nviewMatrix: mat4x4<f32>,\nprojectionMatrix: mat4x4<f32>,\nfocal: vec2f,\ninvViewport: vec2f\n)->vec4f {let modelView=viewMatrix*worldMatrix;let camspace=viewMatrix*vec4f(worldPos,1.0);let pos2d=projectionMatrix*camspace;let bounds=1.2*pos2d.w;if (pos2d.z<0. || pos2d.x<-bounds || pos2d.x>bounds || pos2d.y<-bounds || pos2d.y>bounds) {return vec4f(0.0,0.0,2.0,1.0);}\nlet Vrk=mat3x3<f32>(\ncovA.x,covA.y,covA.z,\ncovA.y,covB.x,covB.y,\ncovA.z,covB.y,covB.z\n);let J=mat3x3<f32>(\nfocal.x/camspace.z,0.0,-(focal.x*camspace.x)/(camspace.z*camspace.z),\n0.0,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),\n0.0,0.0,0.0\n);let invy=mat3x3<f32>(\n1.0,0.0,0.0,\n0.0,-1.0,0.0,\n0.0,0.0,1.0\n);let T=invy*transpose(mat3x3<f32>(\nmodelView[0].xyz,\nmodelView[1].xyz,\nmodelView[2].xyz))*J;let cov2d=transpose(T)*Vrk*T;let mid=(cov2d[0][0]+cov2d[1][1])/2.0;let radius=length(vec2<f32>((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));let lambda1=mid+radius;let lambda2=mid-radius;if (lambda2<0.0) {return vec4f(0.0,0.0,2.0,1.0);}\nlet diagonalVector=normalize(vec2<f32>(cov2d[0][1],lambda1-cov2d[0][0]));let majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;let minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2<f32>(diagonalVector.y,-diagonalVector.x);let vCenter=vec2<f32>(pos2d.x,pos2d.y);return vec4f(\nvCenter+((meshPos.x*majorAxis+meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,\npos2d.z,\npos2d.w\n);}\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingWGSL = { name, shader };\n//# sourceMappingURL=gaussianSplatting.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex: f32;attribute position: vec2f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;varying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var splat: Splat=readSplat(input.splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vColor=splat.color;vertexOutputs.vPosition=input.position;vertexOutputs.position=gaussianSplatting(input.position,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n//# sourceMappingURL=gaussianSplatting.vertex.js.map","import { SerializationHelper } from \"../../Misc/decorators.serialization\";\nimport { VertexBuffer } from \"../../Buffers/buffer\";\nimport { MaterialDefines } from \"../../Materials/materialDefines\";\nimport { PushMaterial } from \"../../Materials/pushMaterial\";\nimport { RegisterClass } from \"../../Misc/typeStore\";\nimport { addClipPlaneUniforms, bindClipPlane } from \"../clipPlaneMaterialHelper\";\nimport { Camera } from \"core/Cameras/camera\";\nimport \"../../Shaders/gaussianSplatting.fragment\";\nimport \"../../Shaders/gaussianSplatting.vertex\";\nimport \"../../ShadersWGSL/gaussianSplatting.fragment\";\nimport \"../../ShadersWGSL/gaussianSplatting.vertex\";\nimport { BindFogParameters, BindLogDepth, PrepareAttributesForInstances, PrepareDefinesForAttributes, PrepareDefinesForFrameBoundValues, PrepareDefinesForMisc, PrepareUniformsAndSamplersList, } from \"../materialHelper.functions\";\n/**\n * @internal\n */\nclass GaussianSplattingMaterialDefines extends MaterialDefines {\n /**\n * Constructor of the defines.\n */\n constructor() {\n super();\n this.FOG = false;\n this.THIN_INSTANCES = true;\n this.LOGARITHMICDEPTH = false;\n this.CLIPPLANE = false;\n this.CLIPPLANE2 = false;\n this.CLIPPLANE3 = false;\n this.CLIPPLANE4 = false;\n this.CLIPPLANE5 = false;\n this.CLIPPLANE6 = false;\n this.rebuild();\n }\n}\n/**\n * GaussianSplattingMaterial material used to render Gaussian Splatting\n * @experimental\n */\nexport class GaussianSplattingMaterial extends PushMaterial {\n /**\n * Instantiates a Gaussian Splatting Material in the given scene\n * @param name The friendly name of the material\n * @param scene The scene to add the material to\n */\n constructor(name, scene) {\n super(name, scene);\n this.backFaceCulling = false;\n }\n /**\n * Gets a boolean indicating that current material needs to register RTT\n */\n get hasRenderTargetTextures() {\n return false;\n }\n /**\n * Specifies whether or not this material should be rendered in alpha test mode.\n * @returns false\n */\n needAlphaTesting() {\n return false;\n }\n /**\n * Specifies whether or not this material should be rendered in alpha blend mode.\n * @returns true\n */\n needAlphaBlending() {\n return true;\n }\n /**\n * Checks whether the material is ready to be rendered for a given mesh.\n * @param mesh The mesh to render\n * @param subMesh The submesh to check against\n * @returns true if all the dependencies are ready (Textures, Effects...)\n */\n isReadyForSubMesh(mesh, subMesh) {\n const useInstances = true;\n const drawWrapper = subMesh._drawWrapper;\n if (drawWrapper.effect && this.isFrozen) {\n if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\n return true;\n }\n }\n if (!subMesh.materialDefines) {\n subMesh.materialDefines = new GaussianSplattingMaterialDefines();\n }\n const scene = this.getScene();\n const defines = subMesh.materialDefines;\n if (this._isReadyForSubMesh(subMesh)) {\n return true;\n }\n const engine = scene.getEngine();\n // Misc.\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, false, defines);\n // Values that need to be evaluated on every frame\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, true);\n // Attribs\n PrepareDefinesForAttributes(mesh, defines, false, false);\n // Get correct effect\n if (defines.isDirty) {\n defines.markAsProcessed();\n scene.resetCachedMaterial();\n //Attributes\n const attribs = [VertexBuffer.PositionKind, \"splatIndex\"];\n PrepareAttributesForInstances(attribs, defines);\n const uniforms = [\"world\", \"view\", \"projection\", \"vFogInfos\", \"vFogColor\", \"logarithmicDepthConstant\", \"invViewport\", \"dataTextureSize\", \"focal\"];\n const samplers = [\"covariancesATexture\", \"covariancesBTexture\", \"centersTexture\", \"colorsTexture\"];\n const uniformBuffers = [\"Scene\", \"Mesh\"];\n PrepareUniformsAndSamplersList({\n uniformsNames: uniforms,\n uniformBuffersNames: uniformBuffers,\n samplers: samplers,\n defines: defines,\n });\n addClipPlaneUniforms(uniforms);\n const join = defines.toString();\n const effect = scene.getEngine().createEffect(\"gaussianSplatting\", {\n attributes: attribs,\n uniformsNames: uniforms,\n uniformBuffersNames: uniformBuffers,\n samplers: samplers,\n defines: join,\n onCompiled: this.onCompiled,\n onError: this.onError,\n indexParameters: {},\n shaderLanguage: this._shaderLanguage,\n extraInitializationsAsync: async () => {\n if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n await Promise.all([import(\"../../ShadersWGSL/gaussianSplatting.fragment\"), import(\"../../ShadersWGSL/gaussianSplatting.vertex\")]);\n }\n else {\n await Promise.all([import(\"../../Shaders/gaussianSplatting.fragment\"), import(\"../../Shaders/gaussianSplatting.vertex\")]);\n }\n },\n }, engine);\n subMesh.setEffect(effect, defines, this._materialContext);\n }\n if (!subMesh.effect || !subMesh.effect.isReady()) {\n return false;\n }\n defines._renderId = scene.getRenderId();\n drawWrapper._wasPreviouslyReady = true;\n drawWrapper._wasPreviouslyUsingInstances = useInstances;\n return true;\n }\n /**\n * Bind material effect for a specific Gaussian Splatting mesh\n * @param mesh Gaussian splatting mesh\n * @param effect Splatting material or node material\n * @param scene scene that contains mesh and camera used for rendering\n */\n static BindEffect(mesh, effect, scene) {\n const engine = scene.getEngine();\n const camera = scene.activeCamera;\n const renderWidth = engine.getRenderWidth();\n const renderHeight = engine.getRenderHeight();\n // check if rigcamera, get number of rigs\n const numberOfRigs = camera?.rigParent?.rigCameras.length || 1;\n effect.setFloat2(\"invViewport\", 1 / (renderWidth / numberOfRigs), 1 / renderHeight);\n let focal = 1000;\n if (camera) {\n /*\n more explicit version:\n const t = camera.getProjectionMatrix().m[5];\n const FovY = Math.atan(1.0 / t) * 2.0;\n focal = renderHeight / 2.0 / Math.tan(FovY / 2.0);\n Using a shorter version here to not have tan(atan) and 2.0 factor\n */\n const t = camera.getProjectionMatrix().m[5];\n if (camera.fovMode == Camera.FOVMODE_VERTICAL_FIXED) {\n focal = (renderHeight * t) / 2.0;\n }\n else {\n focal = (renderWidth * t) / 2.0;\n }\n }\n effect.setFloat2(\"focal\", focal, focal);\n const gsMesh = mesh;\n if (gsMesh.covariancesATexture) {\n const textureSize = gsMesh.covariancesATexture.getSize();\n effect.setFloat2(\"dataTextureSize\", textureSize.width, textureSize.height);\n effect.setTexture(\"covariancesATexture\", gsMesh.covariancesATexture);\n effect.setTexture(\"covariancesBTexture\", gsMesh.covariancesBTexture);\n effect.setTexture(\"centersTexture\", gsMesh.centersTexture);\n effect.setTexture(\"colorsTexture\", gsMesh.colorsTexture);\n }\n }\n /**\n * Binds the submesh to this material by preparing the effect and shader to draw\n * @param world defines the world transformation matrix\n * @param mesh defines the mesh containing the submesh\n * @param subMesh defines the submesh to bind the material to\n */\n bindForSubMesh(world, mesh, subMesh) {\n const scene = this.getScene();\n const defines = subMesh.materialDefines;\n if (!defines) {\n return;\n }\n const effect = subMesh.effect;\n if (!effect) {\n return;\n }\n this._activeEffect = effect;\n // Matrices Mesh.\n mesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n mesh.transferToEffect(world);\n // Bind data\n const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);\n if (mustRebind) {\n this.bindView(effect);\n this.bindViewProjection(effect);\n GaussianSplattingMaterial.BindEffect(mesh, this._activeEffect, scene);\n // Clip plane\n bindClipPlane(effect, this, scene);\n }\n else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {\n this._needToBindSceneUbo = true;\n }\n // Fog\n BindFogParameters(scene, mesh, effect);\n // Log. depth\n if (this.useLogarithmicDepth) {\n BindLogDepth(defines, effect, scene);\n }\n this._afterBind(mesh, this._activeEffect, subMesh);\n }\n /**\n * Clones the material.\n * @param name The cloned name.\n * @returns The cloned material.\n */\n clone(name) {\n return SerializationHelper.Clone(() => new GaussianSplattingMaterial(name, this.getScene()), this);\n }\n /**\n * Serializes the current material to its JSON representation.\n * @returns The JSON representation.\n */\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.customType = \"BABYLON.GaussianSplattingMaterial\";\n return serializationObject;\n }\n /**\n * Gets the class name of the material\n * @returns \"GaussianSplattingMaterial\"\n */\n getClassName() {\n return \"GaussianSplattingMaterial\";\n }\n /**\n * Parse a JSON input to create back a Gaussian Splatting material.\n * @param source The JSON data to parse\n * @param scene The scene to create the parsed material in\n * @param rootUrl The root url of the assets the material depends upon\n * @returns the instantiated GaussianSplattingMaterial.\n */\n static Parse(source, scene, rootUrl) {\n return SerializationHelper.Parse(() => new GaussianSplattingMaterial(source.name, scene), source, scene, rootUrl);\n }\n}\nRegisterClass(\"BABYLON.GaussianSplattingMaterial\", GaussianSplattingMaterial);\n//# sourceMappingURL=gaussianSplattingMaterial.js.map","import * as functions from \"./math.scalar.functions\";\nconst HCF = functions.HighestCommonFactor;\n/**\n * Scalar computation library\n * @deprecated Please use the scalar functions\n */\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const Scalar = {\n ...functions,\n /**\n * Two pi constants convenient for computation.\n */\n TwoPi: Math.PI * 2,\n /**\n * Returns -1 if value is negative and +1 is value is positive.\n * @param value the value\n * @returns the value itself if it's equal to zero.\n */\n Sign: Math.sign,\n /**\n * the log2 of value.\n * @param value the value to compute log2 of\n * @returns the log2 of value.\n */\n Log2: Math.log2,\n /**\n * Returns the highest common factor of two integers.\n * @param a first parameter\n * @param b second parameter\n * @returns HCF of a and b\n */\n HCF,\n};\n/* eslint-enable @typescript-eslint/naming-convention */\n//# sourceMappingURL=math.scalar.js.map","import { SubMesh } from \"../subMesh\";\nimport { Mesh } from \"../mesh\";\nimport { VertexData } from \"../mesh.vertexData\";\nimport { Matrix, TmpVectors, Vector2, Vector3 } from \"core/Maths/math.vector\";\nimport { Logger } from \"core/Misc/logger\";\nimport { GaussianSplattingMaterial } from \"core/Materials/GaussianSplatting/gaussianSplattingMaterial\";\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\nimport { Constants } from \"core/Engines/constants\";\nimport { Tools } from \"core/Misc/tools\";\nimport \"core/Meshes/thinInstanceMesh\";\nimport { ToHalfFloat } from \"core/Misc/textureTools\";\nimport { Scalar } from \"core/Maths/math.scalar\";\nimport { runCoroutineSync, runCoroutineAsync, createYieldingScheduler } from \"core/Misc/coroutine\";\n// @internal\nconst unpackUnorm = (value, bits) => {\n const t = (1 << bits) - 1;\n return (value & t) / t;\n};\n// @internal\nconst unpack111011 = (value, result) => {\n result.x = unpackUnorm(value >>> 21, 11);\n result.y = unpackUnorm(value >>> 11, 10);\n result.z = unpackUnorm(value, 11);\n};\n// @internal\nconst unpack8888 = (value, result) => {\n result[0] = unpackUnorm(value >>> 24, 8) * 255;\n result[1] = unpackUnorm(value >>> 16, 8) * 255;\n result[2] = unpackUnorm(value >>> 8, 8) * 255;\n result[3] = unpackUnorm(value, 8) * 255;\n};\n// @internal\n// unpack quaternion with 2,10,10,10 format (largest element, 3x10bit element)\nconst unpackRot = (value, result) => {\n const norm = 1.0 / (Math.sqrt(2) * 0.5);\n const a = (unpackUnorm(value >>> 20, 10) - 0.5) * norm;\n const b = (unpackUnorm(value >>> 10, 10) - 0.5) * norm;\n const c = (unpackUnorm(value, 10) - 0.5) * norm;\n const m = Math.sqrt(1.0 - (a * a + b * b + c * c));\n switch (value >>> 30) {\n case 0:\n result.set(m, a, b, c);\n break;\n case 1:\n result.set(a, m, b, c);\n break;\n case 2:\n result.set(a, b, m, c);\n break;\n case 3:\n result.set(a, b, c, m);\n break;\n }\n};\n/**\n * Representation of the types\n */\nvar PLYType;\n(function (PLYType) {\n PLYType[PLYType[\"FLOAT\"] = 0] = \"FLOAT\";\n PLYType[PLYType[\"INT\"] = 1] = \"INT\";\n PLYType[PLYType[\"UINT\"] = 2] = \"UINT\";\n PLYType[PLYType[\"DOUBLE\"] = 3] = \"DOUBLE\";\n PLYType[PLYType[\"UCHAR\"] = 4] = \"UCHAR\";\n PLYType[PLYType[\"UNDEFINED\"] = 5] = \"UNDEFINED\";\n})(PLYType || (PLYType = {}));\n/**\n * Usage types of the PLY values\n */\nvar PLYValue;\n(function (PLYValue) {\n PLYValue[PLYValue[\"MIN_X\"] = 0] = \"MIN_X\";\n PLYValue[PLYValue[\"MIN_Y\"] = 1] = \"MIN_Y\";\n PLYValue[PLYValue[\"MIN_Z\"] = 2] = \"MIN_Z\";\n PLYValue[PLYValue[\"MAX_X\"] = 3] = \"MAX_X\";\n PLYValue[PLYValue[\"MAX_Y\"] = 4] = \"MAX_Y\";\n PLYValue[PLYValue[\"MAX_Z\"] = 5] = \"MAX_Z\";\n PLYValue[PLYValue[\"MIN_SCALE_X\"] = 6] = \"MIN_SCALE_X\";\n PLYValue[PLYValue[\"MIN_SCALE_Y\"] = 7] = \"MIN_SCALE_Y\";\n PLYValue[PLYValue[\"MIN_SCALE_Z\"] = 8] = \"MIN_SCALE_Z\";\n PLYValue[PLYValue[\"MAX_SCALE_X\"] = 9] = \"MAX_SCALE_X\";\n PLYValue[PLYValue[\"MAX_SCALE_Y\"] = 10] = \"MAX_SCALE_Y\";\n PLYValue[PLYValue[\"MAX_SCALE_Z\"] = 11] = \"MAX_SCALE_Z\";\n PLYValue[PLYValue[\"PACKED_POSITION\"] = 12] = \"PACKED_POSITION\";\n PLYValue[PLYValue[\"PACKED_ROTATION\"] = 13] = \"PACKED_ROTATION\";\n PLYValue[PLYValue[\"PACKED_SCALE\"] = 14] = \"PACKED_SCALE\";\n PLYValue[PLYValue[\"PACKED_COLOR\"] = 15] = \"PACKED_COLOR\";\n PLYValue[PLYValue[\"X\"] = 16] = \"X\";\n PLYValue[PLYValue[\"Y\"] = 17] = \"Y\";\n PLYValue[PLYValue[\"Z\"] = 18] = \"Z\";\n PLYValue[PLYValue[\"SCALE_0\"] = 19] = \"SCALE_0\";\n PLYValue[PLYValue[\"SCALE_1\"] = 20] = \"SCALE_1\";\n PLYValue[PLYValue[\"SCALE_2\"] = 21] = \"SCALE_2\";\n PLYValue[PLYValue[\"DIFFUSE_RED\"] = 22] = \"DIFFUSE_RED\";\n PLYValue[PLYValue[\"DIFFUSE_GREEN\"] = 23] = \"DIFFUSE_GREEN\";\n PLYValue[PLYValue[\"DIFFUSE_BLUE\"] = 24] = \"DIFFUSE_BLUE\";\n PLYValue[PLYValue[\"OPACITY\"] = 25] = \"OPACITY\";\n PLYValue[PLYValue[\"F_DC_0\"] = 26] = \"F_DC_0\";\n PLYValue[PLYValue[\"F_DC_1\"] = 27] = \"F_DC_1\";\n PLYValue[PLYValue[\"F_DC_2\"] = 28] = \"F_DC_2\";\n PLYValue[PLYValue[\"F_DC_3\"] = 29] = \"F_DC_3\";\n PLYValue[PLYValue[\"ROT_0\"] = 30] = \"ROT_0\";\n PLYValue[PLYValue[\"ROT_1\"] = 31] = \"ROT_1\";\n PLYValue[PLYValue[\"ROT_2\"] = 32] = \"ROT_2\";\n PLYValue[PLYValue[\"ROT_3\"] = 33] = \"ROT_3\";\n PLYValue[PLYValue[\"UNDEFINED\"] = 34] = \"UNDEFINED\";\n})(PLYValue || (PLYValue = {}));\n/**\n * Class used to render a gaussian splatting mesh\n */\nexport class GaussianSplattingMesh extends Mesh {\n /**\n * Gets the covariancesA texture\n */\n get covariancesATexture() {\n return this._covariancesATexture;\n }\n /**\n * Gets the covariancesB texture\n */\n get covariancesBTexture() {\n return this._covariancesBTexture;\n }\n /**\n * Gets the centers texture\n */\n get centersTexture() {\n return this._centersTexture;\n }\n /**\n * Gets the colors texture\n */\n get colorsTexture() {\n return this._colorsTexture;\n }\n /**\n * set rendering material\n */\n set material(value) {\n this._material = value;\n this._material.backFaceCulling = true;\n this._material.cullBackFaces = false;\n value.resetDrawCache();\n }\n /**\n * get rendering material\n */\n get material() {\n return this._material;\n }\n /**\n * Creates a new gaussian splatting mesh\n * @param name defines the name of the mesh\n * @param url defines the url to load from (optional)\n * @param scene defines the hosting scene (optional)\n * @param keepInRam keep datas in ram for editing purpose\n */\n constructor(name, url = null, scene = null, keepInRam = false) {\n super(name, scene);\n this._vertexCount = 0;\n this._worker = null;\n this._frameIdLastUpdate = -1;\n this._modelViewMatrix = Matrix.Identity();\n this._canPostToWorker = true;\n this._readyToDisplay = false;\n this._covariancesATexture = null;\n this._covariancesBTexture = null;\n this._centersTexture = null;\n this._colorsTexture = null;\n this._splatPositions = null;\n this._splatIndex = null;\n //@ts-expect-error\n this._covariancesA = null;\n //@ts-expect-error\n this._covariancesB = null;\n //@ts-expect-error\n this._colors = null;\n this._keepInRam = false;\n this._delayedTextureUpdate = null;\n this._oldDirection = new Vector3();\n this._useRGBACovariants = false;\n this._material = null;\n this._tmpCovariances = [0, 0, 0, 0, 0, 0];\n this._sortIsDirty = false;\n const vertexData = new VertexData();\n // Use an intanced quad or triangle. Triangle might be a bit faster because of less shader invocation but I didn't see any difference.\n // Keeping both and use triangle for now.\n // for quad, use following lines\n //vertexData.positions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];\n //vertexData.indices = [0, 1, 2, 0, 2, 3];\n vertexData.positions = [-3, -2, 0, 3, -2, 0, 0, 4, 0];\n vertexData.indices = [0, 1, 2];\n vertexData.applyToMesh(this);\n this.subMeshes = [];\n // for quad, use following line\n //new SubMesh(0, 0, 4, 0, 6, this);\n new SubMesh(0, 0, 3, 0, 3, this);\n this.setEnabled(false);\n // webGL2 and webGPU support for RG texture with float16 is fine. not webGL1\n this._useRGBACovariants = !this.getEngine().isWebGPU && this.getEngine().version === 1.0;\n this._keepInRam = keepInRam;\n if (url) {\n this.loadFileAsync(url);\n }\n this._material = new GaussianSplattingMaterial(this.name + \"_material\", this._scene);\n }\n /**\n * Returns the class name\n * @returns \"GaussianSplattingMesh\"\n */\n getClassName() {\n return \"GaussianSplattingMesh\";\n }\n /**\n * Returns the total number of vertices (splats) within the mesh\n * @returns the total number of vertices\n */\n getTotalVertices() {\n return this._vertexCount;\n }\n /**\n * Is this node ready to be used/rendered\n * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\n * @returns true when ready\n */\n isReady(completeCheck = false) {\n if (!super.isReady(completeCheck, true)) {\n return false;\n }\n if (!this._readyToDisplay) {\n // mesh is ready when worker has done at least 1 sorting\n this._postToWorker(true);\n return false;\n }\n return true;\n }\n _postToWorker(forced = false) {\n const frameId = this.getScene().getFrameId();\n if ((forced || frameId !== this._frameIdLastUpdate) && this._worker && this._scene.activeCamera && this._canPostToWorker) {\n const cameraMatrix = this._scene.activeCamera.getViewMatrix();\n this.getWorldMatrix().multiplyToRef(cameraMatrix, this._modelViewMatrix);\n cameraMatrix.invertToRef(TmpVectors.Matrix[0]);\n this.getWorldMatrix().multiplyToRef(TmpVectors.Matrix[0], TmpVectors.Matrix[1]);\n Vector3.TransformNormalToRef(Vector3.Forward(this._scene.useRightHandedSystem), TmpVectors.Matrix[1], TmpVectors.Vector3[2]);\n TmpVectors.Vector3[2].normalize();\n const dot = Vector3.Dot(TmpVectors.Vector3[2], this._oldDirection);\n if (forced || Math.abs(dot - 1) >= 0.01) {\n this._oldDirection.copyFrom(TmpVectors.Vector3[2]);\n this._frameIdLastUpdate = frameId;\n this._canPostToWorker = false;\n this._worker.postMessage({ view: this._modelViewMatrix.m, depthMix: this._depthMix, useRightHandedSystem: this._scene.useRightHandedSystem }, [\n this._depthMix.buffer,\n ]);\n }\n }\n }\n /**\n * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager\n * @param subMesh defines the subMesh to render\n * @param enableAlphaMode defines if alpha mode can be changed\n * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering\n * @returns the current mesh\n */\n render(subMesh, enableAlphaMode, effectiveMeshReplacement) {\n this._postToWorker();\n return super.render(subMesh, enableAlphaMode, effectiveMeshReplacement);\n }\n static _TypeNameToEnum(name) {\n switch (name) {\n case \"float\":\n return 0 /* PLYType.FLOAT */;\n case \"int\":\n return 1 /* PLYType.INT */;\n break;\n case \"uint\":\n return 2 /* PLYType.UINT */;\n case \"double\":\n return 3 /* PLYType.DOUBLE */;\n case \"uchar\":\n return 4 /* PLYType.UCHAR */;\n }\n return 5 /* PLYType.UNDEFINED */;\n }\n static _ValueNameToEnum(name) {\n switch (name) {\n case \"min_x\":\n return 0 /* PLYValue.MIN_X */;\n case \"min_y\":\n return 1 /* PLYValue.MIN_Y */;\n case \"min_z\":\n return 2 /* PLYValue.MIN_Z */;\n case \"max_x\":\n return 3 /* PLYValue.MAX_X */;\n case \"max_y\":\n return 4 /* PLYValue.MAX_Y */;\n case \"max_z\":\n return 5 /* PLYValue.MAX_Z */;\n case \"min_scale_x\":\n return 6 /* PLYValue.MIN_SCALE_X */;\n case \"min_scale_y\":\n return 7 /* PLYValue.MIN_SCALE_Y */;\n case \"min_scale_z\":\n return 8 /* PLYValue.MIN_SCALE_Z */;\n case \"max_scale_x\":\n return 9 /* PLYValue.MAX_SCALE_X */;\n case \"max_scale_y\":\n return 10 /* PLYValue.MAX_SCALE_Y */;\n case \"max_scale_z\":\n return 11 /* PLYValue.MAX_SCALE_Z */;\n case \"packed_position\":\n return 12 /* PLYValue.PACKED_POSITION */;\n case \"packed_rotation\":\n return 13 /* PLYValue.PACKED_ROTATION */;\n case \"packed_scale\":\n return 14 /* PLYValue.PACKED_SCALE */;\n case \"packed_color\":\n return 15 /* PLYValue.PACKED_COLOR */;\n case \"x\":\n return 16 /* PLYValue.X */;\n case \"y\":\n return 17 /* PLYValue.Y */;\n case \"z\":\n return 18 /* PLYValue.Z */;\n case \"scale_0\":\n return 19 /* PLYValue.SCALE_0 */;\n case \"scale_1\":\n return 20 /* PLYValue.SCALE_1 */;\n case \"scale_2\":\n return 21 /* PLYValue.SCALE_2 */;\n case \"diffuse_red\":\n case \"red\":\n return 22 /* PLYValue.DIFFUSE_RED */;\n case \"diffuse_green\":\n case \"green\":\n return 23 /* PLYValue.DIFFUSE_GREEN */;\n case \"diffuse_blue\":\n case \"blue\":\n return 24 /* PLYValue.DIFFUSE_BLUE */;\n case \"f_dc_0\":\n return 26 /* PLYValue.F_DC_0 */;\n case \"f_dc_1\":\n return 27 /* PLYValue.F_DC_1 */;\n case \"f_dc_2\":\n return 28 /* PLYValue.F_DC_2 */;\n case \"f_dc_3\":\n return 29 /* PLYValue.F_DC_3 */;\n case \"opacity\":\n return 25 /* PLYValue.OPACITY */;\n case \"rot_0\":\n return 30 /* PLYValue.ROT_0 */;\n case \"rot_1\":\n return 31 /* PLYValue.ROT_1 */;\n case \"rot_2\":\n return 32 /* PLYValue.ROT_2 */;\n case \"rot_3\":\n return 33 /* PLYValue.ROT_3 */;\n }\n return 34 /* PLYValue.UNDEFINED */;\n }\n /**\n * Parse a PLY file header and returns metas infos on splats and chunks\n * @param data the loaded buffer\n * @returns a PLYHeader\n */\n static ParseHeader(data) {\n const ubuf = new Uint8Array(data);\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\n const headerEnd = \"end_header\\n\";\n const headerEndIndex = header.indexOf(headerEnd);\n if (headerEndIndex < 0 || !header) {\n // standard splat\n return null;\n }\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)[1]);\n const chunkElement = /element chunk (\\d+)\\n/.exec(header);\n let chunkCount = 0;\n if (chunkElement) {\n chunkCount = parseInt(chunkElement[1]);\n }\n let rowVertexOffset = 0;\n let rowChunkOffset = 0;\n const offsets = {\n double: 8,\n int: 4,\n uint: 4,\n float: 4,\n short: 2,\n ushort: 2,\n uchar: 1,\n list: 0,\n };\n let ElementMode;\n (function (ElementMode) {\n ElementMode[ElementMode[\"Vertex\"] = 0] = \"Vertex\";\n ElementMode[ElementMode[\"Chunk\"] = 1] = \"Chunk\";\n })(ElementMode || (ElementMode = {}));\n let chunkMode = 1 /* ElementMode.Chunk */;\n const vertexProperties = [];\n const chunkProperties = [];\n const filtered = header.slice(0, headerEndIndex).split(\"\\n\");\n for (const prop of filtered) {\n if (prop.startsWith(\"property \")) {\n const [, typeName, name] = prop.split(\" \");\n const value = GaussianSplattingMesh._ValueNameToEnum(name);\n const type = GaussianSplattingMesh._TypeNameToEnum(typeName);\n if (chunkMode == 1 /* ElementMode.Chunk */) {\n chunkProperties.push({ value, type, offset: rowChunkOffset });\n rowChunkOffset += offsets[typeName];\n }\n else if (chunkMode == 0 /* ElementMode.Vertex */) {\n vertexProperties.push({ value, type, offset: rowVertexOffset });\n rowVertexOffset += offsets[typeName];\n }\n if (!offsets[typeName]) {\n Logger.Warn(`Unsupported property type: ${typeName}.`);\n }\n }\n else if (prop.startsWith(\"element \")) {\n const [, type] = prop.split(\" \");\n if (type == \"chunk\") {\n chunkMode = 1 /* ElementMode.Chunk */;\n }\n else if (type == \"vertex\") {\n chunkMode = 0 /* ElementMode.Vertex */;\n }\n }\n }\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\n const buffer = new ArrayBuffer(GaussianSplattingMesh._RowOutputLength * vertexCount);\n return {\n vertexCount: vertexCount,\n chunkCount: chunkCount,\n rowVertexLength: rowVertexOffset,\n rowChunkLength: rowChunkOffset,\n vertexProperties: vertexProperties,\n chunkProperties: chunkProperties,\n dataView: dataView,\n buffer: buffer,\n };\n }\n static _GetCompressedChunks(header, offset) {\n if (!header.chunkCount) {\n return null;\n }\n const dataView = header.dataView;\n const compressedChunks = new Array(header.chunkCount);\n for (let i = 0; i < header.chunkCount; i++) {\n const currentChunk = { min: new Vector3(), max: new Vector3(), minScale: new Vector3(), maxScale: new Vector3() };\n compressedChunks[i] = currentChunk;\n for (let propertyIndex = 0; propertyIndex < header.chunkProperties.length; propertyIndex++) {\n const property = header.chunkProperties[propertyIndex];\n let value;\n switch (property.type) {\n case 0 /* PLYType.FLOAT */:\n value = dataView.getFloat32(property.offset + offset.value, true);\n break;\n default:\n continue;\n }\n switch (property.value) {\n case 0 /* PLYValue.MIN_X */:\n currentChunk.min.x = value;\n break;\n case 1 /* PLYValue.MIN_Y */:\n currentChunk.min.y = value;\n break;\n case 2 /* PLYValue.MIN_Z */:\n currentChunk.min.z = value;\n break;\n case 3 /* PLYValue.MAX_X */:\n currentChunk.max.x = value;\n break;\n case 4 /* PLYValue.MAX_Y */:\n currentChunk.max.y = value;\n break;\n case 5 /* PLYValue.MAX_Z */:\n currentChunk.max.z = value;\n break;\n case 6 /* PLYValue.MIN_SCALE_X */:\n currentChunk.minScale.x = value;\n break;\n case 7 /* PLYValue.MIN_SCALE_Y */:\n currentChunk.minScale.y = value;\n break;\n case 8 /* PLYValue.MIN_SCALE_Z */:\n currentChunk.minScale.z = value;\n break;\n case 9 /* PLYValue.MAX_SCALE_X */:\n currentChunk.maxScale.x = value;\n break;\n case 10 /* PLYValue.MAX_SCALE_Y */:\n currentChunk.maxScale.y = value;\n break;\n case 11 /* PLYValue.MAX_SCALE_Z */:\n currentChunk.maxScale.z = value;\n break;\n }\n }\n offset.value += header.rowChunkLength;\n }\n return compressedChunks;\n }\n static _GetSplat(header, index, compressedChunks, offset) {\n const q = TmpVectors.Quaternion[0];\n const temp3 = TmpVectors.Vector3[0];\n const rowOutputLength = GaussianSplattingMesh._RowOutputLength;\n const buffer = header.buffer;\n const dataView = header.dataView;\n const position = new Float32Array(buffer, index * rowOutputLength, 3);\n const scale = new Float32Array(buffer, index * rowOutputLength + 12, 3);\n const rgba = new Uint8ClampedArray(buffer, index * rowOutputLength + 24, 4);\n const rot = new Uint8ClampedArray(buffer, index * rowOutputLength + 28, 4);\n const chunkIndex = index >> 8;\n let r0 = 255;\n let r1 = 0;\n let r2 = 0;\n let r3 = 0;\n for (let propertyIndex = 0; propertyIndex < header.vertexProperties.length; propertyIndex++) {\n const property = header.vertexProperties[propertyIndex];\n let value;\n switch (property.type) {\n case 0 /* PLYType.FLOAT */:\n value = dataView.getFloat32(offset.value + property.offset, true);\n break;\n case 1 /* PLYType.INT */:\n value = dataView.getInt32(offset.value + property.offset, true);\n break;\n case 2 /* PLYType.UINT */:\n value = dataView.getUint32(offset.value + property.offset, true);\n break;\n case 3 /* PLYType.DOUBLE */:\n value = dataView.getFloat64(offset.value + property.offset, true);\n break;\n case 4 /* PLYType.UCHAR */:\n value = dataView.getUint8(offset.value + property.offset);\n break;\n default:\n continue;\n }\n switch (property.value) {\n case 12 /* PLYValue.PACKED_POSITION */:\n {\n const compressedChunk = compressedChunks[chunkIndex];\n unpack111011(value, temp3);\n position[0] = Scalar.Lerp(compressedChunk.min.x, compressedChunk.max.x, temp3.x);\n position[1] = -Scalar.Lerp(compressedChunk.min.y, compressedChunk.max.y, temp3.y);\n position[2] = Scalar.Lerp(compressedChunk.min.z, compressedChunk.max.z, temp3.z);\n }\n break;\n case 13 /* PLYValue.PACKED_ROTATION */:\n {\n unpackRot(value, q);\n r0 = q.w;\n r1 = q.z;\n r2 = q.y;\n r3 = q.x;\n }\n break;\n case 14 /* PLYValue.PACKED_SCALE */:\n {\n const compressedChunk = compressedChunks[chunkIndex];\n unpack111011(value, temp3);\n scale[0] = Math.exp(Scalar.Lerp(compressedChunk.minScale.x, compressedChunk.maxScale.x, temp3.x));\n scale[1] = Math.exp(Scalar.Lerp(compressedChunk.minScale.y, compressedChunk.maxScale.y, temp3.y));\n scale[2] = Math.exp(Scalar.Lerp(compressedChunk.minScale.z, compressedChunk.maxScale.z, temp3.z));\n }\n break;\n case 15 /* PLYValue.PACKED_COLOR */:\n unpack8888(value, rgba);\n break;\n case 16 /* PLYValue.X */:\n position[0] = value;\n break;\n case 17 /* PLYValue.Y */:\n position[1] = value;\n break;\n case 18 /* PLYValue.Z */:\n position[2] = value;\n break;\n case 19 /* PLYValue.SCALE_0 */:\n scale[0] = Math.exp(value);\n break;\n case 20 /* PLYValue.SCALE_1 */:\n scale[1] = Math.exp(value);\n break;\n case 21 /* PLYValue.SCALE_2 */:\n scale[2] = Math.exp(value);\n break;\n case 22 /* PLYValue.DIFFUSE_RED */:\n rgba[0] = value;\n break;\n case 23 /* PLYValue.DIFFUSE_GREEN */:\n rgba[1] = value;\n break;\n case 24 /* PLYValue.DIFFUSE_BLUE */:\n rgba[2] = value;\n break;\n case 26 /* PLYValue.F_DC_0 */:\n rgba[0] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;\n break;\n case 27 /* PLYValue.F_DC_1 */:\n rgba[1] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;\n break;\n case 28 /* PLYValue.F_DC_2 */:\n rgba[2] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;\n break;\n case 29 /* PLYValue.F_DC_3 */:\n rgba[3] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;\n break;\n case 25 /* PLYValue.OPACITY */:\n rgba[3] = (1 / (1 + Math.exp(-value))) * 255;\n break;\n case 30 /* PLYValue.ROT_0 */:\n r0 = value;\n break;\n case 31 /* PLYValue.ROT_1 */:\n r1 = value;\n break;\n case 32 /* PLYValue.ROT_2 */:\n r2 = value;\n break;\n case 33 /* PLYValue.ROT_3 */:\n r3 = value;\n break;\n }\n }\n q.set(r1, r2, r3, r0);\n q.normalize();\n rot[0] = q.w * 128 + 128;\n rot[1] = q.x * 128 + 128;\n rot[2] = q.y * 128 + 128;\n rot[3] = q.z * 128 + 128;\n offset.value += header.rowVertexLength;\n }\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @param useCoroutine use coroutine and yield\n * @returns the loaded splat buffer\n */\n static *ConvertPLYToSplat(data, useCoroutine = false) {\n const header = GaussianSplattingMesh.ParseHeader(data);\n if (!header) {\n return data;\n }\n const offset = { value: 0 };\n const compressedChunks = GaussianSplattingMesh._GetCompressedChunks(header, offset);\n for (let i = 0; i < header.vertexCount; i++) {\n GaussianSplattingMesh._GetSplat(header, i, compressedChunks, offset);\n if (i % GaussianSplattingMesh._PlyConversionBatchSize === 0 && useCoroutine) {\n yield;\n }\n }\n return header.buffer;\n }\n /**\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer\n */\n static async ConvertPLYToSplatAsync(data) {\n return runCoroutineAsync(GaussianSplattingMesh.ConvertPLYToSplat(data, true), createYieldingScheduler());\n }\n /**\n * Loads a .splat Gaussian Splatting array buffer asynchronously\n * @param data arraybuffer containing splat file\n * @returns a promise that resolves when the operation is complete\n */\n loadDataAsync(data) {\n return this.updateDataAsync(data);\n }\n /**\n * Loads a .splat Gaussian or .ply Splatting file asynchronously\n * @param url path to the splat file to load\n * @returns a promise that resolves when the operation is complete\n * @deprecated Please use SceneLoader.ImportMeshAsync instead\n */\n loadFileAsync(url) {\n return Tools.LoadFileAsync(url, true).then(async (plyBuffer) => {\n GaussianSplattingMesh.ConvertPLYToSplatAsync(plyBuffer).then((splatsData) => {\n this.updateDataAsync(splatsData);\n });\n });\n }\n /**\n * Releases resources associated with this mesh.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n */\n dispose(doNotRecurse) {\n this._covariancesATexture?.dispose();\n this._covariancesBTexture?.dispose();\n this._centersTexture?.dispose();\n this._colorsTexture?.dispose();\n this._covariancesATexture = null;\n this._covariancesBTexture = null;\n this._centersTexture = null;\n this._colorsTexture = null;\n this._worker?.terminate();\n this._worker = null;\n super.dispose(doNotRecurse, true);\n }\n _copyTextures(source) {\n this._covariancesATexture = source.covariancesATexture?.clone();\n this._covariancesBTexture = source.covariancesBTexture?.clone();\n this._centersTexture = source.centersTexture?.clone();\n this._colorsTexture = source.colorsTexture?.clone();\n }\n /**\n * Returns a new Mesh object generated from the current mesh properties.\n * @param name is a string, the name given to the new mesh\n * @returns a new Gaussian Splatting Mesh\n */\n clone(name = \"\") {\n const newGS = new GaussianSplattingMesh(name, undefined, this.getScene());\n newGS._copySource(this);\n newGS.makeGeometryUnique();\n newGS._vertexCount = this._vertexCount;\n newGS._copyTextures(this);\n newGS._modelViewMatrix = Matrix.Identity();\n newGS._splatPositions = this._splatPositions;\n newGS._readyToDisplay = false;\n newGS._instanciateWorker();\n const binfo = this.getBoundingInfo();\n newGS.getBoundingInfo().reConstruct(binfo.minimum, binfo.maximum, this.getWorldMatrix());\n newGS.forcedInstanceCount = newGS._vertexCount;\n newGS.setEnabled(true);\n return newGS;\n }\n _makeSplat(sourceIndex, destinationIndex, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum) {\n const matrixRotation = TmpVectors.Matrix[0];\n const matrixScale = TmpVectors.Matrix[1];\n const quaternion = TmpVectors.Quaternion[0];\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const x = fBuffer[8 * sourceIndex + 0];\n const y = -fBuffer[8 * sourceIndex + 1];\n const z = fBuffer[8 * sourceIndex + 2];\n this._splatPositions[4 * sourceIndex + 0] = x;\n this._splatPositions[4 * sourceIndex + 1] = y;\n this._splatPositions[4 * sourceIndex + 2] = z;\n minimum.minimizeInPlaceFromFloats(x, y, z);\n maximum.maximizeInPlaceFromFloats(x, y, z);\n quaternion.set((uBuffer[32 * sourceIndex + 28 + 1] - 128) / 128, (uBuffer[32 * sourceIndex + 28 + 2] - 128) / 128, (uBuffer[32 * sourceIndex + 28 + 3] - 128) / 128, -(uBuffer[32 * sourceIndex + 28 + 0] - 128) / 128);\n quaternion.toRotationMatrix(matrixRotation);\n Matrix.ScalingToRef(fBuffer[8 * sourceIndex + 3 + 0] * 2, fBuffer[8 * sourceIndex + 3 + 1] * 2, fBuffer[8 * sourceIndex + 3 + 2] * 2, matrixScale);\n const M = matrixRotation.multiplyToRef(matrixScale, TmpVectors.Matrix[0]).m;\n const covariances = this._tmpCovariances;\n covariances[0] = M[0] * M[0] + M[1] * M[1] + M[2] * M[2];\n covariances[1] = M[0] * M[4] + M[1] * M[5] + M[2] * M[6];\n covariances[2] = M[0] * M[8] + M[1] * M[9] + M[2] * M[10];\n covariances[3] = M[4] * M[4] + M[5] * M[5] + M[6] * M[6];\n covariances[4] = M[4] * M[8] + M[5] * M[9] + M[6] * M[10];\n covariances[5] = M[8] * M[8] + M[9] * M[9] + M[10] * M[10];\n // normalize covA, covB\n let factor = -10000;\n for (let covIndex = 0; covIndex < 6; covIndex++) {\n factor = Math.max(factor, Math.abs(covariances[covIndex]));\n }\n this._splatPositions[4 * sourceIndex + 3] = factor;\n const transform = factor;\n covA[destinationIndex * 4 + 0] = ToHalfFloat(covariances[0] / transform);\n covA[destinationIndex * 4 + 1] = ToHalfFloat(covariances[1] / transform);\n covA[destinationIndex * 4 + 2] = ToHalfFloat(covariances[2] / transform);\n covA[destinationIndex * 4 + 3] = ToHalfFloat(covariances[3] / transform);\n covB[destinationIndex * covBSItemSize + 0] = ToHalfFloat(covariances[4] / transform);\n covB[destinationIndex * covBSItemSize + 1] = ToHalfFloat(covariances[5] / transform);\n // colors\n colorArray[destinationIndex * 4 + 0] = uBuffer[32 * sourceIndex + 24 + 0];\n colorArray[destinationIndex * 4 + 1] = uBuffer[32 * sourceIndex + 24 + 1];\n colorArray[destinationIndex * 4 + 2] = uBuffer[32 * sourceIndex + 24 + 2];\n colorArray[destinationIndex * 4 + 3] = uBuffer[32 * sourceIndex + 24 + 3];\n }\n _updateTextures(covA, covB, colorArray) {\n const textureSize = this._getTextureSize(this._vertexCount);\n // Update the textures\n const createTextureFromData = (data, width, height, format) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, Constants.TEXTURETYPE_FLOAT);\n };\n const createTextureFromDataU8 = (data, width, height, format) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, Constants.TEXTURETYPE_UNSIGNED_BYTE);\n };\n const createTextureFromDataF16 = (data, width, height, format) => {\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, Constants.TEXTURETYPE_HALF_FLOAT);\n };\n if (this._keepInRam) {\n this._covariancesA = covA;\n this._covariancesB = covB;\n this._colors = colorArray;\n }\n if (this._covariancesATexture) {\n this._delayedTextureUpdate = { covA: covA, covB: covB, colors: colorArray, centers: this._splatPositions };\n const positions = Float32Array.from(this._splatPositions);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);\n this._postToWorker(true);\n }\n else {\n this._covariancesATexture = createTextureFromDataF16(covA, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._covariancesBTexture = createTextureFromDataF16(covB, textureSize.x, textureSize.y, this._useRGBACovariants ? Constants.TEXTUREFORMAT_RGBA : Constants.TEXTUREFORMAT_RG);\n this._centersTexture = createTextureFromData(this._splatPositions, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._colorsTexture = createTextureFromDataU8(colorArray, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\n this._instanciateWorker();\n }\n }\n *_updateData(data, isAsync) {\n // if a covariance texture is present, then it's not a creation but an update\n if (!this._covariancesATexture) {\n this._readyToDisplay = false;\n }\n // Parse the data\n const uBuffer = new Uint8Array(data);\n const fBuffer = new Float32Array(uBuffer.buffer);\n const vertexCount = uBuffer.length / GaussianSplattingMesh._RowOutputLength;\n if (vertexCount != this._vertexCount) {\n this._updateSplatIndexBuffer(vertexCount);\n }\n this._vertexCount = vertexCount;\n const textureSize = this._getTextureSize(vertexCount);\n const textureLength = textureSize.x * textureSize.y;\n const lineCountUpdate = GaussianSplattingMesh.ProgressiveUpdateAmount ?? textureSize.y;\n const textureLengthPerUpdate = textureSize.x * lineCountUpdate;\n this._splatPositions = new Float32Array(4 * textureLength);\n const covA = new Uint16Array(textureLength * 4);\n const covB = new Uint16Array((this._useRGBACovariants ? 4 : 2) * textureLength);\n const colorArray = new Uint8Array(textureLength * 4);\n const minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n if (GaussianSplattingMesh.ProgressiveUpdateAmount) {\n // create textures with not filled-yet array, then update directly portions of it\n this._updateTextures(covA, covB, colorArray);\n this.setEnabled(true);\n const partCount = Math.ceil(textureSize.y / lineCountUpdate);\n for (let partIndex = 0; partIndex < partCount; partIndex++) {\n const updateLine = partIndex * lineCountUpdate;\n const splatIndexBase = updateLine * textureSize.x;\n for (let i = 0; i < textureLengthPerUpdate; i++) {\n this._makeSplat(splatIndexBase + i, splatIndexBase + i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum);\n }\n this._updateSubTextures(this._splatPositions, covA, covB, colorArray, updateLine, Math.min(lineCountUpdate, textureSize.y - updateLine));\n // Update the binfo\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n if (isAsync) {\n yield;\n }\n }\n // sort will be dirty here as just finished filled positions will not be sorted\n const positions = Float32Array.from(this._splatPositions);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);\n this._sortIsDirty = true;\n }\n else {\n for (let i = 0; i < vertexCount; i++) {\n this._makeSplat(i, i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum);\n if (isAsync && i % GaussianSplattingMesh._SplatBatchSize === 0) {\n yield;\n }\n }\n // textures\n this._updateTextures(covA, covB, colorArray);\n // Update the binfo\n this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());\n this.setEnabled(true);\n }\n this._postToWorker(true);\n }\n /**\n * Update asynchronously the buffer\n * @param data array buffer containing center, color, orientation and scale of splats\n * @returns a promise\n */\n async updateDataAsync(data) {\n return runCoroutineAsync(this._updateData(data, true), createYieldingScheduler());\n }\n /**\n * @experimental\n * Update data from GS (position, orientation, color, scaling)\n * @param data array that contain all the datas\n */\n updateData(data) {\n runCoroutineSync(this._updateData(data, false));\n }\n // in case size is different\n _updateSplatIndexBuffer(vertexCount) {\n if (!this._splatIndex || vertexCount > this._splatIndex.length) {\n this._splatIndex = new Float32Array(vertexCount);\n this.thinInstanceSetBuffer(\"splatIndex\", this._splatIndex, 1, false);\n }\n this.forcedInstanceCount = vertexCount;\n }\n _updateSubTextures(centers, covA, covB, colors, lineStart, lineCount) {\n const updateTextureFromData = (texture, data, width, lineStart, lineCount) => {\n this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);\n };\n const updateTextureFromDataU8 = (texture, data, width, lineStart, lineCount) => {\n this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);\n };\n const updateTextureFromDataF16 = (texture, data, width, lineStart, lineCount) => {\n this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);\n };\n const textureSize = this._getTextureSize(this._vertexCount);\n const covBSItemSize = this._useRGBACovariants ? 4 : 2;\n const texelStart = lineStart * textureSize.x;\n const texelCount = lineCount * textureSize.x;\n const covAView = new Uint16Array(covA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);\n const covBView = new Uint16Array(covB.buffer, texelStart * covBSItemSize * Uint16Array.BYTES_PER_ELEMENT, texelCount * covBSItemSize);\n const colorsView = new Uint8Array(colors.buffer, texelStart * 4, texelCount * 4);\n const centersView = new Float32Array(centers.buffer, texelStart * 4 * Float32Array.BYTES_PER_ELEMENT, texelCount * 4);\n updateTextureFromDataF16(this._covariancesATexture, covAView, textureSize.x, lineStart, lineCount);\n updateTextureFromDataF16(this._covariancesBTexture, covBView, textureSize.x, lineStart, lineCount);\n updateTextureFromData(this._centersTexture, centersView, textureSize.x, lineStart, lineCount);\n updateTextureFromDataU8(this._colorsTexture, colorsView, textureSize.x, lineStart, lineCount);\n }\n _instanciateWorker() {\n if (!this._vertexCount) {\n return;\n }\n this._updateSplatIndexBuffer(this._vertexCount);\n // Start the worker thread\n this._worker?.terminate();\n this._worker = new Worker(URL.createObjectURL(new Blob([\"(\", GaussianSplattingMesh._CreateWorker.toString(), \")(self)\"], {\n type: \"application/javascript\",\n })));\n this._depthMix = new BigInt64Array(this._vertexCount);\n const positions = Float32Array.from(this._splatPositions);\n const vertexCount = this._vertexCount;\n this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);\n this._worker.onmessage = (e) => {\n this._depthMix = e.data.depthMix;\n const indexMix = new Uint32Array(e.data.depthMix.buffer);\n if (this._splatIndex) {\n for (let j = 0; j < this._vertexCount; j++) {\n this._splatIndex[j] = indexMix[2 * j];\n }\n }\n if (this._delayedTextureUpdate) {\n const textureSize = this._getTextureSize(vertexCount);\n this._updateSubTextures(this._delayedTextureUpdate.centers, this._delayedTextureUpdate.covA, this._delayedTextureUpdate.covB, this._delayedTextureUpdate.colors, 0, textureSize.y);\n this._delayedTextureUpdate = null;\n }\n this.thinInstanceBufferUpdated(\"splatIndex\");\n this._canPostToWorker = true;\n this._readyToDisplay = true;\n // sort is dirty when GS is visible for progressive update with a this message arriving but positions were partially filled\n // another update needs to be kicked. The kick can't happen just when the position buffer is ready because _canPostToWorker might be false.\n if (this._sortIsDirty) {\n this._postToWorker(true);\n this._sortIsDirty = false;\n }\n };\n }\n _getTextureSize(length) {\n const engine = this._scene.getEngine();\n const width = engine.getCaps().maxTextureSize;\n let height = 1;\n if (engine.version === 1 && !engine.isWebGPU) {\n while (width * height < length) {\n height *= 2;\n }\n }\n else {\n height = Math.ceil(length / width);\n }\n if (height > width) {\n Logger.Error(\"GaussianSplatting texture size: (\" + width + \", \" + height + \"), maxTextureSize: \" + width);\n height = width;\n }\n return new Vector2(width, height);\n }\n}\nGaussianSplattingMesh._RowOutputLength = 3 * 4 + 3 * 4 + 4 + 4; // Vector3 position, Vector3 scale, 1 u8 quaternion, 1 color with alpha\nGaussianSplattingMesh._SH_C0 = 0.28209479177387814;\n// batch size between 2 yield calls. This value is a tradeoff between updates overhead and framerate hiccups\n// This step is faster the PLY conversion. So batch size can be bigger\nGaussianSplattingMesh._SplatBatchSize = 327680;\n// batch size between 2 yield calls during the PLY to splat conversion.\nGaussianSplattingMesh._PlyConversionBatchSize = 32768;\n/**\n * Set the number of batch (a batch is 16384 splats) after which a display update is performed\n * A value of 0 (default) means display update will not happens before splat is ready.\n */\nGaussianSplattingMesh.ProgressiveUpdateAmount = 0;\nGaussianSplattingMesh._CreateWorker = function (self) {\n let vertexCount = 0;\n let positions;\n let depthMix;\n let indices;\n let floatMix;\n self.onmessage = (e) => {\n // updated on init\n if (e.data.positions) {\n positions = e.data.positions;\n vertexCount = e.data.vertexCount;\n }\n // udpate on view changed\n else {\n const viewProj = e.data.view;\n if (!positions || !viewProj) {\n // Sanity check, it shouldn't happen!\n throw new Error(\"positions or view is not defined!\");\n }\n depthMix = e.data.depthMix;\n indices = new Uint32Array(depthMix.buffer);\n floatMix = new Float32Array(depthMix.buffer);\n // Sort\n for (let j = 0; j < vertexCount; j++) {\n indices[2 * j] = j;\n }\n let depthFactor = -1;\n if (e.data.useRightHandedSystem) {\n depthFactor = 1;\n }\n for (let j = 0; j < vertexCount; j++) {\n floatMix[2 * j + 1] = 10000 + (viewProj[2] * positions[4 * j + 0] + viewProj[6] * positions[4 * j + 1] + viewProj[10] * positions[4 * j + 2]) * depthFactor;\n }\n depthMix.sort();\n self.postMessage({ depthMix }, [depthMix.buffer]);\n }\n };\n};\n//# sourceMappingURL=gaussianSplattingMesh.js.map","import { Epsilon } from \"core/Maths/math.constants\";\nimport { Matrix, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\nimport { BuildArray } from \"core/Misc/arrayTools\";\nimport { IntersectionInfo } from \"../Collisions/intersectionInfo\";\nimport { PickingInfo } from \"core/Collisions/pickingInfo\";\nimport { EngineStore } from \"core/Engines/engineStore\";\nimport { _ImportHelper } from \"core/import.helper\";\n/**\n * Use this object to customize mesh picking behavior\n */\nexport const PickingCustomization = {\n internalPickerForMesh: undefined,\n};\n/**\n * Class representing a ray with position and direction\n */\nexport class Ray {\n /**\n * Creates a new ray\n * @param origin origin point\n * @param direction direction\n * @param length length of the ray\n * @param epsilon The epsilon value to use when calculating the ray/triangle intersection (default: 0)\n */\n constructor(\n /** origin point */\n origin, \n /** direction */\n direction, \n /** [Number.MAX_VALUE] length of the ray */\n length = Number.MAX_VALUE, \n /** [Epsilon] The epsilon value to use when calculating the ray/triangle intersection (default: Epsilon from math constants) */\n epsilon = Epsilon) {\n this.origin = origin;\n this.direction = direction;\n this.length = length;\n this.epsilon = epsilon;\n }\n // Methods\n /**\n * Clone the current ray\n * @returns a new ray\n */\n clone() {\n return new Ray(this.origin.clone(), this.direction.clone(), this.length);\n }\n /**\n * Checks if the ray intersects a box\n * This does not account for the ray length by design to improve perfs.\n * @param minimum bound of the box\n * @param maximum bound of the box\n * @param intersectionTreshold extra extend to be added to the box in all direction\n * @returns if the box was hit\n */\n intersectsBoxMinMax(minimum, maximum, intersectionTreshold = 0) {\n const newMinimum = Ray._TmpVector3[0].copyFromFloats(minimum.x - intersectionTreshold, minimum.y - intersectionTreshold, minimum.z - intersectionTreshold);\n const newMaximum = Ray._TmpVector3[1].copyFromFloats(maximum.x + intersectionTreshold, maximum.y + intersectionTreshold, maximum.z + intersectionTreshold);\n let d = 0.0;\n let maxValue = Number.MAX_VALUE;\n let inv;\n let min;\n let max;\n let temp;\n if (Math.abs(this.direction.x) < 0.0000001) {\n if (this.origin.x < newMinimum.x || this.origin.x > newMaximum.x) {\n return false;\n }\n }\n else {\n inv = 1.0 / this.direction.x;\n min = (newMinimum.x - this.origin.x) * inv;\n max = (newMaximum.x - this.origin.x) * inv;\n if (max === -Infinity) {\n max = Infinity;\n }\n if (min > max) {\n temp = min;\n min = max;\n max = temp;\n }\n d = Math.max(min, d);\n maxValue = Math.min(max, maxValue);\n if (d > maxValue) {\n return false;\n }\n }\n if (Math.abs(this.direction.y) < 0.0000001) {\n if (this.origin.y < newMinimum.y || this.origin.y > newMaximum.y) {\n return false;\n }\n }\n else {\n inv = 1.0 / this.direction.y;\n min = (newMinimum.y - this.origin.y) * inv;\n max = (newMaximum.y - this.origin.y) * inv;\n if (max === -Infinity) {\n max = Infinity;\n }\n if (min > max) {\n temp = min;\n min = max;\n max = temp;\n }\n d = Math.max(min, d);\n maxValue = Math.min(max, maxValue);\n if (d > maxValue) {\n return false;\n }\n }\n if (Math.abs(this.direction.z) < 0.0000001) {\n if (this.origin.z < newMinimum.z || this.origin.z > newMaximum.z) {\n return false;\n }\n }\n else {\n inv = 1.0 / this.direction.z;\n min = (newMinimum.z - this.origin.z) * inv;\n max = (newMaximum.z - this.origin.z) * inv;\n if (max === -Infinity) {\n max = Infinity;\n }\n if (min > max) {\n temp = min;\n min = max;\n max = temp;\n }\n d = Math.max(min, d);\n maxValue = Math.min(max, maxValue);\n if (d > maxValue) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks if the ray intersects a box\n * This does not account for the ray lenght by design to improve perfs.\n * @param box the bounding box to check\n * @param intersectionTreshold extra extend to be added to the BoundingBox in all direction\n * @returns if the box was hit\n */\n intersectsBox(box, intersectionTreshold = 0) {\n return this.intersectsBoxMinMax(box.minimum, box.maximum, intersectionTreshold);\n }\n /**\n * If the ray hits a sphere\n * @param sphere the bounding sphere to check\n * @param intersectionTreshold extra extend to be added to the BoundingSphere in all direction\n * @returns true if it hits the sphere\n */\n intersectsSphere(sphere, intersectionTreshold = 0) {\n const x = sphere.center.x - this.origin.x;\n const y = sphere.center.y - this.origin.y;\n const z = sphere.center.z - this.origin.z;\n const pyth = x * x + y * y + z * z;\n const radius = sphere.radius + intersectionTreshold;\n const rr = radius * radius;\n if (pyth <= rr) {\n return true;\n }\n const dot = x * this.direction.x + y * this.direction.y + z * this.direction.z;\n if (dot < 0.0) {\n return false;\n }\n const temp = pyth - dot * dot;\n return temp <= rr;\n }\n /**\n * If the ray hits a triange\n * @param vertex0 triangle vertex\n * @param vertex1 triangle vertex\n * @param vertex2 triangle vertex\n * @returns intersection information if hit\n */\n intersectsTriangle(vertex0, vertex1, vertex2) {\n const edge1 = Ray._TmpVector3[0];\n const edge2 = Ray._TmpVector3[1];\n const pvec = Ray._TmpVector3[2];\n const tvec = Ray._TmpVector3[3];\n const qvec = Ray._TmpVector3[4];\n vertex1.subtractToRef(vertex0, edge1);\n vertex2.subtractToRef(vertex0, edge2);\n Vector3.CrossToRef(this.direction, edge2, pvec);\n const det = Vector3.Dot(edge1, pvec);\n if (det === 0) {\n return null;\n }\n const invdet = 1 / det;\n this.origin.subtractToRef(vertex0, tvec);\n const bv = Vector3.Dot(tvec, pvec) * invdet;\n if (bv < -this.epsilon || bv > 1.0 + this.epsilon) {\n return null;\n }\n Vector3.CrossToRef(tvec, edge1, qvec);\n const bw = Vector3.Dot(this.direction, qvec) * invdet;\n if (bw < -this.epsilon || bv + bw > 1.0 + this.epsilon) {\n return null;\n }\n //check if the distance is longer than the predefined length.\n const distance = Vector3.Dot(edge2, qvec) * invdet;\n if (distance > this.length) {\n return null;\n }\n return new IntersectionInfo(1 - bv - bw, bv, distance);\n }\n /**\n * Checks if ray intersects a plane\n * @param plane the plane to check\n * @returns the distance away it was hit\n */\n intersectsPlane(plane) {\n let distance;\n const result1 = Vector3.Dot(plane.normal, this.direction);\n if (Math.abs(result1) < 9.99999997475243e-7) {\n return null;\n }\n else {\n const result2 = Vector3.Dot(plane.normal, this.origin);\n distance = (-plane.d - result2) / result1;\n if (distance < 0.0) {\n if (distance < -9.99999997475243e-7) {\n return null;\n }\n else {\n return 0;\n }\n }\n return distance;\n }\n }\n /**\n * Calculate the intercept of a ray on a given axis\n * @param axis to check 'x' | 'y' | 'z'\n * @param offset from axis interception (i.e. an offset of 1y is intercepted above ground)\n * @returns a vector containing the coordinates where 'axis' is equal to zero (else offset), or null if there is no intercept.\n */\n intersectsAxis(axis, offset = 0) {\n switch (axis) {\n case \"y\": {\n const t = (this.origin.y - offset) / this.direction.y;\n if (t > 0) {\n return null;\n }\n return new Vector3(this.origin.x + this.direction.x * -t, offset, this.origin.z + this.direction.z * -t);\n }\n case \"x\": {\n const t = (this.origin.x - offset) / this.direction.x;\n if (t > 0) {\n return null;\n }\n return new Vector3(offset, this.origin.y + this.direction.y * -t, this.origin.z + this.direction.z * -t);\n }\n case \"z\": {\n const t = (this.origin.z - offset) / this.direction.z;\n if (t > 0) {\n return null;\n }\n return new Vector3(this.origin.x + this.direction.x * -t, this.origin.y + this.direction.y * -t, offset);\n }\n default:\n return null;\n }\n }\n /**\n * Checks if ray intersects a mesh. The ray is defined in WORLD space. A mesh triangle can be picked both from its front and back sides,\n * irrespective of orientation.\n * @param mesh the mesh to check\n * @param fastCheck defines if the first intersection will be used (and not the closest)\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)\n * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point\n * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check\n * @returns picking info of the intersection\n */\n intersectsMesh(mesh, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {\n const tm = TmpVectors.Matrix[0];\n mesh.getWorldMatrix().invertToRef(tm);\n if (this._tmpRay) {\n Ray.TransformToRef(this, tm, this._tmpRay);\n }\n else {\n this._tmpRay = Ray.Transform(this, tm);\n }\n return mesh.intersects(this._tmpRay, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo);\n }\n /**\n * Checks if ray intersects a mesh\n * @param meshes the meshes to check\n * @param fastCheck defines if the first intersection will be used (and not the closest)\n * @param results array to store result in\n * @returns Array of picking infos\n */\n intersectsMeshes(meshes, fastCheck, results) {\n if (results) {\n results.length = 0;\n }\n else {\n results = [];\n }\n for (let i = 0; i < meshes.length; i++) {\n const pickInfo = this.intersectsMesh(meshes[i], fastCheck);\n if (pickInfo.hit) {\n results.push(pickInfo);\n }\n }\n results.sort(this._comparePickingInfo);\n return results;\n }\n _comparePickingInfo(pickingInfoA, pickingInfoB) {\n if (pickingInfoA.distance < pickingInfoB.distance) {\n return -1;\n }\n else if (pickingInfoA.distance > pickingInfoB.distance) {\n return 1;\n }\n else {\n return 0;\n }\n }\n /**\n * Intersection test between the ray and a given segment within a given tolerance (threshold)\n * @param sega the first point of the segment to test the intersection against\n * @param segb the second point of the segment to test the intersection against\n * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful\n * @returns the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection\n */\n intersectionSegment(sega, segb, threshold) {\n const o = this.origin;\n const u = TmpVectors.Vector3[0];\n const rsegb = TmpVectors.Vector3[1];\n const v = TmpVectors.Vector3[2];\n const w = TmpVectors.Vector3[3];\n segb.subtractToRef(sega, u);\n this.direction.scaleToRef(Ray._Rayl, v);\n o.addToRef(v, rsegb);\n sega.subtractToRef(o, w);\n const a = Vector3.Dot(u, u); // always >= 0\n const b = Vector3.Dot(u, v);\n const c = Vector3.Dot(v, v); // always >= 0\n const d = Vector3.Dot(u, w);\n const e = Vector3.Dot(v, w);\n const D = a * c - b * b; // always >= 0\n let sN, sD = D; // sc = sN / sD, default sD = D >= 0\n let tN, tD = D; // tc = tN / tD, default tD = D >= 0\n // compute the line parameters of the two closest points\n if (D < Ray._Smallnum) {\n // the lines are almost parallel\n sN = 0.0; // force using point P0 on segment S1\n sD = 1.0; // to prevent possible division by 0.0 later\n tN = e;\n tD = c;\n }\n else {\n // get the closest points on the infinite lines\n sN = b * e - c * d;\n tN = a * e - b * d;\n if (sN < 0.0) {\n // sc < 0 => the s=0 edge is visible\n sN = 0.0;\n tN = e;\n tD = c;\n }\n else if (sN > sD) {\n // sc > 1 => the s=1 edge is visible\n sN = sD;\n tN = e + b;\n tD = c;\n }\n }\n if (tN < 0.0) {\n // tc < 0 => the t=0 edge is visible\n tN = 0.0;\n // recompute sc for this edge\n if (-d < 0.0) {\n sN = 0.0;\n }\n else if (-d > a) {\n sN = sD;\n }\n else {\n sN = -d;\n sD = a;\n }\n }\n else if (tN > tD) {\n // tc > 1 => the t=1 edge is visible\n tN = tD;\n // recompute sc for this edge\n if (-d + b < 0.0) {\n sN = 0;\n }\n else if (-d + b > a) {\n sN = sD;\n }\n else {\n sN = -d + b;\n sD = a;\n }\n }\n // finally do the division to get sc and tc\n const sc = Math.abs(sN) < Ray._Smallnum ? 0.0 : sN / sD;\n const tc = Math.abs(tN) < Ray._Smallnum ? 0.0 : tN / tD;\n // get the difference of the two closest points\n const qtc = TmpVectors.Vector3[4];\n v.scaleToRef(tc, qtc);\n const qsc = TmpVectors.Vector3[5];\n u.scaleToRef(sc, qsc);\n qsc.addInPlace(w);\n const dP = TmpVectors.Vector3[6];\n qsc.subtractToRef(qtc, dP); // = S1(sc) - S2(tc)\n const isIntersected = tc > 0 && tc <= this.length && dP.lengthSquared() < threshold * threshold; // return intersection result\n if (isIntersected) {\n return qsc.length();\n }\n return -1;\n }\n /**\n * Update the ray from viewport position\n * @param x position\n * @param y y position\n * @param viewportWidth viewport width\n * @param viewportHeight viewport height\n * @param world world matrix\n * @param view view matrix\n * @param projection projection matrix\n * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)\n * @returns this ray updated\n */\n update(x, y, viewportWidth, viewportHeight, world, view, projection, enableDistantPicking = false) {\n if (enableDistantPicking) {\n // With world matrices having great values (like 8000000000 on 1 or more scaling or position axis),\n // multiplying view/projection/world and doing invert will result in loss of float precision in the matrix.\n // One way to fix it is to compute the ray with world at identity then transform the ray in object space.\n // This is slower (2 matrix inverts instead of 1) but precision is preserved.\n // This is hidden behind `EnableDistantPicking` flag (default is false)\n if (!Ray._RayDistant) {\n Ray._RayDistant = Ray.Zero();\n }\n Ray._RayDistant.unprojectRayToRef(x, y, viewportWidth, viewportHeight, Matrix.IdentityReadOnly, view, projection);\n const tm = TmpVectors.Matrix[0];\n world.invertToRef(tm);\n Ray.TransformToRef(Ray._RayDistant, tm, this);\n }\n else {\n this.unprojectRayToRef(x, y, viewportWidth, viewportHeight, world, view, projection);\n }\n return this;\n }\n // Statics\n /**\n * Creates a ray with origin and direction of 0,0,0\n * @returns the new ray\n */\n static Zero() {\n return new Ray(Vector3.Zero(), Vector3.Zero());\n }\n /**\n * Creates a new ray from screen space and viewport\n * @param x position\n * @param y y position\n * @param viewportWidth viewport width\n * @param viewportHeight viewport height\n * @param world world matrix\n * @param view view matrix\n * @param projection projection matrix\n * @returns new ray\n */\n static CreateNew(x, y, viewportWidth, viewportHeight, world, view, projection) {\n const result = Ray.Zero();\n return result.update(x, y, viewportWidth, viewportHeight, world, view, projection);\n }\n /**\n * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be\n * transformed to the given world matrix.\n * @param origin The origin point\n * @param end The end point\n * @param world a matrix to transform the ray to. Default is the identity matrix.\n * @returns the new ray\n */\n static CreateNewFromTo(origin, end, world = Matrix.IdentityReadOnly) {\n const result = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0));\n return Ray.CreateFromToToRef(origin, end, result, world);\n }\n /**\n * Function will update a transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be\n * transformed to the given world matrix.\n * @param origin The origin point\n * @param end The end point\n * @param result the object to store the result\n * @param world a matrix to transform the ray to. Default is the identity matrix.\n * @returns the ref ray\n */\n static CreateFromToToRef(origin, end, result, world = Matrix.IdentityReadOnly) {\n result.origin.copyFrom(origin);\n const direction = end.subtractToRef(origin, result.direction);\n const length = Math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);\n result.length = length;\n result.direction.normalize();\n return Ray.TransformToRef(result, world, result);\n }\n /**\n * Transforms a ray by a matrix\n * @param ray ray to transform\n * @param matrix matrix to apply\n * @returns the resulting new ray\n */\n static Transform(ray, matrix) {\n const result = new Ray(new Vector3(0, 0, 0), new Vector3(0, 0, 0));\n Ray.TransformToRef(ray, matrix, result);\n return result;\n }\n /**\n * Transforms a ray by a matrix\n * @param ray ray to transform\n * @param matrix matrix to apply\n * @param result ray to store result in\n * @returns the updated result ray\n */\n static TransformToRef(ray, matrix, result) {\n Vector3.TransformCoordinatesToRef(ray.origin, matrix, result.origin);\n Vector3.TransformNormalToRef(ray.direction, matrix, result.direction);\n result.length = ray.length;\n result.epsilon = ray.epsilon;\n const dir = result.direction;\n const len = dir.length();\n if (!(len === 0 || len === 1)) {\n const num = 1.0 / len;\n dir.x *= num;\n dir.y *= num;\n dir.z *= num;\n result.length *= len;\n }\n return result;\n }\n /**\n * Unproject a ray from screen space to object space\n * @param sourceX defines the screen space x coordinate to use\n * @param sourceY defines the screen space y coordinate to use\n * @param viewportWidth defines the current width of the viewport\n * @param viewportHeight defines the current height of the viewport\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\n * @param view defines the view matrix to use\n * @param projection defines the projection matrix to use\n */\n unprojectRayToRef(sourceX, sourceY, viewportWidth, viewportHeight, world, view, projection) {\n const matrix = TmpVectors.Matrix[0];\n world.multiplyToRef(view, matrix);\n matrix.multiplyToRef(projection, matrix);\n matrix.invert();\n const engine = EngineStore.LastCreatedEngine;\n const nearScreenSource = TmpVectors.Vector3[0];\n nearScreenSource.x = (sourceX / viewportWidth) * 2 - 1;\n nearScreenSource.y = -((sourceY / viewportHeight) * 2 - 1);\n nearScreenSource.z = engine?.useReverseDepthBuffer ? 1 : engine?.isNDCHalfZRange ? 0 : -1;\n // far Z need to be close but < to 1 or camera projection matrix with maxZ = 0 will NaN\n const farScreenSource = TmpVectors.Vector3[1].copyFromFloats(nearScreenSource.x, nearScreenSource.y, 1.0 - 1e-8);\n const nearVec3 = TmpVectors.Vector3[2];\n const farVec3 = TmpVectors.Vector3[3];\n Vector3._UnprojectFromInvertedMatrixToRef(nearScreenSource, matrix, nearVec3);\n Vector3._UnprojectFromInvertedMatrixToRef(farScreenSource, matrix, farVec3);\n this.origin.copyFrom(nearVec3);\n farVec3.subtractToRef(nearVec3, this.direction);\n this.direction.normalize();\n }\n}\nRay._TmpVector3 = BuildArray(6, Vector3.Zero);\nRay._RayDistant = Ray.Zero();\nRay._Smallnum = 0.00000001;\nRay._Rayl = 10e8;\n/**\n * Creates a ray that can be used to pick in the scene\n * @param scene defines the scene to use for the picking\n * @param x defines the x coordinate of the origin (on-screen)\n * @param y defines the y coordinate of the origin (on-screen)\n * @param world defines the world matrix to use if you want to pick in object space (instead of world space)\n * @param camera defines the camera to use for the picking\n * @param cameraViewSpace defines if picking will be done in view space (false by default)\n * @returns a Ray\n */\nexport function CreatePickingRay(scene, x, y, world, camera, cameraViewSpace = false) {\n const result = Ray.Zero();\n CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace);\n return result;\n}\n/**\n * Creates a ray that can be used to pick in the scene\n * @param scene defines the scene to use for the picking\n * @param x defines the x coordinate of the origin (on-screen)\n * @param y defines the y coordinate of the origin (on-screen)\n * @param world defines the world matrix to use if you want to pick in object space (instead of world space)\n * @param result defines the ray where to store the picking ray\n * @param camera defines the camera to use for the picking\n * @param cameraViewSpace defines if picking will be done in view space (false by default)\n * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)\n * @returns the current scene\n */\nexport function CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {\n const engine = scene.getEngine();\n if (!camera && !(camera = scene.activeCamera)) {\n return scene;\n }\n const cameraViewport = camera.viewport;\n const renderHeight = engine.getRenderHeight();\n const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);\n // Moving coordinates to local viewport world\n const levelInv = 1 / engine.getHardwareScalingLevel();\n x = x * levelInv - vx;\n y = y * levelInv - (renderHeight - vy - height);\n result.update(x, y, width, height, world ? world : Matrix.IdentityReadOnly, cameraViewSpace ? Matrix.IdentityReadOnly : camera.getViewMatrix(), camera.getProjectionMatrix(), enableDistantPicking);\n return scene;\n}\n/**\n * Creates a ray that can be used to pick in the scene\n * @param scene defines the scene to use for the picking\n * @param x defines the x coordinate of the origin (on-screen)\n * @param y defines the y coordinate of the origin (on-screen)\n * @param camera defines the camera to use for the picking\n * @returns a Ray\n */\nexport function CreatePickingRayInCameraSpace(scene, x, y, camera) {\n const result = Ray.Zero();\n CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera);\n return result;\n}\n/**\n * Creates a ray that can be used to pick in the scene\n * @param scene defines the scene to use for the picking\n * @param x defines the x coordinate of the origin (on-screen)\n * @param y defines the y coordinate of the origin (on-screen)\n * @param result defines the ray where to store the picking ray\n * @param camera defines the camera to use for the picking\n * @returns the current scene\n */\nexport function CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera) {\n if (!PickingInfo) {\n return scene;\n }\n const engine = scene.getEngine();\n if (!camera && !(camera = scene.activeCamera)) {\n throw new Error(\"Active camera not set\");\n }\n const cameraViewport = camera.viewport;\n const renderHeight = engine.getRenderHeight();\n const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);\n const identity = Matrix.Identity();\n // Moving coordinates to local viewport world\n const levelInv = 1 / engine.getHardwareScalingLevel();\n x = x * levelInv - vx;\n y = y * levelInv - (renderHeight - vy - height);\n result.update(x, y, width, height, identity, identity, camera.getProjectionMatrix());\n return scene;\n}\nfunction InternalPickForMesh(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) {\n const ray = rayFunction(world, mesh.enableDistantPicking);\n const result = mesh.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo);\n if (!result || !result.hit) {\n return null;\n }\n if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) {\n return null;\n }\n return result;\n}\nfunction InternalPick(scene, rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) {\n let pickingInfo = null;\n const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);\n const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;\n const picker = PickingCustomization.internalPickerForMesh || InternalPickForMesh;\n for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {\n const mesh = scene.meshes[meshIndex];\n if (predicate) {\n if (!predicate(mesh, -1)) {\n continue;\n }\n }\n else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {\n continue;\n }\n const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();\n const world = mesh.computeWorldMatrix(forceCompute, currentCamera);\n if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {\n // first check if the ray intersects the whole bounding box/sphere of the mesh\n const result = picker(pickingInfo, rayFunction, mesh, world, true, true, trianglePredicate);\n if (result) {\n if (onlyBoundingInfo) {\n // the user only asked for a bounding info check so we can return\n return result;\n }\n const tmpMatrix = TmpVectors.Matrix[1];\n const thinMatrices = mesh.thinInstanceGetWorldMatrices();\n for (let index = 0; index < thinMatrices.length; index++) {\n if (predicate && !predicate(mesh, index)) {\n continue;\n }\n const thinMatrix = thinMatrices[index];\n thinMatrix.multiplyToRef(world, tmpMatrix);\n const result = picker(pickingInfo, rayFunction, mesh, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, true);\n if (result) {\n pickingInfo = result;\n pickingInfo.thinInstanceIndex = index;\n if (fastCheck) {\n return pickingInfo;\n }\n }\n }\n }\n }\n else {\n const result = picker(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate);\n if (result) {\n pickingInfo = result;\n if (fastCheck) {\n return pickingInfo;\n }\n }\n }\n }\n return pickingInfo || new PickingInfo();\n}\nfunction InternalMultiPick(scene, rayFunction, predicate, trianglePredicate) {\n if (!PickingInfo) {\n return null;\n }\n const pickingInfos = [];\n const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);\n const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;\n const picker = PickingCustomization.internalPickerForMesh || InternalPickForMesh;\n for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {\n const mesh = scene.meshes[meshIndex];\n if (predicate) {\n if (!predicate(mesh, -1)) {\n continue;\n }\n }\n else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {\n continue;\n }\n const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();\n const world = mesh.computeWorldMatrix(forceCompute, currentCamera);\n if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {\n const result = picker(null, rayFunction, mesh, world, true, true, trianglePredicate);\n if (result) {\n const tmpMatrix = TmpVectors.Matrix[1];\n const thinMatrices = mesh.thinInstanceGetWorldMatrices();\n for (let index = 0; index < thinMatrices.length; index++) {\n if (predicate && !predicate(mesh, index)) {\n continue;\n }\n const thinMatrix = thinMatrices[index];\n thinMatrix.multiplyToRef(world, tmpMatrix);\n const result = picker(null, rayFunction, mesh, tmpMatrix, false, false, trianglePredicate, true);\n if (result) {\n result.thinInstanceIndex = index;\n pickingInfos.push(result);\n }\n }\n }\n }\n else {\n const result = picker(null, rayFunction, mesh, world, false, false, trianglePredicate);\n if (result) {\n pickingInfos.push(result);\n }\n }\n }\n return pickingInfos;\n}\n/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)\n * @param scene defines the scene to use for the picking\n * @param x position on screen\n * @param y position on screen\n * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced\n * @param fastCheck defines if the first intersection will be used (and not the closest)\n * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used\n * @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)\n */\nexport function PickWithBoundingInfo(scene, x, y, predicate, fastCheck, camera) {\n if (!PickingInfo) {\n return null;\n }\n const result = InternalPick(scene, (world) => {\n if (!scene._tempPickingRay) {\n scene._tempPickingRay = Ray.Zero();\n }\n CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null);\n return scene._tempPickingRay;\n }, predicate, fastCheck, true);\n if (result) {\n result.ray = CreatePickingRay(scene, x, y, Matrix.Identity(), camera || null);\n }\n return result;\n}\n/** Launch a ray to try to pick a mesh in the scene\n * @param scene defines the scene to use for the picking\n * @param x position on screen\n * @param y position on screen\n * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced\n * @param fastCheck defines if the first intersection will be used (and not the closest)\n * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @param _enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)\n * @returns a PickingInfo\n */\nexport function Pick(scene, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {\n const result = InternalPick(scene, (world, enableDistantPicking) => {\n if (!scene._tempPickingRay) {\n scene._tempPickingRay = Ray.Zero();\n }\n CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null, false, enableDistantPicking);\n return scene._tempPickingRay;\n }, predicate, fastCheck, false, trianglePredicate);\n if (result) {\n result.ray = CreatePickingRay(scene, x, y, Matrix.Identity(), camera || null);\n }\n return result;\n}\n/**\n * Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,\n * irrespective of orientation.\n * @param scene defines the scene to use for the picking\n * @param ray The ray to use to pick meshes\n * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced\n * @param fastCheck defines if the first intersection will be used (and not the closest)\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @returns a PickingInfo\n */\nexport function PickWithRay(scene, ray, predicate, fastCheck, trianglePredicate) {\n const result = InternalPick(scene, (world) => {\n if (!scene._pickWithRayInverseMatrix) {\n scene._pickWithRayInverseMatrix = Matrix.Identity();\n }\n world.invertToRef(scene._pickWithRayInverseMatrix);\n if (!scene._cachedRayForTransform) {\n scene._cachedRayForTransform = Ray.Zero();\n }\n Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);\n return scene._cachedRayForTransform;\n }, predicate, fastCheck, false, trianglePredicate);\n if (result) {\n result.ray = ray;\n }\n return result;\n}\n/**\n * Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,\n * irrespective of orientation.\n * @param scene defines the scene to use for the picking\n * @param x X position on screen\n * @param y Y position on screen\n * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced\n * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @returns an array of PickingInfo\n */\nexport function MultiPick(scene, x, y, predicate, camera, trianglePredicate) {\n return InternalMultiPick(scene, (world) => CreatePickingRay(scene, x, y, world, camera || null), predicate, trianglePredicate);\n}\n/**\n * Launch a ray to try to pick a mesh in the scene\n * @param scene defines the scene to use for the picking\n * @param ray Ray to use\n * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @returns an array of PickingInfo\n */\nexport function MultiPickWithRay(scene, ray, predicate, trianglePredicate) {\n return InternalMultiPick(scene, (world) => {\n if (!scene._pickWithRayInverseMatrix) {\n scene._pickWithRayInverseMatrix = Matrix.Identity();\n }\n world.invertToRef(scene._pickWithRayInverseMatrix);\n if (!scene._cachedRayForTransform) {\n scene._cachedRayForTransform = Ray.Zero();\n }\n Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);\n return scene._cachedRayForTransform;\n }, predicate, trianglePredicate);\n}\n/**\n * Gets a ray in the forward direction from the camera.\n * @param camera Defines the camera to use to get the ray from\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\nexport function GetForwardRay(camera, length = 100, transform, origin) {\n return GetForwardRayToRef(camera, new Ray(Vector3.Zero(), Vector3.Zero(), length), length, transform, origin);\n}\n/**\n * Gets a ray in the forward direction from the camera.\n * @param camera Defines the camera to use to get the ray from\n * @param refRay the ray to (re)use when setting the values\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\nexport function GetForwardRayToRef(camera, refRay, length = 100, transform, origin) {\n if (!transform) {\n transform = camera.getWorldMatrix();\n }\n refRay.length = length;\n if (origin) {\n refRay.origin.copyFrom(origin);\n }\n else {\n refRay.origin.copyFrom(camera.position);\n }\n const forward = TmpVectors.Vector3[2];\n forward.set(0, 0, camera._scene.useRightHandedSystem ? -1 : 1);\n const worldForward = TmpVectors.Vector3[3];\n Vector3.TransformNormalToRef(forward, transform, worldForward);\n Vector3.NormalizeToRef(worldForward, refRay.direction);\n return refRay;\n}\n/**\n * Initialize the minimal interdependecies between the Ray and Scene and Camera\n * @param sceneClass defines the scene prototype to use\n * @param cameraClass defines the camera prototype to use\n */\nexport function AddRayExtensions(sceneClass, cameraClass) {\n if (cameraClass) {\n cameraClass.prototype.getForwardRay = function (length = 100, transform, origin) {\n return GetForwardRayToRef(this, new Ray(Vector3.Zero(), Vector3.Zero(), length), length, transform, origin);\n };\n cameraClass.prototype.getForwardRayToRef = function (refRay, length = 100, transform, origin) {\n return GetForwardRayToRef(this, refRay, length, transform, origin);\n };\n }\n if (!sceneClass) {\n return;\n }\n _ImportHelper._IsPickingAvailable = true;\n sceneClass.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace = false) {\n return CreatePickingRay(this, x, y, world, camera, cameraViewSpace);\n };\n}\n//# sourceMappingURL=ray.core.js.map","import { Color4, Color3 } from \"../Maths/math\";\nimport { Vector2, Vector3, Vector4, TmpVectors, Matrix } from \"../Maths/math.vector\";\nimport { Logger } from \"../Misc/logger\";\nimport { VertexBuffer } from \"../Buffers/buffer\";\nimport { VertexData } from \"../Meshes/mesh.vertexData\";\nimport { Mesh } from \"../Meshes/mesh\";\nimport { EngineStore } from \"../Engines/engineStore\";\nimport { CloudPoint, PointsGroup } from \"./cloudPoint\";\nimport { Ray } from \"../Culling/ray\";\nimport { StandardMaterial } from \"../Materials/standardMaterial\";\nimport { BaseTexture } from \"./../Materials/Textures/baseTexture\";\nimport { RandomRange } from \"../Maths/math.scalar.functions\";\n/** Defines the 4 color options */\nexport var PointColor;\n(function (PointColor) {\n /** color value */\n PointColor[PointColor[\"Color\"] = 2] = \"Color\";\n /** uv value */\n PointColor[PointColor[\"UV\"] = 1] = \"UV\";\n /** random value */\n PointColor[PointColor[\"Random\"] = 0] = \"Random\";\n /** stated value */\n PointColor[PointColor[\"Stated\"] = 3] = \"Stated\";\n})(PointColor || (PointColor = {}));\n/**\n * The PointCloudSystem (PCS) is a single updatable mesh. The points corresponding to the vertices of this big mesh.\n * As it is just a mesh, the PointCloudSystem has all the same properties as any other BJS mesh : not more, not less. It can be scaled, rotated, translated, enlighted, textured, moved, etc.\n\n * The PointCloudSystem is also a particle system, with each point being a particle. It provides some methods to manage the particles.\n * However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.\n *\n * Full documentation here : TO BE ENTERED\n */\nexport class PointsCloudSystem {\n /**\n * Gets the particle positions computed by the Point Cloud System\n */\n get positions() {\n return this._positions32;\n }\n /**\n * Gets the particle colors computed by the Point Cloud System\n */\n get colors() {\n return this._colors32;\n }\n /**\n * Gets the particle uvs computed by the Point Cloud System\n */\n get uvs() {\n return this._uvs32;\n }\n /**\n * Creates a PCS (Points Cloud System) object\n * @param name (String) is the PCS name, this will be the underlying mesh name\n * @param pointSize (number) is the size for each point. Has no effect on a WebGPU engine.\n * @param scene (Scene) is the scene in which the PCS is added\n * @param options defines the options of the PCS e.g.\n * * updatable (optional boolean, default true) : if the PCS must be updatable or immutable\n */\n constructor(name, pointSize, scene, options) {\n /**\n * The PCS array of cloud point objects. Just access each particle as with any classic array.\n * Example : var p = SPS.particles[i];\n */\n this.particles = new Array();\n /**\n * The PCS total number of particles. Read only. Use PCS.counter instead if you need to set your own value.\n */\n this.nbParticles = 0;\n /**\n * This a counter for your own usage. It's not set by any SPS functions.\n */\n this.counter = 0;\n /**\n * This empty object is intended to store some PCS specific or temporary values in order to lower the Garbage Collector activity.\n * Please read :\n */\n this.vars = {};\n this._promises = [];\n this._positions = new Array();\n this._indices = new Array();\n this._normals = new Array();\n this._colors = new Array();\n this._uvs = new Array();\n this._updatable = true;\n this._isVisibilityBoxLocked = false;\n this._alwaysVisible = false;\n this._groups = new Array(); //start indices for each group of particles\n this._groupCounter = 0;\n this._computeParticleColor = true;\n this._computeParticleTexture = true;\n this._computeParticleRotation = true;\n this._computeBoundingBox = false;\n this._isReady = false;\n this.name = name;\n this._size = pointSize;\n this._scene = scene || EngineStore.LastCreatedScene;\n if (options && options.updatable !== undefined) {\n this._updatable = options.updatable;\n }\n else {\n this._updatable = true;\n }\n }\n /**\n * Builds the PCS underlying mesh. Returns a standard Mesh.\n * If no points were added to the PCS, the returned mesh is just a single point.\n * @param material The material to use to render the mesh. If not provided, will create a default one\n * @returns a promise for the created mesh\n */\n buildMeshAsync(material) {\n return Promise.all(this._promises).then(() => {\n this._isReady = true;\n return this._buildMesh(material);\n });\n }\n /**\n * @internal\n */\n _buildMesh(material) {\n if (this.nbParticles === 0) {\n this.addPoints(1);\n }\n this._positions32 = new Float32Array(this._positions);\n this._uvs32 = new Float32Array(this._uvs);\n this._colors32 = new Float32Array(this._colors);\n const vertexData = new VertexData();\n vertexData.set(this._positions32, VertexBuffer.PositionKind);\n if (this._uvs32.length > 0) {\n vertexData.set(this._uvs32, VertexBuffer.UVKind);\n }\n let ec = 0; //emissive color value 0 for UVs, 1 for color\n if (this._colors32.length > 0) {\n ec = 1;\n vertexData.set(this._colors32, VertexBuffer.ColorKind);\n }\n const mesh = new Mesh(this.name, this._scene);\n vertexData.applyToMesh(mesh, this._updatable);\n this.mesh = mesh;\n // free memory\n this._positions = null;\n this._uvs = null;\n this._colors = null;\n if (!this._updatable) {\n this.particles.length = 0;\n }\n let mat = material;\n if (!mat) {\n mat = new StandardMaterial(\"point cloud material\", this._scene);\n mat.emissiveColor = new Color3(ec, ec, ec);\n mat.disableLighting = true;\n mat.pointsCloud = true;\n mat.pointSize = this._size;\n }\n mesh.material = mat;\n return new Promise((resolve) => resolve(mesh));\n }\n // adds a new particle object in the particles array\n _addParticle(idx, group, groupId, idxInGroup) {\n const cp = new CloudPoint(idx, group, groupId, idxInGroup, this);\n this.particles.push(cp);\n return cp;\n }\n _randomUnitVector(particle) {\n particle.position = new Vector3(Math.random(), Math.random(), Math.random());\n particle.color = new Color4(1, 1, 1, 1);\n }\n _getColorIndicesForCoord(pointsGroup, x, y, width) {\n const imageData = pointsGroup._groupImageData;\n const color = y * (width * 4) + x * 4;\n const colorIndices = [color, color + 1, color + 2, color + 3];\n const redIndex = colorIndices[0];\n const greenIndex = colorIndices[1];\n const blueIndex = colorIndices[2];\n const alphaIndex = colorIndices[3];\n const redForCoord = imageData[redIndex];\n const greenForCoord = imageData[greenIndex];\n const blueForCoord = imageData[blueIndex];\n const alphaForCoord = imageData[alphaIndex];\n return new Color4(redForCoord / 255, greenForCoord / 255, blueForCoord / 255, alphaForCoord);\n }\n _setPointsColorOrUV(mesh, pointsGroup, isVolume, colorFromTexture, hasTexture, color, range, uvSetIndex) {\n uvSetIndex = uvSetIndex ?? 0;\n if (isVolume) {\n mesh.updateFacetData();\n }\n const boundInfo = mesh.getBoundingInfo();\n const diameter = 2 * boundInfo.boundingSphere.radius;\n let meshPos = mesh.getVerticesData(VertexBuffer.PositionKind);\n const meshInd = mesh.getIndices();\n const meshUV = mesh.getVerticesData(VertexBuffer.UVKind + (uvSetIndex ? uvSetIndex + 1 : \"\"));\n const meshCol = mesh.getVerticesData(VertexBuffer.ColorKind);\n const place = Vector3.Zero();\n mesh.computeWorldMatrix();\n const meshMatrix = mesh.getWorldMatrix();\n if (!meshMatrix.isIdentity()) {\n meshPos = meshPos.slice(0);\n for (let p = 0; p < meshPos.length / 3; p++) {\n Vector3.TransformCoordinatesFromFloatsToRef(meshPos[3 * p], meshPos[3 * p + 1], meshPos[3 * p + 2], meshMatrix, place);\n meshPos[3 * p] = place.x;\n meshPos[3 * p + 1] = place.y;\n meshPos[3 * p + 2] = place.z;\n }\n }\n let idxPoints = 0;\n let id0 = 0;\n let id1 = 0;\n let id2 = 0;\n let v0X = 0;\n let v0Y = 0;\n let v0Z = 0;\n let v1X = 0;\n let v1Y = 0;\n let v1Z = 0;\n let v2X = 0;\n let v2Y = 0;\n let v2Z = 0;\n const vertex0 = Vector3.Zero();\n const vertex1 = Vector3.Zero();\n const vertex2 = Vector3.Zero();\n const vec0 = Vector3.Zero();\n const vec1 = Vector3.Zero();\n let uv0X = 0;\n let uv0Y = 0;\n let uv1X = 0;\n let uv1Y = 0;\n let uv2X = 0;\n let uv2Y = 0;\n const uv0 = Vector2.Zero();\n const uv1 = Vector2.Zero();\n const uv2 = Vector2.Zero();\n const uvec0 = Vector2.Zero();\n const uvec1 = Vector2.Zero();\n let col0X = 0;\n let col0Y = 0;\n let col0Z = 0;\n let col0A = 0;\n let col1X = 0;\n let col1Y = 0;\n let col1Z = 0;\n let col1A = 0;\n let col2X = 0;\n let col2Y = 0;\n let col2Z = 0;\n let col2A = 0;\n const col0 = Vector4.Zero();\n const col1 = Vector4.Zero();\n const col2 = Vector4.Zero();\n const colvec0 = Vector4.Zero();\n const colvec1 = Vector4.Zero();\n let lamda = 0;\n let mu = 0;\n range = range ? range : 0;\n let facetPoint;\n let uvPoint;\n let colPoint = new Vector4(0, 0, 0, 0);\n let norm = Vector3.Zero();\n let tang = Vector3.Zero();\n let biNorm = Vector3.Zero();\n let angle = 0;\n let facetPlaneVec = Vector3.Zero();\n let gap = 0;\n let distance = 0;\n const ray = new Ray(Vector3.Zero(), new Vector3(1, 0, 0));\n let pickInfo;\n let direction = Vector3.Zero();\n for (let index = 0; index < meshInd.length / 3; index++) {\n id0 = meshInd[3 * index];\n id1 = meshInd[3 * index + 1];\n id2 = meshInd[3 * index + 2];\n v0X = meshPos[3 * id0];\n v0Y = meshPos[3 * id0 + 1];\n v0Z = meshPos[3 * id0 + 2];\n v1X = meshPos[3 * id1];\n v1Y = meshPos[3 * id1 + 1];\n v1Z = meshPos[3 * id1 + 2];\n v2X = meshPos[3 * id2];\n v2Y = meshPos[3 * id2 + 1];\n v2Z = meshPos[3 * id2 + 2];\n vertex0.set(v0X, v0Y, v0Z);\n vertex1.set(v1X, v1Y, v1Z);\n vertex2.set(v2X, v2Y, v2Z);\n vertex1.subtractToRef(vertex0, vec0);\n vertex2.subtractToRef(vertex1, vec1);\n if (meshUV) {\n uv0X = meshUV[2 * id0];\n uv0Y = meshUV[2 * id0 + 1];\n uv1X = meshUV[2 * id1];\n uv1Y = meshUV[2 * id1 + 1];\n uv2X = meshUV[2 * id2];\n uv2Y = meshUV[2 * id2 + 1];\n uv0.set(uv0X, uv0Y);\n uv1.set(uv1X, uv1Y);\n uv2.set(uv2X, uv2Y);\n uv1.subtractToRef(uv0, uvec0);\n uv2.subtractToRef(uv1, uvec1);\n }\n if (meshCol && colorFromTexture) {\n col0X = meshCol[4 * id0];\n col0Y = meshCol[4 * id0 + 1];\n col0Z = meshCol[4 * id0 + 2];\n col0A = meshCol[4 * id0 + 3];\n col1X = meshCol[4 * id1];\n col1Y = meshCol[4 * id1 + 1];\n col1Z = meshCol[4 * id1 + 2];\n col1A = meshCol[4 * id1 + 3];\n col2X = meshCol[4 * id2];\n col2Y = meshCol[4 * id2 + 1];\n col2Z = meshCol[4 * id2 + 2];\n col2A = meshCol[4 * id2 + 3];\n col0.set(col0X, col0Y, col0Z, col0A);\n col1.set(col1X, col1Y, col1Z, col1A);\n col2.set(col2X, col2Y, col2Z, col2A);\n col1.subtractToRef(col0, colvec0);\n col2.subtractToRef(col1, colvec1);\n }\n let width;\n let height;\n let deltaS;\n let deltaV;\n let h;\n let s;\n let v;\n let hsvCol;\n const statedColor = new Color3(0, 0, 0);\n const colPoint3 = new Color3(0, 0, 0);\n let pointColors;\n let particle;\n for (let i = 0; i < pointsGroup._groupDensity[index]; i++) {\n idxPoints = this.particles.length;\n this._addParticle(idxPoints, pointsGroup, this._groupCounter, index + i);\n particle = this.particles[idxPoints];\n //form a point inside the facet v0, v1, v2;\n lamda = Math.sqrt(RandomRange(0, 1));\n mu = RandomRange(0, 1);\n facetPoint = vertex0.add(vec0.scale(lamda)).add(vec1.scale(lamda * mu));\n if (isVolume) {\n norm = mesh.getFacetNormal(index).normalize().scale(-1);\n tang = vec0.clone().normalize();\n biNorm = Vector3.Cross(norm, tang);\n angle = RandomRange(0, 2 * Math.PI);\n facetPlaneVec = tang.scale(Math.cos(angle)).add(biNorm.scale(Math.sin(angle)));\n angle = RandomRange(0.1, Math.PI / 2);\n direction = facetPlaneVec.scale(Math.cos(angle)).add(norm.scale(Math.sin(angle)));\n ray.origin = facetPoint.add(direction.scale(0.00001));\n ray.direction = direction;\n ray.length = diameter;\n pickInfo = ray.intersectsMesh(mesh);\n if (pickInfo.hit) {\n distance = pickInfo.pickedPoint.subtract(facetPoint).length();\n gap = RandomRange(0, 1) * distance;\n facetPoint.addInPlace(direction.scale(gap));\n }\n }\n particle.position = facetPoint.clone();\n this._positions.push(particle.position.x, particle.position.y, particle.position.z);\n if (colorFromTexture !== undefined) {\n if (meshUV) {\n uvPoint = uv0.add(uvec0.scale(lamda)).add(uvec1.scale(lamda * mu));\n if (colorFromTexture) {\n //Set particle color to texture color\n if (hasTexture && pointsGroup._groupImageData !== null) {\n width = pointsGroup._groupImgWidth;\n height = pointsGroup._groupImgHeight;\n pointColors = this._getColorIndicesForCoord(pointsGroup, Math.round(uvPoint.x * width), Math.round(uvPoint.y * height), width);\n particle.color = pointColors;\n this._colors.push(pointColors.r, pointColors.g, pointColors.b, pointColors.a);\n }\n else {\n if (meshCol) {\n //failure in texture and colors available\n colPoint = col0.add(colvec0.scale(lamda)).add(colvec1.scale(lamda * mu));\n particle.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n }\n else {\n colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1);\n particle.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n }\n }\n }\n else {\n //Set particle uv based on a mesh uv\n particle.uv = uvPoint.clone();\n this._uvs.push(particle.uv.x, particle.uv.y);\n }\n }\n }\n else {\n if (color) {\n statedColor.set(color.r, color.g, color.b);\n deltaS = RandomRange(-range, range);\n deltaV = RandomRange(-range, range);\n hsvCol = statedColor.toHSV();\n h = hsvCol.r;\n s = hsvCol.g + deltaS;\n v = hsvCol.b + deltaV;\n if (s < 0) {\n s = 0;\n }\n if (s > 1) {\n s = 1;\n }\n if (v < 0) {\n v = 0;\n }\n if (v > 1) {\n v = 1;\n }\n Color3.HSVtoRGBToRef(h, s, v, colPoint3);\n colPoint.set(colPoint3.r, colPoint3.g, colPoint3.b, 1);\n }\n else {\n colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1);\n }\n particle.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);\n }\n }\n }\n }\n // stores mesh texture in dynamic texture for color pixel retrieval\n // when pointColor type is color for surface points\n _colorFromTexture(mesh, pointsGroup, isVolume) {\n if (mesh.material === null) {\n Logger.Warn(mesh.name + \"has no material.\");\n pointsGroup._groupImageData = null;\n this._setPointsColorOrUV(mesh, pointsGroup, isVolume, true, false);\n return;\n }\n const mat = mesh.material;\n const textureList = mat.getActiveTextures();\n if (textureList.length === 0) {\n Logger.Warn(mesh.name + \"has no usable texture.\");\n pointsGroup._groupImageData = null;\n this._setPointsColorOrUV(mesh, pointsGroup, isVolume, true, false);\n return;\n }\n const clone = mesh.clone();\n clone.setEnabled(false);\n this._promises.push(new Promise((resolve) => {\n BaseTexture.WhenAllReady(textureList, () => {\n let n = pointsGroup._textureNb;\n if (n < 0) {\n n = 0;\n }\n if (n > textureList.length - 1) {\n n = textureList.length - 1;\n }\n const finalize = () => {\n pointsGroup._groupImgWidth = textureList[n].getSize().width;\n pointsGroup._groupImgHeight = textureList[n].getSize().height;\n this._setPointsColorOrUV(clone, pointsGroup, isVolume, true, true, undefined, undefined, textureList[n].coordinatesIndex);\n clone.dispose();\n resolve();\n };\n pointsGroup._groupImageData = null;\n const dataPromise = textureList[n].readPixels();\n if (!dataPromise) {\n finalize();\n }\n else {\n dataPromise.then((data) => {\n pointsGroup._groupImageData = data;\n finalize();\n });\n }\n });\n }));\n }\n // calculates the point density per facet of a mesh for surface points\n _calculateDensity(nbPoints, positions, indices) {\n let id0;\n let id1;\n let id2;\n let v0X;\n let v0Y;\n let v0Z;\n let v1X;\n let v1Y;\n let v1Z;\n let v2X;\n let v2Y;\n let v2Z;\n const vertex0 = Vector3.Zero();\n const vertex1 = Vector3.Zero();\n const vertex2 = Vector3.Zero();\n const vec0 = Vector3.Zero();\n const vec1 = Vector3.Zero();\n const normal = Vector3.Zero();\n let area;\n const cumulativeAreas = [];\n let surfaceArea = 0;\n const nbFacets = indices.length / 3;\n //surface area\n for (let index = 0; index < nbFacets; index++) {\n id0 = indices[3 * index];\n id1 = indices[3 * index + 1];\n id2 = indices[3 * index + 2];\n v0X = positions[3 * id0];\n v0Y = positions[3 * id0 + 1];\n v0Z = positions[3 * id0 + 2];\n v1X = positions[3 * id1];\n v1Y = positions[3 * id1 + 1];\n v1Z = positions[3 * id1 + 2];\n v2X = positions[3 * id2];\n v2Y = positions[3 * id2 + 1];\n v2Z = positions[3 * id2 + 2];\n vertex0.set(v0X, v0Y, v0Z);\n vertex1.set(v1X, v1Y, v1Z);\n vertex2.set(v2X, v2Y, v2Z);\n vertex1.subtractToRef(vertex0, vec0);\n vertex2.subtractToRef(vertex1, vec1);\n Vector3.CrossToRef(vec0, vec1, normal);\n area = 0.5 * normal.length();\n surfaceArea += area;\n cumulativeAreas[index] = surfaceArea;\n }\n const density = new Array(nbFacets);\n let remainingPoints = nbPoints;\n for (let index = nbFacets - 1; index > 0; index--) {\n const cumulativeArea = cumulativeAreas[index];\n if (cumulativeArea === 0) {\n // avoiding division by 0 upon degenerate triangles\n density[index] = 0;\n }\n else {\n const area = cumulativeArea - cumulativeAreas[index - 1];\n const facetPointsWithFraction = (area / cumulativeArea) * remainingPoints;\n const floored = Math.floor(facetPointsWithFraction);\n const fraction = facetPointsWithFraction - floored;\n const extraPoint = Number(Math.random() < fraction);\n const facetPoints = floored + extraPoint;\n density[index] = facetPoints;\n remainingPoints -= facetPoints;\n }\n }\n density[0] = remainingPoints;\n return density;\n }\n /**\n * Adds points to the PCS in random positions within a unit sphere\n * @param nb (positive integer) the number of particles to be created from this model\n * @param pointFunction is an optional javascript function to be called for each particle on PCS creation\n * @returns the number of groups in the system\n */\n addPoints(nb, pointFunction = this._randomUnitVector) {\n const pointsGroup = new PointsGroup(this._groupCounter, pointFunction);\n let cp;\n // particles\n let idx = this.nbParticles;\n for (let i = 0; i < nb; i++) {\n cp = this._addParticle(idx, pointsGroup, this._groupCounter, i);\n if (pointsGroup && pointsGroup._positionFunction) {\n pointsGroup._positionFunction(cp, idx, i);\n }\n this._positions.push(cp.position.x, cp.position.y, cp.position.z);\n if (cp.color) {\n this._colors.push(cp.color.r, cp.color.g, cp.color.b, cp.color.a);\n }\n if (cp.uv) {\n this._uvs.push(cp.uv.x, cp.uv.y);\n }\n idx++;\n }\n this.nbParticles += nb;\n this._groupCounter++;\n return this._groupCounter;\n }\n /**\n * Adds points to the PCS from the surface of the model shape\n * @param mesh is any Mesh object that will be used as a surface model for the points\n * @param nb (positive integer) the number of particles to be created from this model\n * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)\n * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position\n * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color\n * @returns the number of groups in the system\n */\n addSurfacePoints(mesh, nb, colorWith, color, range) {\n let colored = colorWith ? colorWith : 0 /* PointColor.Random */;\n if (isNaN(colored) || colored < 0 || colored > 3) {\n colored = 0 /* PointColor.Random */;\n }\n const meshPos = mesh.getVerticesData(VertexBuffer.PositionKind);\n const meshInd = mesh.getIndices();\n this._groups.push(this._groupCounter);\n const pointsGroup = new PointsGroup(this._groupCounter, null);\n pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd);\n if (colored === 2 /* PointColor.Color */) {\n pointsGroup._textureNb = color ? color : 0;\n }\n else {\n color = color ? color : new Color4(1, 1, 1, 1);\n }\n switch (colored) {\n case 2 /* PointColor.Color */:\n this._colorFromTexture(mesh, pointsGroup, false);\n break;\n case 1 /* PointColor.UV */:\n this._setPointsColorOrUV(mesh, pointsGroup, false, false, false);\n break;\n case 0 /* PointColor.Random */:\n this._setPointsColorOrUV(mesh, pointsGroup, false);\n break;\n case 3 /* PointColor.Stated */:\n this._setPointsColorOrUV(mesh, pointsGroup, false, undefined, undefined, color, range);\n break;\n }\n this.nbParticles += nb;\n this._groupCounter++;\n return this._groupCounter - 1;\n }\n /**\n * Adds points to the PCS inside the model shape\n * @param mesh is any Mesh object that will be used as a surface model for the points\n * @param nb (positive integer) the number of particles to be created from this model\n * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)\n * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position\n * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color\n * @returns the number of groups in the system\n */\n addVolumePoints(mesh, nb, colorWith, color, range) {\n let colored = colorWith ? colorWith : 0 /* PointColor.Random */;\n if (isNaN(colored) || colored < 0 || colored > 3) {\n colored = 0 /* PointColor.Random */;\n }\n const meshPos = mesh.getVerticesData(VertexBuffer.PositionKind);\n const meshInd = mesh.getIndices();\n this._groups.push(this._groupCounter);\n const pointsGroup = new PointsGroup(this._groupCounter, null);\n pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd);\n if (colored === 2 /* PointColor.Color */) {\n pointsGroup._textureNb = color ? color : 0;\n }\n else {\n color = color ? color : new Color4(1, 1, 1, 1);\n }\n switch (colored) {\n case 2 /* PointColor.Color */:\n this._colorFromTexture(mesh, pointsGroup, true);\n break;\n case 1 /* PointColor.UV */:\n this._setPointsColorOrUV(mesh, pointsGroup, true, false, false);\n break;\n case 0 /* PointColor.Random */:\n this._setPointsColorOrUV(mesh, pointsGroup, true);\n break;\n case 3 /* PointColor.Stated */:\n this._setPointsColorOrUV(mesh, pointsGroup, true, undefined, undefined, color, range);\n break;\n }\n this.nbParticles += nb;\n this._groupCounter++;\n return this._groupCounter - 1;\n }\n /**\n * Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.\n * This method calls `updateParticle()` for each particle of the SPS.\n * For an animated SPS, it is usually called within the render loop.\n * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_\n * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_\n * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_\n * @returns the PCS.\n */\n setParticles(start = 0, end = this.nbParticles - 1, update = true) {\n if (!this._updatable || !this._isReady) {\n return this;\n }\n // custom beforeUpdate\n this.beforeUpdateParticles(start, end, update);\n const rotMatrix = TmpVectors.Matrix[0];\n const mesh = this.mesh;\n const colors32 = this._colors32;\n const positions32 = this._positions32;\n const uvs32 = this._uvs32;\n const tempVectors = TmpVectors.Vector3;\n const camAxisX = tempVectors[5].copyFromFloats(1.0, 0.0, 0.0);\n const camAxisY = tempVectors[6].copyFromFloats(0.0, 1.0, 0.0);\n const camAxisZ = tempVectors[7].copyFromFloats(0.0, 0.0, 1.0);\n const minimum = tempVectors[8].setAll(Number.MAX_VALUE);\n const maximum = tempVectors[9].setAll(-Number.MAX_VALUE);\n Matrix.IdentityToRef(rotMatrix);\n let idx = 0; // current index of the particle\n if (this.mesh?.isFacetDataEnabled) {\n this._computeBoundingBox = true;\n }\n end = end >= this.nbParticles ? this.nbParticles - 1 : end;\n if (this._computeBoundingBox) {\n if (start != 0 || end != this.nbParticles - 1) {\n // only some particles are updated, then use the current existing BBox basis. Note : it can only increase.\n const boundingInfo = this.mesh?.getBoundingInfo();\n if (boundingInfo) {\n minimum.copyFrom(boundingInfo.minimum);\n maximum.copyFrom(boundingInfo.maximum);\n }\n }\n }\n idx = 0; // particle index\n let pindex = 0; //index in positions array\n let cindex = 0; //index in color array\n let uindex = 0; //index in uv array\n // particle loop\n for (let p = start; p <= end; p++) {\n const particle = this.particles[p];\n idx = particle.idx;\n pindex = 3 * idx;\n cindex = 4 * idx;\n uindex = 2 * idx;\n // call to custom user function to update the particle properties\n this.updateParticle(particle);\n const particleRotationMatrix = particle._rotationMatrix;\n const particlePosition = particle.position;\n const particleGlobalPosition = particle._globalPosition;\n if (this._computeParticleRotation) {\n particle.getRotationMatrix(rotMatrix);\n }\n const particleHasParent = particle.parentId !== null;\n if (particleHasParent) {\n const parent = this.particles[particle.parentId];\n const parentRotationMatrix = parent._rotationMatrix;\n const parentGlobalPosition = parent._globalPosition;\n const rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7];\n const rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6];\n const rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8];\n particleGlobalPosition.x = parentGlobalPosition.x + rotatedX;\n particleGlobalPosition.y = parentGlobalPosition.y + rotatedY;\n particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ;\n if (this._computeParticleRotation) {\n const rotMatrixValues = rotMatrix.m;\n particleRotationMatrix[0] =\n rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6];\n particleRotationMatrix[1] =\n rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7];\n particleRotationMatrix[2] =\n rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8];\n particleRotationMatrix[3] =\n rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6];\n particleRotationMatrix[4] =\n rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7];\n particleRotationMatrix[5] =\n rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8];\n particleRotationMatrix[6] =\n rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6];\n particleRotationMatrix[7] =\n rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7];\n particleRotationMatrix[8] =\n rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8];\n }\n }\n else {\n particleGlobalPosition.x = 0;\n particleGlobalPosition.y = 0;\n particleGlobalPosition.z = 0;\n if (this._computeParticleRotation) {\n const rotMatrixValues = rotMatrix.m;\n particleRotationMatrix[0] = rotMatrixValues[0];\n particleRotationMatrix[1] = rotMatrixValues[1];\n particleRotationMatrix[2] = rotMatrixValues[2];\n particleRotationMatrix[3] = rotMatrixValues[4];\n particleRotationMatrix[4] = rotMatrixValues[5];\n particleRotationMatrix[5] = rotMatrixValues[6];\n particleRotationMatrix[6] = rotMatrixValues[8];\n particleRotationMatrix[7] = rotMatrixValues[9];\n particleRotationMatrix[8] = rotMatrixValues[10];\n }\n }\n const pivotBackTranslation = tempVectors[11];\n if (particle.translateFromPivot) {\n pivotBackTranslation.setAll(0.0);\n }\n else {\n pivotBackTranslation.copyFrom(particle.pivot);\n }\n // positions\n const tmpVertex = tempVectors[0];\n tmpVertex.copyFrom(particle.position);\n const vertexX = tmpVertex.x - particle.pivot.x;\n const vertexY = tmpVertex.y - particle.pivot.y;\n const vertexZ = tmpVertex.z - particle.pivot.z;\n let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6];\n let rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7];\n let rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8];\n rotatedX += pivotBackTranslation.x;\n rotatedY += pivotBackTranslation.y;\n rotatedZ += pivotBackTranslation.z;\n const px = (positions32[pindex] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ);\n const py = (positions32[pindex + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ);\n const pz = (positions32[pindex + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ);\n if (this._computeBoundingBox) {\n minimum.minimizeInPlaceFromFloats(px, py, pz);\n maximum.maximizeInPlaceFromFloats(px, py, pz);\n }\n if (this._computeParticleColor && particle.color) {\n const color = particle.color;\n const colors32 = this._colors32;\n colors32[cindex] = color.r;\n colors32[cindex + 1] = color.g;\n colors32[cindex + 2] = color.b;\n colors32[cindex + 3] = color.a;\n }\n if (this._computeParticleTexture && particle.uv) {\n const uv = particle.uv;\n const uvs32 = this._uvs32;\n uvs32[uindex] = uv.x;\n uvs32[uindex + 1] = uv.y;\n }\n }\n // if the VBO must be updated\n if (mesh) {\n if (update) {\n if (this._computeParticleColor) {\n mesh.updateVerticesData(VertexBuffer.ColorKind, colors32, false, false);\n }\n if (this._computeParticleTexture) {\n mesh.updateVerticesData(VertexBuffer.UVKind, uvs32, false, false);\n }\n mesh.updateVerticesData(VertexBuffer.PositionKind, positions32, false, false);\n }\n if (this._computeBoundingBox) {\n if (mesh.hasBoundingInfo) {\n mesh.getBoundingInfo().reConstruct(minimum, maximum, mesh._worldMatrix);\n }\n else {\n mesh.buildBoundingInfo(minimum, maximum, mesh._worldMatrix);\n }\n }\n }\n this.afterUpdateParticles(start, end, update);\n return this;\n }\n /**\n * Disposes the PCS.\n */\n dispose() {\n this.mesh?.dispose();\n this.vars = null;\n // drop references to internal big arrays for the GC\n this._positions = null;\n this._indices = null;\n this._normals = null;\n this._uvs = null;\n this._colors = null;\n this._indices32 = null;\n this._positions32 = null;\n this._uvs32 = null;\n this._colors32 = null;\n }\n /**\n * Visibility helper : Recomputes the visible size according to the mesh bounding box\n * doc :\n * @returns the PCS.\n */\n refreshVisibleSize() {\n if (!this._isVisibilityBoxLocked) {\n this.mesh?.refreshBoundingInfo();\n }\n return this;\n }\n /**\n * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.\n * @param size the size (float) of the visibility box\n * note : this doesn't lock the PCS mesh bounding box.\n * doc :\n */\n setVisibilityBox(size) {\n if (!this.mesh) {\n return;\n }\n const vis = size / 2;\n this.mesh.buildBoundingInfo(new Vector3(-vis, -vis, -vis), new Vector3(vis, vis, vis));\n }\n /**\n * Gets whether the PCS is always visible or not\n * doc :\n */\n get isAlwaysVisible() {\n return this._alwaysVisible;\n }\n /**\n * Sets the PCS as always visible or not\n * doc :\n */\n set isAlwaysVisible(val) {\n if (!this.mesh) {\n return;\n }\n this._alwaysVisible = val;\n this.mesh.alwaysSelectAsActiveMesh = val;\n }\n /**\n * Tells to `setParticles()` to compute the particle rotations or not\n * Default value : false. The PCS is faster when it's set to false\n * Note : particle rotations are only applied to parent particles\n * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate\n */\n set computeParticleRotation(val) {\n this._computeParticleRotation = val;\n }\n /**\n * Tells to `setParticles()` to compute the particle colors or not.\n * Default value : true. The PCS is faster when it's set to false.\n * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.\n */\n set computeParticleColor(val) {\n this._computeParticleColor = val;\n }\n set computeParticleTexture(val) {\n this._computeParticleTexture = val;\n }\n /**\n * Gets if `setParticles()` computes the particle colors or not.\n * Default value : false. The PCS is faster when it's set to false.\n * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.\n */\n get computeParticleColor() {\n return this._computeParticleColor;\n }\n /**\n * Gets if `setParticles()` computes the particle textures or not.\n * Default value : false. The PCS is faster when it's set to false.\n * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.\n */\n get computeParticleTexture() {\n return this._computeParticleTexture;\n }\n /**\n * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.\n */\n set computeBoundingBox(val) {\n this._computeBoundingBox = val;\n }\n /**\n * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.\n */\n get computeBoundingBox() {\n return this._computeBoundingBox;\n }\n // =======================================================================\n // Particle behavior logic\n // these following methods may be overwritten by users to fit their needs\n /**\n * This function does nothing. It may be overwritten to set all the particle first values.\n * The PCS doesn't call this function, you may have to call it by your own.\n * doc :\n */\n initParticles() { }\n /**\n * This function does nothing. It may be overwritten to recycle a particle\n * The PCS doesn't call this function, you can to call it\n * doc :\n * @param particle The particle to recycle\n * @returns the recycled particle\n */\n recycleParticle(particle) {\n return particle;\n }\n /**\n * Updates a particle : this function should be overwritten by the user.\n * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.\n * doc :\n * @example : just set a particle position or velocity and recycle conditions\n * @param particle The particle to update\n * @returns the updated particle\n */\n updateParticle(particle) {\n return particle;\n }\n /**\n * This will be called before any other treatment by `setParticles()` and will be passed three parameters.\n * This does nothing and may be overwritten by the user.\n * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()\n * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()\n * @param update the boolean update value actually passed to setParticles()\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n beforeUpdateParticles(start, stop, update) { }\n /**\n * This will be called by `setParticles()` after all the other treatments and just before the actual mesh update.\n * This will be passed three parameters.\n * This does nothing and may be overwritten by the user.\n * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()\n * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()\n * @param update the boolean update value actually passed to setParticles()\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n afterUpdateParticles(start, stop, update) { }\n}\n//# sourceMappingURL=pointsCloudSystem.js.map","import { registerSceneLoaderPlugin } from \"core/Loading/sceneLoader\";\nimport { SPLATFileLoaderMetadata } from \"./splatFileLoader.metadata\";\nimport { GaussianSplattingMesh } from \"core/Meshes/GaussianSplatting/gaussianSplattingMesh\";\nimport { AssetContainer } from \"core/assetContainer\";\nimport { Mesh } from \"core/Meshes/mesh\";\nimport { Logger } from \"core/Misc/logger\";\nimport { Vector3 } from \"core/Maths/math.vector\";\nimport { PointsCloudSystem } from \"core/Particles/pointsCloudSystem\";\nimport { Color4 } from \"core/Maths/math.color\";\nimport { VertexData } from \"core/Meshes/mesh.vertexData\";\n/**\n * Indicator of the parsed ply buffer. A standard ready to use splat or an array of positions for a point cloud\n */\nvar Mode;\n(function (Mode) {\n Mode[Mode[\"Splat\"] = 0] = \"Splat\";\n Mode[Mode[\"PointCloud\"] = 1] = \"PointCloud\";\n Mode[Mode[\"Mesh\"] = 2] = \"Mesh\";\n})(Mode || (Mode = {}));\n/**\n * @experimental\n * SPLAT file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class SPLATFileLoader {\n /**\n * Creates loader for gaussian splatting files\n * @param loadingOptions options for loading and parsing splat and PLY files.\n */\n constructor(loadingOptions = SPLATFileLoader._DefaultLoadingOptions) {\n /**\n * Defines the name of the plugin.\n */\n this.name = SPLATFileLoaderMetadata.name;\n this._assetContainer = null;\n /**\n * Defines the extensions the splat loader is able to load.\n * force data to come in as an ArrayBuffer\n */\n this.extensions = SPLATFileLoaderMetadata.extensions;\n this._loadingOptions = loadingOptions;\n }\n /** @internal */\n createPlugin(options) {\n return new SPLATFileLoader(options[SPLATFileLoaderMetadata.name]);\n }\n /**\n * Imports from the loaded gaussian splatting data and adds them to the scene\n * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file\n * @param scene the scene the meshes should be added to\n * @param data the gaussian splatting data to load\n * @param rootUrl root url to load from\n * @param onProgress callback called while file is loading\n * @param fileName Defines the name of the file to load\n * @returns a promise containing the loaded meshes, particles, skeletons and animations\n */\n async importMeshAsync(meshesNames, scene, data, rootUrl, onProgress, fileName) {\n return this._parse(meshesNames, scene, data, rootUrl).then((meshes) => {\n return {\n meshes: meshes,\n particleSystems: [],\n skeletons: [],\n animationGroups: [],\n transformNodes: [],\n geometries: [],\n lights: [],\n spriteManagers: [],\n };\n });\n }\n static _BuildPointCloud(pointcloud, data) {\n if (!data.byteLength) {\n return false;\n }\n const uBuffer = new Uint8Array(data);\n const fBuffer = new Float32Array(data);\n // parsed array contains room for position(3floats), normal(3floats), color (4b), quantized quaternion (4b)\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\n const vertexCount = uBuffer.length / rowLength;\n const pointcloudfunc = function (particle, i) {\n const x = fBuffer[8 * i + 0];\n const y = fBuffer[8 * i + 1];\n const z = fBuffer[8 * i + 2];\n particle.position = new Vector3(x, y, z);\n const r = uBuffer[rowLength * i + 24 + 0] / 255;\n const g = uBuffer[rowLength * i + 24 + 1] / 255;\n const b = uBuffer[rowLength * i + 24 + 2] / 255;\n particle.color = new Color4(r, g, b, 1);\n };\n pointcloud.addPoints(vertexCount, pointcloudfunc);\n return true;\n }\n static _BuildMesh(scene, parsedPLY) {\n const mesh = new Mesh(\"PLYMesh\", scene);\n const uBuffer = new Uint8Array(parsedPLY.data);\n const fBuffer = new Float32Array(parsedPLY.data);\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\n const vertexCount = uBuffer.length / rowLength;\n const positions = [];\n const vertexData = new VertexData();\n for (let i = 0; i < vertexCount; i++) {\n const x = fBuffer[8 * i + 0];\n const y = fBuffer[8 * i + 1];\n const z = fBuffer[8 * i + 2];\n positions.push(x, y, z);\n }\n if (parsedPLY.hasVertexColors) {\n const colors = new Float32Array(vertexCount * 4);\n for (let i = 0; i < vertexCount; i++) {\n const r = uBuffer[rowLength * i + 24 + 0] / 255;\n const g = uBuffer[rowLength * i + 24 + 1] / 255;\n const b = uBuffer[rowLength * i + 24 + 2] / 255;\n colors[i * 4 + 0] = r;\n colors[i * 4 + 1] = g;\n colors[i * 4 + 2] = b;\n colors[i * 4 + 3] = 1;\n }\n vertexData.colors = colors;\n }\n vertexData.positions = positions;\n vertexData.indices = parsedPLY.faces;\n vertexData.applyToMesh(mesh);\n return mesh;\n }\n _parse(meshesNames, scene, data, rootUrl) {\n return SPLATFileLoader._ConvertPLYToSplat(data).then(async (parsedPLY) => {\n const babylonMeshesArray = []; //The mesh for babylon\n switch (parsedPLY.mode) {\n case 0 /* Mode.Splat */:\n {\n const gaussianSplatting = new GaussianSplattingMesh(\"GaussianSplatting\", null, scene, this._loadingOptions.keepInRam);\n gaussianSplatting._parentContainer = this._assetContainer;\n babylonMeshesArray.push(gaussianSplatting);\n await gaussianSplatting.updateDataAsync(parsedPLY.data);\n }\n break;\n case 1 /* Mode.PointCloud */:\n {\n const pointcloud = new PointsCloudSystem(\"PointCloud\", 1, scene);\n if (SPLATFileLoader._BuildPointCloud(pointcloud, parsedPLY.data)) {\n return Promise.all([pointcloud.buildMeshAsync()]).then((mesh) => {\n babylonMeshesArray.push(mesh[0]);\n return babylonMeshesArray;\n });\n }\n else {\n pointcloud.dispose();\n }\n }\n break;\n case 2 /* Mode.Mesh */:\n {\n if (parsedPLY.faces) {\n babylonMeshesArray.push(SPLATFileLoader._BuildMesh(scene, parsedPLY));\n }\n else {\n throw new Error(\"PLY mesh doesn't contain face informations.\");\n }\n }\n break;\n default:\n throw new Error(\"Unsupported Splat mode\");\n }\n return new Promise((resolve) => {\n resolve(babylonMeshesArray);\n });\n });\n }\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @returns The loaded asset container\n */\n loadAssetContainerAsync(scene, data, rootUrl) {\n const container = new AssetContainer(scene);\n this._assetContainer = container;\n return this.importMeshAsync(null, scene, data, rootUrl)\n .then((result) => {\n result.meshes.forEach((mesh) => container.meshes.push(mesh));\n // mesh material will be null before 1st rendered frame.\n this._assetContainer = null;\n return container;\n })\n .catch((ex) => {\n this._assetContainer = null;\n throw ex;\n });\n }\n /**\n * Imports all objects from the loaded OBJ data and adds them to the scene\n * @param scene the scene the objects should be added to\n * @param data the OBJ data to load\n * @param rootUrl root url to load from\n * @returns a promise which completes when objects have been loaded to the scene\n */\n loadAsync(scene, data, rootUrl) {\n //Get the 3D model\n return this.importMeshAsync(null, scene, data, rootUrl).then(() => {\n // return void\n });\n }\n /**\n * Code from https://github.com/dylanebert/gsplat.js/blob/main/src/loaders/PLYLoader.ts Under MIT license\n * Converts a .ply data array buffer to splat\n * if data array buffer is not ply, returns the original buffer\n * @param data the .ply data to load\n * @returns the loaded splat buffer\n */\n static _ConvertPLYToSplat(data) {\n const ubuf = new Uint8Array(data);\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\n const headerEnd = \"end_header\\n\";\n const headerEndIndex = header.indexOf(headerEnd);\n if (headerEndIndex < 0 || !header) {\n // standard splat\n return new Promise((resolve) => {\n resolve({ mode: 0 /* Mode.Splat */, data: data });\n });\n }\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)[1]);\n const faceElement = /element face (\\d+)\\n/.exec(header);\n let faceCount = 0;\n if (faceElement) {\n faceCount = parseInt(faceElement[1]);\n }\n const chunkElement = /element chunk (\\d+)\\n/.exec(header);\n let chunkCount = 0;\n if (chunkElement) {\n chunkCount = parseInt(chunkElement[1]);\n }\n let rowVertexOffset = 0;\n let rowChunkOffset = 0;\n const offsets = {\n double: 8,\n int: 4,\n uint: 4,\n float: 4,\n short: 2,\n ushort: 2,\n uchar: 1,\n list: 0,\n };\n let ElementMode;\n (function (ElementMode) {\n ElementMode[ElementMode[\"Vertex\"] = 0] = \"Vertex\";\n ElementMode[ElementMode[\"Chunk\"] = 1] = \"Chunk\";\n })(ElementMode || (ElementMode = {}));\n let chunkMode = 1 /* ElementMode.Chunk */;\n const vertexProperties = [];\n const chunkProperties = [];\n const filtered = header.slice(0, headerEndIndex).split(\"\\n\");\n for (const prop of filtered) {\n if (prop.startsWith(\"property \")) {\n const [, type, name] = prop.split(\" \");\n if (chunkMode == 1 /* ElementMode.Chunk */) {\n chunkProperties.push({ name, type, offset: rowChunkOffset });\n rowChunkOffset += offsets[type];\n }\n else if (chunkMode == 0 /* ElementMode.Vertex */) {\n vertexProperties.push({ name, type, offset: rowVertexOffset });\n rowVertexOffset += offsets[type];\n }\n if (!offsets[type]) {\n Logger.Warn(`Unsupported property type: ${type}.`);\n }\n }\n else if (prop.startsWith(\"element \")) {\n const [, type] = prop.split(\" \");\n if (type == \"chunk\") {\n chunkMode = 1 /* ElementMode.Chunk */;\n }\n else if (type == \"vertex\") {\n chunkMode = 0 /* ElementMode.Vertex */;\n }\n }\n }\n const rowVertexLength = rowVertexOffset;\n const rowChunkLength = rowChunkOffset;\n return GaussianSplattingMesh.ConvertPLYToSplatAsync(data).then((buffer) => {\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\n let offset = rowChunkLength * chunkCount + rowVertexLength * vertexCount;\n // faces\n const faces = [];\n if (faceCount) {\n for (let i = 0; i < faceCount; i++) {\n const faceVertexCount = dataView.getUint8(offset);\n if (faceVertexCount != 3) {\n continue; // only support triangles\n }\n offset += 1;\n for (let j = 0; j < faceVertexCount; j++) {\n const vertexIndex = dataView.getUint32(offset + (2 - j) * 4, true); // change face winding\n faces.push(vertexIndex);\n }\n offset += 12;\n }\n }\n // early exit for chunked/quantized ply\n if (chunkCount) {\n return new Promise((resolve) => {\n resolve({ mode: 0 /* Mode.Splat */, data: buffer, faces: faces, hasVertexColors: false });\n });\n }\n // count available properties. if all necessary are present then it's a splat. Otherwise, it's a point cloud\n // if faces are found, then it's a standard mesh\n let propertyCount = 0;\n let propertyColorCount = 0;\n const splatProperties = [\"x\", \"y\", \"z\", \"scale_0\", \"scale_1\", \"scale_2\", \"opacity\", \"rot_0\", \"rot_1\", \"rot_2\", \"rot_3\"];\n const splatColorProperties = [\"red\", \"green\", \"blue\", \"f_dc_0\", \"f_dc_1\", \"f_dc_2\"];\n for (let propertyIndex = 0; propertyIndex < vertexProperties.length; propertyIndex++) {\n const property = vertexProperties[propertyIndex];\n if (splatProperties.includes(property.name)) {\n propertyCount++;\n }\n if (splatColorProperties.includes(property.name)) {\n propertyColorCount++;\n }\n }\n const hasMandatoryProperties = propertyCount == splatProperties.length && propertyColorCount == 3;\n const currentMode = faceCount ? 2 /* Mode.Mesh */ : hasMandatoryProperties ? 0 /* Mode.Splat */ : 1 /* Mode.PointCloud */;\n // parsed ready ready to be used as a splat\n return new Promise((resolve) => {\n resolve({ mode: currentMode, data: buffer, faces: faces, hasVertexColors: !!propertyColorCount });\n });\n });\n }\n}\nSPLATFileLoader._DefaultLoadingOptions = {\n keepInRam: false,\n};\n// Add this loader into the register plugin\nregisterSceneLoaderPlugin(new SPLATFileLoader());\n//# sourceMappingURL=splatFileLoader.js.map","import { Color4, Vector2, Vector3, TmpVectors, Quaternion } from \"../Maths/math\";\n/**\n * Represents one particle of a points cloud system.\n */\nexport class CloudPoint {\n /**\n * Creates a Point Cloud object.\n * Don't create particles manually, use instead the PCS internal tools like _addParticle()\n * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.\n * @param group (PointsGroup) is the group the particle belongs to\n * @param groupId (integer) is the group identifier in the PCS.\n * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))\n * @param pcs defines the PCS it is associated to\n */\n constructor(particleIndex, group, groupId, idxInGroup, pcs) {\n /**\n * particle global index\n */\n this.idx = 0;\n /**\n * The color of the particle\n */\n this.color = new Color4(1.0, 1.0, 1.0, 1.0);\n /**\n * The world space position of the particle.\n */\n this.position = Vector3.Zero();\n /**\n * The world space rotation of the particle. (Not use if rotationQuaternion is set)\n */\n this.rotation = Vector3.Zero();\n /**\n * The uv of the particle.\n */\n this.uv = new Vector2(0.0, 0.0);\n /**\n * The current speed of the particle.\n */\n this.velocity = Vector3.Zero();\n /**\n * The pivot point in the particle local space.\n */\n this.pivot = Vector3.Zero();\n /**\n * Must the particle be translated from its pivot point in its local space ?\n * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.\n * Default : false\n */\n this.translateFromPivot = false;\n /**\n * Index of this particle in the global \"positions\" array (Internal use)\n * @internal\n */\n this._pos = 0;\n /**\n * @internal Index of this particle in the global \"indices\" array (Internal use)\n */\n this._ind = 0;\n /**\n * Group id of this particle\n */\n this.groupId = 0;\n /**\n * Index of the particle in its group id (Internal use)\n */\n this.idxInGroup = 0;\n /**\n * @internal Still set as invisible in order to skip useless computations (Internal use)\n */\n this._stillInvisible = false;\n /**\n * @internal Last computed particle rotation matrix\n */\n this._rotationMatrix = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];\n /**\n * Parent particle Id, if any.\n * Default null.\n */\n this.parentId = null;\n /**\n * @internal Internal global position in the PCS.\n */\n this._globalPosition = Vector3.Zero();\n this.idx = particleIndex;\n this._group = group;\n this.groupId = groupId;\n this.idxInGroup = idxInGroup;\n this._pcs = pcs;\n }\n /**\n * get point size\n */\n get size() {\n return this.size;\n }\n /**\n * Set point size\n */\n set size(scale) {\n this.size = scale;\n }\n /**\n * Legacy support, changed quaternion to rotationQuaternion\n */\n get quaternion() {\n return this.rotationQuaternion;\n }\n /**\n * Legacy support, changed quaternion to rotationQuaternion\n */\n set quaternion(q) {\n this.rotationQuaternion = q;\n }\n /**\n * Returns a boolean. True if the particle intersects a mesh, else false\n * The intersection is computed on the particle position and Axis Aligned Bounding Box (AABB) or Sphere\n * @param target is the object (point or mesh) what the intersection is computed against\n * @param isSphere is boolean flag when false (default) bounding box of mesh is used, when true the bounding sphere is used\n * @returns true if it intersects\n */\n intersectsMesh(target, isSphere) {\n if (!target.hasBoundingInfo) {\n return false;\n }\n if (!this._pcs.mesh) {\n throw new Error(\"Point Cloud System doesnt contain the Mesh\");\n }\n if (isSphere) {\n return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));\n }\n const bbox = target.getBoundingInfo().boundingBox;\n const maxX = bbox.maximumWorld.x;\n const minX = bbox.minimumWorld.x;\n const maxY = bbox.maximumWorld.y;\n const minY = bbox.minimumWorld.y;\n const maxZ = bbox.maximumWorld.z;\n const minZ = bbox.minimumWorld.z;\n const x = this.position.x + this._pcs.mesh.position.x;\n const y = this.position.y + this._pcs.mesh.position.y;\n const z = this.position.z + this._pcs.mesh.position.z;\n return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ;\n }\n /**\n * get the rotation matrix of the particle\n * @internal\n */\n getRotationMatrix(m) {\n let quaternion;\n if (this.rotationQuaternion) {\n quaternion = this.rotationQuaternion;\n }\n else {\n quaternion = TmpVectors.Quaternion[0];\n const rotation = this.rotation;\n Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);\n }\n quaternion.toRotationMatrix(m);\n }\n}\n/**\n * Represents a group of points in a points cloud system\n * * PCS internal tool, don't use it manually.\n */\nexport class PointsGroup {\n /**\n * Get or set the groupId\n * @deprecated Please use groupId instead\n */\n get groupID() {\n return this.groupId;\n }\n set groupID(groupID) {\n this.groupId = groupID;\n }\n /**\n * Creates a points group object. This is an internal reference to produce particles for the PCS.\n * PCS internal tool, don't use it manually.\n * @internal\n */\n constructor(id, posFunction) {\n this.groupId = id;\n this._positionFunction = posFunction;\n }\n}\n//# sourceMappingURL=cloudPoint.js.map","import { Scene } from \"../scene\";\nimport { Camera } from \"../Cameras/camera\";\nimport { AddRayExtensions, CreatePickingRayInCameraSpace, CreatePickingRayInCameraSpaceToRef, CreatePickingRayToRef, MultiPick, MultiPickWithRay, Pick, PickWithBoundingInfo, PickWithRay, } from \"./ray.core\";\nexport * from \"./ray.core\";\n// Picking\nAddRayExtensions(Scene, Camera);\nScene.prototype.createPickingRayToRef = function (x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {\n return CreatePickingRayToRef(this, x, y, world, result, camera, cameraViewSpace, enableDistantPicking);\n};\nScene.prototype.createPickingRayInCameraSpace = function (x, y, camera) {\n return CreatePickingRayInCameraSpace(this, x, y, camera);\n};\nScene.prototype.createPickingRayInCameraSpaceToRef = function (x, y, result, camera) {\n return CreatePickingRayInCameraSpaceToRef(this, x, y, result, camera);\n};\nScene.prototype.pickWithBoundingInfo = function (x, y, predicate, fastCheck, camera) {\n return PickWithBoundingInfo(this, x, y, predicate, fastCheck, camera);\n};\nScene.prototype.pick = function (x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {\n return Pick(this, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking);\n};\nScene.prototype.pickWithRay = function (ray, predicate, fastCheck, trianglePredicate) {\n return PickWithRay(this, ray, predicate, fastCheck, trianglePredicate);\n};\nScene.prototype.multiPick = function (x, y, predicate, camera, trianglePredicate) {\n return MultiPick(this, x, y, predicate, camera, trianglePredicate);\n};\nScene.prototype.multiPickWithRay = function (ray, predicate, trianglePredicate) {\n return MultiPickWithRay(this, ray, predicate, trianglePredicate);\n};\n//# sourceMappingURL=ray.js.map"],"names":["ShaderStore","IncludesShadersStore","name","shader","ShadersStore","gaussianSplattingPixelShader","gaussianSplattingVertexShader","IncludesShadersStoreWGSL","ShadersStoreWGSL","gaussianSplattingPixelShaderWGSL","gaussianSplattingVertexShaderWGSL","GaussianSplattingMaterialDefines","MaterialDefines","constructor","super","this","FOG","THIN_INSTANCES","LOGARITHMICDEPTH","CLIPPLANE","CLIPPLANE2","CLIPPLANE3","CLIPPLANE4","CLIPPLANE5","CLIPPLANE6","rebuild","GaussianSplattingMaterial","PushMaterial","scene","backFaceCulling","hasRenderTargetTextures","needAlphaTesting","needAlphaBlending","isReadyForSubMesh","mesh","subMesh","useInstances","drawWrapper","_drawWrapper","effect","isFrozen","_wasPreviouslyReady","_wasPreviouslyUsingInstances","materialDefines","getScene","defines","_isReadyForSubMesh","engine","getEngine","PrepareDefinesForMisc","_useLogarithmicDepth","pointsCloud","fogEnabled","PrepareDefinesForFrameBoundValues","PrepareDefinesForAttributes","isDirty","markAsProcessed","resetCachedMaterial","attribs","VertexBuffer","PositionKind","PrepareAttributesForInstances","uniforms","samplers","uniformBuffers","PrepareUniformsAndSamplersList","uniformsNames","uniformBuffersNames","addClipPlaneUniforms","join","toString","createEffect","attributes","onCompiled","onError","indexParameters","shaderLanguage","_shaderLanguage","extraInitializationsAsync","async","Promise","all","resolve","then","gaussianSplatting_fragment","gaussianSplatting_vertex","gaussianSplatting_fragment$1","gaussianSplatting_vertex$1","setEffect","_materialContext","isReady","_renderId","getRenderId","BindEffect","camera","activeCamera","renderWidth","getRenderWidth","renderHeight","getRenderHeight","numberOfRigs","rigParent","rigCameras","length","setFloat2","focal","t","getProjectionMatrix","m","fovMode","Camera","FOVMODE_VERTICAL_FIXED","gsMesh","covariancesATexture","textureSize","getSize","width","height","setTexture","covariancesBTexture","centersTexture","colorsTexture","bindForSubMesh","world","_activeEffect","getMeshUniformBuffer","bindToEffect","transferToEffect","_mustRebind","visibility","bindView","bindViewProjection","bindClipPlane","_features","needToAlwaysBindUniformBuffers","_needToBindSceneUbo","BindFogParameters","useLogarithmicDepth","BindLogDepth","_afterBind","clone","SerializationHelper","Clone","serialize","serializationObject","customType","getClassName","Parse","source","rootUrl","RegisterClass","HCF","functions.HighestCommonFactor","Scalar","functions","TwoPi","Math","PI","Sign","sign","Log2","log2","unpackUnorm","value","bits","unpack111011","result","x","y","z","unpack8888","unpackRot","norm","sqrt","a","b","c","set","PLYType","PLYValue","sceneClass","cameraClass","PointColor","Mode","GaussianSplattingMesh","Mesh","_covariancesATexture","_covariancesBTexture","_centersTexture","_colorsTexture","material","_material","cullBackFaces","resetDrawCache","url","keepInRam","_vertexCount","_worker","_frameIdLastUpdate","_modelViewMatrix","Matrix","Identity","_canPostToWorker","_readyToDisplay","_splatPositions","_splatIndex","_covariancesA","_covariancesB","_colors","_keepInRam","_delayedTextureUpdate","_oldDirection","Vector3","_useRGBACovariants","_tmpCovariances","_sortIsDirty","vertexData","VertexData","positions","indices","applyToMesh","subMeshes","SubMesh","setEnabled","isWebGPU","version","loadFileAsync","_scene","getTotalVertices","completeCheck","_postToWorker","forced","frameId","getFrameId","cameraMatrix","getViewMatrix","getWorldMatrix","multiplyToRef","invertToRef","TmpVectors","TransformNormalToRef","Forward","useRightHandedSystem","normalize","dot","Dot","abs","copyFrom","postMessage","view","depthMix","_depthMix","buffer","render","enableAlphaMode","effectiveMeshReplacement","_TypeNameToEnum","_ValueNameToEnum","ParseHeader","data","ubuf","Uint8Array","header","TextDecoder","decode","slice","headerEnd","headerEndIndex","indexOf","vertexCount","parseInt","exec","chunkElement","chunkCount","rowVertexOffset","rowChunkOffset","offsets","double","int","uint","float","short","ushort","uchar","list","ElementMode","chunkMode","vertexProperties","chunkProperties","filtered","split","prop","startsWith","typeName","type","push","offset","Logger","Warn","rowVertexLength","rowChunkLength","dataView","DataView","ArrayBuffer","_RowOutputLength","_GetCompressedChunks","compressedChunks","Array","i","currentChunk","min","max","minScale","maxScale","propertyIndex","property","getFloat32","_GetSplat","index","q","Quaternion","temp3","rowOutputLength","position","Float32Array","scale","rgba","Uint8ClampedArray","rot","chunkIndex","r0","r1","r2","r3","getInt32","getUint32","getFloat64","getUint8","compressedChunk","Lerp","w","exp","_SH_C0","ConvertPLYToSplat","useCoroutine","_PlyConversionBatchSize","ConvertPLYToSplatAsync","runCoroutineAsync","createYieldingScheduler","loadDataAsync","updateDataAsync","Tools","LoadFileAsync","plyBuffer","splatsData","dispose","doNotRecurse","terminate","_copyTextures","newGS","undefined","_copySource","makeGeometryUnique","_instanciateWorker","binfo","getBoundingInfo","reConstruct","minimum","maximum","forcedInstanceCount","_makeSplat","sourceIndex","destinationIndex","fBuffer","uBuffer","covA","covB","colorArray","matrixRotation","matrixScale","quaternion","covBSItemSize","minimizeInPlaceFromFloats","maximizeInPlaceFromFloats","toRotationMatrix","ScalingToRef","M","covariances","factor","covIndex","transform","ToHalfFloat","_updateTextures","_getTextureSize","createTextureFromData","format","RawTexture","Constants","TEXTURE_BILINEAR_SAMPLINGMODE","TEXTURETYPE_FLOAT","createTextureFromDataU8","TEXTURETYPE_UNSIGNED_BYTE","createTextureFromDataF16","TEXTURETYPE_HALF_FLOAT","colors","centers","from","TEXTUREFORMAT_RGBA","TEXTUREFORMAT_RG","_updateData","isAsync","_updateSplatIndexBuffer","textureLength","lineCountUpdate","ProgressiveUpdateAmount","textureLengthPerUpdate","Uint16Array","Number","MAX_VALUE","partCount","ceil","partIndex","updateLine","splatIndexBase","_updateSubTextures","_SplatBatchSize","updateData","runCoroutineSync","thinInstanceSetBuffer","lineStart","lineCount","updateTextureFromDataF16","texture","updateTextureData","getInternalTexture","texelStart","texelCount","covAView","BYTES_PER_ELEMENT","covBView","colorsView","centersView","updateTextureFromData","updateTextureFromDataU8","Worker","URL","createObjectURL","Blob","_CreateWorker","BigInt64Array","onmessage","e","indexMix","Uint32Array","j","thinInstanceBufferUpdated","getCaps","maxTextureSize","Error","Vector2","self","floatMix","viewProj","depthFactor","sort","CloudPoint","particleIndex","group","groupId","idxInGroup","pcs","idx","color","Color4","Zero","rotation","uv","velocity","pivot","translateFromPivot","_pos","_ind","_stillInvisible","_rotationMatrix","parentId","_globalPosition","_group","_pcs","size","rotationQuaternion","intersectsMesh","target","isSphere","hasBoundingInfo","boundingSphere","intersectsPoint","add","bbox","boundingBox","maxX","maximumWorld","minX","minimumWorld","maxY","minY","maxZ","minZ","getRotationMatrix","RotationYawPitchRollToRef","PointsGroup","groupID","id","posFunction","_positionFunction","Ray","origin","direction","epsilon","Epsilon","intersectsBoxMinMax","intersectionTreshold","newMinimum","_TmpVector3","copyFromFloats","newMaximum","inv","temp","d","maxValue","Infinity","intersectsBox","box","intersectsSphere","sphere","center","pyth","radius","rr","intersectsTriangle","vertex0","vertex1","vertex2","edge1","edge2","pvec","tvec","qvec","subtractToRef","CrossToRef","det","invdet","bv","bw","distance","IntersectionInfo","intersectsPlane","plane","result1","normal","result2","intersectsAxis","axis","fastCheck","trianglePredicate","onlyBoundingInfo","worldToUse","skipBoundingInfo","tm","_tmpRay","TransformToRef","Transform","intersects","intersectsMeshes","meshes","results","pickInfo","hit","_comparePickingInfo","pickingInfoA","pickingInfoB","intersectionSegment","sega","segb","threshold","o","u","rsegb","v","scaleToRef","_Rayl","addToRef","D","sN","tN","sD","tD","_Smallnum","sc","tc","qtc","qsc","addInPlace","dP","lengthSquared","update","viewportWidth","viewportHeight","projection","enableDistantPicking","_RayDistant","unprojectRayToRef","IdentityReadOnly","CreateNew","CreateNewFromTo","end","CreateFromToToRef","ray","matrix","TransformCoordinatesToRef","dir","len","num","sourceX","sourceY","invert","EngineStore","LastCreatedEngine","nearScreenSource","useReverseDepthBuffer","isNDCHalfZRange","farScreenSource","nearVec3","farVec3","_UnprojectFromInvertedMatrixToRef","CreatePickingRay","cameraViewSpace","CreatePickingRayToRef","cameraViewport","viewport","vx","vy","toGlobal","levelInv","getHardwareScalingLevel","CreatePickingRayInCameraSpaceToRef","PickingInfo","identity","InternalPickForMesh","pickingInfo","rayFunction","InternalPick","predicate","computeWorldMatrixForCamera","activeCameras","cameraToUseForPointers","currentCamera","picker","meshIndex","isEnabled","isVisible","isPickable","forceCompute","isWorldMatrixCameraDependent","computeWorldMatrix","hasThinInstances","thinInstanceEnablePicking","tmpMatrix","thinMatrices","thinInstanceGetWorldMatrices","thinInstanceIndex","InternalMultiPick","pickingInfos","GetForwardRayToRef","refRay","forward","worldForward","NormalizeToRef","BuildArray","Scene","prototype","getForwardRay","getForwardRayToRef","_ImportHelper","_IsPickingAvailable","createPickingRay","createPickingRayToRef","createPickingRayInCameraSpace","CreatePickingRayInCameraSpace","createPickingRayInCameraSpaceToRef","pickWithBoundingInfo","_tempPickingRay","PickWithBoundingInfo","pick","_enableDistantPicking","Pick","pickWithRay","_pickWithRayInverseMatrix","_cachedRayForTransform","PickWithRay","multiPick","MultiPick","multiPickWithRay","MultiPickWithRay","PointsCloudSystem","_positions32","_colors32","uvs","_uvs32","pointSize","options","particles","nbParticles","counter","vars","_promises","_positions","_indices","_normals","_uvs","_updatable","_isVisibilityBoxLocked","_alwaysVisible","_groups","_groupCounter","_computeParticleColor","_computeParticleTexture","_computeParticleRotation","_computeBoundingBox","_isReady","_size","LastCreatedScene","updatable","buildMeshAsync","_buildMesh","addPoints","UVKind","ec","ColorKind","mat","StandardMaterial","emissiveColor","Color3","disableLighting","_addParticle","cp","_randomUnitVector","particle","random","_getColorIndicesForCoord","pointsGroup","imageData","_groupImageData","colorIndices","greenIndex","blueIndex","alphaIndex","redForCoord","greenForCoord","blueForCoord","alphaForCoord","_setPointsColorOrUV","isVolume","colorFromTexture","hasTexture","range","uvSetIndex","updateFacetData","diameter","meshPos","getVerticesData","meshInd","getIndices","meshUV","meshCol","place","meshMatrix","isIdentity","p","TransformCoordinatesFromFloatsToRef","idxPoints","id0","id1","id2","v0X","v0Y","v0Z","v1X","v1Y","v1Z","v2X","v2Y","v2Z","vec0","vec1","uv0X","uv0Y","uv1X","uv1Y","uv2X","uv2Y","uv0","uv1","uv2","uvec0","uvec1","col0X","col0Y","col0Z","col0A","col1X","col1Y","col1Z","col1A","col2X","col2Y","col2Z","col2A","col0","Vector4","col1","col2","colvec0","colvec1","facetPoint","uvPoint","lamda","mu","colPoint","tang","biNorm","angle","facetPlaneVec","gap","deltaS","deltaV","h","s","hsvCol","statedColor","colPoint3","pointColors","_groupDensity","RandomRange","getFacetNormal","Cross","cos","sin","pickedPoint","subtract","_groupImgWidth","_groupImgHeight","round","r","g","toHSV","HSVtoRGBToRef","_colorFromTexture","textureList","getActiveTextures","BaseTexture","WhenAllReady","n","_textureNb","finalize","coordinatesIndex","dataPromise","readPixels","_calculateDensity","nbPoints","area","cumulativeAreas","surfaceArea","nbFacets","density","remainingPoints","cumulativeArea","facetPointsWithFraction","floored","floor","fraction","facetPoints","nb","pointFunction","addSurfacePoints","colorWith","colored","isNaN","addVolumePoints","setParticles","start","beforeUpdateParticles","rotMatrix","colors32","positions32","uvs32","tempVectors","camAxisX","camAxisY","camAxisZ","setAll","IdentityToRef","isFacetDataEnabled","boundingInfo","pindex","cindex","uindex","updateParticle","particleRotationMatrix","particlePosition","particleGlobalPosition","parent","parentRotationMatrix","parentGlobalPosition","rotatedY","rotatedX","rotatedZ","rotMatrixValues","pivotBackTranslation","tmpVertex","vertexX","vertexY","vertexZ","px","py","pz","updateVerticesData","_worldMatrix","buildBoundingInfo","afterUpdateParticles","_indices32","refreshVisibleSize","refreshBoundingInfo","setVisibilityBox","vis","isAlwaysVisible","val","alwaysSelectAsActiveMesh","computeParticleRotation","computeParticleColor","computeParticleTexture","computeBoundingBox","initParticles","recycleParticle","stop","SPLATFileLoader","loadingOptions","_DefaultLoadingOptions","SPLATFileLoaderMetadata","_assetContainer","extensions","_loadingOptions","createPlugin","importMeshAsync","meshesNames","onProgress","fileName","_parse","particleSystems","skeletons","animationGroups","transformNodes","geometries","lights","spriteManagers","_BuildPointCloud","pointcloud","byteLength","_BuildMesh","parsedPLY","hasVertexColors","faces","_ConvertPLYToSplat","babylonMeshesArray","mode","gaussianSplatting","_parentContainer","loadAssetContainerAsync","container","AssetContainer","forEach","catch","ex","loadAsync","faceElement","faceCount","faceVertexCount","vertexIndex","propertyCount","propertyColorCount","splatProperties","splatColorProperties","includes","hasMandatoryProperties","currentMode","registerSceneLoaderPlugin"],"mappings":"k6BAeAA,EAAYC,qBAAyB,qCAVtB,+OCEf,MAAMC,EAAO,+BACPC,EAAS,6RAUfH,EAAYI,aAAaF,GAAQC,EAE1B,MAAME,EAA+B,CAAAH,KAAEA,EAAIC,OAAEA,wECfpDH,EAAYC,qBAAyB,mCAFtB,wFCMfD,EAAYC,qBAAyB,gCAJtB,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