@babylonjs/viewer 7.40.2-alpha → 7.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/configuration/configuration.d.ts +107 -0
  2. package/configuration/configuration.js +16 -0
  3. package/configuration/configuration.js.map +1 -0
  4. package/configuration/configurationCompatibility.d.ts +8 -0
  5. package/configuration/configurationCompatibility.js +66 -0
  6. package/configuration/configurationCompatibility.js.map +1 -0
  7. package/configuration/configurationContainer.d.ts +10 -0
  8. package/configuration/configurationContainer.js +10 -0
  9. package/configuration/configurationContainer.js.map +1 -0
  10. package/configuration/globals.d.ts +6 -0
  11. package/configuration/globals.js +18 -0
  12. package/configuration/globals.js.map +1 -0
  13. package/configuration/index.d.ts +2 -0
  14. package/configuration/index.js +4 -0
  15. package/configuration/index.js.map +1 -0
  16. package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
  17. package/configuration/interfaces/cameraConfiguration.js +2 -0
  18. package/configuration/interfaces/cameraConfiguration.js.map +1 -0
  19. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
  20. package/configuration/interfaces/colorGradingConfiguration.js +2 -0
  21. package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
  22. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
  23. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
  24. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
  25. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
  26. package/configuration/interfaces/environmentMapConfiguration.js +2 -0
  27. package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
  28. package/configuration/interfaces/groundConfiguration.d.ts +24 -0
  29. package/configuration/interfaces/groundConfiguration.js +2 -0
  30. package/configuration/interfaces/groundConfiguration.js.map +1 -0
  31. package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
  32. package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
  33. package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
  34. package/configuration/interfaces/index.d.ts +15 -0
  35. package/configuration/interfaces/index.js +16 -0
  36. package/configuration/interfaces/index.js.map +1 -0
  37. package/configuration/interfaces/lightConfiguration.d.ts +60 -0
  38. package/configuration/interfaces/lightConfiguration.js +2 -0
  39. package/configuration/interfaces/lightConfiguration.js.map +1 -0
  40. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
  41. package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
  42. package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
  43. package/configuration/interfaces/modelConfiguration.d.ts +65 -0
  44. package/configuration/interfaces/modelConfiguration.js +2 -0
  45. package/configuration/interfaces/modelConfiguration.js.map +1 -0
  46. package/configuration/interfaces/observersConfiguration.d.ts +5 -0
  47. package/configuration/interfaces/observersConfiguration.js +2 -0
  48. package/configuration/interfaces/observersConfiguration.js.map +1 -0
  49. package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
  50. package/configuration/interfaces/sceneConfiguration.js +2 -0
  51. package/configuration/interfaces/sceneConfiguration.js.map +1 -0
  52. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
  53. package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
  54. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
  55. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
  56. package/configuration/interfaces/skyboxConfiguration.js +2 -0
  57. package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
  58. package/configuration/interfaces/templateConfiguration.d.ts +67 -0
  59. package/configuration/interfaces/templateConfiguration.js +2 -0
  60. package/configuration/interfaces/templateConfiguration.js.map +1 -0
  61. package/configuration/interfaces/vrConfiguration.d.ts +16 -0
  62. package/configuration/interfaces/vrConfiguration.js +2 -0
  63. package/configuration/interfaces/vrConfiguration.js.map +1 -0
  64. package/configuration/loader.d.ts +4 -0
  65. package/configuration/loader.js +17 -0
  66. package/configuration/loader.js.map +1 -0
  67. package/configuration/mappers.d.ts +43 -0
  68. package/configuration/mappers.js +193 -0
  69. package/configuration/mappers.js.map +1 -0
  70. package/configuration/renderOnlyLoader.d.ts +33 -0
  71. package/configuration/renderOnlyLoader.js +162 -0
  72. package/configuration/renderOnlyLoader.js.map +1 -0
  73. package/configuration/types/default.d.ts +6 -0
  74. package/configuration/types/default.js +121 -0
  75. package/configuration/types/default.js.map +1 -0
  76. package/configuration/types/environmentMap.d.ts +5 -0
  77. package/configuration/types/environmentMap.js +14 -0
  78. package/configuration/types/environmentMap.js.map +1 -0
  79. package/configuration/types/extended.d.ts +6 -0
  80. package/configuration/types/extended.js +317 -0
  81. package/configuration/types/extended.js.map +1 -0
  82. package/configuration/types/index.d.ts +14 -0
  83. package/configuration/types/index.js +51 -0
  84. package/configuration/types/index.js.map +1 -0
  85. package/configuration/types/minimal.d.ts +6 -0
  86. package/configuration/types/minimal.js +43 -0
  87. package/configuration/types/minimal.js.map +1 -0
  88. package/configuration/types/renderOnlyDefault.d.ts +30 -0
  89. package/configuration/types/renderOnlyDefault.js +31 -0
  90. package/configuration/types/renderOnlyDefault.js.map +1 -0
  91. package/configuration/types/shadowLight.d.ts +9 -0
  92. package/configuration/types/shadowLight.js +64 -0
  93. package/configuration/types/shadowLight.js.map +1 -0
  94. package/helper/index.d.ts +29 -0
  95. package/helper/index.js +66 -0
  96. package/helper/index.js.map +1 -0
  97. package/index.d.ts +30 -0
  98. package/index.js +46 -0
  99. package/index.js.map +1 -0
  100. package/initializer.d.ts +11 -0
  101. package/initializer.js +35 -0
  102. package/initializer.js.map +1 -0
  103. package/interfaces.d.ts +5 -0
  104. package/interfaces.js +7 -0
  105. package/interfaces.js.map +1 -0
  106. package/labs/environmentSerializer.d.ts +126 -0
  107. package/labs/environmentSerializer.js +191 -0
  108. package/labs/environmentSerializer.js.map +1 -0
  109. package/labs/texture.d.ts +183 -0
  110. package/labs/texture.js +351 -0
  111. package/labs/texture.js.map +1 -0
  112. package/labs/viewerLabs.d.ts +51 -0
  113. package/labs/viewerLabs.js +134 -0
  114. package/labs/viewerLabs.js.map +1 -0
  115. package/loader/modelLoader.d.ts +56 -0
  116. package/loader/modelLoader.js +202 -0
  117. package/loader/modelLoader.js.map +1 -0
  118. package/loader/plugins/applyMaterialConfig.d.ts +12 -0
  119. package/loader/plugins/applyMaterialConfig.js +16 -0
  120. package/loader/plugins/applyMaterialConfig.js.map +1 -0
  121. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
  122. package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
  123. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
  124. package/loader/plugins/index.d.ts +19 -0
  125. package/loader/plugins/index.js +44 -0
  126. package/loader/plugins/index.js.map +1 -0
  127. package/loader/plugins/loaderPlugin.d.ts +24 -0
  128. package/loader/plugins/loaderPlugin.js +2 -0
  129. package/loader/plugins/loaderPlugin.js.map +1 -0
  130. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
  131. package/loader/plugins/msftLodLoaderPlugin.js +21 -0
  132. package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
  133. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
  134. package/loader/plugins/telemetryLoaderPlugin.js +36 -0
  135. package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
  136. package/managers/observablesManager.d.ts +66 -0
  137. package/managers/observablesManager.js +35 -0
  138. package/managers/observablesManager.js.map +1 -0
  139. package/managers/sceneManager.d.ts +245 -0
  140. package/managers/sceneManager.js +1375 -0
  141. package/managers/sceneManager.js.map +1 -0
  142. package/managers/telemetryManager.d.ts +78 -0
  143. package/managers/telemetryManager.js +117 -0
  144. package/managers/telemetryManager.js.map +1 -0
  145. package/model/modelAnimation.d.ts +215 -0
  146. package/model/modelAnimation.js +237 -0
  147. package/model/modelAnimation.js.map +1 -0
  148. package/model/viewerModel.d.ts +233 -0
  149. package/model/viewerModel.js +673 -0
  150. package/model/viewerModel.js.map +1 -0
  151. package/optimizer/custom/extended.d.ts +13 -0
  152. package/optimizer/custom/extended.js +101 -0
  153. package/optimizer/custom/extended.js.map +1 -0
  154. package/optimizer/custom/index.d.ts +9 -0
  155. package/optimizer/custom/index.js +26 -0
  156. package/optimizer/custom/index.js.map +1 -0
  157. package/package.json +28 -19
  158. package/readme.md +28 -28
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +22 -0
  167. package/templating/plugins/hdButtonPlugin.js.map +1 -0
  168. package/templating/plugins/printButton.d.ts +9 -0
  169. package/templating/plugins/printButton.js +41 -0
  170. package/templating/plugins/printButton.js.map +1 -0
  171. package/templating/templateManager.d.ts +197 -0
  172. package/templating/templateManager.js +561 -0
  173. package/templating/templateManager.js.map +1 -0
  174. package/templating/viewerTemplatePlugin.d.ts +21 -0
  175. package/templating/viewerTemplatePlugin.js +69 -0
  176. package/templating/viewerTemplatePlugin.js.map +1 -0
  177. package/viewer/defaultViewer.d.ts +130 -0
  178. package/viewer/defaultViewer.js +672 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/assets/photoStudio.env +0 -0
  193. package/dist/babylon-viewer.esm.js +0 -2
  194. package/dist/babylon-viewer.esm.js.map +0 -1
  195. package/dist/babylon-viewer.esm.min.js +0 -2
  196. package/dist/babylon-viewer.esm.min.js.map +0 -1
  197. package/dist/chunks/EXT_lights_ies-BrhvRw2-.esm.js +0 -84
  198. package/dist/chunks/EXT_lights_ies-BrhvRw2-.esm.js.map +0 -1
  199. package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js +0 -2
  200. package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js.map +0 -1
  201. package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js +0 -2
  202. package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js.map +0 -1
  203. package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js +0 -171
  204. package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js.map +0 -1
  205. package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js +0 -86
  206. package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js.map +0 -1
  207. package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js +0 -2
  208. package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js.map +0 -1
  209. package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js +0 -2
  210. package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js.map +0 -1
  211. package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js +0 -134
  212. package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js.map +0 -1
  213. package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js +0 -2
  214. package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js.map +0 -1
  215. package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js +0 -44
  216. package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js.map +0 -1
  217. package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js +0 -2
  218. package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js.map +0 -1
  219. package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js +0 -43
  220. package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js.map +0 -1
  221. package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js +0 -64
  222. package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js.map +0 -1
  223. package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js +0 -2
  224. package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js.map +0 -1
  225. package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js +0 -352
  226. package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js.map +0 -1
  227. package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js +0 -2
  228. package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js.map +0 -1
  229. package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js +0 -2
  230. package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js.map +0 -1
  231. package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js +0 -617
  232. package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js.map +0 -1
  233. package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js +0 -4033
  234. package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js.map +0 -1
  235. package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js +0 -2
  236. package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js.map +0 -1
  237. package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js +0 -581
  238. package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js.map +0 -1
  239. package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js +0 -2
  240. package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js.map +0 -1
  241. package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js +0 -65
  242. package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js.map +0 -1
  243. package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js +0 -2
  244. package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js.map +0 -1
  245. package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js +0 -96
  246. package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js.map +0 -1
  247. package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js +0 -2
  248. package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js.map +0 -1
  249. package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js +0 -97
  250. package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js +0 -62
  256. package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js +0 -55
  258. package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js +0 -2
  262. package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js.map +0 -1
  263. package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js +0 -64
  264. package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js.map +0 -1
  265. package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js +0 -72
  266. package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js.map +0 -1
  267. package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js +0 -2
  268. package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js.map +0 -1
  269. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js +0 -81
  272. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js +0 -85
  274. package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js.map +0 -1
  275. package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js +0 -2
  276. package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js.map +0 -1
  277. package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js +0 -75
  280. package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js +0 -307
  282. package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js +0 -74
  286. package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js +0 -262
  290. package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js.map +0 -1
  291. package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js +0 -2
  292. package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js.map +0 -1
  293. package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js +0 -2
  294. package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js.map +0 -1
  295. package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js +0 -87
  296. package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js.map +0 -1
  297. package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js +0 -2
  298. package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js.map +0 -1
  299. package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js +0 -26
  300. package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js.map +0 -1
  301. package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js +0 -2
  302. package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js +0 -39
  304. package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js.map +0 -1
  305. package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js +0 -46
  306. package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js.map +0 -1
  307. package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js +0 -2
  308. package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js.map +0 -1
  309. package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js +0 -43
  310. package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js.map +0 -1
  311. package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js +0 -2
  312. package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js.map +0 -1
  313. package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js +0 -63
  314. package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js.map +0 -1
  315. package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js +0 -2
  316. package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js.map +0 -1
  317. package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js +0 -2
  318. package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js.map +0 -1
  319. package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js +0 -51
  320. package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js.map +0 -1
  321. package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js +0 -2
  322. package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js.map +0 -1
  323. package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js +0 -2207
  324. package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js.map +0 -1
  325. package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js +0 -337
  326. package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js.map +0 -1
  327. package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js +0 -2
  328. package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js.map +0 -1
  329. package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js +0 -46
  330. package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js.map +0 -1
  331. package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js +0 -2
  332. package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js.map +0 -1
  333. package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js +0 -2
  334. package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js.map +0 -1
  335. package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js +0 -47
  336. package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js.map +0 -1
  337. package/dist/chunks/animationGroup-DjpN6ul8.esm.js +0 -2482
  338. package/dist/chunks/animationGroup-DjpN6ul8.esm.js.map +0 -1
  339. package/dist/chunks/animationGroup-Duijaphk.esm.min.js +0 -2
  340. package/dist/chunks/animationGroup-Duijaphk.esm.min.js.map +0 -1
  341. package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js +0 -2
  342. package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js.map +0 -1
  343. package/dist/chunks/assetContainer-nATkXNwM.esm.js +0 -1720
  344. package/dist/chunks/assetContainer-nATkXNwM.esm.js.map +0 -1
  345. package/dist/chunks/audioEngine-C2kMlYrt.esm.js +0 -305
  346. package/dist/chunks/audioEngine-C2kMlYrt.esm.js.map +0 -1
  347. package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js +0 -2
  348. package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js.map +0 -1
  349. package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js +0 -114
  350. package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js.map +0 -1
  351. package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js +0 -2
  352. package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js.map +0 -1
  353. package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js +0 -2
  354. package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js.map +0 -1
  355. package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js +0 -600
  356. package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js.map +0 -1
  357. package/dist/chunks/dds-BiituSHb.esm.min.js +0 -2
  358. package/dist/chunks/dds-BiituSHb.esm.min.js.map +0 -1
  359. package/dist/chunks/dds-CeXwQQLK.esm.js +0 -540
  360. package/dist/chunks/dds-CeXwQQLK.esm.js.map +0 -1
  361. package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js +0 -2
  362. package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js.map +0 -1
  363. package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js +0 -88
  364. package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js.map +0 -1
  365. package/dist/chunks/decalFragment-B0hAgbHQ.esm.js +0 -18
  366. package/dist/chunks/decalFragment-B0hAgbHQ.esm.js.map +0 -1
  367. package/dist/chunks/decalFragment-BisNb1SA.esm.min.js +0 -2
  368. package/dist/chunks/decalFragment-BisNb1SA.esm.min.js.map +0 -1
  369. package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js +0 -2
  370. package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js.map +0 -1
  371. package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js +0 -2
  372. package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js.map +0 -1
  373. package/dist/chunks/default.fragment-DBNZgft_.esm.js +0 -515
  374. package/dist/chunks/default.fragment-DBNZgft_.esm.js.map +0 -1
  375. package/dist/chunks/default.fragment-mEUMwg3j.esm.js +0 -446
  376. package/dist/chunks/default.fragment-mEUMwg3j.esm.js.map +0 -1
  377. package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js +0 -2
  378. package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js.map +0 -1
  379. package/dist/chunks/default.vertex-BYGJcupS.esm.js +0 -181
  380. package/dist/chunks/default.vertex-BYGJcupS.esm.js.map +0 -1
  381. package/dist/chunks/default.vertex-D-mtahDc.esm.min.js +0 -2
  382. package/dist/chunks/default.vertex-D-mtahDc.esm.min.js.map +0 -1
  383. package/dist/chunks/default.vertex-uhPv4tjg.esm.js +0 -202
  384. package/dist/chunks/default.vertex-uhPv4tjg.esm.js.map +0 -1
  385. package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js +0 -13
  386. package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js.map +0 -1
  387. package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js +0 -2
  388. package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js.map +0 -1
  389. package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js +0 -2
  390. package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js.map +0 -1
  391. package/dist/chunks/defaultUboDeclaration-vQgTvkEe.esm.js +0 -15
  392. package/dist/chunks/defaultUboDeclaration-vQgTvkEe.esm.js.map +0 -1
  393. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  394. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  395. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  396. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  397. package/dist/chunks/dumpTools-DO-b-FSI.esm.js +0 -200
  398. package/dist/chunks/dumpTools-DO-b-FSI.esm.js.map +0 -1
  399. package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js +0 -2
  400. package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js.map +0 -1
  401. package/dist/chunks/engine-BcUVpC0R.esm.js +0 -2216
  402. package/dist/chunks/engine-BcUVpC0R.esm.js.map +0 -1
  403. package/dist/chunks/engine-CBJrzwFS.esm.min.js +0 -2
  404. package/dist/chunks/engine-CBJrzwFS.esm.min.js.map +0 -1
  405. package/dist/chunks/engine.common-CSbFYR6g.esm.min.js +0 -2
  406. package/dist/chunks/engine.common-CSbFYR6g.esm.min.js.map +0 -1
  407. package/dist/chunks/engine.common-MyFhbP5R.esm.js +0 -1162
  408. package/dist/chunks/engine.common-MyFhbP5R.esm.js.map +0 -1
  409. package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js +0 -2
  410. package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js.map +0 -1
  411. package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js +0 -64
  412. package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js.map +0 -1
  413. package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js +0 -2
  414. package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js.map +0 -1
  415. package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js +0 -382
  416. package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js.map +0 -1
  417. package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js +0 -2
  418. package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js.map +0 -1
  419. package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js +0 -1683
  420. package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js.map +0 -1
  421. package/dist/chunks/fogFragment-B6w-VW0A.esm.js +0 -102
  422. package/dist/chunks/fogFragment-B6w-VW0A.esm.js.map +0 -1
  423. package/dist/chunks/fogFragment-BdwYc4_S.esm.js +0 -101
  424. package/dist/chunks/fogFragment-BdwYc4_S.esm.js.map +0 -1
  425. package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js +0 -2
  426. package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js.map +0 -1
  427. package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js +0 -2
  428. package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js.map +0 -1
  429. package/dist/chunks/fresnelFunction-BeTviBu9.esm.js +0 -12
  430. package/dist/chunks/fresnelFunction-BeTviBu9.esm.js.map +0 -1
  431. package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js +0 -2
  432. package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js.map +0 -1
  433. package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js +0 -2
  434. package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js.map +0 -1
  435. package/dist/chunks/glTFLoader-C3ib4SHM.esm.js +0 -7586
  436. package/dist/chunks/glTFLoader-C3ib4SHM.esm.js.map +0 -1
  437. package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js +0 -2
  438. package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js.map +0 -1
  439. package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.esm.js +0 -77
  440. package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.esm.js.map +0 -1
  441. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  442. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  443. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  444. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  445. package/dist/chunks/harmonicsFunctions-BEk7hjTV.esm.js +0 -35
  446. package/dist/chunks/harmonicsFunctions-BEk7hjTV.esm.js.map +0 -1
  447. package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js +0 -34
  448. package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js.map +0 -1
  449. package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js +0 -2
  450. package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js.map +0 -1
  451. package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js +0 -2
  452. package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js.map +0 -1
  453. package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js +0 -2
  454. package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js.map +0 -1
  455. package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js +0 -253
  456. package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js.map +0 -1
  457. package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js +0 -108
  458. package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js.map +0 -1
  459. package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js +0 -2
  460. package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js.map +0 -1
  461. package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js +0 -2
  462. package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js.map +0 -1
  463. package/dist/chunks/helperFunctions-utyx3wAA.esm.js +0 -80
  464. package/dist/chunks/helperFunctions-utyx3wAA.esm.js.map +0 -1
  465. package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js +0 -189
  466. package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js.map +0 -1
  467. package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js +0 -2
  468. package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js.map +0 -1
  469. package/dist/chunks/index-DnSap2FI.esm.js +0 -74799
  470. package/dist/chunks/index-DnSap2FI.esm.js.map +0 -1
  471. package/dist/chunks/index-j2tloO6T.esm.min.js +0 -57
  472. package/dist/chunks/index-j2tloO6T.esm.min.js.map +0 -1
  473. package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js +0 -814
  474. package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js.map +0 -1
  475. package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js +0 -2
  476. package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js.map +0 -1
  477. package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js +0 -2
  478. package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js.map +0 -1
  479. package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js +0 -2
  480. package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js.map +0 -1
  481. package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js +0 -11
  482. package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js.map +0 -1
  483. package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js +0 -35
  484. package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js.map +0 -1
  485. package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js +0 -81
  486. package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js.map +0 -1
  487. package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js +0 -2
  488. package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js.map +0 -1
  489. package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js +0 -2
  490. package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js.map +0 -1
  491. package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js +0 -77
  492. package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js.map +0 -1
  493. package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js +0 -2
  494. package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js.map +0 -1
  495. package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js +0 -11
  496. package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js.map +0 -1
  497. package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js +0 -2
  498. package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js.map +0 -1
  499. package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js +0 -11
  500. package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js.map +0 -1
  501. package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js +0 -2
  502. package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js.map +0 -1
  503. package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js +0 -26
  504. package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js.map +0 -1
  505. package/dist/chunks/objFileLoader-8afS-_hY.esm.js +0 -1338
  506. package/dist/chunks/objFileLoader-8afS-_hY.esm.js.map +0 -1
  507. package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js +0 -2
  508. package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js.map +0 -1
  509. package/dist/chunks/oitFragment-CHqqW65b.esm.js +0 -1240
  510. package/dist/chunks/oitFragment-CHqqW65b.esm.js.map +0 -1
  511. package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js +0 -2
  512. package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js.map +0 -1
  513. package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js +0 -2
  514. package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js.map +0 -1
  515. package/dist/chunks/oitFragment-alnyZbc9.esm.js +0 -1078
  516. package/dist/chunks/oitFragment-alnyZbc9.esm.js.map +0 -1
  517. package/dist/chunks/pass.fragment-CwG7GshA.esm.js +0 -15
  518. package/dist/chunks/pass.fragment-CwG7GshA.esm.js.map +0 -1
  519. package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js +0 -2
  520. package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js.map +0 -1
  521. package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js +0 -2
  522. package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js.map +0 -1
  523. package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js +0 -15
  524. package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js.map +0 -1
  525. package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js +0 -2
  526. package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js.map +0 -1
  527. package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js +0 -3232
  528. package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js.map +0 -1
  529. package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js +0 -2
  530. package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js.map +0 -1
  531. package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js +0 -3273
  532. package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js.map +0 -1
  533. package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js +0 -214
  534. package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js.map +0 -1
  535. package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js +0 -2
  536. package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js.map +0 -1
  537. package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js +0 -2
  538. package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js.map +0 -1
  539. package/dist/chunks/pbr.vertex-xNnroO_M.esm.js +0 -339
  540. package/dist/chunks/pbr.vertex-xNnroO_M.esm.js.map +0 -1
  541. package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js +0 -2
  542. package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js.map +0 -1
  543. package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js +0 -20
  544. package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js.map +0 -1
  545. package/dist/chunks/rawTexture-CBbxz3pc.esm.js +0 -191
  546. package/dist/chunks/rawTexture-CBbxz3pc.esm.js.map +0 -1
  547. package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js +0 -2
  548. package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js.map +0 -1
  549. package/dist/chunks/ray-C_Cg5Enj.esm.js +0 -946
  550. package/dist/chunks/ray-C_Cg5Enj.esm.js.map +0 -1
  551. package/dist/chunks/ray-VbeIB6un.esm.min.js +0 -2
  552. package/dist/chunks/ray-VbeIB6un.esm.min.js.map +0 -1
  553. package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js +0 -13
  554. package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js.map +0 -1
  555. package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js +0 -13
  556. package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js.map +0 -1
  557. package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js +0 -2
  558. package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js.map +0 -1
  559. package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js +0 -2
  560. package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js.map +0 -1
  561. package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js +0 -2
  562. package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js.map +0 -1
  563. package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js +0 -13
  564. package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js.map +0 -1
  565. package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js +0 -2
  566. package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js.map +0 -1
  567. package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js +0 -13
  568. package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js.map +0 -1
  569. package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js +0 -2
  570. package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js.map +0 -1
  571. package/dist/chunks/splatFileLoader-DE83jdwc.esm.js +0 -3379
  572. package/dist/chunks/splatFileLoader-DE83jdwc.esm.js.map +0 -1
  573. package/dist/chunks/spotLight-98FksSI3.esm.min.js +0 -2
  574. package/dist/chunks/spotLight-98FksSI3.esm.min.js.map +0 -1
  575. package/dist/chunks/spotLight-DuWkoiV8.esm.js +0 -701
  576. package/dist/chunks/spotLight-DuWkoiV8.esm.js.map +0 -1
  577. package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js +0 -1805
  578. package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js.map +0 -1
  579. package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js +0 -2
  580. package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js.map +0 -1
  581. package/dist/chunks/stlFileLoader-BFPumqQB.esm.js +0 -238
  582. package/dist/chunks/stlFileLoader-BFPumqQB.esm.js.map +0 -1
  583. package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js +0 -2
  584. package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js.map +0 -1
  585. package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js +0 -2
  586. package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js.map +0 -1
  587. package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js +0 -349
  588. package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js.map +0 -1
  589. package/dist/chunks/thinEngine-kKYV_9vd.esm.js +0 -3848
  590. package/dist/chunks/thinEngine-kKYV_9vd.esm.js.map +0 -1
  591. package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js +0 -2
  592. package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js.map +0 -1
  593. package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js +0 -314
  594. package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js.map +0 -1
  595. package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js +0 -2
  596. package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js.map +0 -1
  597. package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js +0 -2
  598. package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js.map +0 -1
  599. package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js +0 -412
  600. package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js.map +0 -1
  601. package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js +0 -2
  602. package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js.map +0 -1
  603. package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js +0 -522
  604. package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js.map +0 -1
  605. package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js +0 -2
  606. package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js.map +0 -1
  607. package/dist/chunks/webgpuEngine-Cwdi0UKo.esm.js +0 -11533
  608. package/dist/chunks/webgpuEngine-Cwdi0UKo.esm.js.map +0 -1
  609. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  610. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  611. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  612. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  613. package/lib/index.d.ts +0 -591
  614. package/lib/index.js +0 -2165
  615. package/lib/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSFT_audio_emitter-B7aM8Qaz.esm.min.js","sources":["../../../../../dev/core/dist/Animations/animationEvent.js","../../../../../dev/core/dist/Audio/sound.js","../../../../../dev/core/dist/Audio/weightedsound.js","../../../../../dev/core/dist/Audio/soundTrack.js","../../../../../dev/core/dist/Audio/audioSceneComponent.js","../../../../../dev/loaders/dist/glTF/2.0/Extensions/MSFT_audio_emitter.js"],"sourcesContent":["/**\n * Composed of a frame, and an action function\n */\nexport class AnimationEvent {\n /**\n * Initializes the animation event\n * @param frame The frame for which the event is triggered\n * @param action The event to perform when triggered\n * @param onlyOnce Specifies if the event should be triggered only once\n */\n constructor(\n /** The frame for which the event is triggered **/\n frame, \n /** The event to perform when triggered **/\n action, \n /** Specifies if the event should be triggered only once**/\n onlyOnce) {\n this.frame = frame;\n this.action = action;\n this.onlyOnce = onlyOnce;\n /**\n * Specifies if the animation event is done\n */\n this.isDone = false;\n }\n /** @internal */\n _clone() {\n return new AnimationEvent(this.frame, this.action, this.onlyOnce);\n }\n}\n//# sourceMappingURL=animationEvent.js.map","import { Tools } from \"../Misc/tools\";\nimport { Observable } from \"../Misc/observable\";\nimport { Vector3 } from \"../Maths/math.vector\";\nimport { Logger } from \"../Misc/logger\";\nimport { _WarnImport } from \"../Misc/devTools\";\nimport { EngineStore } from \"../Engines/engineStore\";\nimport { RegisterClass } from \"../Misc/typeStore\";\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\n/**\n * Defines a sound that can be played in the application.\n * The sound can either be an ambient track or a simple sound played in reaction to a user action.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic\n */\nexport class Sound {\n /**\n * Does the sound loop after it finishes playing once.\n */\n get loop() {\n return this._loop;\n }\n set loop(value) {\n if (value === this._loop) {\n return;\n }\n this._loop = value;\n this.updateOptions({ loop: value });\n }\n /**\n * Gets the current time for the sound.\n */\n get currentTime() {\n if (this._htmlAudioElement) {\n return this._htmlAudioElement.currentTime;\n }\n if (AbstractEngine.audioEngine?.audioContext && (this.isPlaying || this.isPaused)) {\n // The `_currentTime` member is only updated when the sound is paused. Add the time since the last start\n // to get the actual current time.\n const timeSinceLastStart = this.isPaused ? 0 : AbstractEngine.audioEngine.audioContext.currentTime - this._startTime;\n return this._currentTime + timeSinceLastStart;\n }\n return 0;\n }\n /**\n * Does this sound enables spatial sound.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n get spatialSound() {\n return this._spatialSound;\n }\n /**\n * Does this sound enables spatial sound.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n set spatialSound(newValue) {\n if (newValue == this._spatialSound) {\n return;\n }\n const wasPlaying = this.isPlaying;\n this.pause();\n if (newValue) {\n this._spatialSound = newValue;\n this._updateSpatialParameters();\n }\n else {\n this._disableSpatialSound();\n }\n if (wasPlaying) {\n this.play();\n }\n }\n /**\n * Create a sound and attach it to a scene\n * @param name Name of your sound\n * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer, it also works with MediaStreams and AudioBuffers\n * @param scene defines the scene the sound belongs to\n * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played\n * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming\n */\n constructor(name, urlOrArrayBuffer, scene, readyToPlayCallback = null, options) {\n /**\n * Does the sound autoplay once loaded.\n */\n this.autoplay = false;\n this._loop = false;\n /**\n * Does the sound use a custom attenuation curve to simulate the falloff\n * happening when the source gets further away from the camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-your-own-custom-attenuation-function\n */\n this.useCustomAttenuation = false;\n /**\n * Is this sound currently played.\n */\n this.isPlaying = false;\n /**\n * Is this sound currently paused.\n */\n this.isPaused = false;\n /**\n * Define the reference distance the sound should be heard perfectly.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n this.refDistance = 1;\n /**\n * Define the roll off factor of spatial sounds.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n this.rolloffFactor = 1;\n /**\n * Define the max distance the sound should be heard (intensity just became 0 at this point).\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n this.maxDistance = 100;\n /**\n * Define the distance attenuation model the sound will follow.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n this.distanceModel = \"linear\";\n /**\n * Gets or sets an object used to store user defined information for the sound.\n */\n this.metadata = null;\n /**\n * Observable event when the current playing sound finishes.\n */\n this.onEndedObservable = new Observable();\n this._spatialSound = false;\n this._panningModel = \"equalpower\";\n this._playbackRate = 1;\n this._streaming = false;\n this._startTime = 0;\n this._currentTime = 0;\n this._position = Vector3.Zero();\n this._localDirection = new Vector3(1, 0, 0);\n this._volume = 1;\n this._isReadyToPlay = false;\n this._isDirectional = false;\n // Used if you'd like to create a directional sound.\n // If not set, the sound will be omnidirectional\n this._coneInnerAngle = 360;\n this._coneOuterAngle = 360;\n this._coneOuterGain = 0;\n this._isOutputConnected = false;\n this._urlType = \"Unknown\";\n this.name = name;\n scene = scene || EngineStore.LastCreatedScene;\n if (!scene) {\n return;\n }\n this._scene = scene;\n Sound._SceneComponentInitialization(scene);\n this._readyToPlayCallback = readyToPlayCallback;\n // Default custom attenuation function is a linear attenuation\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n this._customAttenuationFunction = (currentVolume, currentDistance, maxDistance, refDistance, rolloffFactor) => {\n if (currentDistance < maxDistance) {\n return currentVolume * (1 - currentDistance / maxDistance);\n }\n else {\n return 0;\n }\n };\n if (options) {\n this.autoplay = options.autoplay || false;\n this._loop = options.loop || false;\n // if volume === 0, we need another way to check this option\n if (options.volume !== undefined) {\n this._volume = options.volume;\n }\n this._spatialSound = options.spatialSound ?? false;\n this.maxDistance = options.maxDistance ?? 100;\n this.useCustomAttenuation = options.useCustomAttenuation ?? false;\n this.rolloffFactor = options.rolloffFactor || 1;\n this.refDistance = options.refDistance || 1;\n this.distanceModel = options.distanceModel || \"linear\";\n this._playbackRate = options.playbackRate || 1;\n this._streaming = options.streaming ?? false;\n this._length = options.length;\n this._offset = options.offset;\n }\n if (AbstractEngine.audioEngine?.canUseWebAudio && AbstractEngine.audioEngine.audioContext) {\n this._soundGain = AbstractEngine.audioEngine.audioContext.createGain();\n this._soundGain.gain.value = this._volume;\n this._inputAudioNode = this._soundGain;\n this._outputAudioNode = this._soundGain;\n if (this._spatialSound) {\n this._createSpatialParameters();\n }\n this._scene.mainSoundTrack.addSound(this);\n let validParameter = true;\n // if no parameter is passed, you need to call setAudioBuffer yourself to prepare the sound\n if (urlOrArrayBuffer) {\n try {\n if (typeof urlOrArrayBuffer === \"string\") {\n this._urlType = \"String\";\n this._url = urlOrArrayBuffer;\n }\n else if (urlOrArrayBuffer instanceof ArrayBuffer) {\n this._urlType = \"ArrayBuffer\";\n }\n else if (urlOrArrayBuffer instanceof HTMLMediaElement) {\n this._urlType = \"MediaElement\";\n }\n else if (urlOrArrayBuffer instanceof MediaStream) {\n this._urlType = \"MediaStream\";\n }\n else if (urlOrArrayBuffer instanceof AudioBuffer) {\n this._urlType = \"AudioBuffer\";\n }\n else if (Array.isArray(urlOrArrayBuffer)) {\n this._urlType = \"Array\";\n }\n let urls = [];\n let codecSupportedFound = false;\n switch (this._urlType) {\n case \"MediaElement\":\n this._streaming = true;\n this._isReadyToPlay = true;\n this._streamingSource = AbstractEngine.audioEngine.audioContext.createMediaElementSource(urlOrArrayBuffer);\n if (this.autoplay) {\n this.play(0, this._offset, this._length);\n }\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n break;\n case \"MediaStream\":\n this._streaming = true;\n this._isReadyToPlay = true;\n this._streamingSource = AbstractEngine.audioEngine.audioContext.createMediaStreamSource(urlOrArrayBuffer);\n if (this.autoplay) {\n this.play(0, this._offset, this._length);\n }\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n break;\n case \"ArrayBuffer\":\n if (urlOrArrayBuffer.byteLength > 0) {\n codecSupportedFound = true;\n this._soundLoaded(urlOrArrayBuffer);\n }\n break;\n case \"AudioBuffer\":\n this._audioBufferLoaded(urlOrArrayBuffer);\n break;\n case \"String\":\n urls.push(urlOrArrayBuffer);\n // eslint-disable-next-line no-fallthrough\n case \"Array\":\n if (urls.length === 0) {\n urls = urlOrArrayBuffer;\n }\n // If we found a supported format, we load it immediately and stop the loop\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n codecSupportedFound =\n (options && options.skipCodecCheck) ||\n (url.indexOf(\".mp3\", url.length - 4) !== -1 && AbstractEngine.audioEngine.isMP3supported) ||\n (url.indexOf(\".ogg\", url.length - 4) !== -1 && AbstractEngine.audioEngine.isOGGsupported) ||\n url.indexOf(\".wav\", url.length - 4) !== -1 ||\n url.indexOf(\".m4a\", url.length - 4) !== -1 ||\n url.indexOf(\".mp4\", url.length - 4) !== -1 ||\n url.indexOf(\"blob:\") !== -1;\n if (codecSupportedFound) {\n // Loading sound\n if (!this._streaming) {\n this._scene._loadFile(url, (data) => {\n this._soundLoaded(data);\n }, undefined, true, true, (exception) => {\n if (exception) {\n Logger.Error(\"XHR \" + exception.status + \" error on: \" + url + \".\");\n }\n Logger.Error(\"Sound creation aborted.\");\n this._scene.mainSoundTrack.removeSound(this);\n });\n }\n // Streaming sound using HTML5 Audio tag\n else {\n this._htmlAudioElement = new Audio(url);\n this._htmlAudioElement.controls = false;\n this._htmlAudioElement.loop = this.loop;\n Tools.SetCorsBehavior(url, this._htmlAudioElement);\n this._htmlAudioElement.preload = \"auto\";\n this._htmlAudioElement.addEventListener(\"canplaythrough\", () => {\n this._isReadyToPlay = true;\n if (this.autoplay) {\n this.play(0, this._offset, this._length);\n }\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n }, { once: true });\n document.body.appendChild(this._htmlAudioElement);\n this._htmlAudioElement.load();\n }\n break;\n }\n }\n break;\n default:\n validParameter = false;\n break;\n }\n if (!validParameter) {\n Logger.Error(\"Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.\");\n }\n else {\n if (!codecSupportedFound) {\n this._isReadyToPlay = true;\n // Simulating a ready to play event to avoid breaking code path\n if (this._readyToPlayCallback) {\n setTimeout(() => {\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n }, 1000);\n }\n }\n }\n }\n catch (ex) {\n Logger.Error(\"Unexpected error. Sound creation aborted.\");\n this._scene.mainSoundTrack.removeSound(this);\n }\n }\n }\n else {\n // Adding an empty sound to avoid breaking audio calls for non Web Audio browsers\n this._scene.mainSoundTrack.addSound(this);\n if (AbstractEngine.audioEngine && !AbstractEngine.audioEngine.WarnedWebAudioUnsupported) {\n Logger.Error(\"Web Audio is not supported by your browser.\");\n AbstractEngine.audioEngine.WarnedWebAudioUnsupported = true;\n }\n // Simulating a ready to play event to avoid breaking code for non web audio browsers\n if (this._readyToPlayCallback) {\n setTimeout(() => {\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n }, 1000);\n }\n }\n }\n /**\n * Release the sound and its associated resources\n */\n dispose() {\n if (AbstractEngine.audioEngine?.canUseWebAudio) {\n if (this.isPlaying) {\n this.stop();\n }\n this._isReadyToPlay = false;\n if (this.soundTrackId === -1) {\n this._scene.mainSoundTrack.removeSound(this);\n }\n else if (this._scene.soundTracks) {\n this._scene.soundTracks[this.soundTrackId].removeSound(this);\n }\n if (this._soundGain) {\n this._soundGain.disconnect();\n this._soundGain = null;\n }\n if (this._soundPanner) {\n this._soundPanner.disconnect();\n this._soundPanner = null;\n }\n if (this._soundSource) {\n this._soundSource.disconnect();\n this._soundSource = null;\n }\n this._audioBuffer = null;\n if (this._htmlAudioElement) {\n this._htmlAudioElement.pause();\n this._htmlAudioElement.src = \"\";\n document.body.removeChild(this._htmlAudioElement);\n this._htmlAudioElement = null;\n }\n if (this._streamingSource) {\n this._streamingSource.disconnect();\n this._streamingSource = null;\n }\n if (this._connectedTransformNode && this._registerFunc) {\n this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);\n this._connectedTransformNode = null;\n }\n this._clearTimeoutsAndObservers();\n }\n }\n /**\n * Gets if the sounds is ready to be played or not.\n * @returns true if ready, otherwise false\n */\n isReady() {\n return this._isReadyToPlay;\n }\n /**\n * Get the current class name.\n * @returns current class name\n */\n getClassName() {\n return \"Sound\";\n }\n _audioBufferLoaded(buffer) {\n if (!AbstractEngine.audioEngine?.audioContext) {\n return;\n }\n this._audioBuffer = buffer;\n this._isReadyToPlay = true;\n if (this.autoplay) {\n this.play(0, this._offset, this._length);\n }\n if (this._readyToPlayCallback) {\n this._readyToPlayCallback();\n }\n }\n _soundLoaded(audioData) {\n if (!AbstractEngine.audioEngine?.audioContext) {\n return;\n }\n AbstractEngine.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {\n this._audioBufferLoaded(buffer);\n }, (err) => {\n Logger.Error(\"Error while decoding audio data for: \" + this.name + \" / Error: \" + err);\n });\n }\n /**\n * Sets the data of the sound from an audiobuffer\n * @param audioBuffer The audioBuffer containing the data\n */\n setAudioBuffer(audioBuffer) {\n if (AbstractEngine.audioEngine?.canUseWebAudio) {\n this._audioBuffer = audioBuffer;\n this._isReadyToPlay = true;\n }\n }\n /**\n * Updates the current sounds options such as maxdistance, loop...\n * @param options A JSON object containing values named as the object properties\n */\n updateOptions(options) {\n if (options) {\n this.loop = options.loop ?? this.loop;\n this.maxDistance = options.maxDistance ?? this.maxDistance;\n this.useCustomAttenuation = options.useCustomAttenuation ?? this.useCustomAttenuation;\n this.rolloffFactor = options.rolloffFactor ?? this.rolloffFactor;\n this.refDistance = options.refDistance ?? this.refDistance;\n this.distanceModel = options.distanceModel ?? this.distanceModel;\n this._playbackRate = options.playbackRate ?? this._playbackRate;\n this._length = options.length ?? undefined;\n this.spatialSound = options.spatialSound ?? this._spatialSound;\n this._setOffset(options.offset ?? undefined);\n this.setVolume(options.volume ?? this._volume);\n this._updateSpatialParameters();\n if (this.isPlaying) {\n if (this._streaming && this._htmlAudioElement) {\n this._htmlAudioElement.playbackRate = this._playbackRate;\n if (this._htmlAudioElement.loop !== this.loop) {\n this._htmlAudioElement.loop = this.loop;\n }\n }\n else {\n if (this._soundSource) {\n this._soundSource.playbackRate.value = this._playbackRate;\n if (this._soundSource.loop !== this.loop) {\n this._soundSource.loop = this.loop;\n }\n if (this._offset !== undefined && this._soundSource.loopStart !== this._offset) {\n this._soundSource.loopStart = this._offset;\n }\n if (this._length !== undefined && this._length !== this._soundSource.loopEnd) {\n this._soundSource.loopEnd = (this._offset | 0) + this._length;\n }\n }\n }\n }\n }\n }\n _createSpatialParameters() {\n if (AbstractEngine.audioEngine?.canUseWebAudio && AbstractEngine.audioEngine.audioContext) {\n if (this._scene.headphone) {\n this._panningModel = \"HRTF\";\n }\n this._soundPanner = this._soundPanner ?? AbstractEngine.audioEngine.audioContext.createPanner();\n if (this._soundPanner && this._outputAudioNode) {\n this._updateSpatialParameters();\n this._soundPanner.connect(this._outputAudioNode);\n this._inputAudioNode = this._soundPanner;\n }\n }\n }\n _disableSpatialSound() {\n if (!this._spatialSound) {\n return;\n }\n this._inputAudioNode = this._soundGain;\n this._soundPanner?.disconnect();\n this._soundPanner = null;\n this._spatialSound = false;\n }\n _updateSpatialParameters() {\n if (!this._spatialSound) {\n return;\n }\n if (this._soundPanner) {\n if (this.useCustomAttenuation) {\n // Tricks to disable in a way embedded Web Audio attenuation\n this._soundPanner.distanceModel = \"linear\";\n this._soundPanner.maxDistance = Number.MAX_VALUE;\n this._soundPanner.refDistance = 1;\n this._soundPanner.rolloffFactor = 1;\n this._soundPanner.panningModel = this._panningModel;\n }\n else {\n this._soundPanner.distanceModel = this.distanceModel;\n this._soundPanner.maxDistance = this.maxDistance;\n this._soundPanner.refDistance = this.refDistance;\n this._soundPanner.rolloffFactor = this.rolloffFactor;\n this._soundPanner.panningModel = this._panningModel;\n }\n }\n else {\n this._createSpatialParameters();\n }\n }\n /**\n * Switch the panning model to HRTF:\n * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n switchPanningModelToHRTF() {\n this._panningModel = \"HRTF\";\n this._switchPanningModel();\n }\n /**\n * Switch the panning model to Equal Power:\n * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n switchPanningModelToEqualPower() {\n this._panningModel = \"equalpower\";\n this._switchPanningModel();\n }\n _switchPanningModel() {\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {\n this._soundPanner.panningModel = this._panningModel;\n }\n }\n /**\n * Connect this sound to a sound track audio node like gain...\n * @param soundTrackAudioNode the sound track audio node to connect to\n */\n connectToSoundTrackAudioNode(soundTrackAudioNode) {\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._outputAudioNode) {\n if (this._isOutputConnected) {\n this._outputAudioNode.disconnect();\n }\n this._outputAudioNode.connect(soundTrackAudioNode);\n this._isOutputConnected = true;\n }\n }\n /**\n * Transform this sound into a directional source\n * @param coneInnerAngle Size of the inner cone in degree\n * @param coneOuterAngle Size of the outer cone in degree\n * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)\n */\n setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {\n if (coneOuterAngle < coneInnerAngle) {\n Logger.Error(\"setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.\");\n return;\n }\n this._coneInnerAngle = coneInnerAngle;\n this._coneOuterAngle = coneOuterAngle;\n this._coneOuterGain = coneOuterGain;\n this._isDirectional = true;\n if (this.isPlaying && this.loop) {\n this.stop();\n this.play(0, this._offset, this._length);\n }\n }\n /**\n * Gets or sets the inner angle for the directional cone.\n */\n get directionalConeInnerAngle() {\n return this._coneInnerAngle;\n }\n /**\n * Gets or sets the inner angle for the directional cone.\n */\n set directionalConeInnerAngle(value) {\n if (value != this._coneInnerAngle) {\n if (this._coneOuterAngle < value) {\n Logger.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n return;\n }\n this._coneInnerAngle = value;\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {\n this._soundPanner.coneInnerAngle = this._coneInnerAngle;\n }\n }\n }\n /**\n * Gets or sets the outer angle for the directional cone.\n */\n get directionalConeOuterAngle() {\n return this._coneOuterAngle;\n }\n /**\n * Gets or sets the outer angle for the directional cone.\n */\n set directionalConeOuterAngle(value) {\n if (value != this._coneOuterAngle) {\n if (value < this._coneInnerAngle) {\n Logger.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n return;\n }\n this._coneOuterAngle = value;\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {\n this._soundPanner.coneOuterAngle = this._coneOuterAngle;\n }\n }\n }\n /**\n * Sets the position of the emitter if spatial sound is enabled\n * @param newPosition Defines the new position\n */\n setPosition(newPosition) {\n if (newPosition.equals(this._position)) {\n return;\n }\n this._position.copyFrom(newPosition);\n if (AbstractEngine.audioEngine?.canUseWebAudio &&\n this._spatialSound &&\n this._soundPanner &&\n !isNaN(this._position.x) &&\n !isNaN(this._position.y) &&\n !isNaN(this._position.z)) {\n this._soundPanner.positionX.value = this._position.x;\n this._soundPanner.positionY.value = this._position.y;\n this._soundPanner.positionZ.value = this._position.z;\n }\n }\n /**\n * Sets the local direction of the emitter if spatial sound is enabled\n * @param newLocalDirection Defines the new local direction\n */\n setLocalDirectionToMesh(newLocalDirection) {\n this._localDirection = newLocalDirection;\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.isPlaying) {\n this._updateDirection();\n }\n }\n _updateDirection() {\n if (!this._connectedTransformNode || !this._soundPanner) {\n return;\n }\n const mat = this._connectedTransformNode.getWorldMatrix();\n const direction = Vector3.TransformNormal(this._localDirection, mat);\n direction.normalize();\n this._soundPanner.orientationX.value = direction.x;\n this._soundPanner.orientationY.value = direction.y;\n this._soundPanner.orientationZ.value = direction.z;\n }\n /** @internal */\n updateDistanceFromListener() {\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {\n const distance = this._scene.audioListenerPositionProvider\n ? this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length()\n : this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);\n this._soundGain.gain.value = this._customAttenuationFunction(this._volume, distance, this.maxDistance, this.refDistance, this.rolloffFactor);\n }\n }\n /**\n * Sets a new custom attenuation function for the sound.\n * @param callback Defines the function used for the attenuation\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-your-own-custom-attenuation-function\n */\n setAttenuationFunction(callback) {\n this._customAttenuationFunction = callback;\n }\n /**\n * Play the sound\n * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.\n * @param offset (optional) Start the sound at a specific time in seconds\n * @param length (optional) Sound duration (in seconds)\n */\n play(time, offset, length) {\n if (this._isReadyToPlay && this._scene.audioEnabled && AbstractEngine.audioEngine?.audioContext) {\n try {\n this._clearTimeoutsAndObservers();\n let startTime = time ? AbstractEngine.audioEngine?.audioContext.currentTime + time : AbstractEngine.audioEngine?.audioContext.currentTime;\n if (!this._soundSource || !this._streamingSource) {\n if (this._spatialSound && this._soundPanner) {\n if (!isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z)) {\n this._soundPanner.positionX.value = this._position.x;\n this._soundPanner.positionY.value = this._position.y;\n this._soundPanner.positionZ.value = this._position.z;\n }\n if (this._isDirectional) {\n this._soundPanner.coneInnerAngle = this._coneInnerAngle;\n this._soundPanner.coneOuterAngle = this._coneOuterAngle;\n this._soundPanner.coneOuterGain = this._coneOuterGain;\n if (this._connectedTransformNode) {\n this._updateDirection();\n }\n else {\n this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z);\n }\n }\n }\n }\n if (this._streaming) {\n if (!this._streamingSource && this._htmlAudioElement) {\n this._streamingSource = AbstractEngine.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement);\n this._htmlAudioElement.onended = () => {\n this._onended();\n };\n this._htmlAudioElement.playbackRate = this._playbackRate;\n }\n if (this._streamingSource) {\n this._streamingSource.disconnect();\n if (this._inputAudioNode) {\n this._streamingSource.connect(this._inputAudioNode);\n }\n }\n if (this._htmlAudioElement) {\n // required to manage properly the new suspended default state of Chrome\n // When the option 'streaming: true' is used, we need first to wait for\n // the audio engine to be unlocked by a user gesture before trying to play\n // an HTML Audio element\n const tryToPlay = () => {\n if (AbstractEngine.audioEngine?.unlocked) {\n if (!this._htmlAudioElement) {\n return;\n }\n this._htmlAudioElement.currentTime = offset ?? 0;\n const playPromise = this._htmlAudioElement.play();\n // In browsers that don’t yet support this functionality,\n // playPromise won’t be defined.\n if (playPromise !== undefined) {\n playPromise.catch(() => {\n // Automatic playback failed.\n // Waiting for the audio engine to be unlocked by user click on unmute\n AbstractEngine.audioEngine?.lock();\n if (this.loop || this.autoplay) {\n this._audioUnlockedObserver = AbstractEngine.audioEngine?.onAudioUnlockedObservable.addOnce(() => {\n tryToPlay();\n });\n }\n });\n }\n }\n else {\n if (this.loop || this.autoplay) {\n this._audioUnlockedObserver = AbstractEngine.audioEngine?.onAudioUnlockedObservable.addOnce(() => {\n tryToPlay();\n });\n }\n }\n };\n tryToPlay();\n }\n }\n else {\n const tryToPlay = () => {\n if (AbstractEngine.audioEngine?.audioContext) {\n length = length || this._length;\n if (offset !== undefined) {\n this._setOffset(offset);\n }\n if (this._soundSource) {\n const oldSource = this._soundSource;\n oldSource.onended = () => {\n oldSource.disconnect();\n };\n }\n this._soundSource = AbstractEngine.audioEngine?.audioContext.createBufferSource();\n if (this._soundSource && this._inputAudioNode) {\n this._soundSource.buffer = this._audioBuffer;\n this._soundSource.connect(this._inputAudioNode);\n this._soundSource.loop = this.loop;\n if (offset !== undefined) {\n this._soundSource.loopStart = offset;\n }\n if (length !== undefined) {\n this._soundSource.loopEnd = (offset | 0) + length;\n }\n this._soundSource.playbackRate.value = this._playbackRate;\n this._soundSource.onended = () => {\n this._onended();\n };\n startTime = time ? AbstractEngine.audioEngine?.audioContext.currentTime + time : AbstractEngine.audioEngine.audioContext.currentTime;\n const actualOffset = ((this.isPaused ? this.currentTime : 0) + (this._offset ?? 0)) % this._soundSource.buffer.duration;\n this._soundSource.start(startTime, actualOffset, this.loop ? undefined : length);\n }\n }\n };\n if (AbstractEngine.audioEngine?.audioContext.state === \"suspended\") {\n // Wait a bit for FF as context seems late to be ready.\n this._tryToPlayTimeout = setTimeout(() => {\n if (AbstractEngine.audioEngine?.audioContext.state === \"suspended\") {\n // Automatic playback failed.\n // Waiting for the audio engine to be unlocked by user click on unmute\n AbstractEngine.audioEngine.lock();\n if (this.loop || this.autoplay) {\n this._audioUnlockedObserver = AbstractEngine.audioEngine.onAudioUnlockedObservable.addOnce(() => {\n tryToPlay();\n });\n }\n }\n else {\n tryToPlay();\n }\n }, 500);\n }\n else {\n tryToPlay();\n }\n }\n this._startTime = startTime;\n this.isPlaying = true;\n this.isPaused = false;\n }\n catch (ex) {\n Logger.Error(\"Error while trying to play audio: \" + this.name + \", \" + ex.message);\n }\n }\n }\n _onended() {\n this.isPlaying = false;\n this._startTime = 0;\n this._currentTime = 0;\n if (this.onended) {\n this.onended();\n }\n this.onEndedObservable.notifyObservers(this);\n }\n /**\n * Stop the sound\n * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.\n */\n stop(time) {\n if (this.isPlaying) {\n this._clearTimeoutsAndObservers();\n if (this._streaming) {\n if (this._htmlAudioElement) {\n this._htmlAudioElement.pause();\n // Test needed for Firefox or it will generate an Invalid State Error\n if (this._htmlAudioElement.currentTime > 0) {\n this._htmlAudioElement.currentTime = 0;\n }\n }\n else {\n this._streamingSource?.disconnect();\n }\n this.isPlaying = false;\n }\n else if (AbstractEngine.audioEngine?.audioContext && this._soundSource) {\n const stopTime = time ? AbstractEngine.audioEngine.audioContext.currentTime + time : undefined;\n this._soundSource.onended = () => {\n this.isPlaying = false;\n this.isPaused = false;\n this._startTime = 0;\n this._currentTime = 0;\n if (this._soundSource) {\n this._soundSource.onended = () => void 0;\n }\n this._onended();\n };\n this._soundSource.stop(stopTime);\n }\n else {\n this.isPlaying = false;\n }\n }\n else if (this.isPaused) {\n this.isPaused = false;\n this._startTime = 0;\n this._currentTime = 0;\n }\n }\n /**\n * Put the sound in pause\n */\n pause() {\n if (this.isPlaying) {\n this._clearTimeoutsAndObservers();\n if (this._streaming) {\n if (this._htmlAudioElement) {\n this._htmlAudioElement.pause();\n }\n else {\n this._streamingSource?.disconnect();\n }\n this.isPlaying = false;\n this.isPaused = true;\n }\n else if (AbstractEngine.audioEngine?.audioContext && this._soundSource) {\n this._soundSource.onended = () => void 0;\n this._soundSource.stop();\n this.isPlaying = false;\n this.isPaused = true;\n this._currentTime += AbstractEngine.audioEngine.audioContext.currentTime - this._startTime;\n }\n }\n }\n /**\n * Sets a dedicated volume for this sounds\n * @param newVolume Define the new volume of the sound\n * @param time Define time for gradual change to new volume\n */\n setVolume(newVolume, time) {\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._soundGain) {\n if (time && AbstractEngine.audioEngine.audioContext) {\n this._soundGain.gain.cancelScheduledValues(AbstractEngine.audioEngine.audioContext.currentTime);\n this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, AbstractEngine.audioEngine.audioContext.currentTime);\n this._soundGain.gain.linearRampToValueAtTime(newVolume, AbstractEngine.audioEngine.audioContext.currentTime + time);\n }\n else {\n this._soundGain.gain.value = newVolume;\n }\n }\n this._volume = newVolume;\n }\n /**\n * Set the sound play back rate\n * @param newPlaybackRate Define the playback rate the sound should be played at\n */\n setPlaybackRate(newPlaybackRate) {\n this._playbackRate = newPlaybackRate;\n if (this.isPlaying) {\n if (this._streaming && this._htmlAudioElement) {\n this._htmlAudioElement.playbackRate = this._playbackRate;\n }\n else if (this._soundSource) {\n this._soundSource.playbackRate.value = this._playbackRate;\n }\n }\n }\n /**\n * Gets the sound play back rate.\n * @returns the play back rate of the sound\n */\n getPlaybackRate() {\n return this._playbackRate;\n }\n /**\n * Gets the volume of the sound.\n * @returns the volume of the sound\n */\n getVolume() {\n return this._volume;\n }\n /**\n * Attach the sound to a dedicated mesh\n * @param transformNode The transform node to connect the sound with\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh\n */\n attachToMesh(transformNode) {\n if (this._connectedTransformNode && this._registerFunc) {\n this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);\n this._registerFunc = null;\n }\n this._connectedTransformNode = transformNode;\n if (!this._spatialSound) {\n this._spatialSound = true;\n this._createSpatialParameters();\n if (this.isPlaying && this.loop) {\n this.stop();\n this.play(0, this._offset, this._length);\n }\n }\n this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode);\n this._registerFunc = (transformNode) => this._onRegisterAfterWorldMatrixUpdate(transformNode);\n this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);\n }\n /**\n * Detach the sound from the previously attached mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh\n */\n detachFromMesh() {\n if (this._connectedTransformNode && this._registerFunc) {\n this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);\n this._registerFunc = null;\n this._connectedTransformNode = null;\n }\n }\n _onRegisterAfterWorldMatrixUpdate(node) {\n if (!node.getBoundingInfo) {\n this.setPosition(node.absolutePosition);\n }\n else {\n const mesh = node;\n const boundingInfo = mesh.getBoundingInfo();\n this.setPosition(boundingInfo.boundingSphere.centerWorld);\n }\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._isDirectional && this.isPlaying) {\n this._updateDirection();\n }\n }\n /**\n * Clone the current sound in the scene.\n * @returns the new sound clone\n */\n clone() {\n if (!this._streaming) {\n const setBufferAndRun = () => {\n if (this._isReadyToPlay) {\n clonedSound._audioBuffer = this.getAudioBuffer();\n clonedSound._isReadyToPlay = true;\n if (clonedSound.autoplay) {\n clonedSound.play(0, this._offset, this._length);\n }\n }\n else {\n setTimeout(setBufferAndRun, 300);\n }\n };\n const currentOptions = {\n autoplay: this.autoplay,\n loop: this.loop,\n volume: this._volume,\n spatialSound: this._spatialSound,\n maxDistance: this.maxDistance,\n useCustomAttenuation: this.useCustomAttenuation,\n rolloffFactor: this.rolloffFactor,\n refDistance: this.refDistance,\n distanceModel: this.distanceModel,\n };\n const clonedSound = new Sound(this.name + \"_cloned\", new ArrayBuffer(0), this._scene, null, currentOptions);\n if (this.useCustomAttenuation) {\n clonedSound.setAttenuationFunction(this._customAttenuationFunction);\n }\n clonedSound.setPosition(this._position);\n clonedSound.setPlaybackRate(this._playbackRate);\n setBufferAndRun();\n return clonedSound;\n }\n // Can't clone a streaming sound\n else {\n return null;\n }\n }\n /**\n * Gets the current underlying audio buffer containing the data\n * @returns the audio buffer\n */\n getAudioBuffer() {\n return this._audioBuffer;\n }\n /**\n * Gets the WebAudio AudioBufferSourceNode, lets you keep track of and stop instances of this Sound.\n * @returns the source node\n */\n getSoundSource() {\n return this._soundSource;\n }\n /**\n * Gets the WebAudio GainNode, gives you precise control over the gain of instances of this Sound.\n * @returns the gain node\n */\n getSoundGain() {\n return this._soundGain;\n }\n /**\n * Serializes the Sound in a JSON representation\n * @returns the JSON representation of the sound\n */\n serialize() {\n const serializationObject = {\n name: this.name,\n url: this._url,\n autoplay: this.autoplay,\n loop: this.loop,\n volume: this._volume,\n spatialSound: this._spatialSound,\n maxDistance: this.maxDistance,\n rolloffFactor: this.rolloffFactor,\n refDistance: this.refDistance,\n distanceModel: this.distanceModel,\n playbackRate: this._playbackRate,\n panningModel: this._panningModel,\n soundTrackId: this.soundTrackId,\n metadata: this.metadata,\n };\n if (this._spatialSound) {\n if (this._connectedTransformNode) {\n serializationObject.connectedMeshId = this._connectedTransformNode.id;\n }\n serializationObject.position = this._position.asArray();\n serializationObject.refDistance = this.refDistance;\n serializationObject.distanceModel = this.distanceModel;\n serializationObject.isDirectional = this._isDirectional;\n serializationObject.localDirectionToMesh = this._localDirection.asArray();\n serializationObject.coneInnerAngle = this._coneInnerAngle;\n serializationObject.coneOuterAngle = this._coneOuterAngle;\n serializationObject.coneOuterGain = this._coneOuterGain;\n }\n return serializationObject;\n }\n /**\n * Parse a JSON representation of a sound to instantiate in a given scene\n * @param parsedSound Define the JSON representation of the sound (usually coming from the serialize method)\n * @param scene Define the scene the new parsed sound should be created in\n * @param rootUrl Define the rooturl of the load in case we need to fetch relative dependencies\n * @param sourceSound Define a sound place holder if do not need to instantiate a new one\n * @returns the newly parsed sound\n */\n static Parse(parsedSound, scene, rootUrl, sourceSound) {\n const soundName = parsedSound.name;\n let soundUrl;\n if (parsedSound.url) {\n soundUrl = rootUrl + parsedSound.url;\n }\n else {\n soundUrl = rootUrl + soundName;\n }\n const options = {\n autoplay: parsedSound.autoplay,\n loop: parsedSound.loop,\n volume: parsedSound.volume,\n spatialSound: parsedSound.spatialSound,\n maxDistance: parsedSound.maxDistance,\n rolloffFactor: parsedSound.rolloffFactor,\n refDistance: parsedSound.refDistance,\n distanceModel: parsedSound.distanceModel,\n playbackRate: parsedSound.playbackRate,\n };\n let newSound;\n if (!sourceSound) {\n newSound = new Sound(soundName, soundUrl, scene, () => {\n scene.removePendingData(newSound);\n }, options);\n scene.addPendingData(newSound);\n }\n else {\n const setBufferAndRun = () => {\n if (sourceSound._isReadyToPlay) {\n newSound._audioBuffer = sourceSound.getAudioBuffer();\n newSound._isReadyToPlay = true;\n if (newSound.autoplay) {\n newSound.play(0, newSound._offset, newSound._length);\n }\n }\n else {\n setTimeout(setBufferAndRun, 300);\n }\n };\n newSound = new Sound(soundName, new ArrayBuffer(0), scene, null, options);\n setBufferAndRun();\n }\n if (parsedSound.position) {\n const soundPosition = Vector3.FromArray(parsedSound.position);\n newSound.setPosition(soundPosition);\n }\n if (parsedSound.isDirectional) {\n newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);\n if (parsedSound.localDirectionToMesh) {\n const localDirectionToMesh = Vector3.FromArray(parsedSound.localDirectionToMesh);\n newSound.setLocalDirectionToMesh(localDirectionToMesh);\n }\n }\n if (parsedSound.connectedMeshId) {\n const connectedMesh = scene.getMeshById(parsedSound.connectedMeshId);\n if (connectedMesh) {\n newSound.attachToMesh(connectedMesh);\n }\n }\n if (parsedSound.metadata) {\n newSound.metadata = parsedSound.metadata;\n }\n return newSound;\n }\n _setOffset(value) {\n if (this._offset === value) {\n return;\n }\n if (this.isPaused) {\n this.stop();\n this.isPaused = false;\n }\n this._offset = value;\n }\n _clearTimeoutsAndObservers() {\n if (this._tryToPlayTimeout) {\n clearTimeout(this._tryToPlayTimeout);\n this._tryToPlayTimeout = null;\n }\n if (this._audioUnlockedObserver) {\n AbstractEngine.audioEngine?.onAudioUnlockedObservable.remove(this._audioUnlockedObserver);\n this._audioUnlockedObserver = null;\n }\n }\n}\n/**\n * @internal\n */\nSound._SceneComponentInitialization = (_) => {\n throw _WarnImport(\"AudioSceneComponent\");\n};\n// Register Class Name\nRegisterClass(\"BABYLON.Sound\", Sound);\n//# sourceMappingURL=sound.js.map","import { Logger } from \"../Misc/logger\";\n/**\n * Wraps one or more Sound objects and selects one with random weight for playback.\n */\nexport class WeightedSound {\n /**\n * Creates a new WeightedSound from the list of sounds given.\n * @param loop When true a Sound will be selected and played when the current playing Sound completes.\n * @param sounds Array of Sounds that will be selected from.\n * @param weights Array of number values for selection weights; length must equal sounds, values will be normalized to 1\n */\n constructor(loop, sounds, weights) {\n /** When true a Sound will be selected and played when the current playing Sound completes. */\n this.loop = false;\n this._coneInnerAngle = 360;\n this._coneOuterAngle = 360;\n this._volume = 1;\n /** A Sound is currently playing. */\n this.isPlaying = false;\n /** A Sound is currently paused. */\n this.isPaused = false;\n this._sounds = [];\n this._weights = [];\n if (sounds.length !== weights.length) {\n throw new Error(\"Sounds length does not equal weights length\");\n }\n this.loop = loop;\n this._weights = weights;\n // Normalize the weights\n let weightSum = 0;\n for (const weight of weights) {\n weightSum += weight;\n }\n const invWeightSum = weightSum > 0 ? 1 / weightSum : 0;\n for (let i = 0; i < this._weights.length; i++) {\n this._weights[i] *= invWeightSum;\n }\n this._sounds = sounds;\n for (const sound of this._sounds) {\n sound.onEndedObservable.add(() => {\n this._onended();\n });\n }\n }\n /**\n * The size of cone in degrees for a directional sound in which there will be no attenuation.\n */\n get directionalConeInnerAngle() {\n return this._coneInnerAngle;\n }\n /**\n * The size of cone in degrees for a directional sound in which there will be no attenuation.\n */\n set directionalConeInnerAngle(value) {\n if (value !== this._coneInnerAngle) {\n if (this._coneOuterAngle < value) {\n Logger.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n return;\n }\n this._coneInnerAngle = value;\n for (const sound of this._sounds) {\n sound.directionalConeInnerAngle = value;\n }\n }\n }\n /**\n * Size of cone in degrees for a directional sound outside of which there will be no sound.\n * Listener angles between innerAngle and outerAngle will falloff linearly.\n */\n get directionalConeOuterAngle() {\n return this._coneOuterAngle;\n }\n /**\n * Size of cone in degrees for a directional sound outside of which there will be no sound.\n * Listener angles between innerAngle and outerAngle will falloff linearly.\n */\n set directionalConeOuterAngle(value) {\n if (value !== this._coneOuterAngle) {\n if (value < this._coneInnerAngle) {\n Logger.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n return;\n }\n this._coneOuterAngle = value;\n for (const sound of this._sounds) {\n sound.directionalConeOuterAngle = value;\n }\n }\n }\n /**\n * Playback volume.\n */\n get volume() {\n return this._volume;\n }\n /**\n * Playback volume.\n */\n set volume(value) {\n if (value !== this._volume) {\n for (const sound of this._sounds) {\n sound.setVolume(value);\n }\n }\n }\n _onended() {\n if (this._currentIndex !== undefined) {\n this._sounds[this._currentIndex].autoplay = false;\n }\n if (this.loop && this.isPlaying) {\n this.play();\n }\n else {\n this.isPlaying = false;\n }\n }\n /**\n * Suspend playback\n */\n pause() {\n if (this.isPlaying) {\n this.isPaused = true;\n if (this._currentIndex !== undefined) {\n this._sounds[this._currentIndex].pause();\n }\n }\n }\n /**\n * Stop playback\n */\n stop() {\n this.isPlaying = false;\n if (this._currentIndex !== undefined) {\n this._sounds[this._currentIndex].stop();\n }\n }\n /**\n * Start playback.\n * @param startOffset Position the clip head at a specific time in seconds.\n */\n play(startOffset) {\n if (!this.isPaused) {\n this.stop();\n const randomValue = Math.random();\n let total = 0;\n for (let i = 0; i < this._weights.length; i++) {\n total += this._weights[i];\n if (randomValue <= total) {\n this._currentIndex = i;\n break;\n }\n }\n }\n const sound = this._sounds[this._currentIndex ?? 0];\n if (sound.isReady()) {\n sound.play(0, this.isPaused ? undefined : startOffset);\n }\n else {\n sound.autoplay = true;\n }\n this.isPlaying = true;\n this.isPaused = false;\n }\n}\n//# sourceMappingURL=weightedsound.js.map","import { EngineStore } from \"../Engines/engineStore\";\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\n/**\n * It could be useful to isolate your music & sounds on several tracks to better manage volume on a grouped instance of sounds.\n * It will be also used in a future release to apply effects on a specific track.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks\n */\nexport class SoundTrack {\n /**\n * Creates a new sound track.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks\n * @param scene Define the scene the sound track belongs to\n * @param options\n */\n constructor(scene, options = {}) {\n /**\n * The unique identifier of the sound track in the scene.\n */\n this.id = -1;\n this._isInitialized = false;\n scene = scene || EngineStore.LastCreatedScene;\n if (!scene) {\n return;\n }\n this._scene = scene;\n this.soundCollection = [];\n this._options = options;\n if (!this._options.mainTrack && this._scene.soundTracks) {\n this._scene.soundTracks.push(this);\n this.id = this._scene.soundTracks.length - 1;\n }\n }\n _initializeSoundTrackAudioGraph() {\n if (AbstractEngine.audioEngine?.canUseWebAudio && AbstractEngine.audioEngine.audioContext) {\n this._outputAudioNode = AbstractEngine.audioEngine.audioContext.createGain();\n this._outputAudioNode.connect(AbstractEngine.audioEngine.masterGain);\n if (this._options) {\n if (this._options.volume) {\n this._outputAudioNode.gain.value = this._options.volume;\n }\n }\n this._isInitialized = true;\n }\n }\n /**\n * Release the sound track and its associated resources\n */\n dispose() {\n if (AbstractEngine.audioEngine && AbstractEngine.audioEngine.canUseWebAudio) {\n if (this._connectedAnalyser) {\n this._connectedAnalyser.stopDebugCanvas();\n }\n while (this.soundCollection.length) {\n this.soundCollection[0].dispose();\n }\n if (this._outputAudioNode) {\n this._outputAudioNode.disconnect();\n }\n this._outputAudioNode = null;\n }\n }\n /**\n * Adds a sound to this sound track\n * @param sound define the sound to add\n * @ignoreNaming\n */\n addSound(sound) {\n if (!this._isInitialized) {\n this._initializeSoundTrackAudioGraph();\n }\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._outputAudioNode) {\n sound.connectToSoundTrackAudioNode(this._outputAudioNode);\n }\n if (sound.soundTrackId !== undefined) {\n if (sound.soundTrackId === -1) {\n this._scene.mainSoundTrack.removeSound(sound);\n }\n else if (this._scene.soundTracks) {\n this._scene.soundTracks[sound.soundTrackId].removeSound(sound);\n }\n }\n this.soundCollection.push(sound);\n sound.soundTrackId = this.id;\n }\n /**\n * Removes a sound to this sound track\n * @param sound define the sound to remove\n * @ignoreNaming\n */\n removeSound(sound) {\n const index = this.soundCollection.indexOf(sound);\n if (index !== -1) {\n this.soundCollection.splice(index, 1);\n }\n }\n /**\n * Set a global volume for the full sound track.\n * @param newVolume Define the new volume of the sound track\n */\n setVolume(newVolume) {\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._outputAudioNode) {\n this._outputAudioNode.gain.value = newVolume;\n }\n }\n /**\n * Switch the panning model to HRTF:\n * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n switchPanningModelToHRTF() {\n if (AbstractEngine.audioEngine?.canUseWebAudio) {\n for (let i = 0; i < this.soundCollection.length; i++) {\n this.soundCollection[i].switchPanningModelToHRTF();\n }\n }\n }\n /**\n * Switch the panning model to Equal Power:\n * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound\n */\n switchPanningModelToEqualPower() {\n if (AbstractEngine.audioEngine?.canUseWebAudio) {\n for (let i = 0; i < this.soundCollection.length; i++) {\n this.soundCollection[i].switchPanningModelToEqualPower();\n }\n }\n }\n /**\n * Connect the sound track to an audio analyser allowing some amazing\n * synchronization between the sounds/music and your visualization (VuMeter for instance).\n * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-the-analyser\n * @param analyser The analyser to connect to the engine\n */\n connectToAnalyser(analyser) {\n if (this._connectedAnalyser) {\n this._connectedAnalyser.stopDebugCanvas();\n }\n this._connectedAnalyser = analyser;\n if (AbstractEngine.audioEngine?.canUseWebAudio && this._outputAudioNode) {\n this._outputAudioNode.disconnect();\n this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, AbstractEngine.audioEngine.masterGain);\n }\n }\n}\n//# sourceMappingURL=soundTrack.js.map","import { Sound } from \"./sound\";\nimport { SoundTrack } from \"./soundTrack\";\nimport { Matrix, Vector3 } from \"../Maths/math.vector\";\nimport { SceneComponentConstants } from \"../sceneComponent\";\nimport { Scene } from \"../scene\";\nimport \"./audioEngine\";\nimport { PrecisionDate } from \"../Misc/precisionDate\";\nimport { EngineStore } from \"../Engines/engineStore\";\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\nimport { AddParser } from \"core/Loading/Plugins/babylonFileParser.function\";\n// Adds the parser to the scene parsers.\nAddParser(SceneComponentConstants.NAME_AUDIO, (parsedData, scene, container, rootUrl) => {\n // TODO: add sound\n let loadedSounds = [];\n let loadedSound;\n container.sounds = container.sounds || [];\n if (parsedData.sounds !== undefined && parsedData.sounds !== null) {\n for (let index = 0, cache = parsedData.sounds.length; index < cache; index++) {\n const parsedSound = parsedData.sounds[index];\n if (AbstractEngine.audioEngine?.canUseWebAudio) {\n if (!parsedSound.url) {\n parsedSound.url = parsedSound.name;\n }\n if (!loadedSounds[parsedSound.url]) {\n loadedSound = Sound.Parse(parsedSound, scene, rootUrl);\n loadedSounds[parsedSound.url] = loadedSound;\n container.sounds.push(loadedSound);\n }\n else {\n container.sounds.push(Sound.Parse(parsedSound, scene, rootUrl, loadedSounds[parsedSound.url]));\n }\n }\n else {\n container.sounds.push(new Sound(parsedSound.name, null, scene));\n }\n }\n }\n loadedSounds = [];\n});\nObject.defineProperty(Scene.prototype, \"mainSoundTrack\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n if (!this._mainSoundTrack) {\n this._mainSoundTrack = new SoundTrack(this, { mainTrack: true });\n }\n return this._mainSoundTrack;\n },\n enumerable: true,\n configurable: true,\n});\nScene.prototype.getSoundByName = function (name) {\n let index;\n for (index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {\n if (this.mainSoundTrack.soundCollection[index].name === name) {\n return this.mainSoundTrack.soundCollection[index];\n }\n }\n if (this.soundTracks) {\n for (let sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {\n for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {\n if (this.soundTracks[sdIndex].soundCollection[index].name === name) {\n return this.soundTracks[sdIndex].soundCollection[index];\n }\n }\n }\n }\n return null;\n};\nObject.defineProperty(Scene.prototype, \"audioEnabled\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n return compo.audioEnabled;\n },\n set: function (value) {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n if (value) {\n compo.enableAudio();\n }\n else {\n compo.disableAudio();\n }\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(Scene.prototype, \"headphone\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n return compo.headphone;\n },\n set: function (value) {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n if (value) {\n compo.switchAudioModeForHeadphones();\n }\n else {\n compo.switchAudioModeForNormalSpeakers();\n }\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(Scene.prototype, \"audioListenerPositionProvider\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n return compo.audioListenerPositionProvider;\n },\n set: function (value) {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n if (value && typeof value !== \"function\") {\n throw new Error(\"The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3\");\n }\n else {\n compo.audioListenerPositionProvider = value;\n }\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(Scene.prototype, \"audioListenerRotationProvider\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n return compo.audioListenerRotationProvider;\n },\n set: function (value) {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n if (value && typeof value !== \"function\") {\n throw new Error(\"The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3\");\n }\n else {\n compo.audioListenerRotationProvider = value;\n }\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(Scene.prototype, \"audioPositioningRefreshRate\", {\n get: function () {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n return compo.audioPositioningRefreshRate;\n },\n set: function (value) {\n let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(this);\n this._addComponent(compo);\n }\n compo.audioPositioningRefreshRate = value;\n },\n enumerable: true,\n configurable: true,\n});\n/**\n * Defines the sound scene component responsible to manage any sounds\n * in a given scene.\n */\nexport class AudioSceneComponent {\n /**\n * Gets whether audio is enabled or not.\n * Please use related enable/disable method to switch state.\n */\n get audioEnabled() {\n return this._audioEnabled;\n }\n /**\n * Gets whether audio is outputting to headphone or not.\n * Please use the according Switch methods to change output.\n */\n get headphone() {\n return this._headphone;\n }\n /**\n * Creates a new instance of the component for the given scene\n * @param scene Defines the scene to register the component in\n */\n constructor(scene) {\n /**\n * The component name helpful to identify the component in the list of scene components.\n */\n this.name = SceneComponentConstants.NAME_AUDIO;\n this._audioEnabled = true;\n this._headphone = false;\n /**\n * Gets or sets a refresh rate when using 3D audio positioning\n */\n this.audioPositioningRefreshRate = 500;\n /**\n * Gets or Sets a custom listener position for all sounds in the scene\n * By default, this is the position of the first active camera\n */\n this.audioListenerPositionProvider = null;\n /**\n * Gets or Sets a custom listener rotation for all sounds in the scene\n * By default, this is the rotation of the first active camera\n */\n this.audioListenerRotationProvider = null;\n this._cachedCameraDirection = new Vector3();\n this._cachedCameraPosition = new Vector3();\n this._lastCheck = 0;\n this._invertMatrixTemp = new Matrix();\n this._cameraDirectionTemp = new Vector3();\n scene = scene || EngineStore.LastCreatedScene;\n if (!scene) {\n return;\n }\n this.scene = scene;\n scene.soundTracks = [];\n scene.sounds = [];\n }\n /**\n * Registers the component in a given scene\n */\n register() {\n this.scene._afterRenderStage.registerStep(SceneComponentConstants.STEP_AFTERRENDER_AUDIO, this, this._afterRender);\n }\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() {\n // Nothing to do here. (Not rendering related)\n }\n /**\n * Serializes the component data to the specified json object\n * @param serializationObject The object to serialize to\n */\n serialize(serializationObject) {\n serializationObject.sounds = [];\n if (this.scene.soundTracks) {\n for (let index = 0; index < this.scene.soundTracks.length; index++) {\n const soundtrack = this.scene.soundTracks[index];\n for (let soundId = 0; soundId < soundtrack.soundCollection.length; soundId++) {\n serializationObject.sounds.push(soundtrack.soundCollection[soundId].serialize());\n }\n }\n }\n }\n /**\n * Adds all the elements from the container to the scene\n * @param container the container holding the elements\n */\n addFromContainer(container) {\n if (!container.sounds) {\n return;\n }\n container.sounds.forEach((sound) => {\n sound.play();\n sound.autoplay = true;\n this.scene.mainSoundTrack.addSound(sound);\n });\n }\n /**\n * Removes all the elements in the container from the scene\n * @param container contains the elements to remove\n * @param dispose if the removed element should be disposed (default: false)\n */\n removeFromContainer(container, dispose = false) {\n if (!container.sounds) {\n return;\n }\n container.sounds.forEach((sound) => {\n sound.stop();\n sound.autoplay = false;\n this.scene.mainSoundTrack.removeSound(sound);\n if (dispose) {\n sound.dispose();\n }\n });\n }\n /**\n * Disposes the component and the associated resources.\n */\n dispose() {\n const scene = this.scene;\n if (scene._mainSoundTrack) {\n scene.mainSoundTrack.dispose();\n }\n if (scene.soundTracks) {\n for (let scIndex = 0; scIndex < scene.soundTracks.length; scIndex++) {\n scene.soundTracks[scIndex].dispose();\n }\n }\n }\n /**\n * Disables audio in the associated scene.\n */\n disableAudio() {\n const scene = this.scene;\n this._audioEnabled = false;\n if (AbstractEngine.audioEngine && AbstractEngine.audioEngine.audioContext) {\n AbstractEngine.audioEngine.audioContext.suspend();\n }\n let i;\n for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {\n scene.mainSoundTrack.soundCollection[i].pause();\n }\n if (scene.soundTracks) {\n for (i = 0; i < scene.soundTracks.length; i++) {\n for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {\n scene.soundTracks[i].soundCollection[j].pause();\n }\n }\n }\n }\n /**\n * Enables audio in the associated scene.\n */\n enableAudio() {\n const scene = this.scene;\n this._audioEnabled = true;\n if (AbstractEngine.audioEngine && AbstractEngine.audioEngine.audioContext) {\n AbstractEngine.audioEngine.audioContext.resume();\n }\n let i;\n for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {\n if (scene.mainSoundTrack.soundCollection[i].isPaused) {\n scene.mainSoundTrack.soundCollection[i].play();\n }\n }\n if (scene.soundTracks) {\n for (i = 0; i < scene.soundTracks.length; i++) {\n for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {\n if (scene.soundTracks[i].soundCollection[j].isPaused) {\n scene.soundTracks[i].soundCollection[j].play();\n }\n }\n }\n }\n }\n /**\n * Switch audio to headphone output.\n */\n switchAudioModeForHeadphones() {\n const scene = this.scene;\n this._headphone = true;\n scene.mainSoundTrack.switchPanningModelToHRTF();\n if (scene.soundTracks) {\n for (let i = 0; i < scene.soundTracks.length; i++) {\n scene.soundTracks[i].switchPanningModelToHRTF();\n }\n }\n }\n /**\n * Switch audio to normal speakers.\n */\n switchAudioModeForNormalSpeakers() {\n const scene = this.scene;\n this._headphone = false;\n scene.mainSoundTrack.switchPanningModelToEqualPower();\n if (scene.soundTracks) {\n for (let i = 0; i < scene.soundTracks.length; i++) {\n scene.soundTracks[i].switchPanningModelToEqualPower();\n }\n }\n }\n _afterRender() {\n const now = PrecisionDate.Now;\n if (this._lastCheck && now - this._lastCheck < this.audioPositioningRefreshRate) {\n return;\n }\n this._lastCheck = now;\n const scene = this.scene;\n if (!this._audioEnabled || !scene._mainSoundTrack || !scene.soundTracks || (scene._mainSoundTrack.soundCollection.length === 0 && scene.soundTracks.length === 1)) {\n return;\n }\n const audioEngine = AbstractEngine.audioEngine;\n if (!audioEngine) {\n return;\n }\n if (audioEngine.audioContext) {\n let listeningCamera = scene.activeCamera;\n if (scene.activeCameras && scene.activeCameras.length > 0) {\n listeningCamera = scene.activeCameras[0];\n }\n // A custom listener position provider was set\n // Use the users provided position instead of camera's\n if (this.audioListenerPositionProvider) {\n const position = this.audioListenerPositionProvider();\n // Set the listener position\n audioEngine.audioContext.listener.setPosition(position.x || 0, position.y || 0, position.z || 0);\n // Check if there is a listening camera\n }\n else if (listeningCamera) {\n // Set the listener position to the listening camera global position\n if (!this._cachedCameraPosition.equals(listeningCamera.globalPosition)) {\n this._cachedCameraPosition.copyFrom(listeningCamera.globalPosition);\n audioEngine.audioContext.listener.setPosition(listeningCamera.globalPosition.x, listeningCamera.globalPosition.y, listeningCamera.globalPosition.z);\n }\n }\n // Otherwise set the listener position to 0, 0 ,0\n else {\n // Set the listener position\n audioEngine.audioContext.listener.setPosition(0, 0, 0);\n }\n // A custom listener rotation provider was set\n // Use the users provided rotation instead of camera's\n if (this.audioListenerRotationProvider) {\n const rotation = this.audioListenerRotationProvider();\n audioEngine.audioContext.listener.setOrientation(rotation.x || 0, rotation.y || 0, rotation.z || 0, 0, 1, 0);\n // Check if there is a listening camera\n }\n else if (listeningCamera) {\n // for VR cameras\n if (listeningCamera.rigCameras && listeningCamera.rigCameras.length > 0) {\n listeningCamera = listeningCamera.rigCameras[0];\n }\n listeningCamera.getViewMatrix().invertToRef(this._invertMatrixTemp);\n Vector3.TransformNormalToRef(AudioSceneComponent._CameraDirection, this._invertMatrixTemp, this._cameraDirectionTemp);\n this._cameraDirectionTemp.normalize();\n // To avoid some errors on GearVR\n if (!isNaN(this._cameraDirectionTemp.x) && !isNaN(this._cameraDirectionTemp.y) && !isNaN(this._cameraDirectionTemp.z)) {\n if (!this._cachedCameraDirection.equals(this._cameraDirectionTemp)) {\n this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp);\n audioEngine.audioContext.listener.setOrientation(this._cameraDirectionTemp.x, this._cameraDirectionTemp.y, this._cameraDirectionTemp.z, 0, 1, 0);\n }\n }\n }\n // Otherwise set the listener rotation to 0, 0 ,0\n else {\n // Set the listener position\n audioEngine.audioContext.listener.setOrientation(0, 0, 0, 0, 1, 0);\n }\n let i;\n for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {\n const sound = scene.mainSoundTrack.soundCollection[i];\n if (sound.useCustomAttenuation) {\n sound.updateDistanceFromListener();\n }\n }\n if (scene.soundTracks) {\n for (i = 0; i < scene.soundTracks.length; i++) {\n for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {\n const sound = scene.soundTracks[i].soundCollection[j];\n if (sound.useCustomAttenuation) {\n sound.updateDistanceFromListener();\n }\n }\n }\n }\n }\n }\n}\nAudioSceneComponent._CameraDirection = new Vector3(0, 0, -1);\nSound._SceneComponentInitialization = (scene) => {\n let compo = scene._getComponent(SceneComponentConstants.NAME_AUDIO);\n if (!compo) {\n compo = new AudioSceneComponent(scene);\n scene._addComponent(compo);\n }\n};\n//# sourceMappingURL=audioSceneComponent.js.map","import { Vector3 } from \"core/Maths/math.vector\";\nimport { Tools } from \"core/Misc/tools\";\nimport { AnimationEvent } from \"core/Animations/animationEvent\";\nimport { Sound } from \"core/Audio/sound\";\nimport { WeightedSound } from \"core/Audio/weightedsound\";\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nimport \"core/Audio/audioSceneComponent\";\nconst NAME = \"MSFT_audio_emitter\";\n/**\n * [Specification](https://github.com/najadojo/glTF/blob/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter/README.md)\n * !!! Experimental Extension Subject to Changes !!!\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class MSFT_audio_emitter {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n this._clips = null;\n this._emitters = null;\n }\n /** @internal */\n onLoading() {\n const extensions = this._loader.gltf.extensions;\n if (extensions && extensions[this.name]) {\n const extension = extensions[this.name];\n this._clips = extension.clips;\n this._emitters = extension.emitters;\n ArrayItem.Assign(this._clips);\n ArrayItem.Assign(this._emitters);\n }\n }\n /**\n * @internal\n */\n loadSceneAsync(context, scene) {\n return GLTFLoader.LoadExtensionAsync(context, scene, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadSceneAsync(context, scene));\n for (const emitterIndex of extension.emitters) {\n const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex);\n if (emitter.refDistance != undefined ||\n emitter.maxDistance != undefined ||\n emitter.rolloffFactor != undefined ||\n emitter.distanceModel != undefined ||\n emitter.innerAngle != undefined ||\n emitter.outerAngle != undefined) {\n throw new Error(`${extensionContext}: Direction or Distance properties are not allowed on emitters attached to a scene`);\n }\n promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter));\n }\n return Promise.all(promises).then(() => { });\n });\n }\n /**\n * @internal\n */\n loadNodeAsync(context, node, assign) {\n return GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {\n const promises = new Array();\n return this._loader\n .loadNodeAsync(extensionContext, node, (babylonMesh) => {\n for (const emitterIndex of extension.emitters) {\n const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex);\n promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter).then(() => {\n for (const sound of emitter._babylonSounds) {\n sound.attachToMesh(babylonMesh);\n if (emitter.innerAngle != undefined || emitter.outerAngle != undefined) {\n sound.setLocalDirectionToMesh(Vector3.Forward());\n sound.setDirectionalCone(2 * Tools.ToDegrees(emitter.innerAngle == undefined ? Math.PI : emitter.innerAngle), 2 * Tools.ToDegrees(emitter.outerAngle == undefined ? Math.PI : emitter.outerAngle), 0);\n }\n }\n }));\n }\n assign(babylonMesh);\n })\n .then((babylonMesh) => {\n return Promise.all(promises).then(() => {\n return babylonMesh;\n });\n });\n });\n }\n /**\n * @internal\n */\n loadAnimationAsync(context, animation) {\n return GLTFLoader.LoadExtensionAsync(context, animation, this.name, (extensionContext, extension) => {\n return this._loader.loadAnimationAsync(context, animation).then((babylonAnimationGroup) => {\n const promises = new Array();\n ArrayItem.Assign(extension.events);\n for (const event of extension.events) {\n promises.push(this._loadAnimationEventAsync(`${extensionContext}/events/${event.index}`, context, animation, event, babylonAnimationGroup));\n }\n return Promise.all(promises).then(() => {\n return babylonAnimationGroup;\n });\n });\n });\n }\n _loadClipAsync(context, clip) {\n if (clip._objectURL) {\n return clip._objectURL;\n }\n let promise;\n if (clip.uri) {\n promise = this._loader.loadUriAsync(context, clip, clip.uri);\n }\n else {\n const bufferView = ArrayItem.Get(`${context}/bufferView`, this._loader.gltf.bufferViews, clip.bufferView);\n promise = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView);\n }\n clip._objectURL = promise.then((data) => {\n return URL.createObjectURL(new Blob([data], { type: clip.mimeType }));\n });\n return clip._objectURL;\n }\n _loadEmitterAsync(context, emitter) {\n emitter._babylonSounds = emitter._babylonSounds || [];\n if (!emitter._babylonData) {\n const clipPromises = new Array();\n const name = emitter.name || `emitter${emitter.index}`;\n const options = {\n loop: false,\n autoplay: false,\n volume: emitter.volume == undefined ? 1 : emitter.volume,\n };\n for (let i = 0; i < emitter.clips.length; i++) {\n const clipContext = `/extensions/${this.name}/clips`;\n const clip = ArrayItem.Get(clipContext, this._clips, emitter.clips[i].clip);\n clipPromises.push(this._loadClipAsync(`${clipContext}/${emitter.clips[i].clip}`, clip).then((objectURL) => {\n const sound = (emitter._babylonSounds[i] = new Sound(name, objectURL, this._loader.babylonScene, null, options));\n sound.refDistance = emitter.refDistance || 1;\n sound.maxDistance = emitter.maxDistance || 256;\n sound.rolloffFactor = emitter.rolloffFactor || 1;\n sound.distanceModel = emitter.distanceModel || \"exponential\";\n }));\n }\n const promise = Promise.all(clipPromises).then(() => {\n const weights = emitter.clips.map((clip) => {\n return clip.weight || 1;\n });\n const weightedSound = new WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);\n if (emitter.innerAngle) {\n weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle);\n }\n if (emitter.outerAngle) {\n weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle);\n }\n if (emitter.volume) {\n weightedSound.volume = emitter.volume;\n }\n emitter._babylonData.sound = weightedSound;\n });\n emitter._babylonData = {\n loaded: promise,\n };\n }\n return emitter._babylonData.loaded;\n }\n _getEventAction(context, sound, action, time, startOffset) {\n switch (action) {\n case \"play\" /* IMSFTAudioEmitter_AnimationEventAction.play */: {\n return (currentFrame) => {\n const frameOffset = (startOffset || 0) + (currentFrame - time);\n sound.play(frameOffset);\n };\n }\n case \"stop\" /* IMSFTAudioEmitter_AnimationEventAction.stop */: {\n return () => {\n sound.stop();\n };\n }\n case \"pause\" /* IMSFTAudioEmitter_AnimationEventAction.pause */: {\n return () => {\n sound.pause();\n };\n }\n default: {\n throw new Error(`${context}: Unsupported action ${action}`);\n }\n }\n }\n _loadAnimationEventAsync(context, animationContext, animation, event, babylonAnimationGroup) {\n if (babylonAnimationGroup.targetedAnimations.length == 0) {\n return Promise.resolve();\n }\n const babylonAnimation = babylonAnimationGroup.targetedAnimations[0];\n const emitterIndex = event.emitter;\n const emitter = ArrayItem.Get(`/extensions/${this.name}/emitters`, this._emitters, emitterIndex);\n return this._loadEmitterAsync(context, emitter).then(() => {\n const sound = emitter._babylonData.sound;\n if (sound) {\n const babylonAnimationEvent = new AnimationEvent(event.time, this._getEventAction(context, sound, event.action, event.time, event.startOffset));\n babylonAnimation.animation.addEvent(babylonAnimationEvent);\n // Make sure all started audio stops when this animation is terminated.\n babylonAnimationGroup.onAnimationGroupEndObservable.add(() => {\n sound.stop();\n });\n babylonAnimationGroup.onAnimationGroupPauseObservable.add(() => {\n sound.pause();\n });\n }\n });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new MSFT_audio_emitter(loader));\n//# sourceMappingURL=MSFT_audio_emitter.js.map"],"names":["AnimationEvent","constructor","frame","action","onlyOnce","this","isDone","_clone","Sound","loop","_loop","value","updateOptions","currentTime","_htmlAudioElement","AbstractEngine","audioEngine","audioContext","isPlaying","isPaused","timeSinceLastStart","_startTime","_currentTime","spatialSound","_spatialSound","newValue","wasPlaying","pause","_updateSpatialParameters","_disableSpatialSound","play","name","urlOrArrayBuffer","scene","readyToPlayCallback","options","autoplay","useCustomAttenuation","refDistance","rolloffFactor","maxDistance","distanceModel","metadata","onEndedObservable","Observable","_panningModel","_playbackRate","_streaming","_position","Vector3","Zero","_localDirection","_volume","_isReadyToPlay","_isDirectional","_coneInnerAngle","_coneOuterAngle","_coneOuterGain","_isOutputConnected","_urlType","EngineStore","LastCreatedScene","_scene","_SceneComponentInitialization","_readyToPlayCallback","_customAttenuationFunction","currentVolume","currentDistance","undefined","volume","playbackRate","streaming","_length","length","_offset","offset","canUseWebAudio","_soundGain","createGain","gain","_inputAudioNode","_outputAudioNode","_createSpatialParameters","mainSoundTrack","addSound","validParameter","_url","ArrayBuffer","HTMLMediaElement","MediaStream","AudioBuffer","Array","isArray","urls","codecSupportedFound","_streamingSource","createMediaElementSource","createMediaStreamSource","byteLength","_soundLoaded","_audioBufferLoaded","push","i","url","skipCodecCheck","indexOf","isMP3supported","isOGGsupported","Audio","controls","Tools","SetCorsBehavior","preload","addEventListener","once","document","body","appendChild","load","_loadFile","data","exception","Logger","Error","status","removeSound","setTimeout","ex","WarnedWebAudioUnsupported","dispose","stop","soundTrackId","soundTracks","disconnect","_soundPanner","_soundSource","_audioBuffer","src","removeChild","_connectedTransformNode","_registerFunc","unregisterAfterWorldMatrixUpdate","_clearTimeoutsAndObservers","isReady","getClassName","buffer","audioData","decodeAudioData","err","setAudioBuffer","audioBuffer","_setOffset","setVolume","loopStart","loopEnd","headphone","createPanner","connect","Number","MAX_VALUE","panningModel","switchPanningModelToHRTF","_switchPanningModel","switchPanningModelToEqualPower","connectToSoundTrackAudioNode","soundTrackAudioNode","setDirectionalCone","coneInnerAngle","coneOuterAngle","coneOuterGain","directionalConeInnerAngle","directionalConeOuterAngle","setPosition","newPosition","equals","copyFrom","isNaN","x","y","z","positionX","positionY","positionZ","setLocalDirectionToMesh","newLocalDirection","_updateDirection","mat","getWorldMatrix","direction","TransformNormal","normalize","orientationX","orientationY","orientationZ","updateDistanceFromListener","activeCamera","distance","audioListenerPositionProvider","position","subtract","getDistanceToCamera","setAttenuationFunction","callback","time","audioEnabled","startTime","setOrientation","onended","_onended","tryToPlay","unlocked","playPromise","catch","lock","_audioUnlockedObserver","onAudioUnlockedObservable","addOnce","oldSource","createBufferSource","actualOffset","duration","start","state","_tryToPlayTimeout","message","notifyObservers","stopTime","newVolume","cancelScheduledValues","setValueAtTime","linearRampToValueAtTime","setPlaybackRate","newPlaybackRate","getPlaybackRate","getVolume","attachToMesh","transformNode","_onRegisterAfterWorldMatrixUpdate","registerAfterWorldMatrixUpdate","detachFromMesh","node","getBoundingInfo","boundingInfo","boundingSphere","centerWorld","absolutePosition","clone","setBufferAndRun","clonedSound","getAudioBuffer","currentOptions","getSoundSource","getSoundGain","serialize","serializationObject","connectedMeshId","id","asArray","isDirectional","localDirectionToMesh","Parse","parsedSound","rootUrl","sourceSound","soundName","soundUrl","newSound","removePendingData","addPendingData","soundPosition","FromArray","connectedMesh","getMeshById","clearTimeout","remove","_","_WarnImport","RegisterClass","WeightedSound","sounds","weights","_sounds","_weights","weightSum","weight","invWeightSum","sound","add","_currentIndex","startOffset","randomValue","Math","random","total","SoundTrack","_isInitialized","soundCollection","_options","mainTrack","_initializeSoundTrackAudioGraph","masterGain","_connectedAnalyser","stopDebugCanvas","index","splice","connectToAnalyser","analyser","connectAudioNodes","Object","defineProperty","Scene","prototype","get","compo","_getComponent","SceneComponentConstants","NAME_AUDIO","AudioSceneComponent","_addComponent","_mainSoundTrack","enumerable","configurable","getSoundByName","sdIndex","set","enableAudio","disableAudio","switchAudioModeForHeadphones","switchAudioModeForNormalSpeakers","audioListenerRotationProvider","audioPositioningRefreshRate","_audioEnabled","_headphone","_cachedCameraDirection","_cachedCameraPosition","_lastCheck","_invertMatrixTemp","Matrix","_cameraDirectionTemp","register","_afterRenderStage","registerStep","STEP_AFTERRENDER_AUDIO","_afterRender","rebuild","soundtrack","soundId","addFromContainer","container","forEach","removeFromContainer","scIndex","suspend","j","resume","now","PrecisionDate","Now","listeningCamera","activeCameras","listener","globalPosition","rotation","rigCameras","getViewMatrix","invertToRef","TransformNormalToRef","_CameraDirection","NAME","MSFT_audio_emitter","loader","_loader","enabled","isExtensionUsed","_clips","_emitters","onLoading","extensions","gltf","extension","clips","emitters","ArrayItem","Assign","loadSceneAsync","context","GLTFLoader","LoadExtensionAsync","extensionContext","promises","emitterIndex","emitter","Get","innerAngle","outerAngle","_loadEmitterAsync","Promise","all","then","loadNodeAsync","assign","babylonMesh","_babylonSounds","Forward","ToDegrees","PI","loadAnimationAsync","animation","babylonAnimationGroup","events","event","_loadAnimationEventAsync","_loadClipAsync","clip","_objectURL","promise","uri","loadUriAsync","bufferView","bufferViews","loadBufferViewAsync","URL","createObjectURL","Blob","type","mimeType","_babylonData","clipPromises","clipContext","objectURL","babylonScene","map","weightedSound","loaded","_getEventAction","currentFrame","frameOffset","animationContext","targetedAnimations","resolve","babylonAnimation","babylonAnimationEvent","addEvent","onAnimationGroupEndObservable","onAnimationGroupPauseObservable","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"gYAGO,MAAMA,EAOT,WAAAC,CAEAC,EAEAC,EAEAC,GACIC,KAAKH,MAAQA,EACbG,KAAKF,OAASA,EACdE,KAAKD,SAAWA,EAIhBC,KAAKC,QAAS,CACtB,CAEI,MAAAC,GACI,OAAO,IAAIP,EAAeK,KAAKH,MAAOG,KAAKF,OAAQE,KAAKD,SAChE,ECfO,MAAMI,EAIT,QAAIC,GACA,OAAOJ,KAAKK,KACpB,CACI,QAAID,CAAKE,GACDA,IAAUN,KAAKK,QAGnBL,KAAKK,MAAQC,EACbN,KAAKO,cAAc,CAAEH,KAAME,IACnC,CAII,eAAIE,GACA,GAAIR,KAAKS,kBACL,OAAOT,KAAKS,kBAAkBD,YAElC,GAAIE,EAAeC,aAAaC,eAAiBZ,KAAKa,WAAab,KAAKc,UAAW,CAG/E,MAAMC,EAAqBf,KAAKc,SAAW,EAAIJ,EAAeC,YAAYC,aAAaJ,YAAcR,KAAKgB,WAC1G,OAAOhB,KAAKiB,aAAeF,CACvC,CACQ,OAAO,CACf,CAKI,gBAAIG,GACA,OAAOlB,KAAKmB,aACpB,CAKI,gBAAID,CAAaE,GACb,GAAIA,GAAYpB,KAAKmB,cACjB,OAEJ,MAAME,EAAarB,KAAKa,UACxBb,KAAKsB,QACDF,GACApB,KAAKmB,cAAgBC,EACrBpB,KAAKuB,4BAGLvB,KA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