@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,122 +0,0 @@
1
- /**
2
- * Helper class to push actions to a pool of workers.
3
- */
4
- class WorkerPool {
5
- /**
6
- * Constructor
7
- * @param workers Array of workers to use for actions
8
- */
9
- constructor(workers) {
10
- this._pendingActions = new Array();
11
- this._workerInfos = workers.map((worker) => ({
12
- workerPromise: Promise.resolve(worker),
13
- idle: true,
14
- }));
15
- }
16
- /**
17
- * Terminates all workers and clears any pending actions.
18
- */
19
- dispose() {
20
- for (const workerInfo of this._workerInfos) {
21
- workerInfo.workerPromise.then((worker) => {
22
- worker.terminate();
23
- });
24
- }
25
- this._workerInfos.length = 0;
26
- this._pendingActions.length = 0;
27
- }
28
- /**
29
- * Pushes an action to the worker pool. If all the workers are active, the action will be
30
- * pended until a worker has completed its action.
31
- * @param action The action to perform. Call onComplete when the action is complete.
32
- */
33
- push(action) {
34
- if (!this._executeOnIdleWorker(action)) {
35
- this._pendingActions.push(action);
36
- }
37
- }
38
- _executeOnIdleWorker(action) {
39
- for (const workerInfo of this._workerInfos) {
40
- if (workerInfo.idle) {
41
- this._execute(workerInfo, action);
42
- return true;
43
- }
44
- }
45
- return false;
46
- }
47
- _execute(workerInfo, action) {
48
- workerInfo.idle = false;
49
- workerInfo.workerPromise.then((worker) => {
50
- action(worker, () => {
51
- const nextAction = this._pendingActions.shift();
52
- if (nextAction) {
53
- this._execute(workerInfo, nextAction);
54
- }
55
- else {
56
- workerInfo.idle = true;
57
- }
58
- });
59
- });
60
- }
61
- }
62
- /**
63
- * Similar to the WorkerPool class except it creates and destroys workers automatically with a maximum of `maxWorkers` workers.
64
- * Workers are terminated when it is idle for at least `idleTimeElapsedBeforeRelease` milliseconds.
65
- */
66
- class AutoReleaseWorkerPool extends WorkerPool {
67
- constructor(maxWorkers, createWorkerAsync, options = AutoReleaseWorkerPool.DefaultOptions) {
68
- super([]);
69
- this._maxWorkers = maxWorkers;
70
- this._createWorkerAsync = createWorkerAsync;
71
- this._options = options;
72
- }
73
- push(action) {
74
- if (!this._executeOnIdleWorker(action)) {
75
- if (this._workerInfos.length < this._maxWorkers) {
76
- const workerInfo = {
77
- workerPromise: this._createWorkerAsync(),
78
- idle: false,
79
- };
80
- this._workerInfos.push(workerInfo);
81
- this._execute(workerInfo, action);
82
- }
83
- else {
84
- this._pendingActions.push(action);
85
- }
86
- }
87
- }
88
- _execute(workerInfo, action) {
89
- // Reset the idle timeout.
90
- if (workerInfo.timeoutId) {
91
- clearTimeout(workerInfo.timeoutId);
92
- delete workerInfo.timeoutId;
93
- }
94
- super._execute(workerInfo, (worker, onComplete) => {
95
- action(worker, () => {
96
- onComplete();
97
- if (workerInfo.idle) {
98
- // Schedule the worker to be terminated after the elapsed time.
99
- workerInfo.timeoutId = setTimeout(() => {
100
- workerInfo.workerPromise.then((worker) => {
101
- worker.terminate();
102
- });
103
- const indexOf = this._workerInfos.indexOf(workerInfo);
104
- if (indexOf !== -1) {
105
- this._workerInfos.splice(indexOf, 1);
106
- }
107
- }, this._options.idleTimeElapsedBeforeRelease);
108
- }
109
- });
110
- });
111
- }
112
- }
113
- /**
114
- * Default options for the constructor.
115
- * Override to change the defaults.
116
- */
117
- AutoReleaseWorkerPool.DefaultOptions = {
118
- idleTimeElapsedBeforeRelease: 1000,
119
- };
120
-
121
- export { AutoReleaseWorkerPool as A };
122
- //# sourceMappingURL=workerPool-BUOov2K1.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workerPool-BUOov2K1.esm.js","sources":["../../../../../dev/core/dist/Misc/workerPool.js"],"sourcesContent":["/**\n * Helper class to push actions to a pool of workers.\n */\nexport class WorkerPool {\n /**\n * Constructor\n * @param workers Array of workers to use for actions\n */\n constructor(workers) {\n this._pendingActions = new Array();\n this._workerInfos = workers.map((worker) => ({\n workerPromise: Promise.resolve(worker),\n idle: true,\n }));\n }\n /**\n * Terminates all workers and clears any pending actions.\n */\n dispose() {\n for (const workerInfo of this._workerInfos) {\n workerInfo.workerPromise.then((worker) => {\n worker.terminate();\n });\n }\n this._workerInfos.length = 0;\n this._pendingActions.length = 0;\n }\n /**\n * Pushes an action to the worker pool. If all the workers are active, the action will be\n * pended until a worker has completed its action.\n * @param action The action to perform. Call onComplete when the action is complete.\n */\n push(action) {\n if (!this._executeOnIdleWorker(action)) {\n this._pendingActions.push(action);\n }\n }\n _executeOnIdleWorker(action) {\n for (const workerInfo of this._workerInfos) {\n if (workerInfo.idle) {\n this._execute(workerInfo, action);\n return true;\n }\n }\n return false;\n }\n _execute(workerInfo, action) {\n workerInfo.idle = false;\n workerInfo.workerPromise.then((worker) => {\n action(worker, () => {\n const nextAction = this._pendingActions.shift();\n if (nextAction) {\n this._execute(workerInfo, nextAction);\n }\n else {\n workerInfo.idle = true;\n }\n });\n });\n }\n}\n/**\n * Similar to the WorkerPool class except it creates and destroys workers automatically with a maximum of `maxWorkers` workers.\n * Workers are terminated when it is idle for at least `idleTimeElapsedBeforeRelease` milliseconds.\n */\nexport class AutoReleaseWorkerPool extends WorkerPool {\n constructor(maxWorkers, createWorkerAsync, options = AutoReleaseWorkerPool.DefaultOptions) {\n super([]);\n this._maxWorkers = maxWorkers;\n this._createWorkerAsync = createWorkerAsync;\n this._options = options;\n }\n push(action) {\n if (!this._executeOnIdleWorker(action)) {\n if (this._workerInfos.length < this._maxWorkers) {\n const workerInfo = {\n workerPromise: this._createWorkerAsync(),\n idle: false,\n };\n this._workerInfos.push(workerInfo);\n this._execute(workerInfo, action);\n }\n else {\n this._pendingActions.push(action);\n }\n }\n }\n _execute(workerInfo, action) {\n // Reset the idle timeout.\n if (workerInfo.timeoutId) {\n clearTimeout(workerInfo.timeoutId);\n delete workerInfo.timeoutId;\n }\n super._execute(workerInfo, (worker, onComplete) => {\n action(worker, () => {\n onComplete();\n if (workerInfo.idle) {\n // Schedule the worker to be terminated after the elapsed time.\n workerInfo.timeoutId = setTimeout(() => {\n workerInfo.workerPromise.then((worker) => {\n worker.terminate();\n });\n const indexOf = this._workerInfos.indexOf(workerInfo);\n if (indexOf !== -1) {\n this._workerInfos.splice(indexOf, 1);\n }\n }, this._options.idleTimeElapsedBeforeRelease);\n }\n });\n });\n }\n}\n/**\n * Default options for the constructor.\n * Override to change the defaults.\n */\nAutoRelea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E,yBAAyB;AACzB,qBAAqB,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;AACnE,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS,CAAC,CAAC;AACX,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA;AACA,qBAAqB,CAAC,cAAc,GAAG;AACvC,IAAI,4BAA4B,EAAE,IAAI;AACtC,CAAC;;;;"}
@@ -1,2 +0,0 @@
1
- class e{constructor(e){this._pendingActions=new Array,this._workerInfos=e.map((e=>({workerPromise:Promise.resolve(e),idle:!0})))}dispose(){for(const e of this._workerInfos)e.workerPromise.then((e=>{e.terminate()}));this._workerInfos.length=0,this._pendingActions.length=0}push(e){this._executeOnIdleWorker(e)||this._pendingActions.push(e)}_executeOnIdleWorker(e){for(const s of this._workerInfos)if(s.idle)return this._execute(s,e),!0;return!1}_execute(e,s){e.idle=!1,e.workerPromise.then((t=>{s(t,(()=>{const s=this._pendingActions.shift();s?this._execute(e,s):e.idle=!0}))}))}}class s extends e{constructor(e,t,i=s.DefaultOptions){super([]),this._maxWorkers=e,this._createWorkerAsync=t,this._options=i}push(e){if(!this._executeOnIdleWorker(e))if(this._workerInfos.length<this._maxWorkers){const s={workerPromise:this._createWorkerAsync(),idle:!1};this._workerInfos.push(s),this._execute(s,e)}else this._pendingActions.push(e)}_execute(e,s){e.timeoutId&&(clearTimeout(e.timeoutId),delete e.timeoutId),super._execute(e,((t,i)=>{s(t,(()=>{i(),e.idle&&(e.timeoutId=setTimeout((()=>{e.workerPromise.then((e=>{e.terminate()}));const s=this._workerInfos.indexOf(e);-1!==s&&this._workerInfos.splice(s,1)}),this._options.idleTimeElapsedBeforeRelease))}))}))}}s.DefaultOptions={idleTimeElapsedBeforeRelease:1e3};export{s as A};
2
- //# sourceMappingURL=workerPool-BWHiDmEZ.esm.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workerPool-BWHiDmEZ.esm.min.js","sources":["../../../../../dev/core/dist/Misc/workerPool.js"],"sourcesContent":["/**\n * Helper class to push actions to a pool of workers.\n */\nexport class WorkerPool {\n /**\n * Constructor\n * @param workers Array of workers to use for actions\n */\n constructor(workers) {\n this._pendingActions = new Array();\n this._workerInfos = workers.map((worker) => ({\n workerPromise: Promise.resolve(worker),\n idle: true,\n }));\n }\n /**\n * Terminates all workers and clears any pending actions.\n */\n dispose() {\n for (const workerInfo of this._workerInfos) {\n workerInfo.workerPromise.then((worker) => {\n worker.terminate();\n });\n }\n this._workerInfos.length = 0;\n this._pendingActions.length = 0;\n }\n /**\n * Pushes an action to the worker pool. If all the workers are active, the action will be\n * pended until a worker has completed its action.\n * @param action The action to perform. Call onComplete when the action is complete.\n */\n push(action) {\n if (!this._executeOnIdleWorker(action)) {\n this._pendingActions.push(action);\n }\n }\n _executeOnIdleWorker(action) {\n for (const workerInfo of this._workerInfos) {\n if (workerInfo.idle) {\n this._execute(workerInfo, action);\n return true;\n }\n }\n return false;\n }\n _execute(workerInfo, action) {\n workerInfo.idle = false;\n workerInfo.workerPromise.then((worker) => {\n action(worker, () => {\n const nextAction = this._pendingActions.shift();\n if (nextAction) {\n this._execute(workerInfo, nextAction);\n }\n else {\n workerInfo.idle = true;\n }\n });\n });\n }\n}\n/**\n * Similar to the WorkerPool class except it creates and destroys workers automatically with a maximum of `maxWorkers` workers.\n * Workers are terminated when it is idle for at least `idleTimeElapsedBeforeRelease` milliseconds.\n */\nexport class AutoReleaseWorkerPool extends WorkerPool {\n constructor(maxWorkers, createWorkerAsync, options = AutoReleaseWorkerPool.DefaultOptions) {\n super([]);\n this._maxWorkers = maxWorkers;\n this._createWorkerAsync = createWorkerAsync;\n this._options = options;\n }\n push(action) {\n if (!this._executeOnIdleWorker(action)) {\n if (this._workerInfos.length < this._maxWorkers) {\n const workerInfo = {\n workerPromise: this._createWorkerAsync(),\n idle: false,\n };\n this._workerInfos.push(workerInfo);\n this._execute(workerInfo, action);\n }\n else {\n this._pendingActions.push(action);\n }\n }\n }\n _execute(workerInfo, action) {\n // Reset the idle timeout.\n if (workerInfo.timeoutId) {\n clearTimeout(workerInfo.timeoutId);\n delete workerInfo.timeoutId;\n }\n super._execute(workerInfo, (worker, onComplete) => {\n action(worker, () => {\n onComplete();\n if (workerInfo.idle) {\n // Schedule the worker to be terminated after the elapsed time.\n workerInfo.timeoutId = setTimeout(() => {\n workerInfo.workerPromise.then((worker) => {\n worker.terminate();\n });\n const indexOf = this._workerInfos.indexOf(workerInfo);\n if (indexOf !== -1) {\n this._workerInfos.splice(indexOf, 1);\n }\n }, this._options.idleTimeElapsedBeforeRelease);\n }\n });\n });\n }\n}\n/**\n * Default options for the constructor.\n * Override to change the defaults.\n */\nAutoReleaseWorkerPool.DefaultOptions = {\n idleTimeElapsedBeforeRelease: 1000,\n};\n//# sourceMappingURL=workerPool.js.map"],"names":["WorkerPool","constructor","workers","this","_pendingActions","Array","_workerInfos","map","worker","workerPromise","Promise","resolve","idle","dispose","workerInfo","then","terminate","length","push","action","_executeOnIdleWorker","_execute","nextAction","shift","AutoReleaseWorkerPool","maxWorkers","createWorkerAsync","options","DefaultOptions","super","_maxWorkers","_createWorkerAsync","_options","timeoutId","clearTimeout","onComplete","setTimeout","indexOf","splice","idleTimeElapsedBeforeRelease"],"mappings":"AAGO,MAAMA,EAKT,WAAAC,CAAYC,GACRC,KAAKC,gBAAkB,IAAIC,MAC3BF,KAAKG,aAAeJ,EAAQK,KAAKC,IAAY,CACzCC,cAAeC,QAAQC,QAAQH,GAC/BI,MAAM,KAEb,CAID,OAAAC,GACI,IAAK,MAAMC,KAAcX,KAAKG,aAC1BQ,EAAWL,cAAcM,MAAMP,IAC3BA,EAAOQ,WAAW,IAG1Bb,KAAKG,aAAaW,OAAS,EAC3Bd,KAAKC,gBAAgBa,OAAS,CACjC,CAMD,IAAAC,CAAKC,GACIhB,KAAKiB,qBAAqBD,IAC3BhB,KAAKC,gBAAgBc,KAAKC,EAEjC,CACD,oBAAAC,CAAqBD,GACjB,IAAK,MAAML,KAAcX,KAA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ractEngine, LoadAssetContainerOptions, AbstractEngineOptions, EngineOptions, WebGPUEngineOptions } from '@babylonjs/core/index.js';
2
- import { Color4 } from '@babylonjs/core/Maths/math.color.js';
3
- import { Observable } from '@babylonjs/core/Misc/observable.js';
4
- import { Scene } from '@babylonjs/core/scene.js';
5
- import * as lit_html from 'lit-html';
6
- import * as lit from 'lit';
7
- import { LitElement, PropertyValues } from 'lit';
8
-
9
- declare const defaultViewerOptions: {
10
- readonly backgroundColor: Color4;
11
- };
12
- type ViewerDetails = {
13
- /**
14
- * Gets the Viewer instance.
15
- */
16
- viewer: Viewer;
17
- /**
18
- * Provides access to the Scene managed by the Viewer.
19
- */
20
- scene: Scene;
21
- /**
22
- * Provides access to the currently loaded model.
23
- */
24
- model: Nullable<AssetContainer>;
25
- };
26
- type ViewerOptions = Partial<typeof defaultViewerOptions & Readonly<{
27
- /**
28
- * Called once when the viewer is initialized and provides viewer details that can be used for advanced customization.
29
- */
30
- onInitialized: (details: Readonly<ViewerDetails>) => void;
31
- }>>;
32
- /**
33
- * Provides an experience for viewing a single 3D model.
34
- * @remarks
35
- * The Viewer is not tied to a specific UI framework and can be used with Babylon.js in a browser or with Babylon Native.
36
- * Includes (or will include) support for common model viewing requirements such as:
37
- * - Loading different model formats.
38
- * - Setting up a camera and providing default behaviors like auto orbit and pose interpolation.
39
- * - Framing the loaded model in the camera's view.
40
- * - Setting up the environment, lighting, and tone mapping.
41
- * - Enumerating and playing (or auto playing) animations.
42
- * - Enumerating and switching between material variants.
43
- * - Full screen and XR modes.
44
- */
45
- declare class Viewer implements IDisposable {
46
- private readonly _engine;
47
- /**
48
- * Fired when the environment has changed.
49
- */
50
- readonly onEnvironmentChanged: Observable<void>;
51
- /**
52
- * Fired when an error occurs while loading the environment.
53
- */
54
- readonly onEnvironmentError: Observable<unknown>;
55
- /**
56
- * Fired when a model is loaded into the viewer (or unloaded from the viewer).
57
- */
58
- readonly onModelChanged: Observable<void>;
59
- /**
60
- * Fired when an error occurs while loading a model.
61
- */
62
- readonly onModelError: Observable<unknown>;
63
- /**
64
- * Fired when the selected animation changes.
65
- */
66
- readonly onSelectedAnimationChanged: Observable<void>;
67
- /**
68
- * Fired when the animation speed changes.
69
- */
70
- readonly onAnimationSpeedChanged: Observable<void>;
71
- /**
72
- * Fired when the selected animation is playing or paused.
73
- */
74
- readonly onIsAnimationPlayingChanged: Observable<void>;
75
- /**
76
- * Fired when the current point on the selected animation timeline changes.
77
- */
78
- readonly onAnimationProgressChanged: Observable<void>;
79
- private readonly _details;
80
- private readonly _camera;
81
- private readonly _autoRotationBehavior;
82
- private readonly _renderLoopController;
83
- private _skybox;
84
- private _isDisposed;
85
- private readonly _loadModelLock;
86
- private _loadModelAbortController;
87
- private readonly _loadEnvironmentLock;
88
- private _environment;
89
- private _loadEnvironmentAbortController;
90
- private _selectedAnimation;
91
- private _activeAnimationObservers;
92
- private _animationSpeed;
93
- constructor(_engine: AbstractEngine, options?: ViewerOptions);
94
- /**
95
- * The list of animation names for the currently loaded model.
96
- */
97
- get animations(): readonly string[];
98
- /**
99
- * The currently selected animation index.
100
- */
101
- get selectedAnimation(): number;
102
- set selectedAnimation(value: number);
103
- /**
104
- * True if an animation is currently playing.
105
- */
106
- get isAnimationPlaying(): boolean;
107
- /**
108
- * The speed scale at which animations are played.
109
- */
110
- get animationSpeed(): number;
111
- set animationSpeed(value: number);
112
- /**
113
- * The current point on the selected animation timeline, normalized between 0 and 1.
114
- */
115
- get animationProgress(): number;
116
- set animationProgress(value: number);
117
- private get _activeAnimation();
118
- /**
119
- * Loads a 3D model from the specified URL.
120
- * @remarks
121
- * If a model is already loaded, it will be unloaded before loading the new model.
122
- * @param source A url or File or ArrayBufferView that points to the model to load.
123
- * @param options The options to use when loading the model.
124
- * @param abortSignal An optional signal that can be used to abort the loading process.
125
- */
126
- loadModelAsync(source: string | File | ArrayBufferView, options?: LoadAssetContainerOptions, abortSignal?: AbortSignal): Promise<void>;
127
- /**
128
- * Resets the model to an empty scene.
129
- * @param abortSignal An optional signal that can be used to abort the reset.
130
- */
131
- resetModelAsync(abortSignal?: AbortSignal): Promise<void>;
132
- private _updateModelAsync;
133
- /**
134
- * Loads an environment texture from the specified url and sets up a corresponding skybox.
135
- * @remarks
136
- * If an environment is already loaded, it will be unloaded before loading the new environment.
137
- * @param url The url of the environment texture to load.
138
- * @param options The options to use when loading the environment.
139
- * @param abortSignal An optional signal that can be used to abort the loading process.
140
- */
141
- loadEnvironmentAsync(url: string, options?: {}, abortSignal?: AbortSignal): Promise<void>;
142
- /**
143
- * Resets the environment to a simple hemispheric light.
144
- * @param abortSignal An optional signal that can be used to abort the reset.
145
- */
146
- resetEnvironmentAsync(abortSignal?: AbortSignal): Promise<void>;
147
- private _updateEnvironmentAsync;
148
- /**
149
- * Toggles the play/pause animation state if there is a selected animation.
150
- */
151
- toggleAnimation(): void;
152
- /**
153
- * Plays the selected animation if there is one.
154
- */
155
- playAnimation(): void;
156
- /**
157
- * Pauses the selected animation if there is one.
158
- */
159
- pauseAnimation(): Promise<void>;
160
- /**
161
- * Disposes of the resources held by the Viewer.
162
- */
163
- dispose(): void;
164
- private _updateCamera;
165
- private _applyAnimationSpeed;
166
- /**
167
- * Check for disposed or aborted state (basically everything that can interrupt an async operation).
168
- * @param abortSignals A set of optional AbortSignals to also check.
169
- */
170
- private _throwIfDisposedOrAborted;
171
- }
172
-
173
- /**
174
- * Options for creating a Viewer instance that is bound to an HTML canvas.
175
- */
176
- type CanvasViewerOptions = ViewerOptions & (({
177
- engine?: undefined;
178
- } & AbstractEngineOptions) | ({
179
- engine: "WebGL";
180
- } & EngineOptions) | ({
181
- engine: "WebGPU";
182
- } & WebGPUEngineOptions));
183
- /**
184
- * Chooses a default engine for the current browser environment.
185
- * @returns The default engine to use.
186
- */
187
- declare function getDefaultEngine(): NonNullable<CanvasViewerOptions["engine"]>;
188
- /**
189
- * Creates a Viewer instance that is bound to an HTML canvas.
190
- * @remarks
191
- * This function can be shared across multiple UI integrations (e.g. Web Components, React, etc.).
192
- * @param canvas The canvas element to bind the Viewer to.
193
- * @param options The options to use when creating the Viewer and binding it to the specified canvas.
194
- * @returns A Viewer instance that is bound to the specified canvas.
195
- */
196
- declare function createViewerForCanvas(canvas: HTMLCanvasElement, options?: CanvasViewerOptions): Promise<Viewer>;
197
-
198
- interface HTML3DElementEventMap extends HTMLElementEventMap {
199
- viewerready: CustomEvent<ViewerDetails>;
200
- environmentchange: Event;
201
- environmenterror: Event;
202
- modelchange: Event;
203
- modelerror: Event;
204
- selectedanimationchange: Event;
205
- animationspeedchange: Event;
206
- animationplayingchange: Event;
207
- animationprogresschange: Event;
208
- }
209
- /**
210
- * Represents a custom element that displays a 3D model using the Babylon.js Viewer.
211
- */
212
- declare class HTML3DElement extends LitElement {
213
- private readonly _viewerLock;
214
- private _viewer?;
215
- static styles: lit.CSSResult;
216
- /**
217
- * The engine to use for rendering.
218
- */
219
- engine: NonNullable<CanvasViewerOptions["engine"]>;
220
- /**
221
- * The model URL.
222
- */
223
- src: string | undefined;
224
- /**
225
- * Forces the model to be loaded with the specified extension.
226
- * @remarks
227
- * If this property is not set, the extension will be inferred from the model URL when possible.
228
- */
229
- extension: string | undefined;
230
- /**
231
- * The environment URL.
232
- */
233
- env: string | undefined;
234
- /**
235
- * The list of animation names for the currently loaded model.
236
- */
237
- get animations(): readonly string[];
238
- /**
239
- * The currently selected animation index.
240
- */
241
- get selectedAnimation(): number;
242
- /**
243
- * True if an animation is currently playing.
244
- */
245
- get isAnimationPlaying(): boolean;
246
- /**
247
- * The speed scale at which animations are played.
248
- */
249
- animationSpeed: number;
250
- /**
251
- * The current point on the selected animation timeline, normalized between 0 and 1.
252
- */
253
- animationProgress: number;
254
- private _animations;
255
- private _selectedAnimation;
256
- private _isAnimationPlaying;
257
- private _canvasContainer;
258
- /**
259
- * Toggles the play/pause animation state if there is a selected animation.
260
- */
261
- toggleAnimation(): void;
262
- connectedCallback(): void;
263
- disconnectedCallback(): void;
264
- update(changedProperties: PropertyValues): void;
265
- render(): lit_html.TemplateResult<1>;
266
- addEventListener<K extends keyof HTML3DElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTML3DElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
267
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
268
- private _dispatchCustomEvent;
269
- private _onSelectedAnimationChanged;
270
- private _onAnimationSpeedChanged;
271
- private _onProgressChanged;
272
- private _onProgressPointerDown;
273
- private _setupViewer;
274
- private _tearDownViewer;
275
- private _updateAnimationSpeed;
276
- private _updateSelectedAnimation;
277
- private _updateModel;
278
- private _updateEnv;
279
- }
280
-
281
- export { type CanvasViewerOptions, HTML3DElement, Viewer, type ViewerDetails, type ViewerOptions, createViewerForCanvas, getDefaultEngine };