@babylonjs/viewer 7.26.0-alpha → 7.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/configuration/configuration.d.ts +107 -0
  2. package/configuration/configuration.js +16 -0
  3. package/configuration/configuration.js.map +1 -0
  4. package/configuration/configurationCompatibility.d.ts +8 -0
  5. package/configuration/configurationCompatibility.js +66 -0
  6. package/configuration/configurationCompatibility.js.map +1 -0
  7. package/configuration/configurationContainer.d.ts +10 -0
  8. package/configuration/configurationContainer.js +10 -0
  9. package/configuration/configurationContainer.js.map +1 -0
  10. package/configuration/globals.d.ts +6 -0
  11. package/configuration/globals.js +18 -0
  12. package/configuration/globals.js.map +1 -0
  13. package/configuration/index.d.ts +2 -0
  14. package/configuration/index.js +4 -0
  15. package/configuration/index.js.map +1 -0
  16. package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
  17. package/configuration/interfaces/cameraConfiguration.js +2 -0
  18. package/configuration/interfaces/cameraConfiguration.js.map +1 -0
  19. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
  20. package/configuration/interfaces/colorGradingConfiguration.js +2 -0
  21. package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
  22. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
  23. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
  24. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
  25. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
  26. package/configuration/interfaces/environmentMapConfiguration.js +2 -0
  27. package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
  28. package/configuration/interfaces/groundConfiguration.d.ts +24 -0
  29. package/configuration/interfaces/groundConfiguration.js +2 -0
  30. package/configuration/interfaces/groundConfiguration.js.map +1 -0
  31. package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
  32. package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
  33. package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
  34. package/configuration/interfaces/index.d.ts +15 -0
  35. package/configuration/interfaces/index.js +16 -0
  36. package/configuration/interfaces/index.js.map +1 -0
  37. package/configuration/interfaces/lightConfiguration.d.ts +60 -0
  38. package/configuration/interfaces/lightConfiguration.js +2 -0
  39. package/configuration/interfaces/lightConfiguration.js.map +1 -0
  40. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
  41. package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
  42. package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
  43. package/configuration/interfaces/modelConfiguration.d.ts +65 -0
  44. package/configuration/interfaces/modelConfiguration.js +2 -0
  45. package/configuration/interfaces/modelConfiguration.js.map +1 -0
  46. package/configuration/interfaces/observersConfiguration.d.ts +5 -0
  47. package/configuration/interfaces/observersConfiguration.js +2 -0
  48. package/configuration/interfaces/observersConfiguration.js.map +1 -0
  49. package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
  50. package/configuration/interfaces/sceneConfiguration.js +2 -0
  51. package/configuration/interfaces/sceneConfiguration.js.map +1 -0
  52. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
  53. package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
  54. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
  55. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
  56. package/configuration/interfaces/skyboxConfiguration.js +2 -0
  57. package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
  58. package/configuration/interfaces/templateConfiguration.d.ts +67 -0
  59. package/configuration/interfaces/templateConfiguration.js +2 -0
  60. package/configuration/interfaces/templateConfiguration.js.map +1 -0
  61. package/configuration/interfaces/vrConfiguration.d.ts +16 -0
  62. package/configuration/interfaces/vrConfiguration.js +2 -0
  63. package/configuration/interfaces/vrConfiguration.js.map +1 -0
  64. package/configuration/loader.d.ts +4 -0
  65. package/configuration/loader.js +17 -0
  66. package/configuration/loader.js.map +1 -0
  67. package/configuration/mappers.d.ts +43 -0
  68. package/configuration/mappers.js +192 -0
  69. package/configuration/mappers.js.map +1 -0
  70. package/configuration/renderOnlyLoader.d.ts +33 -0
  71. package/configuration/renderOnlyLoader.js +162 -0
  72. package/configuration/renderOnlyLoader.js.map +1 -0
  73. package/configuration/types/default.d.ts +6 -0
  74. package/configuration/types/default.js +121 -0
  75. package/configuration/types/default.js.map +1 -0
  76. package/configuration/types/environmentMap.d.ts +5 -0
  77. package/configuration/types/environmentMap.js +14 -0
  78. package/configuration/types/environmentMap.js.map +1 -0
  79. package/configuration/types/extended.d.ts +6 -0
  80. package/configuration/types/extended.js +317 -0
  81. package/configuration/types/extended.js.map +1 -0
  82. package/configuration/types/index.d.ts +14 -0
  83. package/configuration/types/index.js +51 -0
  84. package/configuration/types/index.js.map +1 -0
  85. package/configuration/types/minimal.d.ts +6 -0
  86. package/configuration/types/minimal.js +43 -0
  87. package/configuration/types/minimal.js.map +1 -0
  88. package/configuration/types/renderOnlyDefault.d.ts +30 -0
  89. package/configuration/types/renderOnlyDefault.js +31 -0
  90. package/configuration/types/renderOnlyDefault.js.map +1 -0
  91. package/configuration/types/shadowLight.d.ts +9 -0
  92. package/configuration/types/shadowLight.js +64 -0
  93. package/configuration/types/shadowLight.js.map +1 -0
  94. package/helper/index.d.ts +29 -0
  95. package/helper/index.js +66 -0
  96. package/helper/index.js.map +1 -0
  97. package/index.d.ts +30 -0
  98. package/index.js +46 -0
  99. package/index.js.map +1 -0
  100. package/initializer.d.ts +11 -0
  101. package/initializer.js +35 -0
  102. package/initializer.js.map +1 -0
  103. package/interfaces.d.ts +5 -0
  104. package/interfaces.js +7 -0
  105. package/interfaces.js.map +1 -0
  106. package/labs/environmentSerializer.d.ts +126 -0
  107. package/labs/environmentSerializer.js +191 -0
  108. package/labs/environmentSerializer.js.map +1 -0
  109. package/labs/texture.d.ts +183 -0
  110. package/labs/texture.js +350 -0
  111. package/labs/texture.js.map +1 -0
  112. package/labs/viewerLabs.d.ts +51 -0
  113. package/labs/viewerLabs.js +134 -0
  114. package/labs/viewerLabs.js.map +1 -0
  115. package/loader/modelLoader.d.ts +56 -0
  116. package/loader/modelLoader.js +199 -0
  117. package/loader/modelLoader.js.map +1 -0
  118. package/loader/plugins/applyMaterialConfig.d.ts +12 -0
  119. package/loader/plugins/applyMaterialConfig.js +16 -0
  120. package/loader/plugins/applyMaterialConfig.js.map +1 -0
  121. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
  122. package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
  123. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
  124. package/loader/plugins/index.d.ts +19 -0
  125. package/loader/plugins/index.js +44 -0
  126. package/loader/plugins/index.js.map +1 -0
  127. package/loader/plugins/loaderPlugin.d.ts +24 -0
  128. package/loader/plugins/loaderPlugin.js +2 -0
  129. package/loader/plugins/loaderPlugin.js.map +1 -0
  130. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
  131. package/loader/plugins/msftLodLoaderPlugin.js +21 -0
  132. package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
  133. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
  134. package/loader/plugins/telemetryLoaderPlugin.js +36 -0
  135. package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
  136. package/managers/observablesManager.d.ts +66 -0
  137. package/managers/observablesManager.js +35 -0
  138. package/managers/observablesManager.js.map +1 -0
  139. package/managers/sceneManager.d.ts +245 -0
  140. package/managers/sceneManager.js +1375 -0
  141. package/managers/sceneManager.js.map +1 -0
  142. package/managers/telemetryManager.d.ts +78 -0
  143. package/managers/telemetryManager.js +117 -0
  144. package/managers/telemetryManager.js.map +1 -0
  145. package/model/modelAnimation.d.ts +215 -0
  146. package/model/modelAnimation.js +237 -0
  147. package/model/modelAnimation.js.map +1 -0
  148. package/model/viewerModel.d.ts +233 -0
  149. package/model/viewerModel.js +673 -0
  150. package/model/viewerModel.js.map +1 -0
  151. package/optimizer/custom/extended.d.ts +13 -0
  152. package/optimizer/custom/extended.js +101 -0
  153. package/optimizer/custom/extended.js.map +1 -0
  154. package/optimizer/custom/index.d.ts +9 -0
  155. package/optimizer/custom/index.js +26 -0
  156. package/optimizer/custom/index.js.map +1 -0
  157. package/package.json +27 -17
  158. package/readme.md +21 -35
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +21 -0
  167. package/templating/plugins/hdButtonPlugin.js.map +1 -0
  168. package/templating/plugins/printButton.d.ts +9 -0
  169. package/templating/plugins/printButton.js +40 -0
  170. package/templating/plugins/printButton.js.map +1 -0
  171. package/templating/templateManager.d.ts +197 -0
  172. package/templating/templateManager.js +561 -0
  173. package/templating/templateManager.js.map +1 -0
  174. package/templating/viewerTemplatePlugin.d.ts +21 -0
  175. package/templating/viewerTemplatePlugin.js +69 -0
  176. package/templating/viewerTemplatePlugin.js.map +1 -0
  177. package/viewer/defaultViewer.d.ts +130 -0
  178. package/viewer/defaultViewer.js +675 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/dist/babylon-viewer.esm.js +0 -2
  193. package/dist/babylon-viewer.esm.js.map +0 -1
  194. package/dist/babylon-viewer.esm.min.js +0 -2
  195. package/dist/babylon-viewer.esm.min.js.map +0 -1
  196. package/dist/chunks/EXT_lights_image_based-BAAAren3.esm.min.js +0 -2
  197. package/dist/chunks/EXT_lights_image_based-BAAAren3.esm.min.js.map +0 -1
  198. package/dist/chunks/EXT_lights_image_based-CLRxjLYR.esm.js +0 -170
  199. package/dist/chunks/EXT_lights_image_based-CLRxjLYR.esm.js.map +0 -1
  200. package/dist/chunks/EXT_mesh_gpu_instancing-g_z4hICR.esm.min.js +0 -2
  201. package/dist/chunks/EXT_mesh_gpu_instancing-g_z4hICR.esm.min.js.map +0 -1
  202. package/dist/chunks/EXT_mesh_gpu_instancing-xdiHrPE-.esm.js +0 -86
  203. package/dist/chunks/EXT_mesh_gpu_instancing-xdiHrPE-.esm.js.map +0 -1
  204. package/dist/chunks/EXT_meshopt_compression-DtR1iauf.esm.js +0 -134
  205. package/dist/chunks/EXT_meshopt_compression-DtR1iauf.esm.js.map +0 -1
  206. package/dist/chunks/EXT_meshopt_compression-SJRA4qRp.esm.min.js +0 -2
  207. package/dist/chunks/EXT_meshopt_compression-SJRA4qRp.esm.min.js.map +0 -1
  208. package/dist/chunks/EXT_texture_avif-DyYYGGQy.esm.js +0 -44
  209. package/dist/chunks/EXT_texture_avif-DyYYGGQy.esm.js.map +0 -1
  210. package/dist/chunks/EXT_texture_avif-Qcsk_kvk.esm.min.js +0 -2
  211. package/dist/chunks/EXT_texture_avif-Qcsk_kvk.esm.min.js.map +0 -1
  212. package/dist/chunks/EXT_texture_webp-CLgPX9Kq.esm.min.js +0 -2
  213. package/dist/chunks/EXT_texture_webp-CLgPX9Kq.esm.min.js.map +0 -1
  214. package/dist/chunks/EXT_texture_webp-X7MNkN3t.esm.js +0 -43
  215. package/dist/chunks/EXT_texture_webp-X7MNkN3t.esm.js.map +0 -1
  216. package/dist/chunks/ExtrasAsMetadata-DDzM1udc.esm.min.js +0 -2
  217. package/dist/chunks/ExtrasAsMetadata-DDzM1udc.esm.min.js.map +0 -1
  218. package/dist/chunks/ExtrasAsMetadata-_A4ue-yg.esm.js +0 -64
  219. package/dist/chunks/ExtrasAsMetadata-_A4ue-yg.esm.js.map +0 -1
  220. package/dist/chunks/KHR_animation_pointer-C_uSLVMY.esm.min.js +0 -2
  221. package/dist/chunks/KHR_animation_pointer-C_uSLVMY.esm.min.js.map +0 -1
  222. package/dist/chunks/KHR_animation_pointer-DOLmQrF0.esm.js +0 -343
  223. package/dist/chunks/KHR_animation_pointer-DOLmQrF0.esm.js.map +0 -1
  224. package/dist/chunks/KHR_draco_mesh_compression-Dc2dj10X.esm.js +0 -610
  225. package/dist/chunks/KHR_draco_mesh_compression-Dc2dj10X.esm.js.map +0 -1
  226. package/dist/chunks/KHR_draco_mesh_compression-Qjbd-cV8.esm.min.js +0 -2
  227. package/dist/chunks/KHR_draco_mesh_compression-Qjbd-cV8.esm.min.js.map +0 -1
  228. package/dist/chunks/KHR_interactivity-BMxQ78NS.esm.js +0 -4033
  229. package/dist/chunks/KHR_interactivity-BMxQ78NS.esm.js.map +0 -1
  230. package/dist/chunks/KHR_interactivity-Dyhotcuc.esm.min.js +0 -2
  231. package/dist/chunks/KHR_interactivity-Dyhotcuc.esm.min.js.map +0 -1
  232. package/dist/chunks/KHR_lights_punctual-BQxBGi0_.esm.js +0 -1253
  233. package/dist/chunks/KHR_lights_punctual-BQxBGi0_.esm.js.map +0 -1
  234. package/dist/chunks/KHR_lights_punctual-CP6yK7gB.esm.min.js +0 -2
  235. package/dist/chunks/KHR_lights_punctual-CP6yK7gB.esm.min.js.map +0 -1
  236. package/dist/chunks/KHR_materials_anisotropy-B-brojEG.esm.js +0 -64
  237. package/dist/chunks/KHR_materials_anisotropy-B-brojEG.esm.js.map +0 -1
  238. package/dist/chunks/KHR_materials_anisotropy-C_kRwfha.esm.min.js +0 -2
  239. package/dist/chunks/KHR_materials_anisotropy-C_kRwfha.esm.min.js.map +0 -1
  240. package/dist/chunks/KHR_materials_clearcoat-CRp8HOuT.esm.min.js +0 -2
  241. package/dist/chunks/KHR_materials_clearcoat-CRp8HOuT.esm.min.js.map +0 -1
  242. package/dist/chunks/KHR_materials_clearcoat-Dtwqzkls.esm.js +0 -96
  243. package/dist/chunks/KHR_materials_clearcoat-Dtwqzkls.esm.js.map +0 -1
  244. package/dist/chunks/KHR_materials_diffuse_transmission-BrvDWQjW.esm.js +0 -97
  245. package/dist/chunks/KHR_materials_diffuse_transmission-BrvDWQjW.esm.js.map +0 -1
  246. package/dist/chunks/KHR_materials_diffuse_transmission-CNCBiTRi.esm.min.js +0 -2
  247. package/dist/chunks/KHR_materials_diffuse_transmission-CNCBiTRi.esm.min.js.map +0 -1
  248. package/dist/chunks/KHR_materials_dispersion-Bx9AztVQ.esm.js +0 -62
  249. package/dist/chunks/KHR_materials_dispersion-Bx9AztVQ.esm.js.map +0 -1
  250. package/dist/chunks/KHR_materials_dispersion-C0wotXxO.esm.min.js +0 -2
  251. package/dist/chunks/KHR_materials_dispersion-C0wotXxO.esm.min.js.map +0 -1
  252. package/dist/chunks/KHR_materials_emissive_strength-CsJjVgTW.esm.js +0 -55
  253. package/dist/chunks/KHR_materials_emissive_strength-CsJjVgTW.esm.js.map +0 -1
  254. package/dist/chunks/KHR_materials_emissive_strength-DQk1VN_2.esm.min.js +0 -2
  255. package/dist/chunks/KHR_materials_emissive_strength-DQk1VN_2.esm.min.js.map +0 -1
  256. package/dist/chunks/KHR_materials_ior-B-Bz-ZTi.esm.js +0 -64
  257. package/dist/chunks/KHR_materials_ior-B-Bz-ZTi.esm.js.map +0 -1
  258. package/dist/chunks/KHR_materials_ior-DcRJZA_s.esm.min.js +0 -2
  259. package/dist/chunks/KHR_materials_ior-DcRJZA_s.esm.min.js.map +0 -1
  260. package/dist/chunks/KHR_materials_iridescence-B9mn3E_m.esm.js +0 -72
  261. package/dist/chunks/KHR_materials_iridescence-B9mn3E_m.esm.js.map +0 -1
  262. package/dist/chunks/KHR_materials_iridescence-BVq13lbk.esm.min.js +0 -2
  263. package/dist/chunks/KHR_materials_iridescence-BVq13lbk.esm.min.js.map +0 -1
  264. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D81096Xs.esm.min.js +0 -2
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D81096Xs.esm.min.js.map +0 -1
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DbXQeIqw.esm.js +0 -81
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DbXQeIqw.esm.js.map +0 -1
  268. package/dist/chunks/KHR_materials_sheen-CJALPuj4.esm.js +0 -85
  269. package/dist/chunks/KHR_materials_sheen-CJALPuj4.esm.js.map +0 -1
  270. package/dist/chunks/KHR_materials_sheen-D6gJV14Q.esm.min.js +0 -2
  271. package/dist/chunks/KHR_materials_sheen-D6gJV14Q.esm.min.js.map +0 -1
  272. package/dist/chunks/KHR_materials_specular-8J6t7IWW.esm.js +0 -75
  273. package/dist/chunks/KHR_materials_specular-8J6t7IWW.esm.js.map +0 -1
  274. package/dist/chunks/KHR_materials_specular-CLkfKuYs.esm.min.js +0 -2
  275. package/dist/chunks/KHR_materials_specular-CLkfKuYs.esm.min.js.map +0 -1
  276. package/dist/chunks/KHR_materials_transmission-CtmncfNu.esm.js +0 -307
  277. package/dist/chunks/KHR_materials_transmission-CtmncfNu.esm.js.map +0 -1
  278. package/dist/chunks/KHR_materials_transmission-Ds1e4Rgi.esm.min.js +0 -2
  279. package/dist/chunks/KHR_materials_transmission-Ds1e4Rgi.esm.min.js.map +0 -1
  280. package/dist/chunks/KHR_materials_unlit-CjwtrKka.esm.min.js +0 -2
  281. package/dist/chunks/KHR_materials_unlit-CjwtrKka.esm.min.js.map +0 -1
  282. package/dist/chunks/KHR_materials_unlit-D7RRssK9.esm.js +0 -74
  283. package/dist/chunks/KHR_materials_unlit-D7RRssK9.esm.js.map +0 -1
  284. package/dist/chunks/KHR_materials_variants-B16YKuMe.esm.min.js +0 -2
  285. package/dist/chunks/KHR_materials_variants-B16YKuMe.esm.min.js.map +0 -1
  286. package/dist/chunks/KHR_materials_variants-C6mz0mzG.esm.js +0 -238
  287. package/dist/chunks/KHR_materials_variants-C6mz0mzG.esm.js.map +0 -1
  288. package/dist/chunks/KHR_materials_volume-CocxcaC_.esm.min.js +0 -2
  289. package/dist/chunks/KHR_materials_volume-CocxcaC_.esm.min.js.map +0 -1
  290. package/dist/chunks/KHR_materials_volume-kX43-sr-.esm.js +0 -87
  291. package/dist/chunks/KHR_materials_volume-kX43-sr-.esm.js.map +0 -1
  292. package/dist/chunks/KHR_mesh_quantization-B2Y3kC9D.esm.js +0 -26
  293. package/dist/chunks/KHR_mesh_quantization-B2Y3kC9D.esm.js.map +0 -1
  294. package/dist/chunks/KHR_mesh_quantization-BfMxe7Z-.esm.min.js +0 -2
  295. package/dist/chunks/KHR_mesh_quantization-BfMxe7Z-.esm.min.js.map +0 -1
  296. package/dist/chunks/KHR_texture_basisu-DS4eOc5v.esm.js +0 -43
  297. package/dist/chunks/KHR_texture_basisu-DS4eOc5v.esm.js.map +0 -1
  298. package/dist/chunks/KHR_texture_basisu-ghZqGH67.esm.min.js +0 -2
  299. package/dist/chunks/KHR_texture_basisu-ghZqGH67.esm.min.js.map +0 -1
  300. package/dist/chunks/KHR_texture_transform-6nYo8mzH.esm.min.js +0 -2
  301. package/dist/chunks/KHR_texture_transform-6nYo8mzH.esm.min.js.map +0 -1
  302. package/dist/chunks/KHR_texture_transform-B-qDuvbI.esm.js +0 -63
  303. package/dist/chunks/KHR_texture_transform-B-qDuvbI.esm.js.map +0 -1
  304. package/dist/chunks/KHR_xmp_json_ld-CKv9gfXs.esm.min.js +0 -2
  305. package/dist/chunks/KHR_xmp_json_ld-CKv9gfXs.esm.min.js.map +0 -1
  306. package/dist/chunks/KHR_xmp_json_ld-CXjOnFmU.esm.js +0 -51
  307. package/dist/chunks/KHR_xmp_json_ld-CXjOnFmU.esm.js.map +0 -1
  308. package/dist/chunks/MSFT_audio_emitter-1StuTv-Z.esm.js +0 -2236
  309. package/dist/chunks/MSFT_audio_emitter-1StuTv-Z.esm.js.map +0 -1
  310. package/dist/chunks/MSFT_audio_emitter-BfKy7LEd.esm.min.js +0 -2
  311. package/dist/chunks/MSFT_audio_emitter-BfKy7LEd.esm.min.js.map +0 -1
  312. package/dist/chunks/MSFT_lod-DA4UA4La.esm.js +0 -337
  313. package/dist/chunks/MSFT_lod-DA4UA4La.esm.js.map +0 -1
  314. package/dist/chunks/MSFT_lod-wcOn3D2V.esm.min.js +0 -2
  315. package/dist/chunks/MSFT_lod-wcOn3D2V.esm.min.js.map +0 -1
  316. package/dist/chunks/MSFT_minecraftMesh-afhS3NlZ.esm.js +0 -46
  317. package/dist/chunks/MSFT_minecraftMesh-afhS3NlZ.esm.js.map +0 -1
  318. package/dist/chunks/MSFT_minecraftMesh-x417idfJ.esm.min.js +0 -2
  319. package/dist/chunks/MSFT_minecraftMesh-x417idfJ.esm.min.js.map +0 -1
  320. package/dist/chunks/MSFT_sRGBFactors-BjLfK8v1.esm.min.js +0 -2
  321. package/dist/chunks/MSFT_sRGBFactors-BjLfK8v1.esm.min.js.map +0 -1
  322. package/dist/chunks/MSFT_sRGBFactors-fA6kZabo.esm.js +0 -47
  323. package/dist/chunks/MSFT_sRGBFactors-fA6kZabo.esm.js.map +0 -1
  324. package/dist/chunks/assetContainer-BWyT-iC8.esm.min.js +0 -2
  325. package/dist/chunks/assetContainer-BWyT-iC8.esm.min.js.map +0 -1
  326. package/dist/chunks/assetContainer-C9nOA325.esm.js +0 -1598
  327. package/dist/chunks/assetContainer-C9nOA325.esm.js.map +0 -1
  328. package/dist/chunks/audioEngine-Bi_JHe07.esm.js +0 -305
  329. package/dist/chunks/audioEngine-Bi_JHe07.esm.js.map +0 -1
  330. package/dist/chunks/audioEngine-DyaETd2M.esm.min.js +0 -2
  331. package/dist/chunks/audioEngine-DyaETd2M.esm.min.js.map +0 -1
  332. package/dist/chunks/bakedVertexAnimation-Bw1dcogG.esm.min.js +0 -2
  333. package/dist/chunks/bakedVertexAnimation-Bw1dcogG.esm.min.js.map +0 -1
  334. package/dist/chunks/bakedVertexAnimation-D2t3QFFy.esm.js +0 -119
  335. package/dist/chunks/bakedVertexAnimation-D2t3QFFy.esm.js.map +0 -1
  336. package/dist/chunks/basisTextureLoader-DEikcMs0.esm.js +0 -600
  337. package/dist/chunks/basisTextureLoader-DEikcMs0.esm.js.map +0 -1
  338. package/dist/chunks/basisTextureLoader-DnU1aFLP.esm.min.js +0 -2
  339. package/dist/chunks/basisTextureLoader-DnU1aFLP.esm.min.js.map +0 -1
  340. package/dist/chunks/ddsTextureLoader-DBWTHVjj.esm.min.js +0 -2
  341. package/dist/chunks/ddsTextureLoader-DBWTHVjj.esm.min.js.map +0 -1
  342. package/dist/chunks/ddsTextureLoader-ilOloJ4p.esm.js +0 -87
  343. package/dist/chunks/ddsTextureLoader-ilOloJ4p.esm.js.map +0 -1
  344. package/dist/chunks/decalFragment-CMHxc7Hr.esm.min.js +0 -2
  345. package/dist/chunks/decalFragment-CMHxc7Hr.esm.min.js.map +0 -1
  346. package/dist/chunks/decalFragment-CzgxOzQf.esm.js +0 -18
  347. package/dist/chunks/decalFragment-CzgxOzQf.esm.js.map +0 -1
  348. package/dist/chunks/default.fragment-BOotE87x.esm.min.js +0 -2
  349. package/dist/chunks/default.fragment-BOotE87x.esm.min.js.map +0 -1
  350. package/dist/chunks/default.fragment-C8I2FMK1.esm.js +0 -515
  351. package/dist/chunks/default.fragment-C8I2FMK1.esm.js.map +0 -1
  352. package/dist/chunks/default.fragment-CMyZ0Um2.esm.js +0 -449
  353. package/dist/chunks/default.fragment-CMyZ0Um2.esm.js.map +0 -1
  354. package/dist/chunks/default.fragment-dyXo8ZoT.esm.min.js +0 -2
  355. package/dist/chunks/default.fragment-dyXo8ZoT.esm.min.js.map +0 -1
  356. package/dist/chunks/default.vertex-BgameJri.esm.js +0 -199
  357. package/dist/chunks/default.vertex-BgameJri.esm.js.map +0 -1
  358. package/dist/chunks/default.vertex-CI-1zFCv.esm.min.js +0 -2
  359. package/dist/chunks/default.vertex-CI-1zFCv.esm.min.js.map +0 -1
  360. package/dist/chunks/default.vertex-CtvM7XrD.esm.js +0 -180
  361. package/dist/chunks/default.vertex-CtvM7XrD.esm.js.map +0 -1
  362. package/dist/chunks/default.vertex-DVEypQOv.esm.min.js +0 -2
  363. package/dist/chunks/default.vertex-DVEypQOv.esm.min.js.map +0 -1
  364. package/dist/chunks/defaultUboDeclaration-2dituFIw.esm.js +0 -15
  365. package/dist/chunks/defaultUboDeclaration-2dituFIw.esm.js.map +0 -1
  366. package/dist/chunks/defaultUboDeclaration-BCFc39NJ.esm.js +0 -13
  367. package/dist/chunks/defaultUboDeclaration-BCFc39NJ.esm.js.map +0 -1
  368. package/dist/chunks/defaultUboDeclaration-Be_Tm0i8.esm.min.js +0 -2
  369. package/dist/chunks/defaultUboDeclaration-Be_Tm0i8.esm.min.js.map +0 -1
  370. package/dist/chunks/defaultUboDeclaration-CjpL7xej.esm.min.js +0 -2
  371. package/dist/chunks/defaultUboDeclaration-CjpL7xej.esm.min.js.map +0 -1
  372. package/dist/chunks/engine-2EdX14bK.esm.js +0 -1970
  373. package/dist/chunks/engine-2EdX14bK.esm.js.map +0 -1
  374. package/dist/chunks/engine-CTtwkexh.esm.min.js +0 -2
  375. package/dist/chunks/engine-CTtwkexh.esm.min.js.map +0 -1
  376. package/dist/chunks/engine.common-BrXEBOzm.esm.js +0 -1213
  377. package/dist/chunks/engine.common-BrXEBOzm.esm.js.map +0 -1
  378. package/dist/chunks/engine.common-Dn_GE8cx.esm.min.js +0 -2
  379. package/dist/chunks/engine.common-Dn_GE8cx.esm.min.js.map +0 -1
  380. package/dist/chunks/envTextureLoader-9mljxKnB.esm.min.js +0 -2
  381. package/dist/chunks/envTextureLoader-9mljxKnB.esm.min.js.map +0 -1
  382. package/dist/chunks/envTextureLoader-cuBGdyEX.esm.js +0 -63
  383. package/dist/chunks/envTextureLoader-cuBGdyEX.esm.js.map +0 -1
  384. package/dist/chunks/environmentTextureTools-2JiPh6sF.esm.min.js +0 -2
  385. package/dist/chunks/environmentTextureTools-2JiPh6sF.esm.min.js.map +0 -1
  386. package/dist/chunks/environmentTextureTools-CaOOVUg4.esm.js +0 -381
  387. package/dist/chunks/environmentTextureTools-CaOOVUg4.esm.js.map +0 -1
  388. package/dist/chunks/exrTextureLoader-C2yRfZW0.esm.min.js +0 -2
  389. package/dist/chunks/exrTextureLoader-C2yRfZW0.esm.min.js.map +0 -1
  390. package/dist/chunks/exrTextureLoader-DPvYdRIY.esm.js +0 -1682
  391. package/dist/chunks/exrTextureLoader-DPvYdRIY.esm.js.map +0 -1
  392. package/dist/chunks/fogFragment-CerDBxh8.esm.min.js +0 -2
  393. package/dist/chunks/fogFragment-CerDBxh8.esm.min.js.map +0 -1
  394. package/dist/chunks/fogFragment-SpVyZY46.esm.js +0 -102
  395. package/dist/chunks/fogFragment-SpVyZY46.esm.js.map +0 -1
  396. package/dist/chunks/fresnelFunction-Cfc0PCuM.esm.min.js +0 -2
  397. package/dist/chunks/fresnelFunction-Cfc0PCuM.esm.min.js.map +0 -1
  398. package/dist/chunks/fresnelFunction-DYc_QORg.esm.js +0 -12
  399. package/dist/chunks/fresnelFunction-DYc_QORg.esm.js.map +0 -1
  400. package/dist/chunks/glTFLoader-CX847JwZ.esm.min.js +0 -2
  401. package/dist/chunks/glTFLoader-CX847JwZ.esm.min.js.map +0 -1
  402. package/dist/chunks/glTFLoader-FnbdTR40.esm.js +0 -7552
  403. package/dist/chunks/glTFLoader-FnbdTR40.esm.js.map +0 -1
  404. package/dist/chunks/glTFLoaderAnimation-DLprnT2e.esm.js +0 -77
  405. package/dist/chunks/glTFLoaderAnimation-DLprnT2e.esm.js.map +0 -1
  406. package/dist/chunks/glTFLoaderAnimation-YVA5W-1q.esm.min.js +0 -2
  407. package/dist/chunks/glTFLoaderAnimation-YVA5W-1q.esm.min.js.map +0 -1
  408. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  409. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  410. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  411. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  412. package/dist/chunks/harmonicsFunctions-BglL8EAc.esm.min.js +0 -2
  413. package/dist/chunks/harmonicsFunctions-BglL8EAc.esm.min.js.map +0 -1
  414. package/dist/chunks/harmonicsFunctions-BjhkFrPF.esm.min.js +0 -2
  415. package/dist/chunks/harmonicsFunctions-BjhkFrPF.esm.min.js.map +0 -1
  416. package/dist/chunks/harmonicsFunctions-D0kGurRz.esm.js +0 -34
  417. package/dist/chunks/harmonicsFunctions-D0kGurRz.esm.js.map +0 -1
  418. package/dist/chunks/harmonicsFunctions-f0TDZMjd.esm.js +0 -35
  419. package/dist/chunks/harmonicsFunctions-f0TDZMjd.esm.js.map +0 -1
  420. package/dist/chunks/hdrTextureLoader-BYv589K1.esm.min.js +0 -2
  421. package/dist/chunks/hdrTextureLoader-BYv589K1.esm.min.js.map +0 -1
  422. package/dist/chunks/hdrTextureLoader-Cia6kLvR.esm.js +0 -252
  423. package/dist/chunks/hdrTextureLoader-Cia6kLvR.esm.js.map +0 -1
  424. package/dist/chunks/helperFunctions-B6L2NvuR.esm.min.js +0 -2
  425. package/dist/chunks/helperFunctions-B6L2NvuR.esm.min.js.map +0 -1
  426. package/dist/chunks/helperFunctions-CTmvPMOb.esm.js +0 -108
  427. package/dist/chunks/helperFunctions-CTmvPMOb.esm.js.map +0 -1
  428. package/dist/chunks/helperFunctions-Dx_bhcnf.esm.js +0 -80
  429. package/dist/chunks/helperFunctions-Dx_bhcnf.esm.js.map +0 -1
  430. package/dist/chunks/helperFunctions-lfyjwIAq.esm.min.js +0 -2
  431. package/dist/chunks/helperFunctions-lfyjwIAq.esm.min.js.map +0 -1
  432. package/dist/chunks/index-H9RbNFln.esm.js +0 -78669
  433. package/dist/chunks/index-H9RbNFln.esm.js.map +0 -1
  434. package/dist/chunks/index-NKQY07Ai.esm.min.js +0 -57
  435. package/dist/chunks/index-NKQY07Ai.esm.min.js.map +0 -1
  436. package/dist/chunks/ktxTextureLoader-C8P1HmKw.esm.min.js +0 -2
  437. package/dist/chunks/ktxTextureLoader-C8P1HmKw.esm.min.js.map +0 -1
  438. package/dist/chunks/ktxTextureLoader-CGZaZgF4.esm.js +0 -814
  439. package/dist/chunks/ktxTextureLoader-CGZaZgF4.esm.js.map +0 -1
  440. package/dist/chunks/logDepthDeclaration-BtAGVG3-.esm.min.js +0 -2
  441. package/dist/chunks/logDepthDeclaration-BtAGVG3-.esm.min.js.map +0 -1
  442. package/dist/chunks/logDepthDeclaration-BvAgEnZm.esm.min.js +0 -2
  443. package/dist/chunks/logDepthDeclaration-BvAgEnZm.esm.min.js.map +0 -1
  444. package/dist/chunks/logDepthDeclaration-DD208S_2.esm.js +0 -35
  445. package/dist/chunks/logDepthDeclaration-DD208S_2.esm.js.map +0 -1
  446. package/dist/chunks/logDepthDeclaration-T3brxHqo.esm.js +0 -20
  447. package/dist/chunks/logDepthDeclaration-T3brxHqo.esm.js.map +0 -1
  448. package/dist/chunks/logDepthVertex-0P4Fk3ej.esm.js +0 -77
  449. package/dist/chunks/logDepthVertex-0P4Fk3ej.esm.js.map +0 -1
  450. package/dist/chunks/logDepthVertex-Bo4jbfP3.esm.min.js +0 -2
  451. package/dist/chunks/logDepthVertex-Bo4jbfP3.esm.min.js.map +0 -1
  452. package/dist/chunks/logDepthVertex-DhlJdt6n.esm.min.js +0 -2
  453. package/dist/chunks/logDepthVertex-DhlJdt6n.esm.min.js.map +0 -1
  454. package/dist/chunks/logDepthVertex-bCxA8jHH.esm.js +0 -488
  455. package/dist/chunks/logDepthVertex-bCxA8jHH.esm.js.map +0 -1
  456. package/dist/chunks/mainUVVaryingDeclaration-CkGDoJLo.esm.js +0 -11
  457. package/dist/chunks/mainUVVaryingDeclaration-CkGDoJLo.esm.js.map +0 -1
  458. package/dist/chunks/mainUVVaryingDeclaration-DAb0JqU5.esm.min.js +0 -2
  459. package/dist/chunks/mainUVVaryingDeclaration-DAb0JqU5.esm.min.js.map +0 -1
  460. package/dist/chunks/meshUboDeclaration-BEpwR1Md.esm.min.js +0 -2
  461. package/dist/chunks/meshUboDeclaration-BEpwR1Md.esm.min.js.map +0 -1
  462. package/dist/chunks/meshUboDeclaration-wwoFcdXg.esm.js +0 -24
  463. package/dist/chunks/meshUboDeclaration-wwoFcdXg.esm.js.map +0 -1
  464. package/dist/chunks/objFileLoader-9VII_MH6.esm.min.js +0 -2
  465. package/dist/chunks/objFileLoader-9VII_MH6.esm.min.js.map +0 -1
  466. package/dist/chunks/objFileLoader-sy2KqRzD.esm.js +0 -1280
  467. package/dist/chunks/objFileLoader-sy2KqRzD.esm.js.map +0 -1
  468. package/dist/chunks/oitFragment-BKhyL_Ma.esm.min.js +0 -2
  469. package/dist/chunks/oitFragment-BKhyL_Ma.esm.min.js.map +0 -1
  470. package/dist/chunks/oitFragment-BqtunGU7.esm.min.js +0 -2
  471. package/dist/chunks/oitFragment-BqtunGU7.esm.min.js.map +0 -1
  472. package/dist/chunks/oitFragment-CGo4SX0U.esm.js +0 -1150
  473. package/dist/chunks/oitFragment-CGo4SX0U.esm.js.map +0 -1
  474. package/dist/chunks/oitFragment-akBosjiV.esm.js +0 -1210
  475. package/dist/chunks/oitFragment-akBosjiV.esm.js.map +0 -1
  476. package/dist/chunks/pass.fragment-CMK3Cirh.esm.js +0 -15
  477. package/dist/chunks/pass.fragment-CMK3Cirh.esm.js.map +0 -1
  478. package/dist/chunks/pass.fragment-NgBFYMH2.esm.min.js +0 -2
  479. package/dist/chunks/pass.fragment-NgBFYMH2.esm.min.js.map +0 -1
  480. package/dist/chunks/pbr.fragment-BxeirEXF.esm.min.js +0 -2
  481. package/dist/chunks/pbr.fragment-BxeirEXF.esm.min.js.map +0 -1
  482. package/dist/chunks/pbr.fragment-C9P-kot0.esm.min.js +0 -2
  483. package/dist/chunks/pbr.fragment-C9P-kot0.esm.min.js.map +0 -1
  484. package/dist/chunks/pbr.fragment-CmciAvUf.esm.js +0 -3219
  485. package/dist/chunks/pbr.fragment-CmciAvUf.esm.js.map +0 -1
  486. package/dist/chunks/pbr.fragment-DptkOGvm.esm.js +0 -3165
  487. package/dist/chunks/pbr.fragment-DptkOGvm.esm.js.map +0 -1
  488. package/dist/chunks/pbr.vertex-BGYxmiED.esm.min.js +0 -2
  489. package/dist/chunks/pbr.vertex-BGYxmiED.esm.min.js.map +0 -1
  490. package/dist/chunks/pbr.vertex-BKYxq0u4.esm.min.js +0 -2
  491. package/dist/chunks/pbr.vertex-BKYxq0u4.esm.min.js.map +0 -1
  492. package/dist/chunks/pbr.vertex-BW_cBtTy.esm.js +0 -210
  493. package/dist/chunks/pbr.vertex-BW_cBtTy.esm.js.map +0 -1
  494. package/dist/chunks/pbr.vertex-D5_YtZ3F.esm.js +0 -335
  495. package/dist/chunks/pbr.vertex-D5_YtZ3F.esm.js.map +0 -1
  496. package/dist/chunks/postprocess.vertex-BIHPwYtc.esm.min.js +0 -2
  497. package/dist/chunks/postprocess.vertex-BIHPwYtc.esm.min.js.map +0 -1
  498. package/dist/chunks/postprocess.vertex-DQbuHlSL.esm.js +0 -20
  499. package/dist/chunks/postprocess.vertex-DQbuHlSL.esm.js.map +0 -1
  500. package/dist/chunks/rawTexture-BBFBylYg.esm.js +0 -191
  501. package/dist/chunks/rawTexture-BBFBylYg.esm.js.map +0 -1
  502. package/dist/chunks/rawTexture-DtTw1SfK.esm.min.js +0 -2
  503. package/dist/chunks/rawTexture-DtTw1SfK.esm.min.js.map +0 -1
  504. package/dist/chunks/rgbdDecode.fragment-B8vtIeR2.esm.min.js +0 -2
  505. package/dist/chunks/rgbdDecode.fragment-B8vtIeR2.esm.min.js.map +0 -1
  506. package/dist/chunks/rgbdDecode.fragment-BAERNvTB.esm.js +0 -17
  507. package/dist/chunks/rgbdDecode.fragment-BAERNvTB.esm.js.map +0 -1
  508. package/dist/chunks/rgbdDecode.fragment-CUCNLBNb.esm.js +0 -17
  509. package/dist/chunks/rgbdDecode.fragment-CUCNLBNb.esm.js.map +0 -1
  510. package/dist/chunks/rgbdDecode.fragment-DE974oq3.esm.min.js +0 -2
  511. package/dist/chunks/rgbdDecode.fragment-DE974oq3.esm.min.js.map +0 -1
  512. package/dist/chunks/rgbdEncode.fragment-12Ga6DPf.esm.min.js +0 -2
  513. package/dist/chunks/rgbdEncode.fragment-12Ga6DPf.esm.min.js.map +0 -1
  514. package/dist/chunks/rgbdEncode.fragment-C_8FK6je.esm.min.js +0 -2
  515. package/dist/chunks/rgbdEncode.fragment-C_8FK6je.esm.min.js.map +0 -1
  516. package/dist/chunks/rgbdEncode.fragment-DLGZ9Ew-.esm.js +0 -17
  517. package/dist/chunks/rgbdEncode.fragment-DLGZ9Ew-.esm.js.map +0 -1
  518. package/dist/chunks/rgbdEncode.fragment-vtqqWXMx.esm.js +0 -17
  519. package/dist/chunks/rgbdEncode.fragment-vtqqWXMx.esm.js.map +0 -1
  520. package/dist/chunks/splatFileLoader-BvGLmrOU.esm.js +0 -3179
  521. package/dist/chunks/splatFileLoader-BvGLmrOU.esm.js.map +0 -1
  522. package/dist/chunks/splatFileLoader-Du-_lAWj.esm.min.js +0 -2
  523. package/dist/chunks/splatFileLoader-Du-_lAWj.esm.min.js.map +0 -1
  524. package/dist/chunks/standardMaterial-CTqOZPWo.esm.min.js +0 -2
  525. package/dist/chunks/standardMaterial-CTqOZPWo.esm.min.js.map +0 -1
  526. package/dist/chunks/standardMaterial-Nso7Fcun.esm.js +0 -1809
  527. package/dist/chunks/standardMaterial-Nso7Fcun.esm.js.map +0 -1
  528. package/dist/chunks/stlFileLoader-C0UsVNIc.esm.js +0 -237
  529. package/dist/chunks/stlFileLoader-C0UsVNIc.esm.js.map +0 -1
  530. package/dist/chunks/stlFileLoader-Du9QZoAm.esm.min.js +0 -2
  531. package/dist/chunks/stlFileLoader-Du9QZoAm.esm.min.js.map +0 -1
  532. package/dist/chunks/tgaTextureLoader-BNBS-X4Q.esm.min.js +0 -2
  533. package/dist/chunks/tgaTextureLoader-BNBS-X4Q.esm.min.js.map +0 -1
  534. package/dist/chunks/tgaTextureLoader-D46YCUQ_.esm.js +0 -349
  535. package/dist/chunks/tgaTextureLoader-D46YCUQ_.esm.js.map +0 -1
  536. package/dist/chunks/thinInstanceMesh-DCh8MOoj.esm.min.js +0 -2
  537. package/dist/chunks/thinInstanceMesh-DCh8MOoj.esm.min.js.map +0 -1
  538. package/dist/chunks/thinInstanceMesh-DzFmk7SW.esm.js +0 -314
  539. package/dist/chunks/thinInstanceMesh-DzFmk7SW.esm.js.map +0 -1
  540. package/dist/chunks/vertexColorMixing-Bt0lYFpZ.esm.min.js +0 -2
  541. package/dist/chunks/vertexColorMixing-Bt0lYFpZ.esm.min.js.map +0 -1
  542. package/dist/chunks/vertexColorMixing-Ds7u6owR.esm.js +0 -528
  543. package/dist/chunks/vertexColorMixing-Ds7u6owR.esm.js.map +0 -1
  544. package/dist/chunks/webgpuEngine--HWPU_ZX.esm.js +0 -11169
  545. package/dist/chunks/webgpuEngine--HWPU_ZX.esm.js.map +0 -1
  546. package/dist/chunks/webgpuEngine-BwnxF0Zq.esm.min.js +0 -2
  547. package/dist/chunks/webgpuEngine-BwnxF0Zq.esm.min.js.map +0 -1
  548. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  549. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  550. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  551. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  552. package/lib/index.d.ts +0 -281
  553. package/lib/index.js +0 -965
  554. package/lib/index.js.map +0 -1
