@babylonjs/viewer 7.29.0-alpha → 7.30.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-BLpgL6xr.esm.js +0 -172
  198. package/dist/chunks/EXT_lights_image_based-BLpgL6xr.esm.js.map +0 -1
  199. package/dist/chunks/EXT_lights_image_based-DABIIMiy.esm.min.js +0 -2
  200. package/dist/chunks/EXT_lights_image_based-DABIIMiy.esm.min.js.map +0 -1
  201. package/dist/chunks/EXT_mesh_gpu_instancing-BDSRP4n4.esm.js +0 -86
  202. package/dist/chunks/EXT_mesh_gpu_instancing-BDSRP4n4.esm.js.map +0 -1
  203. package/dist/chunks/EXT_mesh_gpu_instancing-BH3DaZoU.esm.min.js +0 -2
  204. package/dist/chunks/EXT_mesh_gpu_instancing-BH3DaZoU.esm.min.js.map +0 -1
  205. package/dist/chunks/EXT_meshopt_compression-By8mAlyb.esm.min.js +0 -2
  206. package/dist/chunks/EXT_meshopt_compression-By8mAlyb.esm.min.js.map +0 -1
  207. package/dist/chunks/EXT_meshopt_compression-D1rBruzX.esm.js +0 -134
  208. package/dist/chunks/EXT_meshopt_compression-D1rBruzX.esm.js.map +0 -1
  209. package/dist/chunks/EXT_texture_avif-BYi9SuPU.esm.js +0 -44
  210. package/dist/chunks/EXT_texture_avif-BYi9SuPU.esm.js.map +0 -1
  211. package/dist/chunks/EXT_texture_avif-BcI-wjut.esm.min.js +0 -2
  212. package/dist/chunks/EXT_texture_avif-BcI-wjut.esm.min.js.map +0 -1
  213. package/dist/chunks/EXT_texture_webp-B77BTNKn.esm.min.js +0 -2
  214. package/dist/chunks/EXT_texture_webp-B77BTNKn.esm.min.js.map +0 -1
  215. package/dist/chunks/EXT_texture_webp-CMPVA_Ux.esm.js +0 -43
  216. package/dist/chunks/EXT_texture_webp-CMPVA_Ux.esm.js.map +0 -1
  217. package/dist/chunks/ExtrasAsMetadata-D8JolXiD.esm.js +0 -64
  218. package/dist/chunks/ExtrasAsMetadata-D8JolXiD.esm.js.map +0 -1
  219. package/dist/chunks/ExtrasAsMetadata-H9TiKlaK.esm.min.js +0 -2
  220. package/dist/chunks/ExtrasAsMetadata-H9TiKlaK.esm.min.js.map +0 -1
  221. package/dist/chunks/KHR_animation_pointer-BMEPPqlx.esm.min.js +0 -2
  222. package/dist/chunks/KHR_animation_pointer-BMEPPqlx.esm.min.js.map +0 -1
  223. package/dist/chunks/KHR_animation_pointer-CGO-JP6i.esm.js +0 -343
  224. package/dist/chunks/KHR_animation_pointer-CGO-JP6i.esm.js.map +0 -1
  225. package/dist/chunks/KHR_draco_mesh_compression-C7lsBOyb.esm.js +0 -610
  226. package/dist/chunks/KHR_draco_mesh_compression-C7lsBOyb.esm.js.map +0 -1
  227. package/dist/chunks/KHR_draco_mesh_compression-C8fS1phA.esm.min.js +0 -2
  228. package/dist/chunks/KHR_draco_mesh_compression-C8fS1phA.esm.min.js.map +0 -1
  229. package/dist/chunks/KHR_interactivity-DP1E1GOi.esm.js +0 -4033
  230. package/dist/chunks/KHR_interactivity-DP1E1GOi.esm.js.map +0 -1
  231. package/dist/chunks/KHR_interactivity-jWT-yvY7.esm.min.js +0 -2
  232. package/dist/chunks/KHR_interactivity-jWT-yvY7.esm.min.js.map +0 -1
  233. package/dist/chunks/KHR_lights_punctual-BnHhNnYS.esm.min.js +0 -2
  234. package/dist/chunks/KHR_lights_punctual-BnHhNnYS.esm.min.js.map +0 -1
  235. package/dist/chunks/KHR_lights_punctual-rrrcWAHt.esm.js +0 -1253
  236. package/dist/chunks/KHR_lights_punctual-rrrcWAHt.esm.js.map +0 -1
  237. package/dist/chunks/KHR_materials_anisotropy-Dde4rNcc.esm.min.js +0 -2
  238. package/dist/chunks/KHR_materials_anisotropy-Dde4rNcc.esm.min.js.map +0 -1
  239. package/dist/chunks/KHR_materials_anisotropy-yvGSy8c_.esm.js +0 -64
  240. package/dist/chunks/KHR_materials_anisotropy-yvGSy8c_.esm.js.map +0 -1
  241. package/dist/chunks/KHR_materials_clearcoat-Bi9JRbpA.esm.min.js +0 -2
  242. package/dist/chunks/KHR_materials_clearcoat-Bi9JRbpA.esm.min.js.map +0 -1
  243. package/dist/chunks/KHR_materials_clearcoat-lmfQZB44.esm.js +0 -96
  244. package/dist/chunks/KHR_materials_clearcoat-lmfQZB44.esm.js.map +0 -1
  245. package/dist/chunks/KHR_materials_diffuse_transmission-BD16xvM0.esm.js +0 -97
  246. package/dist/chunks/KHR_materials_diffuse_transmission-BD16xvM0.esm.js.map +0 -1
  247. package/dist/chunks/KHR_materials_diffuse_transmission-DfIk9Z5i.esm.min.js +0 -2
  248. package/dist/chunks/KHR_materials_diffuse_transmission-DfIk9Z5i.esm.min.js.map +0 -1
  249. package/dist/chunks/KHR_materials_dispersion-CI7zyE7d.esm.js +0 -62
  250. package/dist/chunks/KHR_materials_dispersion-CI7zyE7d.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_dispersion-DUYyino9.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_dispersion-DUYyino9.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_emissive_strength-Na6QCyFS.esm.js +0 -55
  254. package/dist/chunks/KHR_materials_emissive_strength-Na6QCyFS.esm.js.map +0 -1
  255. package/dist/chunks/KHR_materials_emissive_strength-q5HMxr_t.esm.min.js +0 -2
  256. package/dist/chunks/KHR_materials_emissive_strength-q5HMxr_t.esm.min.js.map +0 -1
  257. package/dist/chunks/KHR_materials_ior--dMQk-w-.esm.js +0 -64
  258. package/dist/chunks/KHR_materials_ior--dMQk-w-.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_ior-DHoboBlp.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_ior-DHoboBlp.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_iridescence-BQbRykOa.esm.js +0 -72
  262. package/dist/chunks/KHR_materials_iridescence-BQbRykOa.esm.js.map +0 -1
  263. package/dist/chunks/KHR_materials_iridescence-BvNKQgR-.esm.min.js +0 -2
  264. package/dist/chunks/KHR_materials_iridescence-BvNKQgR-.esm.min.js.map +0 -1
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D95lD-EY.esm.min.js +0 -2
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D95lD-EY.esm.min.js.map +0 -1
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DcyUwgIq.esm.js +0 -81
  268. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DcyUwgIq.esm.js.map +0 -1
  269. package/dist/chunks/KHR_materials_sheen-B8GlvhnO.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_sheen-B8GlvhnO.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_sheen-CqtxCxcR.esm.js +0 -85
  272. package/dist/chunks/KHR_materials_sheen-CqtxCxcR.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_specular-0k7SuDJm.esm.min.js +0 -2
  274. package/dist/chunks/KHR_materials_specular-0k7SuDJm.esm.min.js.map +0 -1
  275. package/dist/chunks/KHR_materials_specular-WBXg6f7k.esm.js +0 -75
  276. package/dist/chunks/KHR_materials_specular-WBXg6f7k.esm.js.map +0 -1
  277. package/dist/chunks/KHR_materials_transmission-BGYL1mq0.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_transmission-BGYL1mq0.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_transmission-DEWS0ffW.esm.js +0 -307
  280. package/dist/chunks/KHR_materials_transmission-DEWS0ffW.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_unlit-DQHPJyn9.esm.js +0 -74
  282. package/dist/chunks/KHR_materials_unlit-DQHPJyn9.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_unlit-zzzSQdNn.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_unlit-zzzSQdNn.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_variants-VXDobVeH.esm.js +0 -238
  286. package/dist/chunks/KHR_materials_variants-VXDobVeH.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_variants-iwrQxXJI.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_variants-iwrQxXJI.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_volume-DT-KKCRg.esm.js +0 -87
  290. package/dist/chunks/KHR_materials_volume-DT-KKCRg.esm.js.map +0 -1
  291. package/dist/chunks/KHR_materials_volume-o7NXz9Nn.esm.min.js +0 -2
  292. package/dist/chunks/KHR_materials_volume-o7NXz9Nn.esm.min.js.map +0 -1
  293. package/dist/chunks/KHR_mesh_quantization-3qGPKoEe.esm.min.js +0 -2
  294. package/dist/chunks/KHR_mesh_quantization-3qGPKoEe.esm.min.js.map +0 -1
  295. package/dist/chunks/KHR_mesh_quantization-Do30PfjZ.esm.js +0 -26
  296. package/dist/chunks/KHR_mesh_quantization-Do30PfjZ.esm.js.map +0 -1
  297. package/dist/chunks/KHR_texture_basisu-CE9rKGzG.esm.js +0 -43
  298. package/dist/chunks/KHR_texture_basisu-CE9rKGzG.esm.js.map +0 -1
  299. package/dist/chunks/KHR_texture_basisu-Ck2n5vg0.esm.min.js +0 -2
  300. package/dist/chunks/KHR_texture_basisu-Ck2n5vg0.esm.min.js.map +0 -1
  301. package/dist/chunks/KHR_texture_transform-CJy8_9hQ.esm.min.js +0 -2
  302. package/dist/chunks/KHR_texture_transform-CJy8_9hQ.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_texture_transform-Cx0DVvGQ.esm.js +0 -63
  304. package/dist/chunks/KHR_texture_transform-Cx0DVvGQ.esm.js.map +0 -1
  305. package/dist/chunks/KHR_xmp_json_ld-Bts0ubto.esm.min.js +0 -2
  306. package/dist/chunks/KHR_xmp_json_ld-Bts0ubto.esm.min.js.map +0 -1
  307. package/dist/chunks/KHR_xmp_json_ld-OUf6ft_7.esm.js +0 -51
  308. package/dist/chunks/KHR_xmp_json_ld-OUf6ft_7.esm.js.map +0 -1
  309. package/dist/chunks/MSFT_audio_emitter-DfrlWbeO.esm.js +0 -2207
  310. package/dist/chunks/MSFT_audio_emitter-DfrlWbeO.esm.js.map +0 -1
  311. package/dist/chunks/MSFT_audio_emitter-V_T8m6U1.esm.min.js +0 -2
  312. package/dist/chunks/MSFT_audio_emitter-V_T8m6U1.esm.min.js.map +0 -1
  313. package/dist/chunks/MSFT_lod-BxCtz--E.esm.js +0 -337
  314. package/dist/chunks/MSFT_lod-BxCtz--E.esm.js.map +0 -1
  315. package/dist/chunks/MSFT_lod-gJ7hndkt.esm.min.js +0 -2
  316. package/dist/chunks/MSFT_lod-gJ7hndkt.esm.min.js.map +0 -1
  317. package/dist/chunks/MSFT_minecraftMesh-CRGsPDH3.esm.js +0 -46
  318. package/dist/chunks/MSFT_minecraftMesh-CRGsPDH3.esm.js.map +0 -1
  319. package/dist/chunks/MSFT_minecraftMesh-DGzi9WLy.esm.min.js +0 -2
  320. package/dist/chunks/MSFT_minecraftMesh-DGzi9WLy.esm.min.js.map +0 -1
  321. package/dist/chunks/MSFT_sRGBFactors-B6yORxCw.esm.min.js +0 -2
  322. package/dist/chunks/MSFT_sRGBFactors-B6yORxCw.esm.min.js.map +0 -1
  323. package/dist/chunks/MSFT_sRGBFactors-DHUk7DUY.esm.js +0 -47
  324. package/dist/chunks/MSFT_sRGBFactors-DHUk7DUY.esm.js.map +0 -1
  325. package/dist/chunks/animationGroup-Boj0OWGd.esm.min.js +0 -2
  326. package/dist/chunks/animationGroup-Boj0OWGd.esm.min.js.map +0 -1
  327. package/dist/chunks/animationGroup-By2lMhyx.esm.js +0 -2479
  328. package/dist/chunks/animationGroup-By2lMhyx.esm.js.map +0 -1
  329. package/dist/chunks/assetContainer-MiYeyCfL.esm.js +0 -1720
  330. package/dist/chunks/assetContainer-MiYeyCfL.esm.js.map +0 -1
  331. package/dist/chunks/assetContainer-_iAK743I.esm.min.js +0 -2
  332. package/dist/chunks/assetContainer-_iAK743I.esm.min.js.map +0 -1
  333. package/dist/chunks/audioEngine-BfZp4Nx9.esm.min.js +0 -2
  334. package/dist/chunks/audioEngine-BfZp4Nx9.esm.min.js.map +0 -1
  335. package/dist/chunks/audioEngine-CpYtEOLP.esm.js +0 -305
  336. package/dist/chunks/audioEngine-CpYtEOLP.esm.js.map +0 -1
  337. package/dist/chunks/bakedVertexAnimation-CKTmu6gx.esm.min.js +0 -2
  338. package/dist/chunks/bakedVertexAnimation-CKTmu6gx.esm.min.js.map +0 -1
  339. package/dist/chunks/bakedVertexAnimation-DQH8b842.esm.js +0 -119
  340. package/dist/chunks/bakedVertexAnimation-DQH8b842.esm.js.map +0 -1
  341. package/dist/chunks/basisTextureLoader-T9CUrOmS.esm.min.js +0 -2
  342. package/dist/chunks/basisTextureLoader-T9CUrOmS.esm.min.js.map +0 -1
  343. package/dist/chunks/basisTextureLoader-eFcTRQym.esm.js +0 -600
  344. package/dist/chunks/basisTextureLoader-eFcTRQym.esm.js.map +0 -1
  345. package/dist/chunks/dds-CPE4Rx1r.esm.js +0 -540
  346. package/dist/chunks/dds-CPE4Rx1r.esm.js.map +0 -1
  347. package/dist/chunks/dds-CaONmIro.esm.min.js +0 -2
  348. package/dist/chunks/dds-CaONmIro.esm.min.js.map +0 -1
  349. package/dist/chunks/ddsTextureLoader-6AgaEZf6.esm.min.js +0 -2
  350. package/dist/chunks/ddsTextureLoader-6AgaEZf6.esm.min.js.map +0 -1
  351. package/dist/chunks/ddsTextureLoader-TU5XoRAD.esm.js +0 -88
  352. package/dist/chunks/ddsTextureLoader-TU5XoRAD.esm.js.map +0 -1
  353. package/dist/chunks/decalFragment-ByZH5cgk.esm.js +0 -18
  354. package/dist/chunks/decalFragment-ByZH5cgk.esm.js.map +0 -1
  355. package/dist/chunks/decalFragment-CBqEFHz-.esm.min.js +0 -2
  356. package/dist/chunks/decalFragment-CBqEFHz-.esm.min.js.map +0 -1
  357. package/dist/chunks/default.fragment-CK9KzasE.esm.min.js +0 -2
  358. package/dist/chunks/default.fragment-CK9KzasE.esm.min.js.map +0 -1
  359. package/dist/chunks/default.fragment-C_DV57mu.esm.js +0 -449
  360. package/dist/chunks/default.fragment-C_DV57mu.esm.js.map +0 -1
  361. package/dist/chunks/default.fragment-Dhc9EqDW.esm.min.js +0 -2
  362. package/dist/chunks/default.fragment-Dhc9EqDW.esm.min.js.map +0 -1
  363. package/dist/chunks/default.fragment-DywhQASU.esm.js +0 -515
  364. package/dist/chunks/default.fragment-DywhQASU.esm.js.map +0 -1
  365. package/dist/chunks/default.vertex-Boy19RTX.esm.min.js +0 -2
  366. package/dist/chunks/default.vertex-Boy19RTX.esm.min.js.map +0 -1
  367. package/dist/chunks/default.vertex-C7NC-Q5X.esm.js +0 -199
  368. package/dist/chunks/default.vertex-C7NC-Q5X.esm.js.map +0 -1
  369. package/dist/chunks/default.vertex-ChNYYvEU.esm.js +0 -180
  370. package/dist/chunks/default.vertex-ChNYYvEU.esm.js.map +0 -1
  371. package/dist/chunks/default.vertex-VcpEapIy.esm.min.js +0 -2
  372. package/dist/chunks/default.vertex-VcpEapIy.esm.min.js.map +0 -1
  373. package/dist/chunks/defaultUboDeclaration-C_jQy41M.esm.min.js +0 -2
  374. package/dist/chunks/defaultUboDeclaration-C_jQy41M.esm.min.js.map +0 -1
  375. package/dist/chunks/defaultUboDeclaration-CzgIGZT-.esm.js +0 -13
  376. package/dist/chunks/defaultUboDeclaration-CzgIGZT-.esm.js.map +0 -1
  377. package/dist/chunks/defaultUboDeclaration-DXP_rq4X.esm.js +0 -15
  378. package/dist/chunks/defaultUboDeclaration-DXP_rq4X.esm.js.map +0 -1
  379. package/dist/chunks/defaultUboDeclaration-DZNlsDGM.esm.min.js +0 -2
  380. package/dist/chunks/defaultUboDeclaration-DZNlsDGM.esm.min.js.map +0 -1
  381. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  382. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  383. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  384. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  385. package/dist/chunks/dumpTools-B-MEkpBW.esm.js +0 -401
  386. package/dist/chunks/dumpTools-B-MEkpBW.esm.js.map +0 -1
  387. package/dist/chunks/dumpTools-B_BheXxl.esm.min.js +0 -2
  388. package/dist/chunks/dumpTools-B_BheXxl.esm.min.js.map +0 -1
  389. package/dist/chunks/engine-D0ppLAY2.esm.min.js +0 -2
  390. package/dist/chunks/engine-D0ppLAY2.esm.min.js.map +0 -1
  391. package/dist/chunks/engine-DTE58S3m.esm.js +0 -2174
  392. package/dist/chunks/engine-DTE58S3m.esm.js.map +0 -1
  393. package/dist/chunks/engine.common-Cz2Oc3jG.esm.min.js +0 -2
  394. package/dist/chunks/engine.common-Cz2Oc3jG.esm.min.js.map +0 -1
  395. package/dist/chunks/engine.common-D86V9DKs.esm.js +0 -1088
  396. package/dist/chunks/engine.common-D86V9DKs.esm.js.map +0 -1
  397. package/dist/chunks/envTextureLoader-BZOa8peJ.esm.min.js +0 -2
  398. package/dist/chunks/envTextureLoader-BZOa8peJ.esm.min.js.map +0 -1
  399. package/dist/chunks/envTextureLoader-ZGF0Bakz.esm.js +0 -65
  400. package/dist/chunks/envTextureLoader-ZGF0Bakz.esm.js.map +0 -1
  401. package/dist/chunks/environmentTextureTools-BgAHEsDW.esm.js +0 -382
  402. package/dist/chunks/environmentTextureTools-BgAHEsDW.esm.js.map +0 -1
  403. package/dist/chunks/environmentTextureTools-BoCxadDB.esm.min.js +0 -2
  404. package/dist/chunks/environmentTextureTools-BoCxadDB.esm.min.js.map +0 -1
  405. package/dist/chunks/exrTextureLoader-CCUrvE8T.esm.js +0 -1682
  406. package/dist/chunks/exrTextureLoader-CCUrvE8T.esm.js.map +0 -1
  407. package/dist/chunks/exrTextureLoader-DLmw6w7U.esm.min.js +0 -2
  408. package/dist/chunks/exrTextureLoader-DLmw6w7U.esm.min.js.map +0 -1
  409. package/dist/chunks/fogFragment-C9uKTlkk.esm.js +0 -102
  410. package/dist/chunks/fogFragment-C9uKTlkk.esm.js.map +0 -1
  411. package/dist/chunks/fogFragment-CKS7vQYA.esm.min.js +0 -2
  412. package/dist/chunks/fogFragment-CKS7vQYA.esm.min.js.map +0 -1
  413. package/dist/chunks/fresnelFunction-BwiYTvrC.esm.min.js +0 -2
  414. package/dist/chunks/fresnelFunction-BwiYTvrC.esm.min.js.map +0 -1
  415. package/dist/chunks/fresnelFunction-P4tBs-LJ.esm.js +0 -12
  416. package/dist/chunks/fresnelFunction-P4tBs-LJ.esm.js.map +0 -1
  417. package/dist/chunks/glTFLoader-BImxTXn_.esm.js +0 -7562
  418. package/dist/chunks/glTFLoader-BImxTXn_.esm.js.map +0 -1
  419. package/dist/chunks/glTFLoader-BNuF7C0G.esm.min.js +0 -2
  420. package/dist/chunks/glTFLoader-BNuF7C0G.esm.min.js.map +0 -1
  421. package/dist/chunks/glTFLoaderAnimation-CjecIvCy.esm.js +0 -77
  422. package/dist/chunks/glTFLoaderAnimation-CjecIvCy.esm.js.map +0 -1
  423. package/dist/chunks/glTFLoaderAnimation-D3PFkbs_.esm.min.js +0 -2
  424. package/dist/chunks/glTFLoaderAnimation-D3PFkbs_.esm.min.js.map +0 -1
  425. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  426. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  427. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  428. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  429. package/dist/chunks/harmonicsFunctions-CNsYOYYz.esm.min.js +0 -2
  430. package/dist/chunks/harmonicsFunctions-CNsYOYYz.esm.min.js.map +0 -1
  431. package/dist/chunks/harmonicsFunctions-CjVihVRn.esm.js +0 -34
  432. package/dist/chunks/harmonicsFunctions-CjVihVRn.esm.js.map +0 -1
  433. package/dist/chunks/harmonicsFunctions-DqDjKw2B.esm.js +0 -35
  434. package/dist/chunks/harmonicsFunctions-DqDjKw2B.esm.js.map +0 -1
  435. package/dist/chunks/harmonicsFunctions-yl0qPETc.esm.min.js +0 -2
  436. package/dist/chunks/harmonicsFunctions-yl0qPETc.esm.min.js.map +0 -1
  437. package/dist/chunks/hdrTextureLoader-BNIWtINl.esm.min.js +0 -2
  438. package/dist/chunks/hdrTextureLoader-BNIWtINl.esm.min.js.map +0 -1
  439. package/dist/chunks/hdrTextureLoader-DMEQGv9e.esm.js +0 -252
  440. package/dist/chunks/hdrTextureLoader-DMEQGv9e.esm.js.map +0 -1
  441. package/dist/chunks/helperFunctions-BChFhVYa.esm.js +0 -80
  442. package/dist/chunks/helperFunctions-BChFhVYa.esm.js.map +0 -1
  443. package/dist/chunks/helperFunctions-CgtzVALZ.esm.min.js +0 -2
  444. package/dist/chunks/helperFunctions-CgtzVALZ.esm.min.js.map +0 -1
  445. package/dist/chunks/helperFunctions-DO6Kdkzy.esm.min.js +0 -2
  446. package/dist/chunks/helperFunctions-DO6Kdkzy.esm.min.js.map +0 -1
  447. package/dist/chunks/helperFunctions-kAvqTiTA.esm.js +0 -108
  448. package/dist/chunks/helperFunctions-kAvqTiTA.esm.js.map +0 -1
  449. package/dist/chunks/index-DGpjt-Zr.esm.js +0 -71825
  450. package/dist/chunks/index-DGpjt-Zr.esm.js.map +0 -1
  451. package/dist/chunks/index-DrYyPlix.esm.min.js +0 -57
  452. package/dist/chunks/index-DrYyPlix.esm.min.js.map +0 -1
  453. package/dist/chunks/ktxTextureLoader-B9nBFT5Z.esm.js +0 -814
  454. package/dist/chunks/ktxTextureLoader-B9nBFT5Z.esm.js.map +0 -1
  455. package/dist/chunks/ktxTextureLoader-Cbery6nh.esm.min.js +0 -2
  456. package/dist/chunks/ktxTextureLoader-Cbery6nh.esm.min.js.map +0 -1
  457. package/dist/chunks/logDepthDeclaration-CGY_4-ML.esm.js +0 -20
  458. package/dist/chunks/logDepthDeclaration-CGY_4-ML.esm.js.map +0 -1
  459. package/dist/chunks/logDepthDeclaration-DBbzin1E.esm.min.js +0 -2
  460. package/dist/chunks/logDepthDeclaration-DBbzin1E.esm.min.js.map +0 -1
  461. package/dist/chunks/logDepthDeclaration-DxdkXM2g.esm.js +0 -35
  462. package/dist/chunks/logDepthDeclaration-DxdkXM2g.esm.js.map +0 -1
  463. package/dist/chunks/logDepthDeclaration-KZf1_VtM.esm.min.js +0 -2
  464. package/dist/chunks/logDepthDeclaration-KZf1_VtM.esm.min.js.map +0 -1
  465. package/dist/chunks/logDepthVertex-4T1ajRdN.esm.min.js +0 -2
  466. package/dist/chunks/logDepthVertex-4T1ajRdN.esm.min.js.map +0 -1
  467. package/dist/chunks/logDepthVertex-C7Lr7R8t.esm.min.js +0 -2
  468. package/dist/chunks/logDepthVertex-C7Lr7R8t.esm.min.js.map +0 -1
  469. package/dist/chunks/logDepthVertex-DgcMvYjN.esm.js +0 -488
  470. package/dist/chunks/logDepthVertex-DgcMvYjN.esm.js.map +0 -1
  471. package/dist/chunks/logDepthVertex-q1TkoNq2.esm.js +0 -77
  472. package/dist/chunks/logDepthVertex-q1TkoNq2.esm.js.map +0 -1
  473. package/dist/chunks/mainUVVaryingDeclaration-C6ih1f42.esm.js +0 -11
  474. package/dist/chunks/mainUVVaryingDeclaration-C6ih1f42.esm.js.map +0 -1
  475. package/dist/chunks/mainUVVaryingDeclaration-DWdhx4Q0.esm.min.js +0 -2
  476. package/dist/chunks/mainUVVaryingDeclaration-DWdhx4Q0.esm.min.js.map +0 -1
  477. package/dist/chunks/meshUboDeclaration-BxJ-l2yR.esm.min.js +0 -2
  478. package/dist/chunks/meshUboDeclaration-BxJ-l2yR.esm.min.js.map +0 -1
  479. package/dist/chunks/meshUboDeclaration-DOOk3iN6.esm.js +0 -24
  480. package/dist/chunks/meshUboDeclaration-DOOk3iN6.esm.js.map +0 -1
  481. package/dist/chunks/objFileLoader-Bk5z6uQ5.esm.js +0 -1338
  482. package/dist/chunks/objFileLoader-Bk5z6uQ5.esm.js.map +0 -1
  483. package/dist/chunks/objFileLoader-D8mq1SAc.esm.min.js +0 -2
  484. package/dist/chunks/objFileLoader-D8mq1SAc.esm.min.js.map +0 -1
  485. package/dist/chunks/oitFragment-BR40uY9u.esm.min.js +0 -2
  486. package/dist/chunks/oitFragment-BR40uY9u.esm.min.js.map +0 -1
  487. package/dist/chunks/oitFragment-Cnluv66E.esm.min.js +0 -2
  488. package/dist/chunks/oitFragment-Cnluv66E.esm.min.js.map +0 -1
  489. package/dist/chunks/oitFragment-DCLs5Ofj.esm.js +0 -1210
  490. package/dist/chunks/oitFragment-DCLs5Ofj.esm.js.map +0 -1
  491. package/dist/chunks/oitFragment-_U2hGZFV.esm.js +0 -1150
  492. package/dist/chunks/oitFragment-_U2hGZFV.esm.js.map +0 -1
  493. package/dist/chunks/pass.fragment-BfIPf9Op.esm.js +0 -15
  494. package/dist/chunks/pass.fragment-BfIPf9Op.esm.js.map +0 -1
  495. package/dist/chunks/pass.fragment-Cqi_RtSm.esm.min.js +0 -2
  496. package/dist/chunks/pass.fragment-Cqi_RtSm.esm.min.js.map +0 -1
  497. package/dist/chunks/pass.fragment-NnudUQhH.esm.min.js +0 -2
  498. package/dist/chunks/pass.fragment-NnudUQhH.esm.min.js.map +0 -1
  499. package/dist/chunks/pass.fragment-ym6lpw5k.esm.js +0 -15
  500. package/dist/chunks/pass.fragment-ym6lpw5k.esm.js.map +0 -1
  501. package/dist/chunks/pbr.fragment-6KGFvuGz.esm.min.js +0 -2
  502. package/dist/chunks/pbr.fragment-6KGFvuGz.esm.min.js.map +0 -1
  503. package/dist/chunks/pbr.fragment-CCLbIhnA.esm.min.js +0 -2
  504. package/dist/chunks/pbr.fragment-CCLbIhnA.esm.min.js.map +0 -1
  505. package/dist/chunks/pbr.fragment-CNjQPayV.esm.js +0 -3219
  506. package/dist/chunks/pbr.fragment-CNjQPayV.esm.js.map +0 -1
  507. package/dist/chunks/pbr.fragment-De4ZFxJz.esm.js +0 -3165
  508. package/dist/chunks/pbr.fragment-De4ZFxJz.esm.js.map +0 -1
  509. package/dist/chunks/pbr.vertex-B3hmUC8g.esm.min.js +0 -2
  510. package/dist/chunks/pbr.vertex-B3hmUC8g.esm.min.js.map +0 -1
  511. package/dist/chunks/pbr.vertex-C1AjipVY.esm.min.js +0 -2
  512. package/dist/chunks/pbr.vertex-C1AjipVY.esm.min.js.map +0 -1
  513. package/dist/chunks/pbr.vertex-CAWTu6Ca.esm.js +0 -335
  514. package/dist/chunks/pbr.vertex-CAWTu6Ca.esm.js.map +0 -1
  515. package/dist/chunks/pbr.vertex-aJMmfvXE.esm.js +0 -210
  516. package/dist/chunks/pbr.vertex-aJMmfvXE.esm.js.map +0 -1
  517. package/dist/chunks/postprocess.vertex-B11DXETn.esm.js +0 -20
  518. package/dist/chunks/postprocess.vertex-B11DXETn.esm.js.map +0 -1
  519. package/dist/chunks/postprocess.vertex-C1SOpyFw.esm.js +0 -18
  520. package/dist/chunks/postprocess.vertex-C1SOpyFw.esm.js.map +0 -1
  521. package/dist/chunks/postprocess.vertex-DlCW14hL.esm.min.js +0 -2
  522. package/dist/chunks/postprocess.vertex-DlCW14hL.esm.min.js.map +0 -1
  523. package/dist/chunks/postprocess.vertex-OGjLw033.esm.min.js +0 -2
  524. package/dist/chunks/postprocess.vertex-OGjLw033.esm.min.js.map +0 -1
  525. package/dist/chunks/rawTexture-Ce1ENd6V.esm.min.js +0 -2
  526. package/dist/chunks/rawTexture-Ce1ENd6V.esm.min.js.map +0 -1
  527. package/dist/chunks/rawTexture-CwYSxwby.esm.js +0 -191
  528. package/dist/chunks/rawTexture-CwYSxwby.esm.js.map +0 -1
  529. package/dist/chunks/rgbdDecode.fragment-C25V4SJl.esm.js +0 -17
  530. package/dist/chunks/rgbdDecode.fragment-C25V4SJl.esm.js.map +0 -1
  531. package/dist/chunks/rgbdDecode.fragment-C4j9qhxg.esm.min.js +0 -2
  532. package/dist/chunks/rgbdDecode.fragment-C4j9qhxg.esm.min.js.map +0 -1
  533. package/dist/chunks/rgbdDecode.fragment-CRVT_8Nw.esm.js +0 -17
  534. package/dist/chunks/rgbdDecode.fragment-CRVT_8Nw.esm.js.map +0 -1
  535. package/dist/chunks/rgbdDecode.fragment-Yw5MzFMM.esm.min.js +0 -2
  536. package/dist/chunks/rgbdDecode.fragment-Yw5MzFMM.esm.min.js.map +0 -1
  537. package/dist/chunks/rgbdEncode.fragment-AGUdw9Ul.esm.min.js +0 -2
  538. package/dist/chunks/rgbdEncode.fragment-AGUdw9Ul.esm.min.js.map +0 -1
  539. package/dist/chunks/rgbdEncode.fragment-BdDs7xXT.esm.js +0 -17
  540. package/dist/chunks/rgbdEncode.fragment-BdDs7xXT.esm.js.map +0 -1
  541. package/dist/chunks/rgbdEncode.fragment-CUc1-tbE.esm.min.js +0 -2
  542. package/dist/chunks/rgbdEncode.fragment-CUc1-tbE.esm.min.js.map +0 -1
  543. package/dist/chunks/rgbdEncode.fragment-SHjb3vhe.esm.js +0 -17
  544. package/dist/chunks/rgbdEncode.fragment-SHjb3vhe.esm.js.map +0 -1
  545. package/dist/chunks/splatFileLoader-AehXXBt6.esm.js +0 -3534
  546. package/dist/chunks/splatFileLoader-AehXXBt6.esm.js.map +0 -1
  547. package/dist/chunks/splatFileLoader-D8cMZAVa.esm.min.js +0 -2
  548. package/dist/chunks/splatFileLoader-D8cMZAVa.esm.min.js.map +0 -1
  549. package/dist/chunks/standardMaterial-CKpk68wS.esm.js +0 -1809
  550. package/dist/chunks/standardMaterial-CKpk68wS.esm.js.map +0 -1
  551. package/dist/chunks/standardMaterial-DV7gvP4N.esm.min.js +0 -2
  552. package/dist/chunks/standardMaterial-DV7gvP4N.esm.min.js.map +0 -1
  553. package/dist/chunks/stlFileLoader-Cfw83knr.esm.min.js +0 -2
  554. package/dist/chunks/stlFileLoader-Cfw83knr.esm.min.js.map +0 -1
  555. package/dist/chunks/stlFileLoader-u4p8h5Lz.esm.js +0 -238
  556. package/dist/chunks/stlFileLoader-u4p8h5Lz.esm.js.map +0 -1
  557. package/dist/chunks/tgaTextureLoader-BtkbesJU.esm.min.js +0 -2
  558. package/dist/chunks/tgaTextureLoader-BtkbesJU.esm.min.js.map +0 -1
  559. package/dist/chunks/tgaTextureLoader-D3clYha3.esm.js +0 -349
  560. package/dist/chunks/tgaTextureLoader-D3clYha3.esm.js.map +0 -1
  561. package/dist/chunks/thinEngine-CBTd7E-p.esm.js +0 -3721
  562. package/dist/chunks/thinEngine-CBTd7E-p.esm.js.map +0 -1
  563. package/dist/chunks/thinEngine-CyJthfdW.esm.min.js +0 -2
  564. package/dist/chunks/thinEngine-CyJthfdW.esm.min.js.map +0 -1
  565. package/dist/chunks/thinInstanceMesh-BIcGwd1R.esm.min.js +0 -2
  566. package/dist/chunks/thinInstanceMesh-BIcGwd1R.esm.min.js.map +0 -1
  567. package/dist/chunks/thinInstanceMesh-Cb8et1Kc.esm.js +0 -314
  568. package/dist/chunks/thinInstanceMesh-Cb8et1Kc.esm.js.map +0 -1
  569. package/dist/chunks/vertexColorMixing-Dmpv8sAw.esm.min.js +0 -2
  570. package/dist/chunks/vertexColorMixing-Dmpv8sAw.esm.min.js.map +0 -1
  571. package/dist/chunks/vertexColorMixing-m4TXU6HC.esm.js +0 -528
  572. package/dist/chunks/vertexColorMixing-m4TXU6HC.esm.js.map +0 -1
  573. package/dist/chunks/webgpuEngine-CWe8ibqx.esm.min.js +0 -2
  574. package/dist/chunks/webgpuEngine-CWe8ibqx.esm.min.js.map +0 -1
  575. package/dist/chunks/webgpuEngine-CafTCw_o.esm.js +0 -11180
  576. package/dist/chunks/webgpuEngine-CafTCw_o.esm.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 -324
  586. package/lib/index.js +0 -1105
  587. package/lib/index.js.map +0 -1
