@babylonjs/viewer 7.32.5-alpha → 7.33.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 (587) 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 -18
  158. package/readme.md +21 -145
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +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 +672 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/assets/photoStudio.env +0 -0
  193. package/dist/babylon-viewer.esm.js +0 -2
  194. package/dist/babylon-viewer.esm.js.map +0 -1
  195. package/dist/babylon-viewer.esm.min.js +0 -2
  196. package/dist/babylon-viewer.esm.min.js.map +0 -1
  197. package/dist/chunks/EXT_lights_image_based-BJDofJ6j.esm.js +0 -171
  198. package/dist/chunks/EXT_lights_image_based-BJDofJ6j.esm.js.map +0 -1
  199. package/dist/chunks/EXT_lights_image_based-CUoVXTdf.esm.min.js +0 -2
  200. package/dist/chunks/EXT_lights_image_based-CUoVXTdf.esm.min.js.map +0 -1
  201. package/dist/chunks/EXT_mesh_gpu_instancing-B40D-gr5.esm.min.js +0 -2
  202. package/dist/chunks/EXT_mesh_gpu_instancing-B40D-gr5.esm.min.js.map +0 -1
  203. package/dist/chunks/EXT_mesh_gpu_instancing-Cym0F52J.esm.js +0 -86
  204. package/dist/chunks/EXT_mesh_gpu_instancing-Cym0F52J.esm.js.map +0 -1
  205. package/dist/chunks/EXT_meshopt_compression-CcH8qKup.esm.min.js +0 -2
  206. package/dist/chunks/EXT_meshopt_compression-CcH8qKup.esm.min.js.map +0 -1
  207. package/dist/chunks/EXT_meshopt_compression-DTKY7Dpi.esm.js +0 -134
  208. package/dist/chunks/EXT_meshopt_compression-DTKY7Dpi.esm.js.map +0 -1
  209. package/dist/chunks/EXT_texture_avif-4HdeMY2l.esm.min.js +0 -2
  210. package/dist/chunks/EXT_texture_avif-4HdeMY2l.esm.min.js.map +0 -1
  211. package/dist/chunks/EXT_texture_avif-8aoBT3fQ.esm.js +0 -44
  212. package/dist/chunks/EXT_texture_avif-8aoBT3fQ.esm.js.map +0 -1
  213. package/dist/chunks/EXT_texture_webp-DPnqfhkh.esm.js +0 -43
  214. package/dist/chunks/EXT_texture_webp-DPnqfhkh.esm.js.map +0 -1
  215. package/dist/chunks/EXT_texture_webp-DjRBREbX.esm.min.js +0 -2
  216. package/dist/chunks/EXT_texture_webp-DjRBREbX.esm.min.js.map +0 -1
  217. package/dist/chunks/ExtrasAsMetadata-DNlO-_kI.esm.min.js +0 -2
  218. package/dist/chunks/ExtrasAsMetadata-DNlO-_kI.esm.min.js.map +0 -1
  219. package/dist/chunks/ExtrasAsMetadata-X3Wq_bzm.esm.js +0 -64
  220. package/dist/chunks/ExtrasAsMetadata-X3Wq_bzm.esm.js.map +0 -1
  221. package/dist/chunks/KHR_animation_pointer-DHprTFXc.esm.min.js +0 -2
  222. package/dist/chunks/KHR_animation_pointer-DHprTFXc.esm.min.js.map +0 -1
  223. package/dist/chunks/KHR_animation_pointer-Dysje7fV.esm.js +0 -343
  224. package/dist/chunks/KHR_animation_pointer-Dysje7fV.esm.js.map +0 -1
  225. package/dist/chunks/KHR_draco_mesh_compression-C80NfWBp.esm.min.js +0 -2
  226. package/dist/chunks/KHR_draco_mesh_compression-C80NfWBp.esm.min.js.map +0 -1
  227. package/dist/chunks/KHR_draco_mesh_compression-CcVAQwaS.esm.js +0 -610
  228. package/dist/chunks/KHR_draco_mesh_compression-CcVAQwaS.esm.js.map +0 -1
  229. package/dist/chunks/KHR_interactivity-C720mtDt.esm.min.js +0 -2
  230. package/dist/chunks/KHR_interactivity-C720mtDt.esm.min.js.map +0 -1
  231. package/dist/chunks/KHR_interactivity-k1UPs7xR.esm.js +0 -4033
  232. package/dist/chunks/KHR_interactivity-k1UPs7xR.esm.js.map +0 -1
  233. package/dist/chunks/KHR_lights_punctual-DYHTnXF_.esm.js +0 -1253
  234. package/dist/chunks/KHR_lights_punctual-DYHTnXF_.esm.js.map +0 -1
  235. package/dist/chunks/KHR_lights_punctual-UYr6XBwt.esm.min.js +0 -2
  236. package/dist/chunks/KHR_lights_punctual-UYr6XBwt.esm.min.js.map +0 -1
  237. package/dist/chunks/KHR_materials_anisotropy-CZYyPR9n.esm.js +0 -65
  238. package/dist/chunks/KHR_materials_anisotropy-CZYyPR9n.esm.js.map +0 -1
  239. package/dist/chunks/KHR_materials_anisotropy-Dgkr7DlC.esm.min.js +0 -2
  240. package/dist/chunks/KHR_materials_anisotropy-Dgkr7DlC.esm.min.js.map +0 -1
  241. package/dist/chunks/KHR_materials_clearcoat-BNHNa3P6.esm.js +0 -96
  242. package/dist/chunks/KHR_materials_clearcoat-BNHNa3P6.esm.js.map +0 -1
  243. package/dist/chunks/KHR_materials_clearcoat-DU__zRc3.esm.min.js +0 -2
  244. package/dist/chunks/KHR_materials_clearcoat-DU__zRc3.esm.min.js.map +0 -1
  245. package/dist/chunks/KHR_materials_diffuse_transmission-DNTldGop.esm.min.js +0 -2
  246. package/dist/chunks/KHR_materials_diffuse_transmission-DNTldGop.esm.min.js.map +0 -1
  247. package/dist/chunks/KHR_materials_diffuse_transmission-jjZuxYJO.esm.js +0 -97
  248. package/dist/chunks/KHR_materials_diffuse_transmission-jjZuxYJO.esm.js.map +0 -1
  249. package/dist/chunks/KHR_materials_dispersion-CyvYBW9b.esm.js +0 -62
  250. package/dist/chunks/KHR_materials_dispersion-CyvYBW9b.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_dispersion-D-hIKQRe.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_dispersion-D-hIKQRe.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_emissive_strength-Dqgyix65.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_emissive_strength-Dqgyix65.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_emissive_strength-r4WuAdzg.esm.js +0 -55
  256. package/dist/chunks/KHR_materials_emissive_strength-r4WuAdzg.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_ior-CkFyA7kd.esm.js +0 -64
  258. package/dist/chunks/KHR_materials_ior-CkFyA7kd.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_ior-JDk3WBjc.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_ior-JDk3WBjc.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_iridescence-DdnR_0Ic.esm.min.js +0 -2
  262. package/dist/chunks/KHR_materials_iridescence-DdnR_0Ic.esm.min.js.map +0 -1
  263. package/dist/chunks/KHR_materials_iridescence-jzdiqTGq.esm.js +0 -72
  264. package/dist/chunks/KHR_materials_iridescence-jzdiqTGq.esm.js.map +0 -1
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BwTTY4le.esm.min.js +0 -2
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BwTTY4le.esm.min.js.map +0 -1
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DkITZQDK.esm.js +0 -81
  268. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DkITZQDK.esm.js.map +0 -1
  269. package/dist/chunks/KHR_materials_sheen-D22Xr3T2.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_sheen-D22Xr3T2.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_sheen-DHz4eqia.esm.js +0 -85
  272. package/dist/chunks/KHR_materials_sheen-DHz4eqia.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_specular-CAnsPHJU.esm.js +0 -75
  274. package/dist/chunks/KHR_materials_specular-CAnsPHJU.esm.js.map +0 -1
  275. package/dist/chunks/KHR_materials_specular-Dlpv7seM.esm.min.js +0 -2
  276. package/dist/chunks/KHR_materials_specular-Dlpv7seM.esm.min.js.map +0 -1
  277. package/dist/chunks/KHR_materials_transmission-CN4BlAnk.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_transmission-CN4BlAnk.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_transmission-srgL1Aqx.esm.js +0 -307
  280. package/dist/chunks/KHR_materials_transmission-srgL1Aqx.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_unlit-D0FfM-NT.esm.min.js +0 -2
  282. package/dist/chunks/KHR_materials_unlit-D0FfM-NT.esm.min.js.map +0 -1
  283. package/dist/chunks/KHR_materials_unlit-VHCS-qet.esm.js +0 -74
  284. package/dist/chunks/KHR_materials_unlit-VHCS-qet.esm.js.map +0 -1
  285. package/dist/chunks/KHR_materials_variants-D4CNKx1i.esm.js +0 -238
  286. package/dist/chunks/KHR_materials_variants-D4CNKx1i.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_variants-v9df5FAx.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_variants-v9df5FAx.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_volume-B4PZJBeI.esm.js +0 -87
  290. package/dist/chunks/KHR_materials_volume-B4PZJBeI.esm.js.map +0 -1
  291. package/dist/chunks/KHR_materials_volume-BfI1XzBb.esm.min.js +0 -2
  292. package/dist/chunks/KHR_materials_volume-BfI1XzBb.esm.min.js.map +0 -1
  293. package/dist/chunks/KHR_mesh_quantization-CTFCGs7-.esm.js +0 -26
  294. package/dist/chunks/KHR_mesh_quantization-CTFCGs7-.esm.js.map +0 -1
  295. package/dist/chunks/KHR_mesh_quantization-yLPX1xU0.esm.min.js +0 -2
  296. package/dist/chunks/KHR_mesh_quantization-yLPX1xU0.esm.min.js.map +0 -1
  297. package/dist/chunks/KHR_node_visibility-BOJrqRh0.esm.js +0 -46
  298. package/dist/chunks/KHR_node_visibility-BOJrqRh0.esm.js.map +0 -1
  299. package/dist/chunks/KHR_node_visibility-vBVWnFJH.esm.min.js +0 -2
  300. package/dist/chunks/KHR_node_visibility-vBVWnFJH.esm.min.js.map +0 -1
  301. package/dist/chunks/KHR_texture_basisu-BUJ7JndS.esm.min.js +0 -2
  302. package/dist/chunks/KHR_texture_basisu-BUJ7JndS.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_texture_basisu-Btv19gNg.esm.js +0 -43
  304. package/dist/chunks/KHR_texture_basisu-Btv19gNg.esm.js.map +0 -1
  305. package/dist/chunks/KHR_texture_transform-CmF30-Wu.esm.min.js +0 -2
  306. package/dist/chunks/KHR_texture_transform-CmF30-Wu.esm.min.js.map +0 -1
  307. package/dist/chunks/KHR_texture_transform-Ddl6gWV-.esm.js +0 -63
  308. package/dist/chunks/KHR_texture_transform-Ddl6gWV-.esm.js.map +0 -1
  309. package/dist/chunks/KHR_xmp_json_ld-CNDHDqxi.esm.min.js +0 -2
  310. package/dist/chunks/KHR_xmp_json_ld-CNDHDqxi.esm.min.js.map +0 -1
  311. package/dist/chunks/KHR_xmp_json_ld-DCsVXEUW.esm.js +0 -51
  312. package/dist/chunks/KHR_xmp_json_ld-DCsVXEUW.esm.js.map +0 -1
  313. package/dist/chunks/MSFT_audio_emitter-C942DlM2.esm.js +0 -2207
  314. package/dist/chunks/MSFT_audio_emitter-C942DlM2.esm.js.map +0 -1
  315. package/dist/chunks/MSFT_audio_emitter-CpjBeiVs.esm.min.js +0 -2
  316. package/dist/chunks/MSFT_audio_emitter-CpjBeiVs.esm.min.js.map +0 -1
  317. package/dist/chunks/MSFT_lod-B14ue3J0.esm.min.js +0 -2
  318. package/dist/chunks/MSFT_lod-B14ue3J0.esm.min.js.map +0 -1
  319. package/dist/chunks/MSFT_lod-DLnphe61.esm.js +0 -337
  320. package/dist/chunks/MSFT_lod-DLnphe61.esm.js.map +0 -1
  321. package/dist/chunks/MSFT_minecraftMesh-CUk0qO4J.esm.js +0 -46
  322. package/dist/chunks/MSFT_minecraftMesh-CUk0qO4J.esm.js.map +0 -1
  323. package/dist/chunks/MSFT_minecraftMesh-QlV1ly8w.esm.min.js +0 -2
  324. package/dist/chunks/MSFT_minecraftMesh-QlV1ly8w.esm.min.js.map +0 -1
  325. package/dist/chunks/MSFT_sRGBFactors-BR3W_5Tq.esm.min.js +0 -2
  326. package/dist/chunks/MSFT_sRGBFactors-BR3W_5Tq.esm.min.js.map +0 -1
  327. package/dist/chunks/MSFT_sRGBFactors-DEUvOUTL.esm.js +0 -47
  328. package/dist/chunks/MSFT_sRGBFactors-DEUvOUTL.esm.js.map +0 -1
  329. package/dist/chunks/animationGroup-C-7_CyRB.esm.min.js +0 -2
  330. package/dist/chunks/animationGroup-C-7_CyRB.esm.min.js.map +0 -1
  331. package/dist/chunks/animationGroup-DNhu77O9.esm.js +0 -2479
  332. package/dist/chunks/animationGroup-DNhu77O9.esm.js.map +0 -1
  333. package/dist/chunks/assetContainer-CHFhliPI.esm.min.js +0 -2
  334. package/dist/chunks/assetContainer-CHFhliPI.esm.min.js.map +0 -1
  335. package/dist/chunks/assetContainer-DCrcJnJJ.esm.js +0 -1720
  336. package/dist/chunks/assetContainer-DCrcJnJJ.esm.js.map +0 -1
  337. package/dist/chunks/audioEngine-C9yPZ8rL.esm.js +0 -305
  338. package/dist/chunks/audioEngine-C9yPZ8rL.esm.js.map +0 -1
  339. package/dist/chunks/audioEngine-CjUln79b.esm.min.js +0 -2
  340. package/dist/chunks/audioEngine-CjUln79b.esm.min.js.map +0 -1
  341. package/dist/chunks/bakedVertexAnimation-Bu6C0iQo.esm.min.js +0 -2
  342. package/dist/chunks/bakedVertexAnimation-Bu6C0iQo.esm.min.js.map +0 -1
  343. package/dist/chunks/bakedVertexAnimation-DOJU4SzN.esm.js +0 -114
  344. package/dist/chunks/bakedVertexAnimation-DOJU4SzN.esm.js.map +0 -1
  345. package/dist/chunks/basisTextureLoader-Bs-6UJMm.esm.js +0 -600
  346. package/dist/chunks/basisTextureLoader-Bs-6UJMm.esm.js.map +0 -1
  347. package/dist/chunks/basisTextureLoader-ByK7WJE_.esm.min.js +0 -2
  348. package/dist/chunks/basisTextureLoader-ByK7WJE_.esm.min.js.map +0 -1
  349. package/dist/chunks/dds-BQwKJGG6.esm.min.js +0 -2
  350. package/dist/chunks/dds-BQwKJGG6.esm.min.js.map +0 -1
  351. package/dist/chunks/dds-Bkxp7KM6.esm.js +0 -540
  352. package/dist/chunks/dds-Bkxp7KM6.esm.js.map +0 -1
  353. package/dist/chunks/ddsTextureLoader-BzaBjvw-.esm.min.js +0 -2
  354. package/dist/chunks/ddsTextureLoader-BzaBjvw-.esm.min.js.map +0 -1
  355. package/dist/chunks/ddsTextureLoader-CiOvJLfe.esm.js +0 -88
  356. package/dist/chunks/ddsTextureLoader-CiOvJLfe.esm.js.map +0 -1
  357. package/dist/chunks/decalFragment-BdF2VCo0.esm.js +0 -18
  358. package/dist/chunks/decalFragment-BdF2VCo0.esm.js.map +0 -1
  359. package/dist/chunks/decalFragment-CKuUNaOG.esm.min.js +0 -2
  360. package/dist/chunks/decalFragment-CKuUNaOG.esm.min.js.map +0 -1
  361. package/dist/chunks/default.fragment-B5m_AG4a.esm.min.js +0 -2
  362. package/dist/chunks/default.fragment-B5m_AG4a.esm.min.js.map +0 -1
  363. package/dist/chunks/default.fragment-B6pUU2Du.esm.js +0 -497
  364. package/dist/chunks/default.fragment-B6pUU2Du.esm.js.map +0 -1
  365. package/dist/chunks/default.fragment-BNqVilb1.esm.js +0 -431
  366. package/dist/chunks/default.fragment-BNqVilb1.esm.js.map +0 -1
  367. package/dist/chunks/default.fragment-CUy8C-9a.esm.min.js +0 -2
  368. package/dist/chunks/default.fragment-CUy8C-9a.esm.min.js.map +0 -1
  369. package/dist/chunks/default.vertex-BjV0viwk.esm.js +0 -201
  370. package/dist/chunks/default.vertex-BjV0viwk.esm.js.map +0 -1
  371. package/dist/chunks/default.vertex-Csws4nlX.esm.js +0 -179
  372. package/dist/chunks/default.vertex-Csws4nlX.esm.js.map +0 -1
  373. package/dist/chunks/default.vertex-DEW9OmaY.esm.min.js +0 -2
  374. package/dist/chunks/default.vertex-DEW9OmaY.esm.min.js.map +0 -1
  375. package/dist/chunks/default.vertex-RwETrvv1.esm.min.js +0 -2
  376. package/dist/chunks/default.vertex-RwETrvv1.esm.min.js.map +0 -1
  377. package/dist/chunks/defaultUboDeclaration-4LjSa83l.esm.js +0 -13
  378. package/dist/chunks/defaultUboDeclaration-4LjSa83l.esm.js.map +0 -1
  379. package/dist/chunks/defaultUboDeclaration-BAc5MuTE.esm.js +0 -15
  380. package/dist/chunks/defaultUboDeclaration-BAc5MuTE.esm.js.map +0 -1
  381. package/dist/chunks/defaultUboDeclaration-BDvH281b.esm.min.js +0 -2
  382. package/dist/chunks/defaultUboDeclaration-BDvH281b.esm.min.js.map +0 -1
  383. package/dist/chunks/defaultUboDeclaration-CsugwIRC.esm.min.js +0 -2
  384. package/dist/chunks/defaultUboDeclaration-CsugwIRC.esm.min.js.map +0 -1
  385. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  386. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  387. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  388. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  389. package/dist/chunks/dumpTools-CVlLcq4U.esm.js +0 -200
  390. package/dist/chunks/dumpTools-CVlLcq4U.esm.js.map +0 -1
  391. package/dist/chunks/dumpTools-FFwGoe6H.esm.min.js +0 -2
  392. package/dist/chunks/dumpTools-FFwGoe6H.esm.min.js.map +0 -1
  393. package/dist/chunks/engine-51E0oCFG.esm.js +0 -2186
  394. package/dist/chunks/engine-51E0oCFG.esm.js.map +0 -1
  395. package/dist/chunks/engine-BzhEsiNo.esm.min.js +0 -2
  396. package/dist/chunks/engine-BzhEsiNo.esm.min.js.map +0 -1
  397. package/dist/chunks/engine.common-BqLNeDQu.esm.min.js +0 -2
  398. package/dist/chunks/engine.common-BqLNeDQu.esm.min.js.map +0 -1
  399. package/dist/chunks/engine.common-DwOUKRlu.esm.js +0 -1103
  400. package/dist/chunks/engine.common-DwOUKRlu.esm.js.map +0 -1
  401. package/dist/chunks/envTextureLoader-D8os7nVc.esm.min.js +0 -2
  402. package/dist/chunks/envTextureLoader-D8os7nVc.esm.min.js.map +0 -1
  403. package/dist/chunks/envTextureLoader-_zMHqVuH.esm.js +0 -64
  404. package/dist/chunks/envTextureLoader-_zMHqVuH.esm.js.map +0 -1
  405. package/dist/chunks/environmentTextureTools-BSDpYJoD.esm.min.js +0 -2
  406. package/dist/chunks/environmentTextureTools-BSDpYJoD.esm.min.js.map +0 -1
  407. package/dist/chunks/environmentTextureTools-CNP6T7fV.esm.js +0 -382
  408. package/dist/chunks/environmentTextureTools-CNP6T7fV.esm.js.map +0 -1
  409. package/dist/chunks/exrTextureLoader-DrYvws9N.esm.js +0 -1682
  410. package/dist/chunks/exrTextureLoader-DrYvws9N.esm.js.map +0 -1
  411. package/dist/chunks/exrTextureLoader-bt4c18qr.esm.min.js +0 -2
  412. package/dist/chunks/exrTextureLoader-bt4c18qr.esm.min.js.map +0 -1
  413. package/dist/chunks/fogFragment-B9OWaB1f.esm.min.js +0 -2
  414. package/dist/chunks/fogFragment-B9OWaB1f.esm.min.js.map +0 -1
  415. package/dist/chunks/fogFragment-DB2ExXYk.esm.js +0 -102
  416. package/dist/chunks/fogFragment-DB2ExXYk.esm.js.map +0 -1
  417. package/dist/chunks/fresnelFunction-BH02MDzu.esm.min.js +0 -2
  418. package/dist/chunks/fresnelFunction-BH02MDzu.esm.min.js.map +0 -1
  419. package/dist/chunks/fresnelFunction-D422SL6y.esm.js +0 -12
  420. package/dist/chunks/fresnelFunction-D422SL6y.esm.js.map +0 -1
  421. package/dist/chunks/glTFLoader-BmJhEWGg.esm.min.js +0 -2
  422. package/dist/chunks/glTFLoader-BmJhEWGg.esm.min.js.map +0 -1
  423. package/dist/chunks/glTFLoader-lFRcahcZ.esm.js +0 -7577
  424. package/dist/chunks/glTFLoader-lFRcahcZ.esm.js.map +0 -1
  425. package/dist/chunks/glTFLoaderAnimation-B2VjYsdt.esm.min.js +0 -2
  426. package/dist/chunks/glTFLoaderAnimation-B2VjYsdt.esm.min.js.map +0 -1
  427. package/dist/chunks/glTFLoaderAnimation-BgqLpBK0.esm.js +0 -77
  428. package/dist/chunks/glTFLoaderAnimation-BgqLpBK0.esm.js.map +0 -1
  429. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  430. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  431. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  432. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  433. package/dist/chunks/harmonicsFunctions-BjlL61sQ.esm.js +0 -34
  434. package/dist/chunks/harmonicsFunctions-BjlL61sQ.esm.js.map +0 -1
  435. package/dist/chunks/harmonicsFunctions-BryEjnIR.esm.js +0 -35
  436. package/dist/chunks/harmonicsFunctions-BryEjnIR.esm.js.map +0 -1
  437. package/dist/chunks/harmonicsFunctions-CTOWg5yb.esm.min.js +0 -2
  438. package/dist/chunks/harmonicsFunctions-CTOWg5yb.esm.min.js.map +0 -1
  439. package/dist/chunks/harmonicsFunctions-DuFvnpfy.esm.min.js +0 -2
  440. package/dist/chunks/harmonicsFunctions-DuFvnpfy.esm.min.js.map +0 -1
  441. package/dist/chunks/hdrTextureLoader-B3iuabrX.esm.js +0 -252
  442. package/dist/chunks/hdrTextureLoader-B3iuabrX.esm.js.map +0 -1
  443. package/dist/chunks/hdrTextureLoader-D4nSOUi6.esm.min.js +0 -2
  444. package/dist/chunks/hdrTextureLoader-D4nSOUi6.esm.min.js.map +0 -1
  445. package/dist/chunks/helperFunctions-C_cpg6zu.esm.js +0 -108
  446. package/dist/chunks/helperFunctions-C_cpg6zu.esm.js.map +0 -1
  447. package/dist/chunks/helperFunctions-DS7aUryI.esm.min.js +0 -2
  448. package/dist/chunks/helperFunctions-DS7aUryI.esm.min.js.map +0 -1
  449. package/dist/chunks/helperFunctions-T1RHvaFk.esm.min.js +0 -2
  450. package/dist/chunks/helperFunctions-T1RHvaFk.esm.min.js.map +0 -1
  451. package/dist/chunks/helperFunctions-XxYbp6RH.esm.js +0 -80
  452. package/dist/chunks/helperFunctions-XxYbp6RH.esm.js.map +0 -1
  453. package/dist/chunks/index-DGmBDVS_.esm.min.js +0 -57
  454. package/dist/chunks/index-DGmBDVS_.esm.min.js.map +0 -1
  455. package/dist/chunks/index-hINy0l09.esm.js +0 -73109
  456. package/dist/chunks/index-hINy0l09.esm.js.map +0 -1
  457. package/dist/chunks/ktxTextureLoader-6AAuELut.esm.min.js +0 -2
  458. package/dist/chunks/ktxTextureLoader-6AAuELut.esm.min.js.map +0 -1
  459. package/dist/chunks/ktxTextureLoader-BrMJBIsP.esm.js +0 -814
  460. package/dist/chunks/ktxTextureLoader-BrMJBIsP.esm.js.map +0 -1
  461. package/dist/chunks/logDepthDeclaration-BEU-e7iX.esm.js +0 -20
  462. package/dist/chunks/logDepthDeclaration-BEU-e7iX.esm.js.map +0 -1
  463. package/dist/chunks/logDepthDeclaration-BzHkegBO.esm.min.js +0 -2
  464. package/dist/chunks/logDepthDeclaration-BzHkegBO.esm.min.js.map +0 -1
  465. package/dist/chunks/logDepthDeclaration-DDGTDKC5.esm.min.js +0 -2
  466. package/dist/chunks/logDepthDeclaration-DDGTDKC5.esm.min.js.map +0 -1
  467. package/dist/chunks/logDepthDeclaration-zWkzJJaj.esm.js +0 -35
  468. package/dist/chunks/logDepthDeclaration-zWkzJJaj.esm.js.map +0 -1
  469. package/dist/chunks/logDepthVertex-BTgRkpDb.esm.js +0 -77
  470. package/dist/chunks/logDepthVertex-BTgRkpDb.esm.js.map +0 -1
  471. package/dist/chunks/logDepthVertex-CR6Dnl8p.esm.js +0 -487
  472. package/dist/chunks/logDepthVertex-CR6Dnl8p.esm.js.map +0 -1
  473. package/dist/chunks/logDepthVertex-D-jlsoRi.esm.min.js +0 -2
  474. package/dist/chunks/logDepthVertex-D-jlsoRi.esm.min.js.map +0 -1
  475. package/dist/chunks/logDepthVertex-DxPFoSRJ.esm.min.js +0 -2
  476. package/dist/chunks/logDepthVertex-DxPFoSRJ.esm.min.js.map +0 -1
  477. package/dist/chunks/mainUVVaryingDeclaration-DsE-nuOI.esm.js +0 -11
  478. package/dist/chunks/mainUVVaryingDeclaration-DsE-nuOI.esm.js.map +0 -1
  479. package/dist/chunks/mainUVVaryingDeclaration-iUnIeKsP.esm.min.js +0 -2
  480. package/dist/chunks/mainUVVaryingDeclaration-iUnIeKsP.esm.min.js.map +0 -1
  481. package/dist/chunks/meshUboDeclaration-ByZURqeP.esm.js +0 -24
  482. package/dist/chunks/meshUboDeclaration-ByZURqeP.esm.js.map +0 -1
  483. package/dist/chunks/meshUboDeclaration-CGE6TBvO.esm.min.js +0 -2
  484. package/dist/chunks/meshUboDeclaration-CGE6TBvO.esm.min.js.map +0 -1
  485. package/dist/chunks/objFileLoader-DSKQNfbT.esm.min.js +0 -2
  486. package/dist/chunks/objFileLoader-DSKQNfbT.esm.min.js.map +0 -1
  487. package/dist/chunks/objFileLoader-ZAUMmoom.esm.js +0 -1338
  488. package/dist/chunks/objFileLoader-ZAUMmoom.esm.js.map +0 -1
  489. package/dist/chunks/oitFragment-CPlL_F_M.esm.min.js +0 -2
  490. package/dist/chunks/oitFragment-CPlL_F_M.esm.min.js.map +0 -1
  491. package/dist/chunks/oitFragment-CjRk4LUn.esm.js +0 -1210
  492. package/dist/chunks/oitFragment-CjRk4LUn.esm.js.map +0 -1
  493. package/dist/chunks/oitFragment-DDtaYDtX.esm.min.js +0 -2
  494. package/dist/chunks/oitFragment-DDtaYDtX.esm.min.js.map +0 -1
  495. package/dist/chunks/oitFragment-DKU-nxjP.esm.js +0 -1150
  496. package/dist/chunks/oitFragment-DKU-nxjP.esm.js.map +0 -1
  497. package/dist/chunks/pass.fragment-BKV6FFmr.esm.js +0 -15
  498. package/dist/chunks/pass.fragment-BKV6FFmr.esm.js.map +0 -1
  499. package/dist/chunks/pass.fragment-D1iXhiCi.esm.js +0 -15
  500. package/dist/chunks/pass.fragment-D1iXhiCi.esm.js.map +0 -1
  501. package/dist/chunks/pass.fragment-Dwcyc4Ej.esm.min.js +0 -2
  502. package/dist/chunks/pass.fragment-Dwcyc4Ej.esm.min.js.map +0 -1
  503. package/dist/chunks/pass.fragment-ZOjBIC5T.esm.min.js +0 -2
  504. package/dist/chunks/pass.fragment-ZOjBIC5T.esm.min.js.map +0 -1
  505. package/dist/chunks/pbr.fragment-7-jvo-Lu.esm.min.js +0 -2
  506. package/dist/chunks/pbr.fragment-7-jvo-Lu.esm.min.js.map +0 -1
  507. package/dist/chunks/pbr.fragment-C0AHDtQZ.esm.js +0 -3218
  508. package/dist/chunks/pbr.fragment-C0AHDtQZ.esm.js.map +0 -1
  509. package/dist/chunks/pbr.fragment-C2umUn6E.esm.min.js +0 -2
  510. package/dist/chunks/pbr.fragment-C2umUn6E.esm.min.js.map +0 -1
  511. package/dist/chunks/pbr.fragment-D1MzHhjE.esm.js +0 -3163
  512. package/dist/chunks/pbr.fragment-D1MzHhjE.esm.js.map +0 -1
  513. package/dist/chunks/pbr.vertex-C-xQLuyI.esm.js +0 -338
  514. package/dist/chunks/pbr.vertex-C-xQLuyI.esm.js.map +0 -1
  515. package/dist/chunks/pbr.vertex-CDlVncXy.esm.min.js +0 -2
  516. package/dist/chunks/pbr.vertex-CDlVncXy.esm.min.js.map +0 -1
  517. package/dist/chunks/pbr.vertex-CSP9bnil.esm.js +0 -212
  518. package/dist/chunks/pbr.vertex-CSP9bnil.esm.js.map +0 -1
  519. package/dist/chunks/pbr.vertex-DBNbF59S.esm.min.js +0 -2
  520. package/dist/chunks/pbr.vertex-DBNbF59S.esm.min.js.map +0 -1
  521. package/dist/chunks/postprocess.vertex-CTDu4M--.esm.js +0 -20
  522. package/dist/chunks/postprocess.vertex-CTDu4M--.esm.js.map +0 -1
  523. package/dist/chunks/postprocess.vertex-Dr1CI2Kf.esm.min.js +0 -2
  524. package/dist/chunks/postprocess.vertex-Dr1CI2Kf.esm.min.js.map +0 -1
  525. package/dist/chunks/rawTexture-B5xaxZ_c.esm.js +0 -191
  526. package/dist/chunks/rawTexture-B5xaxZ_c.esm.js.map +0 -1
  527. package/dist/chunks/rawTexture-C7-sBY2k.esm.min.js +0 -2
  528. package/dist/chunks/rawTexture-C7-sBY2k.esm.min.js.map +0 -1
  529. package/dist/chunks/rgbdDecode.fragment-BrWKXvJ-.esm.min.js +0 -2
  530. package/dist/chunks/rgbdDecode.fragment-BrWKXvJ-.esm.min.js.map +0 -1
  531. package/dist/chunks/rgbdDecode.fragment-DqUF358g.esm.min.js +0 -2
  532. package/dist/chunks/rgbdDecode.fragment-DqUF358g.esm.min.js.map +0 -1
  533. package/dist/chunks/rgbdDecode.fragment-Duw7huP3.esm.js +0 -17
  534. package/dist/chunks/rgbdDecode.fragment-Duw7huP3.esm.js.map +0 -1
  535. package/dist/chunks/rgbdDecode.fragment-ZV6XgSnm.esm.js +0 -17
  536. package/dist/chunks/rgbdDecode.fragment-ZV6XgSnm.esm.js.map +0 -1
  537. package/dist/chunks/rgbdEncode.fragment-C-G9An5L.esm.js +0 -17
  538. package/dist/chunks/rgbdEncode.fragment-C-G9An5L.esm.js.map +0 -1
  539. package/dist/chunks/rgbdEncode.fragment-C0j5RCbr.esm.js +0 -17
  540. package/dist/chunks/rgbdEncode.fragment-C0j5RCbr.esm.js.map +0 -1
  541. package/dist/chunks/rgbdEncode.fragment-CtGBIZQp.esm.min.js +0 -2
  542. package/dist/chunks/rgbdEncode.fragment-CtGBIZQp.esm.min.js.map +0 -1
  543. package/dist/chunks/rgbdEncode.fragment-d4BzLxQt.esm.min.js +0 -2
  544. package/dist/chunks/rgbdEncode.fragment-d4BzLxQt.esm.min.js.map +0 -1
  545. package/dist/chunks/splatFileLoader-CkOGfjDc.esm.js +0 -3807
  546. package/dist/chunks/splatFileLoader-CkOGfjDc.esm.js.map +0 -1
  547. package/dist/chunks/splatFileLoader-NH-lVwz1.esm.min.js +0 -2
  548. package/dist/chunks/splatFileLoader-NH-lVwz1.esm.min.js.map +0 -1
  549. package/dist/chunks/standardMaterial-CkrdY6He.esm.min.js +0 -2
  550. package/dist/chunks/standardMaterial-CkrdY6He.esm.min.js.map +0 -1
  551. package/dist/chunks/standardMaterial-D_xEA8Mf.esm.js +0 -1805
  552. package/dist/chunks/standardMaterial-D_xEA8Mf.esm.js.map +0 -1
  553. package/dist/chunks/stlFileLoader-BoXK4BT7.esm.js +0 -238
  554. package/dist/chunks/stlFileLoader-BoXK4BT7.esm.js.map +0 -1
  555. package/dist/chunks/stlFileLoader-DUh8a4d5.esm.min.js +0 -2
  556. package/dist/chunks/stlFileLoader-DUh8a4d5.esm.min.js.map +0 -1
  557. package/dist/chunks/tgaTextureLoader-BqQKERzb.esm.min.js +0 -2
  558. package/dist/chunks/tgaTextureLoader-BqQKERzb.esm.min.js.map +0 -1
  559. package/dist/chunks/tgaTextureLoader-CtOyJ6rA.esm.js +0 -349
  560. package/dist/chunks/tgaTextureLoader-CtOyJ6rA.esm.js.map +0 -1
  561. package/dist/chunks/thinEngine-0kjJ4nmB.esm.js +0 -3721
  562. package/dist/chunks/thinEngine-0kjJ4nmB.esm.js.map +0 -1
  563. package/dist/chunks/thinEngine-BS_evuoV.esm.min.js +0 -2
  564. package/dist/chunks/thinEngine-BS_evuoV.esm.min.js.map +0 -1
  565. package/dist/chunks/thinInstanceMesh-D97pJRZH.esm.min.js +0 -2
  566. package/dist/chunks/thinInstanceMesh-D97pJRZH.esm.min.js.map +0 -1
  567. package/dist/chunks/thinInstanceMesh-DUynhhy_.esm.js +0 -314
  568. package/dist/chunks/thinInstanceMesh-DUynhhy_.esm.js.map +0 -1
  569. package/dist/chunks/vertexColorMixing-DtowtWJN.esm.js +0 -522
  570. package/dist/chunks/vertexColorMixing-DtowtWJN.esm.js.map +0 -1
  571. package/dist/chunks/vertexColorMixing-PKuqLcMC.esm.min.js +0 -2
  572. package/dist/chunks/vertexColorMixing-PKuqLcMC.esm.min.js.map +0 -1
  573. package/dist/chunks/webgpuEngine-CeBLRqls.esm.js +0 -11228
  574. package/dist/chunks/webgpuEngine-CeBLRqls.esm.js.map +0 -1
  575. package/dist/chunks/webgpuEngine-DG7GVLbC.esm.min.js +0 -2
  576. package/dist/chunks/webgpuEngine-DG7GVLbC.esm.min.js.map +0 -1
  577. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  578. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  579. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  580. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  581. package/docs/ViewerDefault.jpg +0 -0
  582. package/docs/ViewerParts.jpg +0 -0
  583. package/docs/ViewerSlots.jpg +0 -0
  584. package/docs/ViewerStyled.jpg +0 -0
  585. package/lib/index.d.ts +0 -372
  586. package/lib/index.js +0 -1312
  587. package/lib/index.js.map +0 -1