@@ -1,1213 +0,0 @@
1
- import { n as PrecisionDate, T as ThinEngine, C as Constants, A as AbstractEngine, o as IsWindowObjectExist, p as IsDocumentAvailable, E as EngineStore } from './index-H9RbNFln.esm.js';
2
-
3
- /**
4
- * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
5
- */
6
- class PerformanceMonitor {
7
- /**
8
- * constructor
9
- * @param frameSampleSize The number of samples required to saturate the sliding window
10
- */
11
- constructor(frameSampleSize = 30) {
12
- this._enabled = true;
13
- this._rollingFrameTime = new RollingAverage(frameSampleSize);
14
- }
15
- /**
16
- * Samples current frame
17
- * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames
18
- */
19
- sampleFrame(timeMs = PrecisionDate.Now) {
20
- if (!this._enabled) {
21
- return;
22
- }
23
- if (this._lastFrameTimeMs != null) {
24
- const dt = timeMs - this._lastFrameTimeMs;
25
- this._rollingFrameTime.add(dt);
26
- }
27
- this._lastFrameTimeMs = timeMs;
28
- }
29
- /**
30
- * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
31
- */
32
- get averageFrameTime() {
33
- return this._rollingFrameTime.average;
34
- }
35
- /**
36
- * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
37
- */
38
- get averageFrameTimeVariance() {
39
- return this._rollingFrameTime.variance;
40
- }
41
- /**
42
- * Returns the frame time of the most recent frame
43
- */
44
- get instantaneousFrameTime() {
45
- return this._rollingFrameTime.history(0);
46
- }
47
- /**
48
- * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
49
- */
50
- get averageFPS() {
51
- return 1000.0 / this._rollingFrameTime.average;
52
- }
53
- /**
54
- * Returns the average framerate in frames per second using the most recent frame time
55
- */
56
- get instantaneousFPS() {
57
- const history = this._rollingFrameTime.history(0);
58
- if (history === 0) {
59
- return 0;
60
- }
61
- return 1000.0 / history;
62
- }
63
- /**
64
- * Returns true if enough samples have been taken to completely fill the sliding window
65
- */
66
- get isSaturated() {
67
- return this._rollingFrameTime.isSaturated();
68
- }
69
- /**
70
- * Enables contributions to the sliding window sample set
71
- */
72
- enable() {
73
- this._enabled = true;
74
- }
75
- /**
76
- * Disables contributions to the sliding window sample set
77
- * Samples will not be interpolated over the disabled period
78
- */
79
- disable() {
80
- this._enabled = false;
81
- //clear last sample to avoid interpolating over the disabled period when next enabled
82
- this._lastFrameTimeMs = null;
83
- }
84
- /**
85
- * Returns true if sampling is enabled
86
- */
87
- get isEnabled() {
88
- return this._enabled;
89
- }
90
- /**
91
- * Resets performance monitor
92
- */
93
- reset() {
94
- //clear last sample to avoid interpolating over the disabled period when next enabled
95
- this._lastFrameTimeMs = null;
96
- //wipe record
97
- this._rollingFrameTime.reset();
98
- }
99
- }
100
- /**
101
- * RollingAverage
102
- *
103
- * Utility to efficiently compute the rolling average and variance over a sliding window of samples
104
- */
105
- class RollingAverage {
106
- /**
107
- * constructor
108
- * @param length The number of samples required to saturate the sliding window
109
- */
110
- constructor(length) {
111
- this._samples = new Array(length);
112
- this.reset();
113
- }
114
- /**
115
- * Adds a sample to the sample set
116
- * @param v The sample value
117
- */
118
- add(v) {
119
- //http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
120
- let delta;
121
- //we need to check if we've already wrapped round
122
- if (this.isSaturated()) {
123
- //remove bottom of stack from mean
124
- const bottomValue = this._samples[this._pos];
125
- delta = bottomValue - this.average;
126
- this.average -= delta / (this._sampleCount - 1);
127
- this._m2 -= delta * (bottomValue - this.average);
128
- }
129
- else {
130
- this._sampleCount++;
131
- }
132
- //add new value to mean
133
- delta = v - this.average;
134
- this.average += delta / this._sampleCount;
135
- this._m2 += delta * (v - this.average);
136
- //set the new variance
137
- this.variance = this._m2 / (this._sampleCount - 1);
138
- this._samples[this._pos] = v;
139
- this._pos++;
140
- this._pos %= this._samples.length; //positive wrap around
141
- }
142
- /**
143
- * Returns previously added values or null if outside of history or outside the sliding window domain
144
- * @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that
145
- * @returns Value previously recorded with add() or null if outside of range
146
- */
147
- history(i) {
148
- if (i >= this._sampleCount || i >= this._samples.length) {
149
- return 0;
150
- }
151
- const i0 = this._wrapPosition(this._pos - 1.0);
152
- return this._samples[this._wrapPosition(i0 - i)];
153
- }
154
- /**
155
- * Returns true if enough samples have been taken to completely fill the sliding window
156
- * @returns true if sample-set saturated
157
- */
158
- isSaturated() {
159
- return this._sampleCount >= this._samples.length;
160
- }
161
- /**
162
- * Resets the rolling average (equivalent to 0 samples taken so far)
163
- */
164
- reset() {
165
- this.average = 0;
166
- this.variance = 0;
167
- this._sampleCount = 0;
168
- this._pos = 0;
169
- this._m2 = 0;
170
- }
171
- /**
172
- * Wraps a value around the sample range boundaries
173
- * @param i Position in sample range, for example if the sample length is 5, and i is -3, then 2 will be returned.
174
- * @returns Wrapped position in sample range
175
- */
176
- _wrapPosition(i) {
177
- const max = this._samples.length;
178
- return ((i % max) + max) % max;
179
- }
180
- }
181
-
182
- /**
183
- * Allocate a typed array depending on a texture type. Optionally can copy existing data in the buffer.
184
- * @param type type of the texture
185
- * @param sizeOrDstBuffer size of the array OR an existing buffer that will be used as the destination of the copy (if copyBuffer is provided)
186
- * @param sizeInBytes true if the size of the array is given in bytes, false if it is the number of elements of the array
187
- * @param copyBuffer if provided, buffer to copy into the destination buffer (either a newly allocated buffer if sizeOrDstBuffer is a number or use sizeOrDstBuffer as the destination buffer otherwise)
188
- * @returns the allocated buffer or sizeOrDstBuffer if the latter is an ArrayBuffer
189
- */
190
- function allocateAndCopyTypedBuffer(type, sizeOrDstBuffer, sizeInBytes = false, copyBuffer) {
191
- switch (type) {
192
- case Constants.TEXTURETYPE_BYTE: {
193
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int8Array(sizeOrDstBuffer) : new Int8Array(sizeOrDstBuffer);
194
- if (copyBuffer) {
195
- buffer.set(new Int8Array(copyBuffer));
196
- }
197
- return buffer;
198
- }
199
- case Constants.TEXTURETYPE_UNSIGNED_BYTE: {
200
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);
201
- if (copyBuffer) {
202
- buffer.set(new Uint8Array(copyBuffer));
203
- }
204
- return buffer;
205
- }
206
- case Constants.TEXTURETYPE_SHORT: {
207
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int16Array(sizeOrDstBuffer) : new Int16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);
208
- if (copyBuffer) {
209
- buffer.set(new Int16Array(copyBuffer));
210
- }
211
- return buffer;
212
- }
213
- case Constants.TEXTURETYPE_UNSIGNED_SHORT:
214
- case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:
215
- case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:
216
- case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:
217
- case Constants.TEXTURETYPE_HALF_FLOAT: {
218
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint16Array(sizeOrDstBuffer) : new Uint16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);
219
- if (copyBuffer) {
220
- buffer.set(new Uint16Array(copyBuffer));
221
- }
222
- return buffer;
223
- }
224
- case Constants.TEXTURETYPE_INT: {
225
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int32Array(sizeOrDstBuffer) : new Int32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
226
- if (copyBuffer) {
227
- buffer.set(new Int32Array(copyBuffer));
228
- }
229
- return buffer;
230
- }
231
- case Constants.TEXTURETYPE_UNSIGNED_INTEGER:
232
- case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:
233
- case Constants.TEXTURETYPE_UNSIGNED_INT_24_8:
234
- case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:
235
- case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:
236
- case Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV: {
237
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint32Array(sizeOrDstBuffer) : new Uint32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
238
- if (copyBuffer) {
239
- buffer.set(new Uint32Array(copyBuffer));
240
- }
241
- return buffer;
242
- }
243
- case Constants.TEXTURETYPE_FLOAT: {
244
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Float32Array(sizeOrDstBuffer) : new Float32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
245
- if (copyBuffer) {
246
- buffer.set(new Float32Array(copyBuffer));
247
- }
248
- return buffer;
249
- }
250
- }
251
- const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);
252
- if (copyBuffer) {
253
- buffer.set(new Uint8Array(copyBuffer));
254
- }
255
- return buffer;
256
- }
257
- ThinEngine.prototype._readTexturePixelsSync = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {
258
- const gl = this._gl;
259
- if (!gl) {
260
- throw new Error("Engine does not have gl rendering context.");
261
- }
262
- if (!this._dummyFramebuffer) {
263
- const dummy = gl.createFramebuffer();
264
- if (!dummy) {
265
- throw new Error("Unable to create dummy framebuffer");
266
- }
267
- this._dummyFramebuffer = dummy;
268
- }
269
- gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer);
270
- if (faceIndex > -1) {
271
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, texture._hardwareTexture?.underlyingResource, level);
272
- }
273
- else {
274
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._hardwareTexture?.underlyingResource, level);
275
- }
276
- let readType = texture.type !== undefined ? this._getWebGLTextureType(texture.type) : gl.UNSIGNED_BYTE;
277
- if (!noDataConversion) {
278
- switch (readType) {
279
- case gl.UNSIGNED_BYTE:
280
- if (!buffer) {
281
- buffer = new Uint8Array(4 * width * height);
282
- }
283
- readType = gl.UNSIGNED_BYTE;
284
- break;
285
- default:
286
- if (!buffer) {
287
- buffer = new Float32Array(4 * width * height);
288
- }
289
- readType = gl.FLOAT;
290
- break;
291
- }
292
- }
293
- else if (!buffer) {
294
- buffer = allocateAndCopyTypedBuffer(texture.type, 4 * width * height);
295
- }
296
- if (flushRenderer) {
297
- this.flushFramebuffer();
298
- }
299
- gl.readPixels(x, y, width, height, gl.RGBA, readType, buffer);
300
- gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer);
301
- return buffer;
302
- };
303
- ThinEngine.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {
304
- return Promise.resolve(this._readTexturePixelsSync(texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y));
305
- };
306
-
307
- /**
308
- * Wrapper around a render target (either single or multi textures)
309
- */
310
- class RenderTargetWrapper {
311
- /**
312
- * Gets the depth/stencil texture (if created by a createDepthStencilTexture() call)
313
- */
314
- get depthStencilTexture() {
315
- return this._depthStencilTexture;
316
- }
317
- /**
318
- * Indicates if the depth/stencil texture has a stencil aspect
319
- */
320
- get depthStencilTextureWithStencil() {
321
- return this._depthStencilTextureWithStencil;
322
- }
323
- /**
324
- * Defines if the render target wrapper is for a cube texture or if false a 2d texture
325
- */
326
- get isCube() {
327
- return this._isCube;
328
- }
329
- /**
330
- * Defines if the render target wrapper is for a single or multi target render wrapper
331
- */
332
- get isMulti() {
333
- return this._isMulti;
334
- }
335
- /**
336
- * Defines if the render target wrapper is for a single or an array of textures
337
- */
338
- get is2DArray() {
339
- return this.layers > 0;
340
- }
341
- /**
342
- * Defines if the render target wrapper is for a 3D texture
343
- */
344
- get is3D() {
345
- return this.depth > 0;
346
- }
347
- /**
348
- * Gets the size of the render target wrapper (used for cubes, as width=height in this case)
349
- */
350
- get size() {
351
- return this.width;
352
- }
353
- /**
354
- * Gets the width of the render target wrapper
355
- */
356
- get width() {
357
- return this._size.width || this._size;
358
- }
359
- /**
360
- * Gets the height of the render target wrapper
361
- */
362
- get height() {
363
- return this._size.height || this._size;
364
- }
365
- /**
366
- * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)
367
- */
368
- get layers() {
369
- return this._size.layers || 0;
370
- }
371
- /**
372
- * Gets the depth of the render target wrapper (only used if is3D is true and wrapper is not a multi render target)
373
- */
374
- get depth() {
375
- return this._size.depth || 0;
376
- }
377
- /**
378
- * Gets the render texture. If this is a multi render target, gets the first texture
379
- */
380
- get texture() {
381
- return this._textures?.[0] ?? null;
382
- }
383
- /**
384
- * Gets the list of render textures. If we are not in a multi render target, the list will be null (use the texture getter instead)
385
- */
386
- get textures() {
387
- return this._textures;
388
- }
389
- /**
390
- * Gets the face indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
391
- */
392
- get faceIndices() {
393
- return this._faceIndices;
394
- }
395
- /**
396
- * Gets the layer indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
397
- */
398
- get layerIndices() {
399
- return this._layerIndices;
400
- }
401
- /**
402
- * Gets the sample count of the render target
403
- */
404
- get samples() {
405
- return this._samples;
406
- }
407
- /**
408
- * Sets the sample count of the render target
409
- * @param value sample count
410
- * @param initializeBuffers If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).
411
- * @param force true to force calling the update sample count engine function even if the current sample count is equal to value
412
- * @returns the sample count that has been set
413
- */
414
- setSamples(value, initializeBuffers = true, force = false) {
415
- if (this.samples === value && !force) {
416
- return value;
417
- }
418
- const result = this._isMulti
419
- ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, value, initializeBuffers)
420
- : this._engine.updateRenderTargetTextureSampleCount(this, value);
421
- this._samples = value;
422
- return result;
423
- }
424
- /**
425
- * Initializes the render target wrapper
426
- * @param isMulti true if the wrapper is a multi render target
427
- * @param isCube true if the wrapper should render to a cube texture
428
- * @param size size of the render target (width/height/layers)
429
- * @param engine engine used to create the render target
430
- * @param label defines the label to use for the wrapper (for debugging purpose only)
431
- */
432
- constructor(isMulti, isCube, size, engine, label) {
433
- this._textures = null;
434
- this._faceIndices = null;
435
- this._layerIndices = null;
436
- /** @internal */
437
- this._samples = 1;
438
- /** @internal */
439
- this._attachments = null;
440
- /** @internal */
441
- this._generateStencilBuffer = false;
442
- /** @internal */
443
- this._generateDepthBuffer = false;
444
- /** @internal */
445
- this._depthStencilTextureWithStencil = false;
446
- this._isMulti = isMulti;
447
- this._isCube = isCube;
448
- this._size = size;
449
- this._engine = engine;
450
- this._depthStencilTexture = null;
451
- this.label = label;
452
- }
453
- /**
454
- * Sets the render target texture(s)
455
- * @param textures texture(s) to set
456
- */
457
- setTextures(textures) {
458
- if (Array.isArray(textures)) {
459
- this._textures = textures;
460
- }
461
- else if (textures) {
462
- this._textures = [textures];
463
- }
464
- else {
465
- this._textures = null;
466
- }
467
- }
468
- /**
469
- * Set a texture in the textures array
470
- * @param texture The texture to set
471
- * @param index The index in the textures array to set
472
- * @param disposePrevious If this function should dispose the previous texture
473
- */
474
- setTexture(texture, index = 0, disposePrevious = true) {
475
- if (!this._textures) {
476
- this._textures = [];
477
- }
478
- if (this._textures[index] === texture) {
479
- return;
480
- }
481
- if (this._textures[index] && disposePrevious) {
482
- this._textures[index].dispose();
483
- }
484
- this._textures[index] = texture;
485
- }
486
- /**
487
- * Sets the layer and face indices of every render target texture bound to each color attachment
488
- * @param layers The layers of each texture to be set
489
- * @param faces The faces of each texture to be set
490
- */
491
- setLayerAndFaceIndices(layers, faces) {
492
- this._layerIndices = layers;
493
- this._faceIndices = faces;
494
- }
495
- /**
496
- * Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment
497
- * @param index The index of the texture in the textures array to modify
498
- * @param layer The layer of the texture to be set
499
- * @param face The face of the texture to be set
500
- */
501
- setLayerAndFaceIndex(index = 0, layer, face) {
502
- if (!this._layerIndices) {
503
- this._layerIndices = [];
504
- }
505
- if (!this._faceIndices) {
506
- this._faceIndices = [];
507
- }
508
- if (layer !== undefined && layer >= 0) {
509
- this._layerIndices[index] = layer;
510
- }
511
- if (face !== undefined && face >= 0) {
512
- this._faceIndices[index] = face;
513
- }
514
- }
515
- /**
516
- * Creates the depth/stencil texture
517
- * @param comparisonFunction Comparison function to use for the texture
518
- * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture
519
- * @param generateStencil Not used anymore. "format" will be used to determine if stencil should be created
520
- * @param samples sample count to use when creating the texture (default: 1)
521
- * @param format format of the depth texture (default: Constants.TEXTUREFORMAT_DEPTH32_FLOAT)
522
- * @param label defines the label to use for the texture (for debugging purpose only)
523
- * @returns the depth/stencil created texture
524
- */
525
- createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = Constants.TEXTUREFORMAT_DEPTH32_FLOAT, label) {
526
- this._depthStencilTexture?.dispose();
527
- this._depthStencilTextureWithStencil = generateStencil;
528
- this._depthStencilTextureLabel = label;
529
- this._depthStencilTexture = this._engine.createDepthStencilTexture(this._size, {
530
- bilinearFiltering,
531
- comparisonFunction,
532
- generateStencil,
533
- isCube: this._isCube,
534
- samples,
535
- depthTextureFormat: format,
536
- label,
537
- }, this);
538
- return this._depthStencilTexture;
539
- }
540
- /**
541
- * @deprecated Use shareDepth instead
542
- * @param renderTarget Destination renderTarget
543
- */
544
- _shareDepth(renderTarget) {
545
- this.shareDepth(renderTarget);
546
- }
547
- /**
548
- * Shares the depth buffer of this render target with another render target.
549
- * @param renderTarget Destination renderTarget
550
- */
551
- shareDepth(renderTarget) {
552
- if (this._depthStencilTexture) {
553
- if (renderTarget._depthStencilTexture) {
554
- renderTarget._depthStencilTexture.dispose();
555
- }
556
- renderTarget._depthStencilTexture = this._depthStencilTexture;
557
- renderTarget._depthStencilTextureWithStencil = this._depthStencilTextureWithStencil;
558
- this._depthStencilTexture.incrementReferences();
559
- }
560
- }
561
- /**
562
- * @internal
563
- */
564
- _swapAndDie(target) {
565
- if (this.texture) {
566
- this.texture._swapAndDie(target);
567
- }
568
- this._textures = null;
569
- this.dispose(true);
570
- }
571
- _cloneRenderTargetWrapper() {
572
- let rtw = null;
573
- if (this._isMulti) {
574
- const textureArray = this.textures;
575
- if (textureArray && textureArray.length > 0) {
576
- let generateDepthTexture = false;
577
- let textureCount = textureArray.length;
578
- let depthTextureFormat = -1;
579
- const lastTextureSource = textureArray[textureArray.length - 1]._source;
580
- if (lastTextureSource === 14 /* InternalTextureSource.Depth */ || lastTextureSource === 12 /* InternalTextureSource.DepthStencil */) {
581
- generateDepthTexture = true;
582
- depthTextureFormat = textureArray[textureArray.length - 1].format;
583
- textureCount--;
584
- }
585
- const samplingModes = [];
586
- const types = [];
587
- const formats = [];
588
- const targetTypes = [];
589
- const faceIndex = [];
590
- const layerIndex = [];
591
- const layerCounts = [];
592
- const internalTexture2Index = {};
593
- for (let i = 0; i < textureCount; ++i) {
594
- const texture = textureArray[i];
595
- samplingModes.push(texture.samplingMode);
596
- types.push(texture.type);
597
- formats.push(texture.format);
598
- const index = internalTexture2Index[texture.uniqueId];
599
- if (index !== undefined) {
600
- targetTypes.push(-1);
601
- layerCounts.push(0);
602
- }
603
- else {
604
- internalTexture2Index[texture.uniqueId] = i;
605
- if (texture.is2DArray) {
606
- targetTypes.push(Constants.TEXTURE_2D_ARRAY);
607
- layerCounts.push(texture.depth);
608
- }
609
- else if (texture.isCube) {
610
- targetTypes.push(Constants.TEXTURE_CUBE_MAP);
611
- layerCounts.push(0);
612
- } /*else if (texture.isCubeArray) {
613
- targetTypes.push(Constants.TEXTURE_CUBE_MAP_ARRAY);
614
- layerCounts.push(texture.depth);
615
- }*/
616
- else if (texture.is3D) {
617
- targetTypes.push(Constants.TEXTURE_3D);
618
- layerCounts.push(texture.depth);
619
- }
620
- else {
621
- targetTypes.push(Constants.TEXTURE_2D);
622
- layerCounts.push(0);
623
- }
624
- }
625
- if (this._faceIndices) {
626
- faceIndex.push(this._faceIndices[i] ?? 0);
627
- }
628
- if (this._layerIndices) {
629
- layerIndex.push(this._layerIndices[i] ?? 0);
630
- }
631
- }
632
- const optionsMRT = {
633
- samplingModes,
634
- generateMipMaps: textureArray[0].generateMipMaps,
635
- generateDepthBuffer: this._generateDepthBuffer,
636
- generateStencilBuffer: this._generateStencilBuffer,
637
- generateDepthTexture,
638
- depthTextureFormat,
639
- types,
640
- formats,
641
- textureCount,
642
- targetTypes,
643
- faceIndex,
644
- layerIndex,
645
- layerCounts,
646
- label: this.label,
647
- };
648
- const size = {
649
- width: this.width,
650
- height: this.height,
651
- depth: this.depth,
652
- };
653
- rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);
654
- for (let i = 0; i < textureCount; ++i) {
655
- if (targetTypes[i] !== -1) {
656
- continue;
657
- }
658
- const index = internalTexture2Index[textureArray[i].uniqueId];
659
- rtw.setTexture(rtw.textures[index], i);
660
- }
661
- }
662
- }
663
- else {
664
- const options = {};
665
- options.generateDepthBuffer = this._generateDepthBuffer;
666
- options.generateMipMaps = this.texture?.generateMipMaps ?? false;
667
- options.generateStencilBuffer = this._generateStencilBuffer;
668
- options.samplingMode = this.texture?.samplingMode;
669
- options.type = this.texture?.type;
670
- options.format = this.texture?.format;
671
- options.noColorAttachment = !this._textures;
672
- options.label = this.label;
673
- if (this.isCube) {
674
- rtw = this._engine.createRenderTargetCubeTexture(this.width, options);
675
- }
676
- else {
677
- const size = {
678
- width: this.width,
679
- height: this.height,
680
- layers: this.is2DArray || this.is3D ? this.texture?.depth : undefined,
681
- };
682
- rtw = this._engine.createRenderTargetTexture(size, options);
683
- }
684
- if (rtw.texture) {
685
- rtw.texture.isReady = true;
686
- }
687
- }
688
- return rtw;
689
- }
690
- _swapRenderTargetWrapper(target) {
691
- if (this._textures && target._textures) {
692
- for (let i = 0; i < this._textures.length; ++i) {
693
- this._textures[i]._swapAndDie(target._textures[i], false);
694
- target._textures[i].isReady = true;
695
- }
696
- }
697
- if (this._depthStencilTexture && target._depthStencilTexture) {
698
- this._depthStencilTexture._swapAndDie(target._depthStencilTexture);
699
- target._depthStencilTexture.isReady = true;
700
- }
701
- this._textures = null;
702
- this._depthStencilTexture = null;
703
- }
704
- /** @internal */
705
- _rebuild() {
706
- const rtw = this._cloneRenderTargetWrapper();
707
- if (!rtw) {
708
- return;
709
- }
710
- if (this._depthStencilTexture) {
711
- const samplingMode = this._depthStencilTexture.samplingMode;
712
- const format = this._depthStencilTexture.format;
713
- const bilinear = samplingMode === Constants.TEXTURE_BILINEAR_SAMPLINGMODE ||
714
- samplingMode === Constants.TEXTURE_TRILINEAR_SAMPLINGMODE ||
715
- samplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;
716
- rtw.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction, bilinear, this._depthStencilTextureWithStencil, this._depthStencilTexture.samples, format, this._depthStencilTextureLabel);
717
- }
718
- if (this.samples > 1) {
719
- rtw.setSamples(this.samples);
720
- }
721
- rtw._swapRenderTargetWrapper(this);
722
- rtw.dispose();
723
- }
724
- /**
725
- * Releases the internal render textures
726
- */
727
- releaseTextures() {
728
- if (this._textures) {
729
- for (let i = 0; i < this._textures?.length ?? 0; ++i) {
730
- this._textures[i].dispose();
731
- }
732
- }
733
- this._textures = null;
734
- }
735
- /**
736
- * Disposes the whole render target wrapper
737
- * @param disposeOnlyFramebuffers true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released
738
- */
739
- dispose(disposeOnlyFramebuffers = false) {
740
- if (!disposeOnlyFramebuffers) {
741
- this._depthStencilTexture?.dispose();
742
- this._depthStencilTexture = null;
743
- this.releaseTextures();
744
- }
745
- this._engine._releaseRenderTargetWrapper(this);
746
- }
747
- }
748
-
749
- AbstractEngine.prototype.createDepthStencilTexture = function (size, options, rtWrapper) {
750
- if (options.isCube) {
751
- const width = size.width || size;
752
- return this._createDepthStencilCubeTexture(width, options);
753
- }
754
- else {
755
- return this._createDepthStencilTexture(size, options, rtWrapper);
756
- }
757
- };
758
-
759
- AbstractEngine.prototype.displayLoadingUI = function () {
760
- if (!IsWindowObjectExist()) {
761
- return;
762
- }
763
- const loadingScreen = this.loadingScreen;
764
- if (loadingScreen) {
765
- loadingScreen.displayLoadingUI();
766
- }
767
- };
768
- AbstractEngine.prototype.hideLoadingUI = function () {
769
- if (!IsWindowObjectExist()) {
770
- return;
771
- }
772
- const loadingScreen = this._loadingScreen;
773
- if (loadingScreen) {
774
- loadingScreen.hideLoadingUI();
775
- }
776
- };
777
- Object.defineProperty(AbstractEngine.prototype, "loadingScreen", {
778
- get: function () {
779
- if (!this._loadingScreen && this._renderingCanvas) {
780
- this._loadingScreen = AbstractEngine.DefaultLoadingScreenFactory(this._renderingCanvas);
781
- }
782
- return this._loadingScreen;
783
- },
784
- set: function (value) {
785
- this._loadingScreen = value;
786
- },
787
- enumerable: true,
788
- configurable: true,
789
- });
790
- Object.defineProperty(AbstractEngine.prototype, "loadingUIText", {
791
- set: function (value) {
792
- this.loadingScreen.loadingUIText = value;
793
- },
794
- enumerable: true,
795
- configurable: true,
796
- });
797
- Object.defineProperty(AbstractEngine.prototype, "loadingUIBackgroundColor", {
798
- set: function (value) {
799
- this.loadingScreen.loadingUIBackgroundColor = value;
800
- },
801
- enumerable: true,
802
- configurable: true,
803
- });
804
-
805
- AbstractEngine.prototype.getInputElement = function () {
806
- return this._renderingCanvas;
807
- };
808
- AbstractEngine.prototype.getRenderingCanvasClientRect = function () {
809
- if (!this._renderingCanvas) {
810
- return null;
811
- }
812
- return this._renderingCanvas.getBoundingClientRect();
813
- };
814
- AbstractEngine.prototype.getInputElementClientRect = function () {
815
- if (!this._renderingCanvas) {
816
- return null;
817
- }
818
- return this.getInputElement().getBoundingClientRect();
819
- };
820
- AbstractEngine.prototype.getAspectRatio = function (viewportOwner, useScreen = false) {
821
- const viewport = viewportOwner.viewport;
822
- return (this.getRenderWidth(useScreen) * viewport.width) / (this.getRenderHeight(useScreen) * viewport.height);
823
- };
824
- AbstractEngine.prototype.getScreenAspectRatio = function () {
825
- return this.getRenderWidth(true) / this.getRenderHeight(true);
826
- };
827
- AbstractEngine.prototype._verifyPointerLock = function () {
828
- this._onPointerLockChange?.();
829
- };
830
-
831
- AbstractEngine.prototype.setAlphaEquation = function (equation) {
832
- if (this._alphaEquation === equation) {
833
- return;
834
- }
835
- switch (equation) {
836
- case Constants.ALPHA_EQUATION_ADD:
837
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_ADD, Constants.GL_ALPHA_EQUATION_ADD);
838
- break;
839
- case Constants.ALPHA_EQUATION_SUBSTRACT:
840
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_SUBTRACT, Constants.GL_ALPHA_EQUATION_SUBTRACT);
841
- break;
842
- case Constants.ALPHA_EQUATION_REVERSE_SUBTRACT:
843
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT, Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT);
844
- break;
845
- case Constants.ALPHA_EQUATION_MAX:
846
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_MAX, Constants.GL_ALPHA_EQUATION_MAX);
847
- break;
848
- case Constants.ALPHA_EQUATION_MIN:
849
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_MIN, Constants.GL_ALPHA_EQUATION_MIN);
850
- break;
851
- case Constants.ALPHA_EQUATION_DARKEN:
852
- this._alphaState.setAlphaEquationParameters(Constants.GL_ALPHA_EQUATION_MIN, Constants.GL_ALPHA_EQUATION_ADD);
853
- break;
854
- }
855
- this._alphaEquation = equation;
856
- };
857
-
858
- AbstractEngine.prototype.getInputElement = function () {
859
- return this._renderingCanvas;
860
- };
861
- AbstractEngine.prototype.getDepthFunction = function () {
862
- return this._depthCullingState.depthFunc;
863
- };
864
- AbstractEngine.prototype.setDepthFunction = function (depthFunc) {
865
- this._depthCullingState.depthFunc = depthFunc;
866
- };
867
- AbstractEngine.prototype.setDepthFunctionToGreater = function () {
868
- this.setDepthFunction(Constants.GREATER);
869
- };
870
- AbstractEngine.prototype.setDepthFunctionToGreaterOrEqual = function () {
871
- this.setDepthFunction(Constants.GEQUAL);
872
- };
873
- AbstractEngine.prototype.setDepthFunctionToLess = function () {
874
- this.setDepthFunction(Constants.LESS);
875
- };
876
- AbstractEngine.prototype.setDepthFunctionToLessOrEqual = function () {
877
- this.setDepthFunction(Constants.LEQUAL);
878
- };
879
- AbstractEngine.prototype.getDepthWrite = function () {
880
- return this._depthCullingState.depthMask;
881
- };
882
- AbstractEngine.prototype.setDepthWrite = function (enable) {
883
- this._depthCullingState.depthMask = enable;
884
- };
885
- AbstractEngine.prototype.getStencilBuffer = function () {
886
- return this._stencilState.stencilTest;
887
- };
888
- AbstractEngine.prototype.setStencilBuffer = function (enable) {
889
- this._stencilState.stencilTest = enable;
890
- };
891
- AbstractEngine.prototype.getStencilMask = function () {
892
- return this._stencilState.stencilMask;
893
- };
894
- AbstractEngine.prototype.setStencilMask = function (mask) {
895
- this._stencilState.stencilMask = mask;
896
- };
897
- AbstractEngine.prototype.getStencilFunction = function () {
898
- return this._stencilState.stencilFunc;
899
- };
900
- AbstractEngine.prototype.getStencilFunctionReference = function () {
901
- return this._stencilState.stencilFuncRef;
902
- };
903
- AbstractEngine.prototype.getStencilFunctionMask = function () {
904
- return this._stencilState.stencilFuncMask;
905
- };
906
- AbstractEngine.prototype.setStencilFunction = function (stencilFunc) {
907
- this._stencilState.stencilFunc = stencilFunc;
908
- };
909
- AbstractEngine.prototype.setStencilFunctionReference = function (reference) {
910
- this._stencilState.stencilFuncRef = reference;
911
- };
912
- AbstractEngine.prototype.setStencilFunctionMask = function (mask) {
913
- this._stencilState.stencilFuncMask = mask;
914
- };
915
- AbstractEngine.prototype.getStencilOperationFail = function () {
916
- return this._stencilState.stencilOpStencilFail;
917
- };
918
- AbstractEngine.prototype.getStencilOperationDepthFail = function () {
919
- return this._stencilState.stencilOpDepthFail;
920
- };
921
- AbstractEngine.prototype.getStencilOperationPass = function () {
922
- return this._stencilState.stencilOpStencilDepthPass;
923
- };
924
- AbstractEngine.prototype.setStencilOperationFail = function (operation) {
925
- this._stencilState.stencilOpStencilFail = operation;
926
- };
927
- AbstractEngine.prototype.setStencilOperationDepthFail = function (operation) {
928
- this._stencilState.stencilOpDepthFail = operation;
929
- };
930
- AbstractEngine.prototype.setStencilOperationPass = function (operation) {
931
- this._stencilState.stencilOpStencilDepthPass = operation;
932
- };
933
- AbstractEngine.prototype.cacheStencilState = function () {
934
- this._cachedStencilBuffer = this.getStencilBuffer();
935
- this._cachedStencilFunction = this.getStencilFunction();
936
- this._cachedStencilMask = this.getStencilMask();
937
- this._cachedStencilOperationPass = this.getStencilOperationPass();
938
- this._cachedStencilOperationFail = this.getStencilOperationFail();
939
- this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
940
- this._cachedStencilReference = this.getStencilFunctionReference();
941
- };
942
- AbstractEngine.prototype.restoreStencilState = function () {
943
- this.setStencilFunction(this._cachedStencilFunction);
944
- this.setStencilMask(this._cachedStencilMask);
945
- this.setStencilBuffer(this._cachedStencilBuffer);
946
- this.setStencilOperationPass(this._cachedStencilOperationPass);
947
- this.setStencilOperationFail(this._cachedStencilOperationFail);
948
- this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
949
- this.setStencilFunctionReference(this._cachedStencilReference);
950
- };
951
- AbstractEngine.prototype.setAlphaConstants = function (r, g, b, a) {
952
- this._alphaState.setAlphaBlendConstants(r, g, b, a);
953
- };
954
- AbstractEngine.prototype.getAlphaMode = function () {
955
- return this._alphaMode;
956
- };
957
- AbstractEngine.prototype.getAlphaEquation = function () {
958
- return this._alphaEquation;
959
- };
960
-
961
- AbstractEngine.prototype.getRenderPassNames = function () {
962
- return this._renderPassNames;
963
- };
964
- AbstractEngine.prototype.getCurrentRenderPassName = function () {
965
- return this._renderPassNames[this.currentRenderPassId];
966
- };
967
- AbstractEngine.prototype.createRenderPassId = function (name) {
968
- // Note: render pass id == 0 is always for the main render pass
969
- const id = ++AbstractEngine._RenderPassIdCounter;
970
- this._renderPassNames[id] = name ?? "NONAME";
971
- return id;
972
- };
973
- AbstractEngine.prototype.releaseRenderPassId = function (id) {
974
- this._renderPassNames[id] = undefined;
975
- for (let s = 0; s < this.scenes.length; ++s) {
976
- const scene = this.scenes[s];
977
- for (let m = 0; m < scene.meshes.length; ++m) {
978
- const mesh = scene.meshes[m];
979
- if (mesh.subMeshes) {
980
- for (let b = 0; b < mesh.subMeshes.length; ++b) {
981
- const subMesh = mesh.subMeshes[b];
982
- subMesh._removeDrawWrapper(id);
983
- }
984
- }
985
- }
986
- }
987
- };
988
-
989
- /** @internal */
990
- function _DisableTouchAction(canvas) {
991
- if (!canvas || !canvas.setAttribute) {
992
- return;
993
- }
994
- canvas.setAttribute("touch-action", "none");
995
- canvas.style.touchAction = "none";
996
- canvas.style.webkitTapHighlightColor = "transparent";
997
- }
998
- /** @internal */
999
- function _CommonInit(commonEngine, canvas, creationOptions) {
1000
- commonEngine._onCanvasFocus = () => {
1001
- commonEngine.onCanvasFocusObservable.notifyObservers(commonEngine);
1002
- };
1003
- commonEngine._onCanvasBlur = () => {
1004
- commonEngine.onCanvasBlurObservable.notifyObservers(commonEngine);
1005
- };
1006
- commonEngine._onCanvasContextMenu = (evt) => {
1007
- if (commonEngine.disableContextMenu) {
1008
- evt.preventDefault();
1009
- }
1010
- };
1011
- canvas.addEventListener("focus", commonEngine._onCanvasFocus);
1012
- canvas.addEventListener("blur", commonEngine._onCanvasBlur);
1013
- canvas.addEventListener("contextmenu", commonEngine._onCanvasContextMenu);
1014
- commonEngine._onBlur = () => {
1015
- if (commonEngine.disablePerformanceMonitorInBackground) {
1016
- commonEngine.performanceMonitor.disable();
1017
- }
1018
- commonEngine._windowIsBackground = true;
1019
- };
1020
- commonEngine._onFocus = () => {
1021
- if (commonEngine.disablePerformanceMonitorInBackground) {
1022
- commonEngine.performanceMonitor.enable();
1023
- }
1024
- commonEngine._windowIsBackground = false;
1025
- };
1026
- commonEngine._onCanvasPointerOut = (ev) => {
1027
- // Check that the element at the point of the pointer out isn't the canvas and if it isn't, notify observers
1028
- // Note: This is a workaround for a bug with Safari
1029
- if (document.elementFromPoint(ev.clientX, ev.clientY) !== canvas) {
1030
- commonEngine.onCanvasPointerOutObservable.notifyObservers(ev);
1031
- }
1032
- };
1033
- const hostWindow = commonEngine.getHostWindow(); // it calls IsWindowObjectExist()
1034
- if (hostWindow && typeof hostWindow.addEventListener === "function") {
1035
- hostWindow.addEventListener("blur", commonEngine._onBlur);
1036
- hostWindow.addEventListener("focus", commonEngine._onFocus);
1037
- }
1038
- canvas.addEventListener("pointerout", commonEngine._onCanvasPointerOut);
1039
- if (!creationOptions.doNotHandleTouchAction) {
1040
- _DisableTouchAction(canvas);
1041
- }
1042
- // Create Audio Engine if needed.
1043
- if (!AbstractEngine.audioEngine && creationOptions.audioEngine && AbstractEngine.AudioEngineFactory) {
1044
- AbstractEngine.audioEngine = AbstractEngine.AudioEngineFactory(commonEngine.getRenderingCanvas(), commonEngine.getAudioContext(), commonEngine.getAudioDestination());
1045
- }
1046
- if (IsDocumentAvailable()) {
1047
- // Fullscreen
1048
- commonEngine._onFullscreenChange = () => {
1049
- commonEngine.isFullscreen = !!document.fullscreenElement;
1050
- // Pointer lock
1051
- if (commonEngine.isFullscreen && commonEngine._pointerLockRequested && canvas) {
1052
- RequestPointerlock(canvas);
1053
- }
1054
- };
1055
- document.addEventListener("fullscreenchange", commonEngine._onFullscreenChange, false);
1056
- document.addEventListener("webkitfullscreenchange", commonEngine._onFullscreenChange, false);
1057
- // Pointer lock
1058
- commonEngine._onPointerLockChange = () => {
1059
- commonEngine.isPointerLock = document.pointerLockElement === canvas;
1060
- };
1061
- document.addEventListener("pointerlockchange", commonEngine._onPointerLockChange, false);
1062
- document.addEventListener("webkitpointerlockchange", commonEngine._onPointerLockChange, false);
1063
- }
1064
- commonEngine.enableOfflineSupport = AbstractEngine.OfflineProviderFactory !== undefined;
1065
- commonEngine._deterministicLockstep = !!creationOptions.deterministicLockstep;
1066
- commonEngine._lockstepMaxSteps = creationOptions.lockstepMaxSteps || 0;
1067
- commonEngine._timeStep = creationOptions.timeStep || 1 / 60;
1068
- }
1069
- /** @internal */
1070
- function _CommonDispose(commonEngine, canvas) {
1071
- // Release audio engine
1072
- if (EngineStore.Instances.length === 1 && AbstractEngine.audioEngine) {
1073
- AbstractEngine.audioEngine.dispose();
1074
- AbstractEngine.audioEngine = null;
1075
- }
1076
- // Events
1077
- const hostWindow = commonEngine.getHostWindow(); // it calls IsWindowObjectExist()
1078
- if (hostWindow && typeof hostWindow.removeEventListener === "function") {
1079
- hostWindow.removeEventListener("blur", commonEngine._onBlur);
1080
- hostWindow.removeEventListener("focus", commonEngine._onFocus);
1081
- }
1082
- if (canvas) {
1083
- canvas.removeEventListener("focus", commonEngine._onCanvasFocus);
1084
- canvas.removeEventListener("blur", commonEngine._onCanvasBlur);
1085
- canvas.removeEventListener("pointerout", commonEngine._onCanvasPointerOut);
1086
- canvas.removeEventListener("contextmenu", commonEngine._onCanvasContextMenu);
1087
- }
1088
- if (IsDocumentAvailable()) {
1089
- document.removeEventListener("fullscreenchange", commonEngine._onFullscreenChange);
1090
- document.removeEventListener("mozfullscreenchange", commonEngine._onFullscreenChange);
1091
- document.removeEventListener("webkitfullscreenchange", commonEngine._onFullscreenChange);
1092
- document.removeEventListener("msfullscreenchange", commonEngine._onFullscreenChange);
1093
- document.removeEventListener("pointerlockchange", commonEngine._onPointerLockChange);
1094
- document.removeEventListener("mspointerlockchange", commonEngine._onPointerLockChange);
1095
- document.removeEventListener("mozpointerlockchange", commonEngine._onPointerLockChange);
1096
- document.removeEventListener("webkitpointerlockchange", commonEngine._onPointerLockChange);
1097
- }
1098
- }
1099
- /**
1100
- * Get Font size information
1101
- * @param font font name
1102
- * @returns an object containing ascent, height and descent
1103
- */
1104
- function GetFontOffset(font) {
1105
- const text = document.createElement("span");
1106
- text.textContent = "Hg";
1107
- text.style.font = font;
1108
- const block = document.createElement("div");
1109
- block.style.display = "inline-block";
1110
- block.style.width = "1px";
1111
- block.style.height = "0px";
1112
- block.style.verticalAlign = "bottom";
1113
- const div = document.createElement("div");
1114
- div.style.whiteSpace = "nowrap";
1115
- div.appendChild(text);
1116
- div.appendChild(block);
1117
- document.body.appendChild(div);
1118
- let fontAscent = 0;
1119
- let fontHeight = 0;
1120
- try {
1121
- fontHeight = block.getBoundingClientRect().top - text.getBoundingClientRect().top;
1122
- block.style.verticalAlign = "baseline";
1123
- fontAscent = block.getBoundingClientRect().top - text.getBoundingClientRect().top;
1124
- }
1125
- finally {
1126
- document.body.removeChild(div);
1127
- }
1128
- return { ascent: fontAscent, height: fontHeight, descent: fontHeight - fontAscent };
1129
- }
1130
- /** @internal */
1131
- function CreateImageBitmapFromSource(engine, imageSource, options) {
1132
- const promise = new Promise((resolve, reject) => {
1133
- const image = new Image();
1134
- image.onload = () => {
1135
- image.decode().then(() => {
1136
- engine.createImageBitmap(image, options).then((imageBitmap) => {
1137
- resolve(imageBitmap);
1138
- });
1139
- });
1140
- };
1141
- image.onerror = () => {
1142
- reject(`Error loading image ${image.src}`);
1143
- };
1144
- image.src = imageSource;
1145
- });
1146
- return promise;
1147
- }
1148
- /** @internal */
1149
- function ResizeImageBitmap(engine, image, bufferWidth, bufferHeight) {
1150
- const canvas = engine.createCanvas(bufferWidth, bufferHeight);
1151
- const context = canvas.getContext("2d");
1152
- if (!context) {
1153
- throw new Error("Unable to get 2d context for resizeImageBitmap");
1154
- }
1155
- context.drawImage(image, 0, 0);
1156
- // Create VertexData from map data
1157
- // Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949
1158
- const buffer = context.getImageData(0, 0, bufferWidth, bufferHeight).data;
1159
- return buffer;
1160
- }
1161
- /**
1162
- * Ask the browser to promote the current element to fullscreen rendering mode
1163
- * @param element defines the DOM element to promote
1164
- */
1165
- function RequestFullscreen(element) {
1166
- const requestFunction = element.requestFullscreen || element.webkitRequestFullscreen;
1167
- if (!requestFunction) {
1168
- return;
1169
- }
1170
- requestFunction.call(element);
1171
- }
1172
- /**
1173
- * Asks the browser to exit fullscreen mode
1174
- */
1175
- function ExitFullscreen() {
1176
- const anyDoc = document;
1177
- if (document.exitFullscreen) {
1178
- document.exitFullscreen();
1179
- }
1180
- else if (anyDoc.webkitCancelFullScreen) {
1181
- anyDoc.webkitCancelFullScreen();
1182
- }
1183
- }
1184
- /**
1185
- * Ask the browser to promote the current element to pointerlock mode
1186
- * @param element defines the DOM element to promote
1187
- */
1188
- function RequestPointerlock(element) {
1189
- if (element.requestPointerLock) {
1190
- // In some browsers, requestPointerLock returns a promise.
1191
- // Handle possible rejections to avoid an unhandled top-level exception.
1192
- const promise = element.requestPointerLock();
1193
- if (promise instanceof Promise)
1194
- promise
1195
- .then(() => {
1196
- element.focus();
1197
- })
1198
- .catch(() => { });
1199
- else
1200
- element.focus();
1201
- }
1202
- }
1203
- /**
1204
- * Asks the browser to exit pointerlock mode
1205
- */
1206
- function ExitPointerlock() {
1207
- if (document.exitPointerLock) {
1208
- document.exitPointerLock();
1209
- }
1210
- }
1211
-
1212
- export { CreateImageBitmapFromSource as C, ExitFullscreen as E, GetFontOffset as G, PerformanceMonitor as P, RenderTargetWrapper as R, _CommonInit as _, ResizeImageBitmap as a, RequestFullscreen as b, RequestPointerlock as c, ExitPointerlock as d, _CommonDispose as e, allocateAndCopyTypedBuffer as f };
1213
- //# sourceMappingURL=engine.common-BrXEBOzm.esm.js.map