package/lib/index.js DELETED
@@ -1,1105 +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 { Color4 } from '@babylonjs/core/Maths/math.color.js';
8
- import { Clamp } from '@babylonjs/core/Maths/math.scalar.functions.js';
9
- import { Vector3, TmpVectors } from '@babylonjs/core/Maths/math.vector.js';
10
- import { CreateBox } from '@babylonjs/core/Meshes/Builders/boxBuilder.js';
11
- import { computeMaxExtents } from '@babylonjs/core/Meshes/meshUtils.js';
12
- import { AsyncLock } from '@babylonjs/core/Misc/asyncLock.js';
13
- import { Observable } from '@babylonjs/core/Misc/observable.js';
14
- import { Scene } from '@babylonjs/core/scene.js';
15
- import { registerBuiltInLoaders } from '@babylonjs/loaders/dynamic.js';
16
- import { Viewport } from '@babylonjs/core/Maths/math.viewport.js';
17
- import { GetHotSpotToRef } from '@babylonjs/core/Meshes/abstractMesh.hotSpot.js';
18
- import { __decorate } from '@babylonjs/core/tslib.es6.js';
19
- import { css, LitElement, html } from 'lit';
20
- import { property, state, query, customElement } from 'lit/decorators.js';
21
- import { Logger } from '@babylonjs/core/Misc/logger.js';
22
-
23
- function throwIfAborted(...abortSignals) {
24
- for (const signal of abortSignals) {
25
- signal?.throwIfAborted();
26
- }
27
- }
28
- function createSkybox(scene, camera, environmentTexture, blur) {
29
- const hdrSkybox = CreateBox("hdrSkyBox", undefined, scene);
30
- const hdrSkyboxMaterial = new PBRMaterial("skyBox", scene);
31
- hdrSkyboxMaterial.backFaceCulling = false;
32
- hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone();
33
- if (hdrSkyboxMaterial.reflectionTexture) {
34
- hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE;
35
- }
36
- hdrSkyboxMaterial.microSurface = 1.0 - blur;
37
- hdrSkyboxMaterial.disableLighting = true;
38
- hdrSkyboxMaterial.twoSidedLighting = true;
39
- hdrSkybox.material = hdrSkyboxMaterial;
40
- hdrSkybox.isPickable = false;
41
- hdrSkybox.infiniteDistance = true;
42
- hdrSkybox.ignoreCameraMaxZ = 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
- const defaultViewerOptions = {
50
- backgroundColor: new Color4(0.1, 0.1, 0.2, 1.0),
51
- };
52
- /**
53
- * Provides an experience for viewing a single 3D model.
54
- * @remarks
55
- * The Viewer is not tied to a specific UI framework and can be used with Babylon.js in a browser or with Babylon Native.
56
- * Includes (or will include) support for common model viewing requirements such as:
57
- * - Loading different model formats.
58
- * - Setting up a camera and providing default behaviors like auto orbit and pose interpolation.
59
- * - Framing the loaded model in the camera's view.
60
- * - Setting up the environment, lighting, and tone mapping.
61
- * - Enumerating and playing (or auto playing) animations.
62
- * - Enumerating and switching between material variants.
63
- * - Full screen and XR modes.
64
- */
65
- class Viewer {
66
- constructor(_engine, options) {
67
- this._engine = _engine;
68
- /**
69
- * Fired when the environment has changed.
70
- */
71
- this.onEnvironmentChanged = new Observable();
72
- /**
73
- * Fired when an error occurs while loading the environment.
74
- */
75
- this.onEnvironmentError = new Observable();
76
- /**
77
- * Fired when a model is loaded into the viewer (or unloaded from the viewer).
78
- */
79
- this.onModelChanged = new Observable();
80
- /**
81
- * Fired when an error occurs while loading a model.
82
- */
83
- this.onModelError = new Observable();
84
- /**
85
- * Fired when the selected animation changes.
86
- */
87
- this.onSelectedAnimationChanged = new Observable();
88
- /**
89
- * Fired when the animation speed changes.
90
- */
91
- this.onAnimationSpeedChanged = new Observable();
92
- /**
93
- * Fired when the selected animation is playing or paused.
94
- */
95
- this.onIsAnimationPlayingChanged = new Observable();
96
- /**
97
- * Fired when the current point on the selected animation timeline changes.
98
- */
99
- this.onAnimationProgressChanged = new Observable();
100
- this._skybox = null;
101
- this._light = null;
102
- this._isDisposed = false;
103
- this._loadModelLock = new AsyncLock();
104
- this._loadModelAbortController = null;
105
- this._loadEnvironmentLock = new AsyncLock();
106
- this._environment = null;
107
- this._loadEnvironmentAbortController = null;
108
- this._selectedAnimation = -1;
109
- this._activeAnimationObservers = [];
110
- this._animationSpeed = 1;
111
- const finalOptions = { ...defaultViewerOptions, ...options };
112
- this._details = {
113
- viewer: this,
114
- scene: new Scene(this._engine),
115
- model: null,
116
- };
117
- this._details.scene.performancePriority = 2 /* ScenePerformancePriority.Aggressive */;
118
- this._details.scene.clearColor = finalOptions.backgroundColor;
119
- this._camera = new ArcRotateCamera("camera1", 0, 0, 1, Vector3.Zero(), this._details.scene);
120
- this._camera.attachControl();
121
- this._updateCamera(); // set default camera values
122
- this._autoRotationBehavior = this._camera.getBehaviorByName("AutoRotation");
123
- // Load a default light, but ignore errors as the user might be immediately loading their own environment.
124
- this.resetEnvironment().catch(() => { });
125
- // TODO: render at least back ground. Maybe we can only run renderloop when a mesh is loaded. What to render until then?
126
- const render = () => {
127
- this._details.scene.render();
128
- if (this.isAnimationPlaying) {
129
- this.onAnimationProgressChanged.notifyObservers();
130
- this._autoRotationBehavior.resetLastInteractionTime();
131
- }
132
- };
133
- this._engine.runRenderLoop(render);
134
- this._renderLoopController = {
135
- dispose: () => this._engine.stopRenderLoop(render),
136
- };
137
- options?.onInitialized?.(this._details);
138
- }
139
- /**
140
- * The list of animation names for the currently loaded model.
141
- */
142
- get animations() {
143
- return this._details.model?.animationGroups.map((group) => group.name) ?? [];
144
- }
145
- /**
146
- * The currently selected animation index.
147
- */
148
- get selectedAnimation() {
149
- return this._selectedAnimation;
150
- }
151
- set selectedAnimation(value) {
152
- value = Math.round(Clamp(value, -1, this.animations.length - 1));
153
- if (value !== this._selectedAnimation) {
154
- const startAnimation = this.isAnimationPlaying;
155
- if (this._activeAnimation) {
156
- this._activeAnimationObservers.forEach((observer) => observer.remove());
157
- this._activeAnimationObservers = [];
158
- this._activeAnimation.pause();
159
- this._activeAnimation.goToFrame(0);
160
- }
161
- this._selectedAnimation = value;
162
- if (this._activeAnimation) {
163
- this._activeAnimation.goToFrame(0);
164
- this._activeAnimation.play(true);
165
- if (!startAnimation) {
166
- this.pauseAnimation();
167
- }
168
- this._activeAnimationObservers = [
169
- this._activeAnimation.onAnimationGroupPlayObservable.add(() => {
170
- this.onIsAnimationPlayingChanged.notifyObservers();
171
- }),
172
- this._activeAnimation.onAnimationGroupPauseObservable.add(() => {
173
- this.onIsAnimationPlayingChanged.notifyObservers();
174
- }),
175
- this._activeAnimation.onAnimationGroupEndObservable.add(() => {
176
- this.onIsAnimationPlayingChanged.notifyObservers();
177
- this.onAnimationProgressChanged.notifyObservers();
178
- }),
179
- ];
180
- }
181
- this._updateCamera();
182
- this.onSelectedAnimationChanged.notifyObservers();
183
- }
184
- }
185
- /**
186
- * True if an animation is currently playing.
187
- */
188
- get isAnimationPlaying() {
189
- return this._activeAnimation?.isPlaying ?? false;
190
- }
191
- /**
192
- * The speed scale at which animations are played.
193
- */
194
- get animationSpeed() {
195
- return this._animationSpeed;
196
- }
197
- set animationSpeed(value) {
198
- this._animationSpeed = value;
199
- this._applyAnimationSpeed();
200
- this.onAnimationSpeedChanged.notifyObservers();
201
- }
202
- /**
203
- * The current point on the selected animation timeline, normalized between 0 and 1.
204
- */
205
- get animationProgress() {
206
- if (this._activeAnimation) {
207
- return this._activeAnimation.getCurrentFrame() / (this._activeAnimation.to - this._activeAnimation.from);
208
- }
209
- return 0;
210
- }
211
- set animationProgress(value) {
212
- if (this._activeAnimation) {
213
- this._activeAnimation.goToFrame(value * (this._activeAnimation.to - this._activeAnimation.from));
214
- this.onAnimationProgressChanged.notifyObservers();
215
- this._autoRotationBehavior.resetLastInteractionTime();
216
- }
217
- }
218
- get _activeAnimation() {
219
- return this._details.model?.animationGroups[this._selectedAnimation] ?? null;
220
- }
221
- /**
222
- * Loads a 3D model from the specified URL.
223
- * @remarks
224
- * If a model is already loaded, it will be unloaded before loading the new model.
225
- * @param source A url or File or ArrayBufferView that points to the model to load.
226
- * @param options The options to use when loading the model.
227
- * @param abortSignal An optional signal that can be used to abort the loading process.
228
- */
229
- async loadModel(source, options, abortSignal) {
230
- await this._updateModel(source, options, abortSignal);
231
- }
232
- /**
233
- * Unloads the current 3D model if one is loaded.
234
- * @param abortSignal An optional signal that can be used to abort the reset.
235
- */
236
- async resetModel(abortSignal) {
237
- await this._updateModel(undefined, undefined, abortSignal);
238
- }
239
- async _updateModel(source, options, abortSignal) {
240
- this._throwIfDisposedOrAborted(abortSignal);
241
- this._loadModelAbortController?.abort("New model is being loaded before previous model finished loading.");
242
- const abortController = (this._loadModelAbortController = new AbortController());
243
- await this._loadModelLock.lockAsync(async () => {
244
- throwIfAborted(abortSignal, abortController.signal);
245
- this._details.model?.dispose();
246
- this._details.model = null;
247
- this.selectedAnimation = -1;
248
- try {
249
- if (source) {
250
- this._details.model = await loadAssetContainerAsync(source, this._details.scene, options);
251
- this._details.model.animationGroups.forEach((group) => {
252
- group.start(true, this.animationSpeed);
253
- group.pause();
254
- });
255
- this.selectedAnimation = 0;
256
- this._details.model.addAllToScene();
257
- }
258
- this._updateCamera();
259
- this._updateLight();
260
- this._applyAnimationSpeed();
261
- this.onModelChanged.notifyObservers();
262
- }
263
- catch (e) {
264
- this.onModelError.notifyObservers(e);
265
- throw e;
266
- }
267
- });
268
- }
269
- /**
270
- * Loads an environment texture from the specified url and sets up a corresponding skybox.
271
- * @remarks
272
- * If an environment is already loaded, it will be unloaded before loading the new environment.
273
- * @param url The url of the environment texture to load.
274
- * @param options The options to use when loading the environment.
275
- * @param abortSignal An optional signal that can be used to abort the loading process.
276
- */
277
- async loadEnvironment(url, options, abortSignal) {
278
- await this._updateEnvironment(url, options, abortSignal);
279
- }
280
- /**
281
- * Unloads the current environment if one is loaded.
282
- * @param abortSignal An optional signal that can be used to abort the reset.
283
- */
284
- async resetEnvironment(abortSignal) {
285
- await this._updateEnvironment(undefined, undefined, abortSignal);
286
- }
287
- async _updateEnvironment(url, options, abortSignal) {
288
- this._throwIfDisposedOrAborted(abortSignal);
289
- this._loadEnvironmentAbortController?.abort("New environment is being loaded before previous environment finished loading.");
290
- const abortController = (this._loadEnvironmentAbortController = new AbortController());
291
- await this._loadEnvironmentLock.lockAsync(async () => {
292
- throwIfAborted(abortSignal, abortController.signal);
293
- this._environment?.dispose();
294
- this._environment = null;
295
- this._details.scene.autoClear = true;
296
- try {
297
- if (url) {
298
- this._environment = await new Promise((resolve, reject) => {
299
- const cubeTexture = CubeTexture.CreateFromPrefilteredData(url, this._details.scene);
300
- this._details.scene.environmentTexture = cubeTexture;
301
- const skybox = createSkybox(this._details.scene, this._camera, cubeTexture, 0.3);
302
- this._skybox = skybox;
303
- this._details.scene.autoClear = false;
304
- const dispose = () => {
305
- cubeTexture.dispose();
306
- skybox.dispose();
307
- this._skybox = null;
308
- };
309
- const successObserver = cubeTexture.onLoadObservable.addOnce(() => {
310
- successObserver.remove();
311
- errorObserver.remove();
312
- resolve({
313
- dispose,
314
- });
315
- });
316
- const errorObserver = Texture.OnTextureLoadErrorObservable.add((texture) => {
317
- if (texture === cubeTexture) {
318
- successObserver.remove();
319
- errorObserver.remove();
320
- dispose();
321
- reject(new Error("Failed to load environment texture."));
322
- }
323
- });
324
- });
325
- }
326
- this._updateLight();
327
- this.onEnvironmentChanged.notifyObservers();
328
- }
329
- catch (e) {
330
- this.onEnvironmentError.notifyObservers(e);
331
- throw e;
332
- }
333
- });
334
- }
335
- /**
336
- * Toggles the play/pause animation state if there is a selected animation.
337
- */
338
- toggleAnimation() {
339
- if (this.isAnimationPlaying) {
340
- this.pauseAnimation();
341
- }
342
- else {
343
- this.playAnimation();
344
- }
345
- }
346
- /**
347
- * Plays the selected animation if there is one.
348
- */
349
- playAnimation() {
350
- this._activeAnimation?.play(true);
351
- }
352
- /**
353
- * Pauses the selected animation if there is one.
354
- */
355
- async pauseAnimation() {
356
- this._activeAnimation?.pause();
357
- }
358
- /**
359
- * Disposes of the resources held by the Viewer.
360
- */
361
- dispose() {
362
- this.selectedAnimation = -1;
363
- this.animationProgress = 0;
364
- this._loadEnvironmentAbortController?.abort("Thew viewer is being disposed.");
365
- this._loadModelAbortController?.abort("Thew viewer is being disposed.");
366
- this._renderLoopController.dispose();
367
- this._details.scene.dispose();
368
- this.onEnvironmentChanged.clear();
369
- this.onEnvironmentError.clear();
370
- this.onModelChanged.clear();
371
- this.onModelError.clear();
372
- this.onSelectedAnimationChanged.clear();
373
- this.onAnimationSpeedChanged.clear();
374
- this.onIsAnimationPlayingChanged.clear();
375
- this.onAnimationProgressChanged.clear();
376
- this._isDisposed = true;
377
- }
378
- /**
379
- * retrun world and canvas coordinates of an hot spot
380
- * @param hotSpotQuery mesh index and surface information to query the hot spot positions
381
- * @param res Query a Hot Spot and does the conversion for Babylon Hot spot to a more generic HotSpotPositions, without Vector types
382
- * @returns true if hotspot found
383
- */
384
- getHotSpotToRef(hotSpotQuery, res) {
385
- if (!this._details.model) {
386
- return false;
387
- }
388
- const worldPos = TmpVectors.Vector3[1];
389
- const screenPos = TmpVectors.Vector3[0];
390
- const mesh = this._details.model.meshes[hotSpotQuery.meshIndex];
391
- if (!mesh) {
392
- return false;
393
- }
394
- GetHotSpotToRef(mesh, hotSpotQuery, worldPos);
395
- const renderWidth = this._engine.getRenderWidth(); // Get the canvas width
396
- const renderHeight = this._engine.getRenderHeight(); // Get the canvas height
397
- const viewportWidth = this._camera.viewport.width * renderWidth;
398
- const viewportHeight = this._camera.viewport.height * renderHeight;
399
- const scene = this._details.scene;
400
- Vector3.ProjectToRef(worldPos, mesh.getWorldMatrix(), scene.getTransformMatrix(), new Viewport(0, 0, viewportWidth, viewportHeight), screenPos);
401
- res.screenPosition = [screenPos.x, screenPos.y];
402
- res.worldPosition = [worldPos.x, worldPos.y, worldPos.z];
403
- return true;
404
- }
405
- _updateCamera() {
406
- // Enable camera's behaviors
407
- this._camera.useFramingBehavior = true;
408
- const framingBehavior = this._camera.getBehaviorByName("Framing");
409
- framingBehavior.framingTime = 0;
410
- framingBehavior.elevationReturnTime = -1;
411
- let radius = 1;
412
- if (this._details.model?.meshes.length) {
413
- // get bounds and prepare framing/camera radius from its values
414
- this._camera.lowerRadiusLimit = null;
415
- const maxExtents = computeMaxExtents(this._details.model.meshes, this._activeAnimation);
416
- const worldExtents = {
417
- 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))),
418
- 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))),
419
- };
420
- framingBehavior.zoomOnBoundingInfo(worldExtents.min, worldExtents.max);
421
- const worldSize = worldExtents.max.subtract(worldExtents.min);
422
- const worldCenter = worldExtents.min.add(worldSize.scale(0.5));
423
- radius = worldSize.length() * 1.1;
424
- if (!isFinite(radius)) {
425
- radius = 1;
426
- worldCenter.copyFromFloats(0, 0, 0);
427
- }
428
- this._camera.setTarget(worldCenter);
429
- }
430
- this._camera.lowerRadiusLimit = radius * 0.01;
431
- this._camera.wheelPrecision = 100 / radius;
432
- this._camera.alpha = Math.PI / 2;
433
- this._camera.beta = Math.PI / 2.4;
434
- this._camera.radius = radius;
435
- this._camera.minZ = radius * 0.01;
436
- this._camera.maxZ = radius * 1000;
437
- this._camera.speed = radius * 0.2;
438
- this._camera.useAutoRotationBehavior = true;
439
- this._camera.pinchPrecision = 200 / this._camera.radius;
440
- this._camera.upperRadiusLimit = 5 * this._camera.radius;
441
- this._camera.wheelDeltaPercentage = 0.01;
442
- this._camera.pinchDeltaPercentage = 0.01;
443
- this._camera.restoreStateInterpolationFactor = 0.1;
444
- this._camera.storeState();
445
- updateSkybox(this._skybox, this._camera);
446
- }
447
- _updateLight() {
448
- let shouldHaveDefaultLight;
449
- if (!this._details.model) {
450
- shouldHaveDefaultLight = false;
451
- }
452
- else {
453
- const hasModelProvidedLights = this._details.model.lights.length > 0;
454
- const hasImageBasedLighting = !!this._environment;
455
- const hasMaterials = this._details.model.materials.length > 0;
456
- const hasNonPBRMaterials = this._details.model.materials.some((material) => !(material instanceof PBRMaterial));
457
- if (hasModelProvidedLights) {
458
- shouldHaveDefaultLight = false;
459
- }
460
- else {
461
- shouldHaveDefaultLight = !hasImageBasedLighting || !hasMaterials || hasNonPBRMaterials;
462
- }
463
- }
464
- if (shouldHaveDefaultLight) {
465
- if (!this._light) {
466
- this._light = new HemisphericLight("defaultLight", Vector3.Up(), this._details.scene);
467
- }
468
- }
469
- else {
470
- this._light?.dispose();
471
- this._light = null;
472
- }
473
- }
474
- _applyAnimationSpeed() {
475
- this._details.model?.animationGroups.forEach((group) => (group.speedRatio = this._animationSpeed));
476
- }
477
- /**
478
- * Check for disposed or aborted state (basically everything that can interrupt an async operation).
479
- * @param abortSignals A set of optional AbortSignals to also check.
480
- */
481
- _throwIfDisposedOrAborted(...abortSignals) {
482
- if (this._isDisposed) {
483
- throw new Error("Viewer is disposed.");
484
- }
485
- throwIfAborted(...abortSignals);
486
- }
487
- }
488
- (() => {
489
- registerBuiltInLoaders();
490
- })();
491
-
492
- const defaultCanvasViewerOptions = {};
493
- /**
494
- * Chooses a default engine for the current browser environment.
495
- * @returns The default engine to use.
496
- */
497
- function getDefaultEngine() {
498
- // TODO: When WebGPU is fully production ready, we may want to prefer it if it is supported by the browser.
499
- return "WebGL";
500
- }
501
- /**
502
- * Creates a Viewer instance that is bound to an HTML canvas.
503
- * @remarks
504
- * This function can be shared across multiple UI integrations (e.g. Web Components, React, etc.).
505
- * @param canvas The canvas element to bind the Viewer to.
506
- * @param options The options to use when creating the Viewer and binding it to the specified canvas.
507
- * @returns A Viewer instance that is bound to the specified canvas.
508
- */
509
- async function createViewerForCanvas(canvas, options) {
510
- const finalOptions = { ...defaultCanvasViewerOptions, ...options };
511
- const disposeActions = [];
512
- // If the canvas is resized, note that the engine needs a resize, but don't resize it here as it will result in flickering.
513
- let needsResize = false;
514
- const resizeObserver = new ResizeObserver(() => (needsResize = true));
515
- resizeObserver.observe(canvas);
516
- disposeActions.push(() => resizeObserver.disconnect());
517
- // Create an engine instance.
518
- let engine;
519
- switch (finalOptions.engine ?? getDefaultEngine()) {
520
- case "WebGL": {
521
- // eslint-disable-next-line @typescript-eslint/naming-convention, no-case-declarations
522
- const { Engine } = await import('@babylonjs/core/Engines/engine.js');
523
- engine = new Engine(canvas, undefined, options);
524
- break;
525
- }
526
- case "WebGPU": {
527
- // eslint-disable-next-line @typescript-eslint/naming-convention, no-case-declarations
528
- const { WebGPUEngine } = await import('@babylonjs/core/Engines/webgpuEngine.js');
529
- const webGPUEngine = new WebGPUEngine(canvas, options);
530
- await webGPUEngine.initAsync();
531
- engine = webGPUEngine;
532
- break;
533
- }
534
- }
535
- // Override the onInitialized callback to add in some specific behavior.
536
- const onInitialized = finalOptions.onInitialized;
537
- finalOptions.onInitialized = (details) => {
538
- // Resize if needed right before rendering the Viewer scene to avoid any flickering.
539
- const beforeRenderObserver = details.scene.onBeforeRenderObservable.add(() => {
540
- if (needsResize) {
541
- engine.resize();
542
- needsResize = false;
543
- }
544
- });
545
- disposeActions.push(() => beforeRenderObserver.remove());
546
- // Call the original onInitialized callback, if one was provided.
547
- onInitialized?.(details);
548
- };
549
- // Instantiate the Viewer with the engine and options.
550
- const viewer = new Viewer(engine, finalOptions);
551
- disposeActions.push(viewer.dispose.bind(viewer));
552
- disposeActions.push(() => engine.dispose());
553
- // Override the Viewer's dispose method to add in additional cleanup.
554
- viewer.dispose = () => disposeActions.forEach((dispose) => dispose());
555
- return viewer;
556
- }
557
-
558
- // 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
559
- 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";
560
- 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";
561
- const allowedAnimationSpeeds = [0.5, 1, 1.5, 2];
562
- /**
563
- * Represents a custom element that displays a 3D model using the Babylon.js Viewer.
564
- */
565
- let HTML3DElement = class HTML3DElement extends LitElement {
566
- constructor() {
567
- super(...arguments);
568
- this._viewerLock = new AsyncLock();
569
- /**
570
- * The engine to use for rendering.
571
- */
572
- this.engine = getDefaultEngine();
573
- /**
574
- * The model URL.
575
- */
576
- this.source = null;
577
- /**
578
- * Forces the model to be loaded with the specified extension.
579
- * @remarks
580
- * If this property is not set, the extension will be inferred from the model URL when possible.
581
- */
582
- this.extension = null;
583
- /**
584
- * The environment URL.
585
- */
586
- this.environment = null;
587
- /**
588
- * A string value that encodes one or more hotspots.
589
- */
590
- this.hotspots = null;
591
- /**
592
- * The speed scale at which animations are played.
593
- */
594
- this.animationSpeed = 1;
595
- /**
596
- * The current point on the selected animation timeline, normalized between 0 and 1.
597
- */
598
- this.animationProgress = 0;
599
- this._animations = [];
600
- this._selectedAnimation = -1;
601
- this._isAnimationPlaying = false;
602
- }
603
- /**
604
- * Gets the underlying viewer details (when the underlying viewer is in a loaded state).
605
- * This is useful for advanced scenarios where direct access to the viewer or Babylon scene is needed.
606
- */
607
- get viewerDetails() {
608
- return this._viewerDetails;
609
- }
610
- /**
611
- * Get hotspot world and screen values from a named hotspot
612
- * @param name slot of the hot spot
613
- * @param result resulting world and screen positions
614
- * @returns world and screen space coordinates
615
- */
616
- queryHotSpot(name, result) {
617
- // Retrieve all hotspots inside the viewer element
618
- let resultFound = false;
619
- // Iterate through each hotspot to get the 'data-surface' and 'data-name' attributes
620
- if (this._viewerDetails) {
621
- const hotspot = this.hotspots?.[name];
622
- if (hotspot) {
623
- resultFound = this._viewerDetails.viewer.getHotSpotToRef(hotspot, result);
624
- }
625
- }
626
- return resultFound;
627
- }
628
- /**
629
- * The list of animation names for the currently loaded model.
630
- */
631
- get animations() {
632
- return this._animations;
633
- }
634
- /**
635
- * The currently selected animation index.
636
- */
637
- get selectedAnimation() {
638
- return this._selectedAnimation;
639
- }
640
- /**
641
- * True if an animation is currently playing.
642
- */
643
- get isAnimationPlaying() {
644
- return this._isAnimationPlaying;
645
- }
646
- /**
647
- * Toggles the play/pause animation state if there is a selected animation.
648
- */
649
- toggleAnimation() {
650
- this._viewerDetails?.viewer.toggleAnimation();
651
- }
652
- // eslint-disable-next-line babylonjs/available
653
- connectedCallback() {
654
- super.connectedCallback();
655
- this._setupViewer();
656
- }
657
- // eslint-disable-next-line babylonjs/available
658
- disconnectedCallback() {
659
- super.disconnectedCallback();
660
- this._tearDownViewer();
661
- }
662
- // eslint-disable-next-line babylonjs/available
663
- update(changedProperties) {
664
- super.update(changedProperties);
665
- if (changedProperties.get("engine")) {
666
- this._tearDownViewer();
667
- this._setupViewer();
668
- }
669
- else {
670
- if (changedProperties.has("animationSpeed")) {
671
- this._updateAnimationSpeed();
672
- }
673
- if (changedProperties.has("_selectedAnimation")) {
674
- this._updateSelectedAnimation();
675
- }
676
- if (changedProperties.has("source")) {
677
- this._updateModel();
678
- }
679
- if (changedProperties.has("environment")) {
680
- this._updateEnv();
681
- }
682
- }
683
- }
684
- // eslint-disable-next-line babylonjs/available
685
- render() {
686
- // NOTE: The unnamed 'slot' element holds all child elements of the <babylon-viewer> that do not specify a 'slot' attribute.
687
- return html `
688
- <div class="full-size">
689
- <div id="canvasContainer" class="full-size"></div>
690
- <slot class="full-size children-slot"></slot>
691
- ${this.animations.length === 0
692
- ? ""
693
- : html `
694
- <slot name="tool-bar">
695
- <div part="tool-bar" class="tool-bar">
696
- <div class="progress-control">
697
- <button aria-label="${this.isAnimationPlaying ? "Pause" : "Play"}" @click="${this.toggleAnimation}">
698
- ${!this.isAnimationPlaying
699
- ? html `<svg viewBox="0 0 20 20">
700
- <path d="${playFilledIcon}" fill="currentColor"></path>
701
- </svg>`
702
- : html `<svg viewBox="-3 -2 24 24">
703
- <path d="${pauseFilledIcon}" fill="currentColor"></path>
704
- </svg>`}
705
- </button>
706
- <input
707
- aria-label="Animation Progress"
708
- class="progress-wrapper"
709
- type="range"
710
- min="0"
711
- max="1"
712
- step="0.0001"
713
- .value="${this.animationProgress}"
714
- @input="${this._onProgressChanged}"
715
- @pointerdown="${this._onProgressPointerDown}"
716
- />
717
- </div>
718
- <select aria-label="Select Animation Speed" @change="${this._onAnimationSpeedChanged}">
719
- ${allowedAnimationSpeeds.map((speed) => html `<option value="${speed}" .selected="${this.animationSpeed === speed}">${speed}x</option>`)}
720
- </select>
721
- ${this.animations.length > 1
722
- ? html `<select aria-label="Select Animation" @change="${this._onSelectedAnimationChanged}">
723
- ${this.animations.map((name, index) => html `<option value="${index}" .selected="${this.selectedAnimation == index}">${name}</option>`)}
724
- </select>`
725
- : ""}
726
- </div>
727
- </slot>
728
- `}
729
- </div>
730
- `;
731
- }
732
- addEventListener(type, listener, options) {
733
- super.addEventListener(type, listener, options);
734
- }
735
- _dispatchCustomEvent(type, event) {
736
- this.dispatchEvent(event(type));
737
- }
738
- _onSelectedAnimationChanged(event) {
739
- const selectElement = event.target;
740
- this._selectedAnimation = Number(selectElement.value);
741
- }
742
- _onAnimationSpeedChanged(event) {
743
- const selectElement = event.target;
744
- this.animationSpeed = Number(selectElement.value);
745
- }
746
- _onProgressChanged(event) {
747
- if (this._viewerDetails) {
748
- const input = event.target;
749
- const value = Number(input.value);
750
- if (value !== this.animationProgress) {
751
- this._viewerDetails.viewer.animationProgress = value;
752
- }
753
- }
754
- }
755
- _onProgressPointerDown(event) {
756
- if (this._viewerDetails?.viewer.isAnimationPlaying) {
757
- this._viewerDetails.viewer.pauseAnimation();
758
- const input = event.target;
759
- input.addEventListener("pointerup", () => this._viewerDetails?.viewer.playAnimation(), { once: true });
760
- }
761
- }
762
- async _setupViewer() {
763
- await this._viewerLock.lockAsync(async () => {
764
- // The first time the element is connected, the canvas container may not be available yet.
765
- // Wait for the first update if needed.
766
- if (!this._canvasContainer) {
767
- await this.updateComplete;
768
- }
769
- if (this._canvasContainer && !this._viewerDetails) {
770
- const canvas = document.createElement("canvas");
771
- canvas.className = "full-size";
772
- canvas.setAttribute("touch-action", "none");
773
- this._canvasContainer.appendChild(canvas);
774
- await createViewerForCanvas(canvas, {
775
- engine: this.engine,
776
- onInitialized: (details) => {
777
- this._viewerDetails = details;
778
- details.viewer.onEnvironmentChanged.add(() => {
779
- this._dispatchCustomEvent("environmentchange", (type) => new Event(type));
780
- });
781
- details.viewer.onEnvironmentError.add((error) => {
782
- this._dispatchCustomEvent("environmenterror", (type) => new ErrorEvent(type, { error }));
783
- });
784
- details.viewer.onModelChanged.add(() => {
785
- this._animations = [...details.viewer.animations];
786
- this._dispatchCustomEvent("modelchange", (type) => new Event(type));
787
- });
788
- details.viewer.onModelError.add((error) => {
789
- this._animations = [...details.viewer.animations];
790
- this._dispatchCustomEvent("modelerror", (type) => new ErrorEvent(type, { error }));
791
- });
792
- details.viewer.onSelectedAnimationChanged.add(() => {
793
- this._selectedAnimation = details.viewer.selectedAnimation ?? -1;
794
- this._dispatchCustomEvent("selectedanimationchange", (type) => new Event(type));
795
- });
796
- details.viewer.onAnimationSpeedChanged.add(() => {
797
- let speed = details.viewer.animationSpeed ?? 1;
798
- speed = allowedAnimationSpeeds.reduce((prev, curr) => (Math.abs(curr - speed) < Math.abs(prev - speed) ? curr : prev));
799
- this.animationSpeed = speed;
800
- this._dispatchCustomEvent("animationspeedchange", (type) => new Event(type));
801
- });
802
- details.viewer.onIsAnimationPlayingChanged.add(() => {
803
- this._isAnimationPlaying = details.viewer.isAnimationPlaying ?? false;
804
- this._dispatchCustomEvent("animationplayingchange", (type) => new Event(type));
805
- });
806
- details.viewer.onAnimationProgressChanged.add(() => {
807
- this.animationProgress = details.viewer.animationProgress ?? 0;
808
- this._dispatchCustomEvent("animationprogresschange", (type) => new Event(type));
809
- });
810
- this._updateSelectedAnimation();
811
- this._updateAnimationSpeed();
812
- this._updateModel();
813
- this._updateEnv();
814
- this._dispatchCustomEvent("viewerready", (type) => new Event(type));
815
- },
816
- });
817
- }
818
- });
819
- }
820
- async _tearDownViewer() {
821
- await this._viewerLock.lockAsync(async () => {
822
- if (this._viewerDetails) {
823
- this._viewerDetails.viewer.dispose();
824
- this._viewerDetails = undefined;
825
- }
826
- // We want to replace the canvas for two reasons:
827
- // 1. When the viewer element is reconnected to the DOM, we don't want to briefly see the last frame of the previous model.
828
- // 2. If we are changing engines (e.g. WebGL to WebGPU), we need to create a new canvas for the new engine.
829
- if (this._canvasContainer && this._canvasContainer.firstElementChild) {
830
- this._canvasContainer.removeChild(this._canvasContainer.firstElementChild);
831
- }
832
- });
833
- }
834
- _updateAnimationSpeed() {
835
- if (this._viewerDetails) {
836
- this._viewerDetails.viewer.animationSpeed = this.animationSpeed;
837
- }
838
- }
839
- _updateSelectedAnimation() {
840
- if (this._viewerDetails) {
841
- this._viewerDetails.viewer.selectedAnimation = this._selectedAnimation;
842
- }
843
- }
844
- async _updateModel() {
845
- try {
846
- if (this.source) {
847
- await this._viewerDetails?.viewer.loadModel(this.source, { pluginExtension: this.extension ?? undefined });
848
- }
849
- else {
850
- await this._viewerDetails?.viewer.resetModel();
851
- }
852
- }
853
- catch (error) {
854
- Logger.Log(error);
855
- }
856
- }
857
- async _updateEnv() {
858
- try {
859
- if (this.environment) {
860
- await this._viewerDetails?.viewer.loadEnvironment(this.environment);
861
- }
862
- else {
863
- await this._viewerDetails?.viewer.resetEnvironment();
864
- }
865
- }
866
- catch (error) {
867
- Logger.Log(error);
868
- }
869
- }
870
- };
871
- // eslint-disable-next-line @typescript-eslint/naming-convention, jsdoc/require-jsdoc
872
- HTML3DElement.styles = css `
873
- :host {
874
- --ui-foreground-color: white;
875
- --ui-background-hue: 233;
876
- --ui-background-saturation: 8%;
877
- --ui-background-lightness: 39%;
878
- --ui-background-opacity: 0.75;
879
- --ui-background-color: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), var(--ui-background-opacity));
880
- --ui-background-color-hover: hsla(
881
- var(--ui-background-hue),
882
- var(--ui-background-saturation),
883
- calc(var(--ui-background-lightness) - 10%),
884
- calc(var(--ui-background-opacity) - 0.1)
885
- );
886
- }
887
-
888
- * {
889
- box-sizing: border-box;
890
- }
891
-
892
- .full-size {
893
- display: block;
894
- position: relative;
895
- width: 100%;
896
- height: 100%;
897
- }
898
-
899
- .children-slot {
900
- position: absolute;
901
- top: 0;
902
- background: transparent;
903
- pointer-events: none;
904
- }
905
-
906
- .tool-bar {
907
- position: absolute;
908
- display: flex;
909
- flex-direction: row;
910
- border-radius: 12px;
911
- border-color: var(--ui-foreground-color);
912
- height: 48px;
913
- width: calc(100% - 24px);
914
- min-width: 150px;
915
- max-width: 1280px;
916
- bottom: 12px;
917
- left: 50%;
918
- transform: translateX(-50%);
919
- background-color: var(--ui-background-color);
920
- color: var(--ui-foreground-color);
921
- -webkit-tap-highlight-color: transparent;
922
- }
923
-
924
- .tool-bar * {
925
- height: 100%;
926
- min-width: 48px;
927
- }
928
-
929
- .tool-bar select {
930
- background: none;
931
- min-width: 52px;
932
- max-width: 128px;
933
- border: 1px solid transparent;
934
- border-radius: inherit;
935
- color: inherit;
936
- font-size: 14px;
937
- padding: 12px;
938
- cursor: pointer;
939
- outline: none;
940
- appearance: none; /* Remove default styling */
941
- -webkit-appearance: none; /* Remove default styling for Safari */
942
- }
943
-
944
- .tool-bar select:hover,
945
- .tool-bar select:focus {
946
- background-color: var(--ui-background-color-hover);
947
- }
948
-
949
- .tool-bar select option {
950
- background-color: var(--ui-background-color);
951
- color: var(--ui-foreground-color);
952
- }
953
-
954
- .tool-bar select:focus-visible {
955
- border-color: inherit;
956
- }
957
-
958
- .tool-bar button {
959
- background: none;
960
- border: 1px solid transparent;
961
- border-radius: inherit;
962
- color: inherit;
963
- padding: 0;
964
- cursor: pointer;
965
- outline: none;
966
- }
967
-
968
- .tool-bar button:hover {
969
- background-color: var(--ui-background-color-hover);
970
- }
971
-
972
- .tool-bar button:focus-visible {
973
- border-color: inherit;
974
- }
975
-
976
- .tool-bar button svg {
977
- width: 32px;
978
- height: 32px;
979
- }
980
-
981
- .progress-control {
982
- display: flex;
983
- flex: 1;
984
- position: relative;
985
- overflow: hidden;
986
- cursor: pointer;
987
- align-items: center;
988
- border-radius: inherit;
989
- border-color: inherit;
990
- }
991
-
992
- .progress-wrapper {
993
- -webkit-appearance: none;
994
- cursor: pointer;
995
- width: 100%;
996
- height: 100%;
997
- outline: none;
998
- border: 1px solid transparent;
999
- border-radius: inherit;
1000
- padding: 0 12px;
1001
- background-color: transparent;
1002
- }
1003
-
1004
- .progress-wrapper:focus-visible {
1005
- border-color: inherit;
1006
- }
1007
-
1008
- /*Chrome -webkit */
1009
-
1010
- .progress-wrapper::-webkit-slider-thumb {
1011
- -webkit-appearance: none;
1012
- width: 20px;
1013
- height: 20px;
1014
- border: 2px solid;
1015
- color: var(--ui-foreground-color);
1016
- border-radius: 50%;
1017
- background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1);
1018
- margin-top: -10px;
1019
- }
1020
-
1021
- .progress-wrapper::-webkit-slider-runnable-track {
1022
- height: 2px;
1023
- -webkit-appearance: none;
1024
- background-color: var(--ui-foreground-color);
1025
- }
1026
-
1027
- /** FireFox -moz */
1028
-
1029
- .progress-wrapper::-moz-range-progress {
1030
- height: 2px;
1031
- background-color: var(--ui-foreground-color);
1032
- }
1033
-
1034
- .progress-wrapper::-moz-range-thumb {
1035
- width: 16px;
1036
- height: 16px;
1037
- border: 2px solid var(--ui-foreground-color);
1038
- border-radius: 50%;
1039
- background: hsla(var(--ui-background-hue), var(--ui-background-saturation), var(--ui-background-lightness), 1);
1040
- }
1041
-
1042
- .progress-wrapper::-moz-range-track {
1043
- height: 2px;
1044
- background: var(--ui-foreground-color);
1045
- }
1046
- `;
1047
- __decorate([
1048
- property({ reflect: true })
1049
- ], HTML3DElement.prototype, "engine", void 0);
1050
- __decorate([
1051
- property({ reflect: true })
1052
- ], HTML3DElement.prototype, "source", void 0);
1053
- __decorate([
1054
- property({ reflect: true })
1055
- ], HTML3DElement.prototype, "extension", void 0);
1056
- __decorate([
1057
- property({ reflect: true })
1058
- ], HTML3DElement.prototype, "environment", void 0);
1059
- __decorate([
1060
- property({
1061
- type: "string",
1062
- converter: (value) => {
1063
- if (!value) {
1064
- return null;
1065
- }
1066
- const array = value.split(" ");
1067
- if (array.length % 8 !== 0) {
1068
- 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}'`);
1069
- }
1070
- const hotspots = {};
1071
- for (let offset = 0; offset < array.length; offset += 8) {
1072
- hotspots[array[offset]] = {
1073
- meshIndex: Number(array[offset + 1]),
1074
- pointIndex: [Number(array[offset + 2]), Number(array[offset + 3]), Number(array[offset + 4])],
1075
- barycentric: [Number(array[offset + 5]), Number(array[offset + 6]), Number(array[offset + 7])],
1076
- };
1077
- }
1078
- return hotspots;
1079
- },
1080
- })
1081
- ], HTML3DElement.prototype, "hotspots", void 0);
1082
- __decorate([
1083
- property({ attribute: "animation-speed", reflect: true })
1084
- ], HTML3DElement.prototype, "animationSpeed", void 0);
1085
- __decorate([
1086
- property({ attribute: false })
1087
- ], HTML3DElement.prototype, "animationProgress", void 0);
1088
- __decorate([
1089
- state()
1090
- ], HTML3DElement.prototype, "_animations", void 0);
1091
- __decorate([
1092
- state()
1093
- ], HTML3DElement.prototype, "_selectedAnimation", void 0);
1094
- __decorate([
1095
- state()
1096
- ], HTML3DElement.prototype, "_isAnimationPlaying", void 0);
1097
- __decorate([
1098
- query("#canvasContainer")
1099
- ], HTML3DElement.prototype, "_canvasContainer", void 0);
1100
- HTML3DElement = __decorate([
1101
- customElement("babylon-viewer")
1102
- ], HTML3DElement);
1103
-
1104
- export { HTML3DElement, Viewer, createViewerForCanvas, getDefaultEngine };
1105
- //# sourceMappingURL=index.js.map