package/lib/index.js DELETED
@@ -1,1312 +0,0 @@
1
- import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera.js';
2
- import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight.js';
3
- import { loadAssetContainerAsync } from '@babylonjs/core/Loading/sceneLoader.js';
4
- import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial.js';
5
- import { CubeTexture } from '@babylonjs/core/Materials/Textures/cubeTexture.js';
6
- import { Texture } from '@babylonjs/core/Materials/Textures/texture.js';
7
- import { Clamp } from '@babylonjs/core/Maths/math.scalar.functions.js';
8
- import { Vector3, TmpVectors } from '@babylonjs/core/Maths/math.vector.js';
9
- import { CreateBox } from '@babylonjs/core/Meshes/Builders/boxBuilder.js';
10
- import { computeMaxExtents } from '@babylonjs/core/Meshes/meshUtils.js';
11
- import { AsyncLock } from '@babylonjs/core/Misc/asyncLock.js';
12
- import { Observable } from '@babylonjs/core/Misc/observable.js';
13
- import { Scene } from '@babylonjs/core/scene.js';
14
- import { registerBuiltInLoaders } from '@babylonjs/loaders/dynamic.js';
15
- import { Viewport } from '@babylonjs/core/Maths/math.viewport.js';
16
- import { GetHotSpotToRef } from '@babylonjs/core/Meshes/abstractMesh.hotSpot.js';
17
- import { SnapshotRenderingHelper } from '@babylonjs/core/Misc/snapshotRenderingHelper.js';
18
- import { __decorate } from '@babylonjs/core/tslib.es6.js';
19
- import { css, LitElement, html, defaultConverter } from 'lit';
20
- import { property, state, query, customElement } from 'lit/decorators.js';
21
- import { Color4 } from '@babylonjs/core/Maths/math.color.js';
22
- import { Logger } from '@babylonjs/core/Misc/logger.js';
23
-
24
- function throwIfAborted(...abortSignals) {
25
- for (const signal of abortSignals) {
26
- signal?.throwIfAborted();
27
- }
28
- }
29
- function createSkybox(scene, camera, environmentTexture, blur) {
30
- const hdrSkybox = CreateBox("hdrSkyBox", undefined, scene);
31
- const hdrSkyboxMaterial = new PBRMaterial("skyBox", scene);
32
- hdrSkyboxMaterial.backFaceCulling = false;
33
- hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone();
34
- if (hdrSkyboxMaterial.reflectionTexture) {
35
- hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE;
36
- }
37
- hdrSkyboxMaterial.microSurface = 1.0 - blur;
38
- hdrSkyboxMaterial.disableLighting = true;
39
- hdrSkyboxMaterial.twoSidedLighting = true;
40
- hdrSkybox.material = hdrSkyboxMaterial;
41
- hdrSkybox.isPickable = false;
42
- hdrSkybox.infiniteDistance = true;
43
- updateSkybox(hdrSkybox, camera);
44
- return hdrSkybox;
45
- }
46
- function updateSkybox(skybox, camera) {
47
- skybox?.scaling.setAll((camera.maxZ - camera.minZ) / 2);
48
- }
49
- /**
50
- * @experimental
51
- * Provides an experience for viewing a single 3D model.
52
- * @remarks
53
- * The Viewer is not tied to a specific UI framework and can be used with Babylon.js in a browser or with Babylon Native.
54
- * Includes (or will include) support for common model viewing requirements such as:
55
- * - Loading different model formats.
56
- * - Setting up a camera and providing default behaviors like auto orbit and pose interpolation.
57
- * - Framing the loaded model in the camera's view.
58
- * - Setting up the environment, lighting, and tone mapping.
59
- * - Enumerating and playing (or auto playing) animations.
60
- * - Enumerating and switching between material variants.
61
- * - Full screen and XR modes.
62
- */
63
- class Viewer {
64
- constructor(_engine, options) {
65
- this._engine = _engine;
66
- /**
67
- * Fired when the environment has changed.
68
- */
69
- this.onEnvironmentChanged = new Observable();
70
- /**
71
- * Fired when an error occurs while loading the environment.
72
- */
73
- this.onEnvironmentError = new Observable();
74
- /**
75
- * Fired when the skybox blur changes.
76
- */
77
- this.onSkyboxBlurChanged = new Observable();
78
- /**
79
- * Fired when a model is loaded into the viewer (or unloaded from the viewer).
80
- */
81
- this.onModelChanged = new Observable();
82
- /**
83
- * Fired when an error occurs while loading a model.
84
- */
85
- this.onModelError = new Observable();
86
- /**
87
- * Fired when the camera auto orbit state changes.
88
- */
89
- this.onCameraAutoOrbitChanged = new Observable();
90
- /**
91
- * Fired when the selected animation changes.
92
- */
93
- this.onSelectedAnimationChanged = new Observable();
94
- /**
95
- * Fired when the animation speed changes.
96
- */
97
- this.onAnimationSpeedChanged = new Observable();
98
- /**
99
- * Fired when the selected animation is playing or paused.
100
- */
101
- this.onIsAnimationPlayingChanged = new Observable();
102
- /**
103
- * Fired when the current point on the selected animation timeline changes.
104
- */
105
- this.onAnimationProgressChanged = new Observable();
106
- this._skybox = null;
107
- this._skyboxBlur = 0.3;
108
- this._light = null;
109
- this._isDisposed = false;
110
- this._loadModelLock = new AsyncLock();
111
- this._loadModelAbortController = null;
112
- this._loadEnvironmentLock = new AsyncLock();
113
- this._environment = null;
114
- this._loadEnvironmentAbortController = null;
115
- this._selectedAnimation = -1;
116
- this._activeAnimationObservers = [];
117
- this._animationSpeed = 1;
118
- {
119
- const scene = new Scene(this._engine);
120
- const camera = new ArcRotateCamera("Viewer Default Camera", 0, 0, 1, Vector3.Zero(), scene);
121
- this._details = {
122
- viewer: this,
123
- scene,
124
- camera,
125
- model: null,
126
- };
127
- }
128
- this._details.scene.skipFrustumClipping = true;
129
- this._details.scene.skipPointerMovePicking = true;
130
- this._snapshotHelper = new SnapshotRenderingHelper(this._details.scene, { morphTargetsNumMaxInfluences: 30 });
131
- this._details.camera.attachControl();
132
- this._updateCamera(); // set default camera values
133
- this._autoRotationBehavior = this._details.camera.getBehaviorByName("AutoRotation");
134
- // Load a default light, but ignore errors as the user might be immediately loading their own environment.
135
- this.resetEnvironment().catch(() => { });
136
- // TODO: render at least back ground. Maybe we can only run renderloop when a mesh is loaded. What to render until then?
137
- const render = () => {
138
- this._details.scene.render();
139
- if (this.isAnimationPlaying) {
140
- this.onAnimationProgressChanged.notifyObservers();
141
- this._autoRotationBehavior.resetLastInteractionTime();
142
- }
143
- };
144
- this._engine.runRenderLoop(render);
145
- this._renderLoopController = {
146
- dispose: () => this._engine.stopRenderLoop(render),
147
- };
148
- options?.onInitialized?.(this._details);
149
- }
150
- /**
151
- * Enables or disables camera auto orbit.
152
- */
153
- get cameraAutoOrbit() {
154
- return this._details.camera.behaviors.includes(this._autoRotationBehavior);
155
- }
156
- set cameraAutoOrbit(value) {
157
- if (value !== this.cameraAutoOrbit) {
158
- if (value) {
159
- this._details.camera.addBehavior(this._autoRotationBehavior);
160
- }
161
- else {
162
- this._details.camera.removeBehavior(this._autoRotationBehavior);
163
- }
164
- this.onCameraAutoOrbitChanged.notifyObservers();
165
- }
166
- }
167
- /**
168
- * A value between 0 and 1 that specifies how much to blur the skybox.
169
- */
170
- get skyboxBlur() {
171
- return this._skyboxBlur;
172
- }
173
- set skyboxBlur(value) {
174
- if (value !== this._skyboxBlur) {
175
- this._skyboxBlur = value;
176
- if (this._skybox) {
177
- const material = this._skybox.material;
178
- if (material instanceof PBRMaterial) {
179
- this._snapshotHelper.disableSnapshotRendering();
180
- material.microSurface = 1.0 - value;
181
- this._snapshotHelper.enableSnapshotRendering();
182
- }
183
- }
184
- this.onSkyboxBlurChanged.notifyObservers();
185
- }
186
- }
187
- /**
188
- * The list of animation names for the currently loaded model.
189
- */
190
- get animations() {
191
- return this._details.model?.animationGroups.map((group) => group.name) ?? [];
192
- }
193
- /**
194
- * The currently selected animation index.
195
- */
196
- get selectedAnimation() {
197
- return this._selectedAnimation;
198
- }
199
- set selectedAnimation(value) {
200
- value = Math.round(Clamp(value, -1, this.animations.length - 1));
201
- if (value !== this._selectedAnimation) {
202
- const startAnimation = this.isAnimationPlaying;
203
- if (this._activeAnimation) {
204
- this._activeAnimationObservers.forEach((observer) => observer.remove());
205
- this._activeAnimationObservers = [];
206
- this._activeAnimation.pause();
207
- this._activeAnimation.goToFrame(0);
208
- }
209
- this._selectedAnimation = value;
210
- if (this._activeAnimation) {
211
- this._activeAnimation.goToFrame(0);
212
- this._activeAnimation.play(true);
213
- if (!startAnimation) {
214
- this.pauseAnimation();
215
- }
216
- this._activeAnimationObservers = [
217
- this._activeAnimation.onAnimationGroupPlayObservable.add(() => {
218
- this.onIsAnimationPlayingChanged.notifyObservers();
219
- }),
220
- this._activeAnimation.onAnimationGroupPauseObservable.add(() => {
221
- this.onIsAnimationPlayingChanged.notifyObservers();
222
- }),
223
- this._activeAnimation.onAnimationGroupEndObservable.add(() => {
224
- this.onIsAnimationPlayingChanged.notifyObservers();
225
- this.onAnimationProgressChanged.notifyObservers();
226
- }),
227
- ];
228
- }
229
- this._updateCamera();
230
- this.onSelectedAnimationChanged.notifyObservers();
231
- }
232
- }
233
- /**
234
- * True if an animation is currently playing.
235
- */
236
- get isAnimationPlaying() {
237
- return this._activeAnimation?.isPlaying ?? false;
238
- }
239
- /**
240
- * The speed scale at which animations are played.
241
- */
242
- get animationSpeed() {
243
- return this._animationSpeed;
244
- }
245
- set animationSpeed(value) {
246
- this._animationSpeed = value;
247
- this._applyAnimationSpeed();
248
- this.onAnimationSpeedChanged.notifyObservers();
249
- }
250
- /**
251
- * The current point on the selected animation timeline, normalized between 0 and 1.
252
- */
253
- get animationProgress() {
254
- if (this._activeAnimation) {
255
- return this._activeAnimation.getCurrentFrame() / (this._activeAnimation.to - this._activeAnimation.from);
256
- }
257
- return 0;
258
- }
259
- set animationProgress(value) {
260
- if (this._activeAnimation) {
261
- this._activeAnimation.goToFrame(value * (this._activeAnimation.to - this._activeAnimation.from));
262
- this.onAnimationProgressChanged.notifyObservers();
263
- this._autoRotationBehavior.resetLastInteractionTime();
264
- }
265
- }
266
- get _activeAnimation() {
267
- return this._details.model?.animationGroups[this._selectedAnimation] ?? null;
268
- }
269
- /**
270
- * Loads a 3D model from the specified URL.
271
- * @remarks
272
- * If a model is already loaded, it will be unloaded before loading the new model.
273
- * @param source A url or File or ArrayBufferView that points to the model to load.
274
- * @param options The options to use when loading the model.
275
- * @param abortSignal An optional signal that can be used to abort the loading process.
276
- */
277
- async loadModel(source, options, abortSignal) {
278
- await this._updateModel(source, options, abortSignal);
279
- }
280
- /**
281
- * Unloads the current 3D model if one is loaded.
282
- * @param abortSignal An optional signal that can be used to abort the reset.
283
- */
284
- async resetModel(abortSignal) {
285
- await this._updateModel(undefined, undefined, abortSignal);
286
- }
287
- async _updateModel(source, options, abortSignal) {
288
- this._throwIfDisposedOrAborted(abortSignal);
289
- this._loadModelAbortController?.abort("New model is being loaded before previous model finished loading.");
290
- const abortController = (this._loadModelAbortController = new AbortController());
291
- await this._loadModelLock.lockAsync(async () => {
292
- throwIfAborted(abortSignal, abortController.signal);
293
- this._snapshotHelper.disableSnapshotRendering();
294
- this._details.model?.dispose();
295
- this._details.model = null;
296
- this.selectedAnimation = -1;
297
- try {
298
- if (source) {
299
- this._details.model = await loadAssetContainerAsync(source, this._details.scene, options);
300
- this._details.model.animationGroups.forEach((group) => {
301
- group.start(true, this.animationSpeed);
302
- group.pause();
303
- });
304
- this.selectedAnimation = 0;
305
- this._snapshotHelper.fixMeshes(this._details.model.meshes);
306
- this._details.model.addAllToScene();
307
- }
308
- this._updateCamera();
309
- this._updateLight();
310
- this._applyAnimationSpeed();
311
- this.onModelChanged.notifyObservers();
312
- }
313
- catch (e) {
314
- this.onModelError.notifyObservers(e);
315
- throw e;
316
- }
317
- finally {
318
- this._snapshotHelper.enableSnapshotRendering();
319
- }
320
- });
321
- }
322
- /**
323
- * Loads an environment texture from the specified url and sets up a corresponding skybox.
324
- * @remarks
325
- * If an environment is already loaded, it will be unloaded before loading the new environment.
326
- * @param url The url of the environment texture to load.
327
- * @param options The options to use when loading the environment.
328
- * @param abortSignal An optional signal that can be used to abort the loading process.
329
- */
330
- async loadEnvironment(url, options, abortSignal) {
331
- await this._updateEnvironment(url, options, abortSignal);
332
- }
333
- /**
334
- * Unloads the current environment if one is loaded.
335
- * @param abortSignal An optional signal that can be used to abort the reset.
336
- */
337
- async resetEnvironment(abortSignal) {
338
- await this._updateEnvironment(undefined, undefined, abortSignal);
339
- }
340
- async _updateEnvironment(url, options, abortSignal) {
341
- this._throwIfDisposedOrAborted(abortSignal);
342
- this._loadEnvironmentAbortController?.abort("New environment is being loaded before previous environment finished loading.");
343
- const abortController = (this._loadEnvironmentAbortController = new AbortController());
344
- await this._loadEnvironmentLock.lockAsync(async () => {
345
- throwIfAborted(abortSignal, abortController.signal);
346
- this._snapshotHelper.disableSnapshotRendering();
347
- this._environment?.dispose();
348
- this._environment = null;
349
- this._details.scene.autoClear = true;
350
- try {
351
- if (url) {
352
- this._environment = await new Promise((resolve, reject) => {
353
- const cubeTexture = CubeTexture.CreateFromPrefilteredData(url, this._details.scene);
354
- this._details.scene.environmentTexture = cubeTexture;
355
- const skybox = createSkybox(this._details.scene, this._details.camera, cubeTexture, this.skyboxBlur);
356
- this._snapshotHelper.fixMeshes([skybox]);
357
- this._skybox = skybox;
358
- this._details.scene.autoClear = false;
359
- const dispose = () => {
360
- cubeTexture.dispose();
361
- skybox.dispose();
362
- this._skybox = null;
363
- };
364
- const successObserver = cubeTexture.onLoadObservable.addOnce(() => {
365
- successObserver.remove();
366
- errorObserver.remove();
367
- resolve({
368
- dispose,
369
- });
370
- });
371
- const errorObserver = Texture.OnTextureLoadErrorObservable.add((texture) => {
372
- if (texture === cubeTexture) {
373
- successObserver.remove();
374
- errorObserver.remove();
375
- dispose();
376
- reject(new Error("Failed to load environment texture."));
377
- }
378
- });
379
- });
380
- }
381
- this._updateLight();
382
- this.onEnvironmentChanged.notifyObservers();
383
- }
384
- catch (e) {
385
- this.onEnvironmentError.notifyObservers(e);
386
- throw e;
387
- }
388
- finally {
389
- this._snapshotHelper.enableSnapshotRendering();
390
- }
391
- });
392
- }
393
- /**
394
- * Toggles the play/pause animation state if there is a selected animation.
395
- */
396
- toggleAnimation() {
397
- if (this.isAnimationPlaying) {
398
- this.pauseAnimation();
399
- }
400
- else {
401
- this.playAnimation();
402
- }
403
- }
404
- /**
405
- * Plays the selected animation if there is one.
406
- */
407
- playAnimation() {
408
- this._activeAnimation?.play(true);
409
- }
410
- /**
411
- * Pauses the selected animation if there is one.
412
- */
413
- async pauseAnimation() {
414
- this._activeAnimation?.pause();
415
- }
416
- /**
417
- * Disposes of the resources held by the Viewer.
418
- */
419
- dispose() {
420
- this.selectedAnimation = -1;
421
- this.animationProgress = 0;
422
- this._loadEnvironmentAbortController?.abort("Thew viewer is being disposed.");
423
- this._loadModelAbortController?.abort("Thew viewer is being disposed.");
424
- this._renderLoopController.dispose();
425
- this._details.scene.dispose();
426
- this.onEnvironmentChanged.clear();
427
- this.onEnvironmentError.clear();
428
- this.onSkyboxBlurChanged.clear();
429
- this.onModelChanged.clear();
430
- this.onModelError.clear();
431
- this.onCameraAutoOrbitChanged.clear();
432
- this.onSelectedAnimationChanged.clear();
433
- this.onAnimationSpeedChanged.clear();
434
- this.onIsAnimationPlayingChanged.clear();
435
- this.onAnimationProgressChanged.clear();
436
- this._isDisposed = true;
437
- }
438
- /**
439
- * retrun world and canvas coordinates of an hot spot
440
- * @param hotSpotQuery mesh index and surface information to query the hot spot positions
441
- * @param res Query a Hot Spot and does the conversion for Babylon Hot spot to a more generic HotSpotPositions, without Vector types
442
- * @returns true if hotspot found
443
- */
444
- getHotSpotToRef(hotSpotQuery, res) {
445
- if (!this._details.model) {
446
- return false;
447
- }
448
- const worldPos = TmpVectors.Vector3[1];
449
- const screenPos = TmpVectors.Vector3[0];
450
- const mesh = this._details.model.meshes[hotSpotQuery.meshIndex];
451
- if (!mesh) {
452
- return false;
453
- }
454
- GetHotSpotToRef(mesh, hotSpotQuery, worldPos);
455
- const renderWidth = this._engine.getRenderWidth(); // Get the canvas width
456
- const renderHeight = this._engine.getRenderHeight(); // Get the canvas height
457
- const viewportWidth = this._details.camera.viewport.width * renderWidth;
458
- const viewportHeight = this._details.camera.viewport.height * renderHeight;
459
- const scene = this._details.scene;
460
- Vector3.ProjectToRef(worldPos, mesh.getWorldMatrix(), scene.getTransformMatrix(), new Viewport(0, 0, viewportWidth, viewportHeight), screenPos);
461
- res.screenPosition = [screenPos.x, screenPos.y];
462
- res.worldPosition = [worldPos.x, worldPos.y, worldPos.z];
463
- return true;
464
- }
465
- _updateCamera() {
466
- // Enable camera's behaviors
467
- this._details.camera.useFramingBehavior = true;
468
- const framingBehavior = this._details.camera.getBehaviorByName("Framing");
469
- framingBehavior.framingTime = 0;
470
- framingBehavior.elevationReturnTime = -1;
471
- let radius = 1;
472
- if (this._details.model?.meshes.length) {
473
- // get bounds and prepare framing/camera radius from its values
474
- this._details.camera.lowerRadiusLimit = null;
475
- const maxExtents = computeMaxExtents(this._details.model.meshes, this._activeAnimation);
476
- const worldExtents = {
477
- min: new Vector3(Math.min(...maxExtents.map((e) => e.minimum.x)), Math.min(...maxExtents.map((e) => e.minimum.y)), Math.min(...maxExtents.map((e) => e.minimum.z))),
478
- max: new Vector3(Math.max(...maxExtents.map((e) => e.maximum.x)), Math.max(...maxExtents.map((e) => e.maximum.y)), Math.max(...maxExtents.map((e) => e.maximum.z))),
479
- };
480
- framingBehavior.zoomOnBoundingInfo(worldExtents.min, worldExtents.max);
481
- const worldSize = worldExtents.max.subtract(worldExtents.min);
482
- const worldCenter = worldExtents.min.add(worldSize.scale(0.5));
483
- radius = worldSize.length() * 1.1;
484
- if (!isFinite(radius)) {
485
- radius = 1;
486
- worldCenter.copyFromFloats(0, 0, 0);
487
- }
488
- this._details.camera.setTarget(worldCenter);
489
- }
490
- this._details.camera.lowerRadiusLimit = radius * 0.01;
491
- this._details.camera.wheelPrecision = 100 / radius;
492
- this._details.camera.alpha = Math.PI / 2;
493
- this._details.camera.beta = Math.PI / 2.4;
494
- this._details.camera.radius = radius;
495
- this._details.camera.minZ = radius * 0.01;
496
- this._details.camera.maxZ = radius * 1000;
497
- this._details.camera.speed = radius * 0.2;
498
- this._details.camera.useAutoRotationBehavior = true;
499
- this._details.camera.pinchPrecision = 200 / this._details.camera.radius;
500
- this._details.camera.upperRadiusLimit = 5 * this._details.camera.radius;
501
- this._details.camera.wheelDeltaPercentage = 0.01;
502
- this._details.camera.pinchDeltaPercentage = 0.01;
503
- this._details.camera.restoreStateInterpolationFactor = 0.1;
504
- this._details.camera.storeState();
505
- updateSkybox(this._skybox, this._details.camera);
506
- }
507
- _updateLight() {
508
- let shouldHaveDefaultLight;
509
- if (!this._details.model) {
510
- shouldHaveDefaultLight = false;
511
- }
512
- else {
513
- const hasModelProvidedLights = this._details.model.lights.length > 0;
514
- const hasImageBasedLighting = !!this._environment;
515
- const hasMaterials = this._details.model.materials.length > 0;
516
- const hasNonPBRMaterials = this._details.model.materials.some((material) => !(material instanceof PBRMaterial));
517
- if (hasModelProvidedLights) {
518
- shouldHaveDefaultLight = false;
519
- }
520
- else {
521
- shouldHaveDefaultLight = !hasImageBasedLighting || !hasMaterials || hasNonPBRMaterials;
522
- }
523
- }
524
- if (shouldHaveDefaultLight) {
525
- if (!this._light) {
526
- this._light = new HemisphericLight("defaultLight", Vector3.Up(), this._details.scene);
527
- }
528
- }
529
- else {
530
- this._light?.dispose();
531
- this._light = null;
532
- }
533
- }
534
- _applyAnimationSpeed() {
535
- this._details.model?.animationGroups.forEach((group) => (group.speedRatio = this._animationSpeed));
536
- }
537
- /**
538
- * Check for disposed or aborted state (basically everything that can interrupt an async operation).
539
- * @param abortSignals A set of optional AbortSignals to also check.
540
- */
541
- _throwIfDisposedOrAborted(...abortSignals) {
542
- if (this._isDisposed) {
543
- throw new Error("Viewer is disposed.");
544
- }
545
- throwIfAborted(...abortSignals);
546
- }
547
- }
548
- (() => {
549
- registerBuiltInLoaders();
550
- })();
551
-
552
- const defaultCanvasViewerOptions = {};
553
- /**
554
- * Chooses a default engine for the current browser environment.
555
- * @returns The default engine to use.
556
- */
557
- function getDefaultEngine() {
558
- // TODO: When WebGPU is fully production ready, we may want to prefer it if it is supported by the browser.
559
- return "WebGL";
560
- }
561
- /**
562
- * Creates a Viewer instance that is bound to an HTML canvas.
563
- * @remarks
564
- * This function can be shared across multiple UI integrations (e.g. Web Components, React, etc.).
565
- * @param canvas The canvas element to bind the Viewer to.
566
- * @param options The options to use when creating the Viewer and binding it to the specified canvas.
567
- * @returns A Viewer instance that is bound to the specified canvas.
568
- */
569
- async function createViewerForCanvas(canvas, options) {
570
- const finalOptions = { ...defaultCanvasViewerOptions, ...options };
571
- const disposeActions = [];
572
- // If the canvas is resized, note that the engine needs a resize, but don't resize it here as it will result in flickering.
573
- let needsResize = false;
574
- const resizeObserver = new ResizeObserver(() => (needsResize = true));
575
- resizeObserver.observe(canvas);
576
- disposeActions.push(() => resizeObserver.disconnect());
577
- // Create an engine instance.
578
- let engine;
579
- switch (finalOptions.engine ?? getDefaultEngine()) {
580
- case "WebGL": {
581
- // eslint-disable-next-line @typescript-eslint/naming-convention, no-case-declarations
582
- const { Engine } = await import('@babylonjs/core/Engines/engine.js');
583
- engine = new Engine(canvas, undefined, options);
584
- break;
585
- }
586
- case "WebGPU": {
587
- // eslint-disable-next-line @typescript-eslint/naming-convention, no-case-declarations
588
- const { WebGPUEngine } = await import('@babylonjs/core/Engines/webgpuEngine.js');
589
- const webGPUEngine = new WebGPUEngine(canvas, options);
590
- await webGPUEngine.initAsync();
591
- engine = webGPUEngine;
592
- break;
593
- }
594
- }
595
- // Override the onInitialized callback to add in some specific behavior.
596
- const onInitialized = finalOptions.onInitialized;
597
- finalOptions.onInitialized = (details) => {
598
- // Resize if needed right before rendering the Viewer scene to avoid any flickering.
599
- const beforeRenderObserver = details.scene.onBeforeRenderObservable.add(() => {
600
- if (needsResize) {
601
- engine.resize();
602
- needsResize = false;
603
- }
604
- });
605
- disposeActions.push(() => beforeRenderObserver.remove());
606
- // Call the original onInitialized callback, if one was provided.
607
- onInitialized?.(details);
608
- };
609
- // Instantiate the Viewer with the engine and options.
610
- const viewer = new Viewer(engine, finalOptions);
611
- disposeActions.push(viewer.dispose.bind(viewer));
612
- disposeActions.push(() => engine.dispose());
613
- // Override the Viewer's dispose method to add in additional cleanup.
614
- viewer.dispose = () => disposeActions.forEach((dispose) => dispose());
615
- return viewer;
616
- }
617
-
618
- var HTML3DElement_1;
619
- // Icon SVG is pulled from https://fluentuipr.z22.web.core.windows.net/heads/master/public-docsite-v9/storybook/iframe.html?id=icons-catalog--page&viewMode=story
620
- const playFilledIcon = "M17.22 8.68a1.5 1.5 0 0 1 0 2.63l-10 5.5A1.5 1.5 0 0 1 5 15.5v-11A1.5 1.5 0 0 1 7.22 3.2l10 5.5Z";
621
- const pauseFilledIcon = "M5 2a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H5Zm8 0a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-2Z";
622
- const allowedAnimationSpeeds = [0.5, 1, 1.5, 2];
623
- // Converts any standard html color string to a Color4 object.
624
- function parseColor(color) {
625
- if (!color) {
626
- return null;
627
- }
628
- const canvas = document.createElement("canvas");
629
- canvas.width = canvas.height = 1;
630
- const context = canvas.getContext("2d");
631
- if (!context) {
632
- throw new Error("Unable to get 2d context for parseColor");
633
- }
634
- context.clearRect(0, 0, 1, 1);
635
- context.fillStyle = color;
636
- context.fillRect(0, 0, 1, 1);
637
- const data = context.getImageData(0, 0, 1, 1).data;
638
- return new Color4(data[0] / 255, data[1] / 255, data[2] / 255, data[3] / 255);
639
- }
640
- /**
641
- * Represents a custom element that displays a 3D model using the Babylon.js Viewer.
642
- */
643
- let HTML3DElement = HTML3DElement_1 = class HTML3DElement extends LitElement {
644
- constructor() {
645
- super(...arguments);
646
- this._viewerLock = new AsyncLock();
647
- // Bindings for properties that are synchronized both ways between the lower level Viewer and the HTML3DElement.
648
- this._propertyBindings = [
649
- this._createPropertyBinding("clearColor", (details) => details.scene.onClearColorChangedObservable, (details) => (details.scene.clearColor = this.clearColor ?? new Color4(0, 0, 0, 0)), (details) => (this.clearColor = details.scene.clearColor)),
650
- this._createPropertyBinding("skyboxBlur", (details) => details.viewer.onSkyboxBlurChanged, (details) => (details.viewer.skyboxBlur = this.skyboxBlur ?? details.viewer.skyboxBlur), (details) => (this.skyboxBlur = details.viewer.skyboxBlur)),
651
- this._createPropertyBinding("cameraAutoOrbit", (details) => details.viewer.onCameraAutoOrbitChanged, (details) => (details.viewer.cameraAutoOrbit = this.cameraAutoOrbit), (details) => (this.cameraAutoOrbit = details.viewer.cameraAutoOrbit)),
652
- this._createPropertyBinding("animationSpeed", (details) => details.viewer.onAnimationSpeedChanged, (details) => (details.viewer.animationSpeed = this.animationSpeed), (details) => {
653
- let speed = details.viewer.animationSpeed;
654
- speed = allowedAnimationSpeeds.reduce((prev, curr) => (Math.abs(curr - speed) < Math.abs(prev - speed) ? curr : prev));
655
- this.animationSpeed = speed;
656
- this._dispatchCustomEvent("animationspeedchange", (type) => new Event(type));
657
- }),
658
- this._createPropertyBinding("selectedAnimation", (details) => details.viewer.onSelectedAnimationChanged, (details) => (details.viewer.selectedAnimation = this.selectedAnimation), (details) => (this.selectedAnimation = details.viewer.selectedAnimation ?? -1)),
659
- ];
660
- /**
661
- * The engine to use for rendering.
662
- */
663
- this.engine = getDefaultEngine();
664
- /**
665
- * The model URL.
666
- */
667
- this.source = null;
668
- /**
669
- * Forces the model to be loaded with the specified extension.
670
- * @remarks
671
- * If this property is not set, the extension will be inferred from the model URL when possible.
672
- */
673
- this.extension = null;
674
- /**
675
- * The environment URL.
676
- */
677
- this.environment = null;
678
- /**
679
- * A value between 0 and 1 that specifies how much to blur the skybox.
680
- */
681
- this.skyboxBlur = null;
682
- /**
683
- * The clear color (e.g. background color) for the viewer.
684
- */
685
- this.clearColor = null;
686
- /**
687
- * Enables or disables camera auto-orbit.
688
- */
689
- this.cameraAutoOrbit = false;
690
- /**
691
- * Camera orbit can only be set as an attribute, and is set on the camera each time a new model is loaded.
692
- * For access to the real time camera properties, use viewerDetails.camera.
693
- */
694
- this._cameraOrbitCoercer = null;
695
- /**
696
- * Camera target can only be set as an attribute, and is set on the camera each time a new model is loaded.
697
- * For access to the real time camera properties, use viewerDetails.camera.
698
- */
699
- this._cameraTargetCoercer = null;
700
- /**
701
- * A string value that encodes one or more hotspots.
702
- */
703
- this.hotspots = null;
704
- /**
705
- * True if the default animation should play automatically when a model is loaded.
706
- */
707
- this.animationAutoPlay = false;
708
- /**
709
- * The currently selected animation index.
710
- */
711
- this.selectedAnimation = -1;
712
- /**
713
- * The speed scale at which animations are played.
714
- */
715
- this.animationSpeed = 1;
716
- /**
717
- * The current point on the selected animation timeline, normalized between 0 and 1.
718
- */
719
- this.animationProgress = 0;
720
- this._animations = [];
721
- this._isAnimationPlaying = false;
722
- }
723
- /**
724
- * Gets the underlying viewer details (when the underlying viewer is in a loaded state).
725
- * This is useful for advanced scenarios where direct access to the viewer or Babylon scene is needed.
726
- */
727
- get viewerDetails() {
728
- return this._viewerDetails;
729
- }
730
- /**
731
- * Get hotspot world and screen values from a named hotspot
732
- * @param name slot of the hot spot
733
- * @param result resulting world and screen positions
734
- * @returns world and screen space coordinates
735
- */
736
- queryHotSpot(name, result) {
737
- // Retrieve all hotspots inside the viewer element
738
- let resultFound = false;
739
- // Iterate through each hotspot to get the 'data-surface' and 'data-name' attributes
740
- if (this._viewerDetails) {
741
- const hotspot = this.hotspots?.[name];
742
- if (hotspot) {
743
- resultFound = this._viewerDetails.viewer.getHotSpotToRef(hotspot, result);
744
- }
745
- }
746
- return resultFound;
747
- }
748
- /**
749
- * The list of animation names for the currently loaded model.
750
- */
751
- get animations() {
752
- return this._animations;
753
- }
754
- /**
755
- * True if an animation is currently playing.
756
- */
757
- get isAnimationPlaying() {
758
- return this._isAnimationPlaying;
759
- }
760
- /**
761
- * Toggles the play/pause animation state if there is a selected animation.
762
- */
763
- toggleAnimation() {
764
- this._viewerDetails?.viewer.toggleAnimation();
765
- }
766
- // eslint-disable-next-line babylonjs/available
767
- connectedCallback() {
768
- super.connectedCallback();
769
- this._setupViewer();
770
- }
771
- // eslint-disable-next-line babylonjs/available
772
- disconnectedCallback() {
773
- super.disconnectedCallback();
774
- this._tearDownViewer();
775
- }
776
- // eslint-disable-next-line babylonjs/available
777
- update(changedProperties) {
778
- super.update(changedProperties);
779
- if (changedProperties.get("engine")) {
780
- this._tearDownViewer();
781
- this._setupViewer();
782
- }
783
- else {
784
- this._propertyBindings.filter((binding) => changedProperties.has(binding.property)).forEach((binding) => binding.updateViewer());
785
- if (changedProperties.has("source")) {
786
- this._updateModel();
787
- }
788
- if (changedProperties.has("environment")) {
789
- this._updateEnv();
790
- }
791
- }
792
- }
793
- // eslint-disable-next-line babylonjs/available
794
- render() {
795
- // NOTE: The unnamed 'slot' element holds all child elements of the <babylon-viewer> that do not specify a 'slot' attribute.
796
- return html `
797
- <div class="full-size">
798
- <div id="canvasContainer" class="full-size"></div>
799
- <slot class="full-size children-slot"></slot>
800
- ${this.animations.length === 0
801
- ? ""
802
- : html `
803
- <slot name="tool-bar">
804
- <div part="tool-bar" class="tool-bar">
805
- <div class="progress-control">
806
- <button aria-label="${this.isAnimationPlaying ? "Pause" : "Play"}" @click="${this.toggleAnimation}">
807
- ${!this.isAnimationPlaying
808
- ? html `<svg viewBox="0 0 20 20">
809
- <path d="${playFilledIcon}" fill="currentColor"></path>
810
- </svg>`
811
- : html `<svg viewBox="-3 -2 24 24">
812
- <path d="${pauseFilledIcon}" fill="currentColor"></path>
813
- </svg>`}
814
- </button>
815
- <input
816
- aria-label="Animation Progress"
817
- class="progress-wrapper"
818
- type="range"
819
- min="0"
820
- max="1"
821
- step="0.0001"
822
- .value="${this.animationProgress}"
823
- @input="${this._onProgressChanged}"
824
- @pointerdown="${this._onProgressPointerDown}"
825
- />
826
- </div>
827
- <select aria-label="Select Animation Speed" @change="${this._onAnimationSpeedChanged}">
828
- ${allowedAnimationSpeeds.map((speed) => html `<option value="${speed}" .selected="${this.animationSpeed === speed}">${speed}x</option>`)}
829
- </select>
830
- ${this.animations.length > 1
831
- ? html `<select aria-label="Select Animation" @change="${this._onSelectedAnimationChanged}">
832
- ${this.animations.map((name, index) => html `<option value="${index}" .selected="${this.selectedAnimation === index}">${name}</option>`)}
833
- </select>`
834
- : ""}
835
- </div>
836
- </slot>
837
- `}
838
- </div>
839
- `;
840
- }
841
- addEventListener(type, listener, options) {
842
- super.addEventListener(type, listener, options);
843
- }
844
- _dispatchCustomEvent(type, event) {
845
- this.dispatchEvent(event(type));
846
- }
847
- _onSelectedAnimationChanged(event) {
848
- const selectElement = event.target;
849
- this.selectedAnimation = Number(selectElement.value);
850
- }
851
- _onAnimationSpeedChanged(event) {
852
- const selectElement = event.target;
853
- this.animationSpeed = Number(selectElement.value);
854
- }
855
- _onProgressChanged(event) {
856
- if (this._viewerDetails) {
857
- const input = event.target;
858
- const value = Number(input.value);
859
- if (value !== this.animationProgress) {
860
- this._viewerDetails.viewer.animationProgress = value;
861
- }
862
- }
863
- }
864
- _onProgressPointerDown(event) {
865
- if (this._viewerDetails?.viewer.isAnimationPlaying) {
866
- this._viewerDetails.viewer.pauseAnimation();
867
- const input = event.target;
868
- input.addEventListener("pointerup", () => this._viewerDetails?.viewer.playAnimation(), { once: true });
869
- }
870
- }
871
- // Helper function to simplify keeping Viewer properties in sync with HTML3DElement properties.
872
- _createPropertyBinding(property, getObservable, updateViewer, updateElement) {
873
- return {
874
- property,
875
- // Called each time a Viewer instance is created.
876
- onInitialized: (viewerDetails) => {
877
- getObservable(viewerDetails).add(() => {
878
- updateElement(viewerDetails);
879
- });
880
- updateViewer(viewerDetails);
881
- },
882
- // Called when the HTML3DElement property should be propagated to the Viewer.
883
- updateViewer: () => {
884
- if (this._viewerDetails) {
885
- updateViewer(this._viewerDetails);
886
- }
887
- },
888
- // Called to re-sync the HTML3DElement property with its corresponding attribute.
889
- syncToAttribute: () => {
890
- const descriptor = HTML3DElement_1.elementProperties.get(property);
891
- if (descriptor) {
892
- if (descriptor.attribute) {
893
- const attributeName = descriptor.attribute === true ? property : descriptor.attribute;
894
- if (this.hasAttribute(attributeName)) {
895
- const attributeValue = this.getAttribute(attributeName);
896
- const converter = typeof descriptor.converter === "function"
897
- ? descriptor.converter
898
- : descriptor.converter?.fromAttribute !== undefined
899
- ? descriptor.converter.fromAttribute
900
- : defaultConverter.fromAttribute;
901
- this[property] = converter ? converter(attributeValue, descriptor.type) : attributeValue;
902
- }
903
- }
904
- }
905
- },
906
- };
907
- }
908
- async _setupViewer() {
909
- await this._viewerLock.lockAsync(async () => {
910
- // The first time the element is connected, the canvas container may not be available yet.
911
- // Wait for the first update if needed.
912
- if (!this._canvasContainer) {
913
- await this.updateComplete;
914
- }
915
- if (this._canvasContainer && !this._viewerDetails) {
916
- const canvas = document.createElement("canvas");
917
- canvas.className = "full-size";
918
- canvas.setAttribute("touch-action", "none");
919
- this._canvasContainer.appendChild(canvas);
920
- await createViewerForCanvas(canvas, {
921
- engine: this.engine,
922
- onInitialized: (details) => {
923
- this._viewerDetails = details;
924
- details.viewer.onEnvironmentChanged.add(() => {
925
- this._dispatchCustomEvent("environmentchange", (type) => new Event(type));
926
- });
927
- details.viewer.onEnvironmentError.add((error) => {
928
- this._dispatchCustomEvent("environmenterror", (type) => new ErrorEvent(type, { error }));
929
- });
930
- details.viewer.onModelChanged.add(() => {
931
- this._animations = [...details.viewer.animations];
932
- // When attributes are explicitly set, they are re-applied when a new model is loaded.
933
- this._propertyBindings.forEach((binding) => binding.syncToAttribute());
934
- // The same goes for camera pose attributes, but it is handled a little differently because there are no corresponding public properties
935
- // (since the underlying Babylon camera already has these properties).
936
- this._cameraOrbitCoercer?.(details.camera);
937
- this._cameraTargetCoercer?.(details.camera);
938
- // If animation auto play was set, then start the default animation (if possible).
939
- if (this.animationAutoPlay) {
940
- details.viewer.playAnimation();
941
- }
942
- this._dispatchCustomEvent("modelchange", (type) => new Event(type));
943
- });
944
- details.viewer.onModelError.add((error) => {
945
- this._animations = [...details.viewer.animations];
946
- this._dispatchCustomEvent("modelerror", (type) => new ErrorEvent(type, { error }));
947
- });
948
- details.viewer.onIsAnimationPlayingChanged.add(() => {
949
- this._isAnimationPlaying = details.viewer.isAnimationPlaying ?? false;
950
- this._dispatchCustomEvent("animationplayingchange", (type) => new Event(type));
951
- });
952
- details.viewer.onAnimationProgressChanged.add(() => {
953
- this.animationProgress = details.viewer.animationProgress ?? 0;
954
- this._dispatchCustomEvent("animationprogresschange", (type) => new Event(type));
955
- });
956
- this._updateModel();
957
- this._updateEnv();
958
- this._propertyBindings.forEach((binding) => binding.onInitialized(details));
959
- this._dispatchCustomEvent("viewerready", (type) => new Event(type));
960
- },
961
- });
962
- }
963
- });
964
- }
965
- async _tearDownViewer() {
966
- await this._viewerLock.lockAsync(async () => {
967
- if (this._viewerDetails) {
968
- this._viewerDetails.viewer.dispose();
969
- this._viewerDetails = undefined;
970
- }
971
- // We want to replace the canvas for two reasons:
972
- // 1. When the viewer element is reconnected to the DOM, we don't want to briefly see the last frame of the previous model.
973
- // 2. If we are changing engines (e.g. WebGL to WebGPU), we need to create a new canvas for the new engine.
974
- if (this._canvasContainer && this._canvasContainer.firstElementChild) {
975
- this._canvasContainer.removeChild(this._canvasContainer.firstElementChild);
976
- }
977
- });
978
- }
979
- async _updateModel() {
980
- if (this._viewerDetails) {
981
- try {
982
- if (this.source) {
983
- await this._viewerDetails.viewer.loadModel(this.source, { pluginExtension: this.extension ?? undefined });
984
- }
985
- else {
986
- await this._viewerDetails.viewer.resetModel();
987
- }
988
- }
989
- catch (error) {
990
- Logger.Log(error);
991
- }
992
- }
993
- }
994
- async _updateEnv() {
995
- if (this._viewerDetails) {
996
- try {
997
- if (this.environment) {
998
- await this._viewerDetails.viewer.loadEnvironment(this.environment);
999
- }
1000
- else {
1001
- await this._viewerDetails.viewer.resetEnvironment();
1002
- }
1003
- }
1004
- catch (error) {
1005
- Logger.Log(error);
1006
- }
1007
- }
1008
- }
1009
- };
1010
- // eslint-disable-next-line @typescript-eslint/naming-convention, jsdoc/require-jsdoc
1011
- HTML3DElement.styles = css `
1012
- :host {
1013
- --ui-foreground-color: white;
1014
- --ui-background-hue: 233;
1015
- --ui-background-saturation: 8%;
1016
- --ui-background-lightness: 39%;
1017
- --ui-background-opacity: 0.75;
1018
- --ui-background-color: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), var(--ui-background-opacity));
1019
- --ui-background-color-hover: hsla(
1020
- var(--ui-background-hue),
1021
- var(--ui-background-saturation),
1022
- calc(var(--ui-background-lightness) - 10%),
1023
- calc(var(--ui-background-opacity) - 0.1)
1024
- );
1025
- all: inherit;
1026
- }
1027
-
1028
- * {
1029
- box-sizing: border-box;
1030
- }
1031
-
1032
- .full-size {
1033
- display: block;
1034
- position: relative;
1035
- width: 100%;
1036
- height: 100%;
1037
- }
1038
-
1039
- .children-slot {
1040
- position: absolute;
1041
- top: 0;
1042
- background: transparent;
1043
- pointer-events: none;
1044
- }
1045
-
1046
- .tool-bar {
1047
- position: absolute;
1048
- display: flex;
1049
- flex-direction: row;
1050
- border-radius: 12px;
1051
- border-color: var(--ui-foreground-color);
1052
- height: 48px;
1053
- width: calc(100% - 24px);
1054
- min-width: 150px;
1055
- max-width: 1280px;
1056
- bottom: 12px;
1057
- left: 50%;
1058
- transform: translateX(-50%);
1059
- background-color: var(--ui-background-color);
1060
- color: var(--ui-foreground-color);
1061
- -webkit-tap-highlight-color: transparent;
1062
- }
1063
-
1064
- .tool-bar * {
1065
- height: 100%;
1066
- min-width: 48px;
1067
- }
1068
-
1069
- .tool-bar select {
1070
- background: none;
1071
- min-width: 52px;
1072
- max-width: 128px;
1073
- border: 1px solid transparent;
1074
- border-radius: inherit;
1075
- color: inherit;
1076
- font-size: 14px;
1077
- padding: 12px;
1078
- cursor: pointer;
1079
- outline: none;
1080
- appearance: none; /* Remove default styling */
1081
- -webkit-appearance: none; /* Remove default styling for Safari */
1082
- }
1083
-
1084
- .tool-bar select:hover,
1085
- .tool-bar select:focus {
1086
- background-color: var(--ui-background-color-hover);
1087
- }
1088
-
1089
- .tool-bar select option {
1090
- background-color: var(--ui-background-color);
1091
- color: var(--ui-foreground-color);
1092
- }
1093
-
1094
- .tool-bar select:focus-visible {
1095
- border-color: inherit;
1096
- }
1097
-
1098
- .tool-bar button {
1099
- background: none;
1100
- border: 1px solid transparent;
1101
- border-radius: inherit;
1102
- color: inherit;
1103
- padding: 0;
1104
- cursor: pointer;
1105
- outline: none;
1106
- }
1107
-
1108
- .tool-bar button:hover {
1109
- background-color: var(--ui-background-color-hover);
1110
- }
1111
-
1112
- .tool-bar button:focus-visible {
1113
- border-color: inherit;
1114
- }
1115
-
1116
- .tool-bar button svg {
1117
- width: 32px;
1118
- height: 32px;
1119
- }
1120
-
1121
- .progress-control {
1122
- display: flex;
1123
- flex: 1;
1124
- position: relative;
1125
- overflow: hidden;
1126
- cursor: pointer;
1127
- align-items: center;
1128
- border-radius: inherit;
1129
- border-color: inherit;
1130
- }
1131
-
1132
- .progress-wrapper {
1133
- -webkit-appearance: none;
1134
- cursor: pointer;
1135
- width: 100%;
1136
- height: 100%;
1137
- outline: none;
1138
- border: 1px solid transparent;
1139
- border-radius: inherit;
1140
- padding: 0 12px;
1141
- background-color: transparent;
1142
- }
1143
-
1144
- .progress-wrapper:focus-visible {
1145
- border-color: inherit;
1146
- }
1147
-
1148
- /*Chrome -webkit */
1149
-
1150
- .progress-wrapper::-webkit-slider-thumb {
1151
- -webkit-appearance: none;
1152
- width: 20px;
1153
- height: 20px;
1154
- border: 2px solid;
1155
- color: var(--ui-foreground-color);
1156
- border-radius: 50%;
1157
- background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1);
1158
- margin-top: -10px;
1159
- }
1160
-
1161
- .progress-wrapper::-webkit-slider-runnable-track {
1162
- height: 2px;
1163
- -webkit-appearance: none;
1164
- background-color: var(--ui-foreground-color);
1165
- }
1166
-
1167
- /** FireFox -moz */
1168
-
1169
- .progress-wrapper::-moz-range-progress {
1170
- height: 2px;
1171
- background-color: var(--ui-foreground-color);
1172
- }
1173
-
1174
- .progress-wrapper::-moz-range-thumb {
1175
- width: 16px;
1176
- height: 16px;
1177
- border: 2px solid var(--ui-foreground-color);
1178
- border-radius: 50%;
1179
- background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1);
1180
- }
1181
-
1182
- .progress-wrapper::-moz-range-track {
1183
- height: 2px;
1184
- background: var(--ui-foreground-color);
1185
- }
1186
- `;
1187
- __decorate([
1188
- property({ reflect: true })
1189
- ], HTML3DElement.prototype, "engine", void 0);
1190
- __decorate([
1191
- property({ reflect: true })
1192
- ], HTML3DElement.prototype, "source", void 0);
1193
- __decorate([
1194
- property({ reflect: true })
1195
- ], HTML3DElement.prototype, "extension", void 0);
1196
- __decorate([
1197
- property({ reflect: true })
1198
- ], HTML3DElement.prototype, "environment", void 0);
1199
- __decorate([
1200
- property({ attribute: "skybox-blur", reflect: true })
1201
- ], HTML3DElement.prototype, "skyboxBlur", void 0);
1202
- __decorate([
1203
- property({
1204
- attribute: "clear-color",
1205
- reflect: true,
1206
- converter: {
1207
- fromAttribute: parseColor,
1208
- toAttribute: (color) => (color ? color.toHexString() : null),
1209
- },
1210
- })
1211
- ], HTML3DElement.prototype, "clearColor", void 0);
1212
- __decorate([
1213
- property({
1214
- attribute: "camera-auto-orbit",
1215
- type: Boolean,
1216
- })
1217
- ], HTML3DElement.prototype, "cameraAutoOrbit", void 0);
1218
- __decorate([
1219
- property({
1220
- attribute: "camera-orbit",
1221
- converter: (value) => {
1222
- if (!value) {
1223
- return null;
1224
- }
1225
- const array = value.split(/\s+/);
1226
- if (array.length !== 3) {
1227
- throw new Error("cameraOrbit should be defined as 'alpha beta radius'");
1228
- }
1229
- return (camera) => {
1230
- for (const [index, property] of ["alpha", "beta", "radius"].entries()) {
1231
- const value = array[index];
1232
- if (value !== "auto") {
1233
- camera[property] = Number(value);
1234
- }
1235
- }
1236
- };
1237
- },
1238
- })
1239
- ], HTML3DElement.prototype, "_cameraOrbitCoercer", void 0);
1240
- __decorate([
1241
- property({
1242
- attribute: "camera-target",
1243
- converter: (value) => {
1244
- if (!value) {
1245
- return null;
1246
- }
1247
- const array = value.split(/\s+/);
1248
- if (array.length !== 3) {
1249
- throw new Error("cameraTarget should be defined as 'x y z'");
1250
- }
1251
- return (camera) => {
1252
- const target = camera.target;
1253
- for (const [index, property] of ["x", "y", "z"].entries()) {
1254
- const value = array[index];
1255
- if (value !== "auto") {
1256
- target[property] = Number(value);
1257
- }
1258
- }
1259
- camera.target = target.clone();
1260
- };
1261
- },
1262
- })
1263
- ], HTML3DElement.prototype, "_cameraTargetCoercer", void 0);
1264
- __decorate([
1265
- property({
1266
- converter: (value) => {
1267
- if (!value) {
1268
- return null;
1269
- }
1270
- const array = value.split(/\s+/);
1271
- if (array.length % 8 !== 0) {
1272
- throw new Error(`hotspots should be defined in sets of 8 elements: 'name meshIndex pointIndex1 pointIndex2 pointIndex3 barycentricCoord1 barycentricCoord2 barycentricCoord3', but a total of ${array.length} elements were found in '${value}'`);
1273
- }
1274
- const hotspots = {};
1275
- for (let offset = 0; offset < array.length; offset += 8) {
1276
- hotspots[array[offset]] = {
1277
- meshIndex: Number(array[offset + 1]),
1278
- pointIndex: [Number(array[offset + 2]), Number(array[offset + 3]), Number(array[offset + 4])],
1279
- barycentric: [Number(array[offset + 5]), Number(array[offset + 6]), Number(array[offset + 7])],
1280
- };
1281
- }
1282
- return hotspots;
1283
- },
1284
- })
1285
- ], HTML3DElement.prototype, "hotspots", void 0);
1286
- __decorate([
1287
- property({ attribute: "animation-auto-play", reflect: true, type: Boolean })
1288
- ], HTML3DElement.prototype, "animationAutoPlay", void 0);
1289
- __decorate([
1290
- property({ attribute: "selected-animation" })
1291
- ], HTML3DElement.prototype, "selectedAnimation", void 0);
1292
- __decorate([
1293
- property({ attribute: "animation-speed" })
1294
- ], HTML3DElement.prototype, "animationSpeed", void 0);
1295
- __decorate([
1296
- property({ attribute: false })
1297
- ], HTML3DElement.prototype, "animationProgress", void 0);
1298
- __decorate([
1299
- state()
1300
- ], HTML3DElement.prototype, "_animations", void 0);
1301
- __decorate([
1302
- state()
1303
- ], HTML3DElement.prototype, "_isAnimationPlaying", void 0);
1304
- __decorate([
1305
- query("#canvasContainer")
1306
- ], HTML3DElement.prototype, "_canvasContainer", void 0);
1307
- HTML3DElement = HTML3DElement_1 = __decorate([
1308
- customElement("babylon-viewer")
1309
- ], HTML3DElement);
1310
-
1311
- export { HTML3DElement, Viewer, createViewerForCanvas, getDefaultEngine };
1312
- //# sourceMappingURL=index.js.map