@babylonjs/viewer 7.40.2-alpha → 7.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/configuration/configuration.d.ts +107 -0
  2. package/configuration/configuration.js +16 -0
  3. package/configuration/configuration.js.map +1 -0
  4. package/configuration/configurationCompatibility.d.ts +8 -0
  5. package/configuration/configurationCompatibility.js +66 -0
  6. package/configuration/configurationCompatibility.js.map +1 -0
  7. package/configuration/configurationContainer.d.ts +10 -0
  8. package/configuration/configurationContainer.js +10 -0
  9. package/configuration/configurationContainer.js.map +1 -0
  10. package/configuration/globals.d.ts +6 -0
  11. package/configuration/globals.js +18 -0
  12. package/configuration/globals.js.map +1 -0
  13. package/configuration/index.d.ts +2 -0
  14. package/configuration/index.js +4 -0
  15. package/configuration/index.js.map +1 -0
  16. package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
  17. package/configuration/interfaces/cameraConfiguration.js +2 -0
  18. package/configuration/interfaces/cameraConfiguration.js.map +1 -0
  19. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
  20. package/configuration/interfaces/colorGradingConfiguration.js +2 -0
  21. package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
  22. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
  23. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
  24. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
  25. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
  26. package/configuration/interfaces/environmentMapConfiguration.js +2 -0
  27. package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
  28. package/configuration/interfaces/groundConfiguration.d.ts +24 -0
  29. package/configuration/interfaces/groundConfiguration.js +2 -0
  30. package/configuration/interfaces/groundConfiguration.js.map +1 -0
  31. package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
  32. package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
  33. package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
  34. package/configuration/interfaces/index.d.ts +15 -0
  35. package/configuration/interfaces/index.js +16 -0
  36. package/configuration/interfaces/index.js.map +1 -0
  37. package/configuration/interfaces/lightConfiguration.d.ts +60 -0
  38. package/configuration/interfaces/lightConfiguration.js +2 -0
  39. package/configuration/interfaces/lightConfiguration.js.map +1 -0
  40. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
  41. package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
  42. package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
  43. package/configuration/interfaces/modelConfiguration.d.ts +65 -0
  44. package/configuration/interfaces/modelConfiguration.js +2 -0
  45. package/configuration/interfaces/modelConfiguration.js.map +1 -0
  46. package/configuration/interfaces/observersConfiguration.d.ts +5 -0
  47. package/configuration/interfaces/observersConfiguration.js +2 -0
  48. package/configuration/interfaces/observersConfiguration.js.map +1 -0
  49. package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
  50. package/configuration/interfaces/sceneConfiguration.js +2 -0
  51. package/configuration/interfaces/sceneConfiguration.js.map +1 -0
  52. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
  53. package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
  54. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
  55. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
  56. package/configuration/interfaces/skyboxConfiguration.js +2 -0
  57. package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
  58. package/configuration/interfaces/templateConfiguration.d.ts +67 -0
  59. package/configuration/interfaces/templateConfiguration.js +2 -0
  60. package/configuration/interfaces/templateConfiguration.js.map +1 -0
  61. package/configuration/interfaces/vrConfiguration.d.ts +16 -0
  62. package/configuration/interfaces/vrConfiguration.js +2 -0
  63. package/configuration/interfaces/vrConfiguration.js.map +1 -0
  64. package/configuration/loader.d.ts +4 -0
  65. package/configuration/loader.js +17 -0
  66. package/configuration/loader.js.map +1 -0
  67. package/configuration/mappers.d.ts +43 -0
  68. package/configuration/mappers.js +193 -0
  69. package/configuration/mappers.js.map +1 -0
  70. package/configuration/renderOnlyLoader.d.ts +33 -0
  71. package/configuration/renderOnlyLoader.js +162 -0
  72. package/configuration/renderOnlyLoader.js.map +1 -0
  73. package/configuration/types/default.d.ts +6 -0
  74. package/configuration/types/default.js +121 -0
  75. package/configuration/types/default.js.map +1 -0
  76. package/configuration/types/environmentMap.d.ts +5 -0
  77. package/configuration/types/environmentMap.js +14 -0
  78. package/configuration/types/environmentMap.js.map +1 -0
  79. package/configuration/types/extended.d.ts +6 -0
  80. package/configuration/types/extended.js +317 -0
  81. package/configuration/types/extended.js.map +1 -0
  82. package/configuration/types/index.d.ts +14 -0
  83. package/configuration/types/index.js +51 -0
  84. package/configuration/types/index.js.map +1 -0
  85. package/configuration/types/minimal.d.ts +6 -0
  86. package/configuration/types/minimal.js +43 -0
  87. package/configuration/types/minimal.js.map +1 -0
  88. package/configuration/types/renderOnlyDefault.d.ts +30 -0
  89. package/configuration/types/renderOnlyDefault.js +31 -0
  90. package/configuration/types/renderOnlyDefault.js.map +1 -0
  91. package/configuration/types/shadowLight.d.ts +9 -0
  92. package/configuration/types/shadowLight.js +64 -0
  93. package/configuration/types/shadowLight.js.map +1 -0
  94. package/helper/index.d.ts +29 -0
  95. package/helper/index.js +66 -0
  96. package/helper/index.js.map +1 -0
  97. package/index.d.ts +30 -0
  98. package/index.js +46 -0
  99. package/index.js.map +1 -0
  100. package/initializer.d.ts +11 -0
  101. package/initializer.js +35 -0
  102. package/initializer.js.map +1 -0
  103. package/interfaces.d.ts +5 -0
  104. package/interfaces.js +7 -0
  105. package/interfaces.js.map +1 -0
  106. package/labs/environmentSerializer.d.ts +126 -0
  107. package/labs/environmentSerializer.js +191 -0
  108. package/labs/environmentSerializer.js.map +1 -0
  109. package/labs/texture.d.ts +183 -0
  110. package/labs/texture.js +351 -0
  111. package/labs/texture.js.map +1 -0
  112. package/labs/viewerLabs.d.ts +51 -0
  113. package/labs/viewerLabs.js +134 -0
  114. package/labs/viewerLabs.js.map +1 -0
  115. package/loader/modelLoader.d.ts +56 -0
  116. package/loader/modelLoader.js +202 -0
  117. package/loader/modelLoader.js.map +1 -0
  118. package/loader/plugins/applyMaterialConfig.d.ts +12 -0
  119. package/loader/plugins/applyMaterialConfig.js +16 -0
  120. package/loader/plugins/applyMaterialConfig.js.map +1 -0
  121. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
  122. package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
  123. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
  124. package/loader/plugins/index.d.ts +19 -0
  125. package/loader/plugins/index.js +44 -0
  126. package/loader/plugins/index.js.map +1 -0
  127. package/loader/plugins/loaderPlugin.d.ts +24 -0
  128. package/loader/plugins/loaderPlugin.js +2 -0
  129. package/loader/plugins/loaderPlugin.js.map +1 -0
  130. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
  131. package/loader/plugins/msftLodLoaderPlugin.js +21 -0
  132. package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
  133. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
  134. package/loader/plugins/telemetryLoaderPlugin.js +36 -0
  135. package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
  136. package/managers/observablesManager.d.ts +66 -0
  137. package/managers/observablesManager.js +35 -0
  138. package/managers/observablesManager.js.map +1 -0
  139. package/managers/sceneManager.d.ts +245 -0
  140. package/managers/sceneManager.js +1375 -0
  141. package/managers/sceneManager.js.map +1 -0
  142. package/managers/telemetryManager.d.ts +78 -0
  143. package/managers/telemetryManager.js +117 -0
  144. package/managers/telemetryManager.js.map +1 -0
  145. package/model/modelAnimation.d.ts +215 -0
  146. package/model/modelAnimation.js +237 -0
  147. package/model/modelAnimation.js.map +1 -0
  148. package/model/viewerModel.d.ts +233 -0
  149. package/model/viewerModel.js +673 -0
  150. package/model/viewerModel.js.map +1 -0
  151. package/optimizer/custom/extended.d.ts +13 -0
  152. package/optimizer/custom/extended.js +101 -0
  153. package/optimizer/custom/extended.js.map +1 -0
  154. package/optimizer/custom/index.d.ts +9 -0
  155. package/optimizer/custom/index.js +26 -0
  156. package/optimizer/custom/index.js.map +1 -0
  157. package/package.json +28 -19
  158. package/readme.md +28 -28
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +22 -0
  167. package/templating/plugins/hdButtonPlugin.js.map +1 -0
  168. package/templating/plugins/printButton.d.ts +9 -0
  169. package/templating/plugins/printButton.js +41 -0
  170. package/templating/plugins/printButton.js.map +1 -0
  171. package/templating/templateManager.d.ts +197 -0
  172. package/templating/templateManager.js +561 -0
  173. package/templating/templateManager.js.map +1 -0
  174. package/templating/viewerTemplatePlugin.d.ts +21 -0
  175. package/templating/viewerTemplatePlugin.js +69 -0
  176. package/templating/viewerTemplatePlugin.js.map +1 -0
  177. package/viewer/defaultViewer.d.ts +130 -0
  178. package/viewer/defaultViewer.js +672 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/assets/photoStudio.env +0 -0
  193. package/dist/babylon-viewer.esm.js +0 -2
  194. package/dist/babylon-viewer.esm.js.map +0 -1
  195. package/dist/babylon-viewer.esm.min.js +0 -2
  196. package/dist/babylon-viewer.esm.min.js.map +0 -1
  197. package/dist/chunks/EXT_lights_ies-BrhvRw2-.esm.js +0 -84
  198. package/dist/chunks/EXT_lights_ies-BrhvRw2-.esm.js.map +0 -1
  199. package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js +0 -2
  200. package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js.map +0 -1
  201. package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js +0 -2
  202. package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js.map +0 -1
  203. package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js +0 -171
  204. package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js.map +0 -1
  205. package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js +0 -86
  206. package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js.map +0 -1
  207. package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js +0 -2
  208. package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js.map +0 -1
  209. package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js +0 -2
  210. package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js.map +0 -1
  211. package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js +0 -134
  212. package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js.map +0 -1
  213. package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js +0 -2
  214. package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js.map +0 -1
  215. package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js +0 -44
  216. package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js.map +0 -1
  217. package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js +0 -2
  218. package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js.map +0 -1
  219. package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js +0 -43
  220. package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js.map +0 -1
  221. package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js +0 -64
  222. package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js.map +0 -1
  223. package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js +0 -2
  224. package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js.map +0 -1
  225. package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js +0 -352
  226. package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js.map +0 -1
  227. package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js +0 -2
  228. package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js.map +0 -1
  229. package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js +0 -2
  230. package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js.map +0 -1
  231. package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js +0 -617
  232. package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js.map +0 -1
  233. package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js +0 -4033
  234. package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js.map +0 -1
  235. package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js +0 -2
  236. package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js.map +0 -1
  237. package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js +0 -581
  238. package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js.map +0 -1
  239. package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js +0 -2
  240. package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js.map +0 -1
  241. package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js +0 -65
  242. package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js.map +0 -1
  243. package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js +0 -2
  244. package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js.map +0 -1
  245. package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js +0 -96
  246. package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js.map +0 -1
  247. package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js +0 -2
  248. package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js.map +0 -1
  249. package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js +0 -97
  250. package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js.map +0 -1
  251. package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js +0 -2
  252. package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js.map +0 -1
  253. package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js +0 -2
  254. package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js.map +0 -1
  255. package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js +0 -62
  256. package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js.map +0 -1
  257. package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js +0 -55
  258. package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js.map +0 -1
  259. package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js +0 -2
  260. package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js.map +0 -1
  261. package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js +0 -2
  262. package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js.map +0 -1
  263. package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js +0 -64
  264. package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js.map +0 -1
  265. package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js +0 -72
  266. package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js.map +0 -1
  267. package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js +0 -2
  268. package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js.map +0 -1
  269. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js +0 -2
  270. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js.map +0 -1
  271. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js +0 -81
  272. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js.map +0 -1
  273. package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js +0 -85
  274. package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js.map +0 -1
  275. package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js +0 -2
  276. package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js.map +0 -1
  277. package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js +0 -2
  278. package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js.map +0 -1
  279. package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js +0 -75
  280. package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js.map +0 -1
  281. package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js +0 -307
  282. package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js.map +0 -1
  283. package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js +0 -2
  284. package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js.map +0 -1
  285. package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js +0 -74
  286. package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js.map +0 -1
  287. package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js +0 -2
  288. package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js.map +0 -1
  289. package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js +0 -262
  290. package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js.map +0 -1
  291. package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js +0 -2
  292. package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js.map +0 -1
  293. package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js +0 -2
  294. package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js.map +0 -1
  295. package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js +0 -87
  296. package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js.map +0 -1
  297. package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js +0 -2
  298. package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js.map +0 -1
  299. package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js +0 -26
  300. package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js.map +0 -1
  301. package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js +0 -2
  302. package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js.map +0 -1
  303. package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js +0 -39
  304. package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js.map +0 -1
  305. package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js +0 -46
  306. package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js.map +0 -1
  307. package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js +0 -2
  308. package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js.map +0 -1
  309. package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js +0 -43
  310. package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js.map +0 -1
  311. package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js +0 -2
  312. package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js.map +0 -1
  313. package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js +0 -63
  314. package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js.map +0 -1
  315. package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js +0 -2
  316. package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js.map +0 -1
  317. package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js +0 -2
  318. package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js.map +0 -1
  319. package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js +0 -51
  320. package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js.map +0 -1
  321. package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js +0 -2
  322. package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js.map +0 -1
  323. package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js +0 -2207
  324. package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js.map +0 -1
  325. package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js +0 -337
  326. package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js.map +0 -1
  327. package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js +0 -2
  328. package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js.map +0 -1
  329. package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js +0 -46
  330. package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js.map +0 -1
  331. package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js +0 -2
  332. package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js.map +0 -1
  333. package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js +0 -2
  334. package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js.map +0 -1
  335. package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js +0 -47
  336. package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js.map +0 -1
  337. package/dist/chunks/animationGroup-DjpN6ul8.esm.js +0 -2482
  338. package/dist/chunks/animationGroup-DjpN6ul8.esm.js.map +0 -1
  339. package/dist/chunks/animationGroup-Duijaphk.esm.min.js +0 -2
  340. package/dist/chunks/animationGroup-Duijaphk.esm.min.js.map +0 -1
  341. package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js +0 -2
  342. package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js.map +0 -1
  343. package/dist/chunks/assetContainer-nATkXNwM.esm.js +0 -1720
  344. package/dist/chunks/assetContainer-nATkXNwM.esm.js.map +0 -1
  345. package/dist/chunks/audioEngine-C2kMlYrt.esm.js +0 -305
  346. package/dist/chunks/audioEngine-C2kMlYrt.esm.js.map +0 -1
  347. package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js +0 -2
  348. package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js.map +0 -1
  349. package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js +0 -114
  350. package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js.map +0 -1
  351. package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js +0 -2
  352. package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js.map +0 -1
  353. package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js +0 -2
  354. package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js.map +0 -1
  355. package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js +0 -600
  356. package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js.map +0 -1
  357. package/dist/chunks/dds-BiituSHb.esm.min.js +0 -2
  358. package/dist/chunks/dds-BiituSHb.esm.min.js.map +0 -1
  359. package/dist/chunks/dds-CeXwQQLK.esm.js +0 -540
  360. package/dist/chunks/dds-CeXwQQLK.esm.js.map +0 -1
  361. package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js +0 -2
  362. package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js.map +0 -1
  363. package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js +0 -88
  364. package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js.map +0 -1
  365. package/dist/chunks/decalFragment-B0hAgbHQ.esm.js +0 -18
  366. package/dist/chunks/decalFragment-B0hAgbHQ.esm.js.map +0 -1
  367. package/dist/chunks/decalFragment-BisNb1SA.esm.min.js +0 -2
  368. package/dist/chunks/decalFragment-BisNb1SA.esm.min.js.map +0 -1
  369. package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js +0 -2
  370. package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js.map +0 -1
  371. package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js +0 -2
  372. package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js.map +0 -1
  373. package/dist/chunks/default.fragment-DBNZgft_.esm.js +0 -515
  374. package/dist/chunks/default.fragment-DBNZgft_.esm.js.map +0 -1
  375. package/dist/chunks/default.fragment-mEUMwg3j.esm.js +0 -446
  376. package/dist/chunks/default.fragment-mEUMwg3j.esm.js.map +0 -1
  377. package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js +0 -2
  378. package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js.map +0 -1
  379. package/dist/chunks/default.vertex-BYGJcupS.esm.js +0 -181
  380. package/dist/chunks/default.vertex-BYGJcupS.esm.js.map +0 -1
  381. package/dist/chunks/default.vertex-D-mtahDc.esm.min.js +0 -2
  382. package/dist/chunks/default.vertex-D-mtahDc.esm.min.js.map +0 -1
  383. package/dist/chunks/default.vertex-uhPv4tjg.esm.js +0 -202
  384. package/dist/chunks/default.vertex-uhPv4tjg.esm.js.map +0 -1
  385. package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js +0 -13
  386. package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js.map +0 -1
  387. package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js +0 -2
  388. package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js.map +0 -1
  389. package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js +0 -2
  390. package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js.map +0 -1
  391. package/dist/chunks/defaultUboDeclaration-vQgTvkEe.esm.js +0 -15
  392. package/dist/chunks/defaultUboDeclaration-vQgTvkEe.esm.js.map +0 -1
  393. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
  394. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
  395. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
  396. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
  397. package/dist/chunks/dumpTools-DO-b-FSI.esm.js +0 -200
  398. package/dist/chunks/dumpTools-DO-b-FSI.esm.js.map +0 -1
  399. package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js +0 -2
  400. package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js.map +0 -1
  401. package/dist/chunks/engine-BcUVpC0R.esm.js +0 -2216
  402. package/dist/chunks/engine-BcUVpC0R.esm.js.map +0 -1
  403. package/dist/chunks/engine-CBJrzwFS.esm.min.js +0 -2
  404. package/dist/chunks/engine-CBJrzwFS.esm.min.js.map +0 -1
  405. package/dist/chunks/engine.common-CSbFYR6g.esm.min.js +0 -2
  406. package/dist/chunks/engine.common-CSbFYR6g.esm.min.js.map +0 -1
  407. package/dist/chunks/engine.common-MyFhbP5R.esm.js +0 -1162
  408. package/dist/chunks/engine.common-MyFhbP5R.esm.js.map +0 -1
  409. package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js +0 -2
  410. package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js.map +0 -1
  411. package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js +0 -64
  412. package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js.map +0 -1
  413. package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js +0 -2
  414. package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js.map +0 -1
  415. package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js +0 -382
  416. package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js.map +0 -1
  417. package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js +0 -2
  418. package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js.map +0 -1
  419. package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js +0 -1683
  420. package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js.map +0 -1
  421. package/dist/chunks/fogFragment-B6w-VW0A.esm.js +0 -102
  422. package/dist/chunks/fogFragment-B6w-VW0A.esm.js.map +0 -1
  423. package/dist/chunks/fogFragment-BdwYc4_S.esm.js +0 -101
  424. package/dist/chunks/fogFragment-BdwYc4_S.esm.js.map +0 -1
  425. package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js +0 -2
  426. package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js.map +0 -1
  427. package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js +0 -2
  428. package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js.map +0 -1
  429. package/dist/chunks/fresnelFunction-BeTviBu9.esm.js +0 -12
  430. package/dist/chunks/fresnelFunction-BeTviBu9.esm.js.map +0 -1
  431. package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js +0 -2
  432. package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js.map +0 -1
  433. package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js +0 -2
  434. package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js.map +0 -1
  435. package/dist/chunks/glTFLoader-C3ib4SHM.esm.js +0 -7586
  436. package/dist/chunks/glTFLoader-C3ib4SHM.esm.js.map +0 -1
  437. package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js +0 -2
  438. package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js.map +0 -1
  439. package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.esm.js +0 -77
  440. package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.esm.js.map +0 -1
  441. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  442. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  443. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  444. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  445. package/dist/chunks/harmonicsFunctions-BEk7hjTV.esm.js +0 -35
  446. package/dist/chunks/harmonicsFunctions-BEk7hjTV.esm.js.map +0 -1
  447. package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js +0 -34
  448. package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js.map +0 -1
  449. package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js +0 -2
  450. package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js.map +0 -1
  451. package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js +0 -2
  452. package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js.map +0 -1
  453. package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js +0 -2
  454. package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js.map +0 -1
  455. package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js +0 -253
  456. package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js.map +0 -1
  457. package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js +0 -108
  458. package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js.map +0 -1
  459. package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js +0 -2
  460. package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js.map +0 -1
  461. package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js +0 -2
  462. package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js.map +0 -1
  463. package/dist/chunks/helperFunctions-utyx3wAA.esm.js +0 -80
  464. package/dist/chunks/helperFunctions-utyx3wAA.esm.js.map +0 -1
  465. package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js +0 -189
  466. package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js.map +0 -1
  467. package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js +0 -2
  468. package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js.map +0 -1
  469. package/dist/chunks/index-DnSap2FI.esm.js +0 -74799
  470. package/dist/chunks/index-DnSap2FI.esm.js.map +0 -1
  471. package/dist/chunks/index-j2tloO6T.esm.min.js +0 -57
  472. package/dist/chunks/index-j2tloO6T.esm.min.js.map +0 -1
  473. package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js +0 -814
  474. package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js.map +0 -1
  475. package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js +0 -2
  476. package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js.map +0 -1
  477. package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js +0 -2
  478. package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js.map +0 -1
  479. package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js +0 -2
  480. package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js.map +0 -1
  481. package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js +0 -11
  482. package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js.map +0 -1
  483. package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js +0 -35
  484. package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js.map +0 -1
  485. package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js +0 -81
  486. package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js.map +0 -1
  487. package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js +0 -2
  488. package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js.map +0 -1
  489. package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js +0 -2
  490. package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js.map +0 -1
  491. package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js +0 -77
  492. package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js.map +0 -1
  493. package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js +0 -2
  494. package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js.map +0 -1
  495. package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js +0 -11
  496. package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js.map +0 -1
  497. package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js +0 -2
  498. package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js.map +0 -1
  499. package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js +0 -11
  500. package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js.map +0 -1
  501. package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js +0 -2
  502. package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js.map +0 -1
  503. package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js +0 -26
  504. package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js.map +0 -1
  505. package/dist/chunks/objFileLoader-8afS-_hY.esm.js +0 -1338
  506. package/dist/chunks/objFileLoader-8afS-_hY.esm.js.map +0 -1
  507. package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js +0 -2
  508. package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js.map +0 -1
  509. package/dist/chunks/oitFragment-CHqqW65b.esm.js +0 -1240
  510. package/dist/chunks/oitFragment-CHqqW65b.esm.js.map +0 -1
  511. package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js +0 -2
  512. package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js.map +0 -1
  513. package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js +0 -2
  514. package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js.map +0 -1
  515. package/dist/chunks/oitFragment-alnyZbc9.esm.js +0 -1078
  516. package/dist/chunks/oitFragment-alnyZbc9.esm.js.map +0 -1
  517. package/dist/chunks/pass.fragment-CwG7GshA.esm.js +0 -15
  518. package/dist/chunks/pass.fragment-CwG7GshA.esm.js.map +0 -1
  519. package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js +0 -2
  520. package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js.map +0 -1
  521. package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js +0 -2
  522. package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js.map +0 -1
  523. package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js +0 -15
  524. package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js.map +0 -1
  525. package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js +0 -2
  526. package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js.map +0 -1
  527. package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js +0 -3232
  528. package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js.map +0 -1
  529. package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js +0 -2
  530. package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js.map +0 -1
  531. package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js +0 -3273
  532. package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js.map +0 -1
  533. package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js +0 -214
  534. package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js.map +0 -1
  535. package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js +0 -2
  536. package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js.map +0 -1
  537. package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js +0 -2
  538. package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js.map +0 -1
  539. package/dist/chunks/pbr.vertex-xNnroO_M.esm.js +0 -339
  540. package/dist/chunks/pbr.vertex-xNnroO_M.esm.js.map +0 -1
  541. package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js +0 -2
  542. package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js.map +0 -1
  543. package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js +0 -20
  544. package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js.map +0 -1
  545. package/dist/chunks/rawTexture-CBbxz3pc.esm.js +0 -191
  546. package/dist/chunks/rawTexture-CBbxz3pc.esm.js.map +0 -1
  547. package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js +0 -2
  548. package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js.map +0 -1
  549. package/dist/chunks/ray-C_Cg5Enj.esm.js +0 -946
  550. package/dist/chunks/ray-C_Cg5Enj.esm.js.map +0 -1
  551. package/dist/chunks/ray-VbeIB6un.esm.min.js +0 -2
  552. package/dist/chunks/ray-VbeIB6un.esm.min.js.map +0 -1
  553. package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js +0 -13
  554. package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js.map +0 -1
  555. package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js +0 -13
  556. package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js.map +0 -1
  557. package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js +0 -2
  558. package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js.map +0 -1
  559. package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js +0 -2
  560. package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js.map +0 -1
  561. package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js +0 -2
  562. package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js.map +0 -1
  563. package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js +0 -13
  564. package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js.map +0 -1
  565. package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js +0 -2
  566. package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js.map +0 -1
  567. package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js +0 -13
  568. package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js.map +0 -1
  569. package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js +0 -2
  570. package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js.map +0 -1
  571. package/dist/chunks/splatFileLoader-DE83jdwc.esm.js +0 -3379
  572. package/dist/chunks/splatFileLoader-DE83jdwc.esm.js.map +0 -1
  573. package/dist/chunks/spotLight-98FksSI3.esm.min.js +0 -2
  574. package/dist/chunks/spotLight-98FksSI3.esm.min.js.map +0 -1
  575. package/dist/chunks/spotLight-DuWkoiV8.esm.js +0 -701
  576. package/dist/chunks/spotLight-DuWkoiV8.esm.js.map +0 -1
  577. package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js +0 -1805
  578. package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js.map +0 -1
  579. package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js +0 -2
  580. package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js.map +0 -1
  581. package/dist/chunks/stlFileLoader-BFPumqQB.esm.js +0 -238
  582. package/dist/chunks/stlFileLoader-BFPumqQB.esm.js.map +0 -1
  583. package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js +0 -2
  584. package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js.map +0 -1
  585. package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js +0 -2
  586. package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js.map +0 -1
  587. package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js +0 -349
  588. package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js.map +0 -1
  589. package/dist/chunks/thinEngine-kKYV_9vd.esm.js +0 -3848
  590. package/dist/chunks/thinEngine-kKYV_9vd.esm.js.map +0 -1
  591. package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js +0 -2
  592. package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js.map +0 -1
  593. package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js +0 -314
  594. package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js.map +0 -1
  595. package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js +0 -2
  596. package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js.map +0 -1
  597. package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js +0 -2
  598. package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js.map +0 -1
  599. package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js +0 -412
  600. package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js.map +0 -1
  601. package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js +0 -2
  602. package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js.map +0 -1
  603. package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js +0 -522
  604. package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js.map +0 -1
  605. package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js +0 -2
  606. package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js.map +0 -1
  607. package/dist/chunks/webgpuEngine-Cwdi0UKo.esm.js +0 -11533
  608. package/dist/chunks/webgpuEngine-Cwdi0UKo.esm.js.map +0 -1
  609. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  610. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  611. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  612. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  613. package/lib/index.d.ts +0 -591
  614. package/lib/index.js +0 -2165
  615. package/lib/index.js.map +0 -1
@@ -1,1338 +0,0 @@
1
- import { s as Color3, t as Texture, m as Color4, u as Vector2, v as Vector3, V as VertexBuffer, L as Logger, w as Geometry, M as Mesh, x as VertexData, O as OBJFileLoaderMetadata, T as Tools, y as registerSceneLoaderPlugin } from './index-DnSap2FI.esm.js';
2
- import { A as AssetContainer } from './assetContainer-nATkXNwM.esm.js';
3
- import { S as StandardMaterial } from './standardMaterial-Bp1mTX1d.esm.js';
4
-
5
- /**
6
- * Class reading and parsing the MTL file bundled with the obj file.
7
- */
8
- class MTLFileLoader {
9
- constructor() {
10
- /**
11
- * All material loaded from the mtl will be set here
12
- */
13
- this.materials = [];
14
- }
15
- /**
16
- * This function will read the mtl file and create each material described inside
17
- * This function could be improve by adding :
18
- * -some component missing (Ni, Tf...)
19
- * -including the specific options available
20
- *
21
- * @param scene defines the scene the material will be created in
22
- * @param data defines the mtl data to parse
23
- * @param rootUrl defines the rooturl to use in order to load relative dependencies
24
- * @param assetContainer defines the asset container to store the material in (can be null)
25
- */
26
- parseMTL(scene, data, rootUrl, assetContainer) {
27
- if (data instanceof ArrayBuffer) {
28
- return;
29
- }
30
- //Split the lines from the file
31
- const lines = data.split("\n");
32
- // whitespace char ie: [ \t\r\n\f]
33
- const delimiter_pattern = /\s+/;
34
- //Array with RGB colors
35
- let color;
36
- //New material
37
- let material = null;
38
- //Look at each line
39
- for (let i = 0; i < lines.length; i++) {
40
- const line = lines[i].trim();
41
- // Blank line or comment
42
- if (line.length === 0 || line.charAt(0) === "#") {
43
- continue;
44
- }
45
- //Get the first parameter (keyword)
46
- const pos = line.indexOf(" ");
47
- let key = pos >= 0 ? line.substring(0, pos) : line;
48
- key = key.toLowerCase();
49
- //Get the data following the key
50
- const value = pos >= 0 ? line.substring(pos + 1).trim() : "";
51
- //This mtl keyword will create the new material
52
- if (key === "newmtl") {
53
- //Check if it is the first material.
54
- // Materials specifications are described after this keyword.
55
- if (material) {
56
- //Add the previous material in the material array.
57
- this.materials.push(material);
58
- }
59
- //Create a new material.
60
- // value is the name of the material read in the mtl file
61
- scene._blockEntityCollection = !!assetContainer;
62
- material = new StandardMaterial(value, scene);
63
- material._parentContainer = assetContainer;
64
- scene._blockEntityCollection = false;
65
- }
66
- else if (key === "kd" && material) {
67
- // Diffuse color (color under white light) using RGB values
68
- //value = "r g b"
69
- color = value.split(delimiter_pattern, 3).map(parseFloat);
70
- //color = [r,g,b]
71
- //Set tghe color into the material
72
- material.diffuseColor = Color3.FromArray(color);
73
- }
74
- else if (key === "ka" && material) {
75
- // Ambient color (color under shadow) using RGB values
76
- //value = "r g b"
77
- color = value.split(delimiter_pattern, 3).map(parseFloat);
78
- //color = [r,g,b]
79
- //Set tghe color into the material
80
- material.ambientColor = Color3.FromArray(color);
81
- }
82
- else if (key === "ks" && material) {
83
- // Specular color (color when light is reflected from shiny surface) using RGB values
84
- //value = "r g b"
85
- color = value.split(delimiter_pattern, 3).map(parseFloat);
86
- //color = [r,g,b]
87
- //Set the color into the material
88
- material.specularColor = Color3.FromArray(color);
89
- }
90
- else if (key === "ke" && material) {
91
- // Emissive color using RGB values
92
- color = value.split(delimiter_pattern, 3).map(parseFloat);
93
- material.emissiveColor = Color3.FromArray(color);
94
- }
95
- else if (key === "ns" && material) {
96
- //value = "Integer"
97
- material.specularPower = parseFloat(value);
98
- }
99
- else if (key === "d" && material) {
100
- //d is dissolve for current material. It mean alpha for BABYLON
101
- material.alpha = parseFloat(value);
102
- //Texture
103
- //This part can be improved by adding the possible options of texture
104
- }
105
- else if (key === "map_ka" && material) {
106
- // ambient texture map with a loaded image
107
- //We must first get the folder of the image
108
- material.ambientTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);
109
- }
110
- else if (key === "map_kd" && material) {
111
- // Diffuse texture map with a loaded image
112
- material.diffuseTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);
113
- }
114
- else if (key === "map_ks" && material) {
115
- // Specular texture map with a loaded image
116
- //We must first get the folder of the image
117
- material.specularTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);
118
- }
119
- else if (key === "map_ns") ;
120
- else if (key === "map_bump" && material) {
121
- //The bump texture
122
- const values = value.split(delimiter_pattern);
123
- const bumpMultiplierIndex = values.indexOf("-bm");
124
- let bumpMultiplier = null;
125
- if (bumpMultiplierIndex >= 0) {
126
- bumpMultiplier = values[bumpMultiplierIndex + 1];
127
- values.splice(bumpMultiplierIndex, 2); // remove
128
- }
129
- material.bumpTexture = MTLFileLoader._GetTexture(rootUrl, values.join(" "), scene);
130
- if (material.bumpTexture && bumpMultiplier !== null) {
131
- material.bumpTexture.level = parseFloat(bumpMultiplier);
132
- }
133
- }
134
- else if (key === "map_d" && material) {
135
- // The dissolve of the material
136
- material.opacityTexture = MTLFileLoader._GetTexture(rootUrl, value, scene);
137
- //Options for illumination
138
- }
139
- else ;
140
- }
141
- //At the end of the file, add the last material
142
- if (material) {
143
- this.materials.push(material);
144
- }
145
- }
146
- /**
147
- * Gets the texture for the material.
148
- *
149
- * If the material is imported from input file,
150
- * We sanitize the url to ensure it takes the texture from aside the material.
151
- *
152
- * @param rootUrl The root url to load from
153
- * @param value The value stored in the mtl
154
- * @param scene
155
- * @returns The Texture
156
- */
157
- static _GetTexture(rootUrl, value, scene) {
158
- if (!value) {
159
- return null;
160
- }
161
- let url = rootUrl;
162
- // Load from input file.
163
- if (rootUrl === "file:") {
164
- let lastDelimiter = value.lastIndexOf("\\");
165
- if (lastDelimiter === -1) {
166
- lastDelimiter = value.lastIndexOf("/");
167
- }
168
- if (lastDelimiter > -1) {
169
- url += value.substring(lastDelimiter + 1);
170
- }
171
- else {
172
- url += value;
173
- }
174
- }
175
- // Not from input file.
176
- else {
177
- url += value;
178
- }
179
- return new Texture(url, scene, false, MTLFileLoader.INVERT_TEXTURE_Y);
180
- }
181
- }
182
- /**
183
- * Invert Y-Axis of referenced textures on load
184
- */
185
- MTLFileLoader.INVERT_TEXTURE_Y = true;
186
-
187
- /**
188
- * Class used to load mesh data from OBJ content
189
- */
190
- class SolidParser {
191
- /**
192
- * Creates a new SolidParser
193
- * @param materialToUse defines the array to fill with the list of materials to use (it will be filled by the parse function)
194
- * @param babylonMeshesArray defines the array to fill with the list of loaded meshes (it will be filled by the parse function)
195
- * @param loadingOptions defines the loading options to use
196
- */
197
- constructor(materialToUse, babylonMeshesArray, loadingOptions) {
198
- this._positions = []; //values for the positions of vertices
199
- this._normals = []; //Values for the normals
200
- this._uvs = []; //Values for the textures
201
- this._colors = [];
202
- this._extColors = []; //Extension color
203
- this._meshesFromObj = []; //[mesh] Contains all the obj meshes
204
- this._indicesForBabylon = []; //The list of indices for VertexData
205
- this._wrappedPositionForBabylon = []; //The list of position in vectors
206
- this._wrappedUvsForBabylon = []; //Array with all value of uvs to match with the indices
207
- this._wrappedColorsForBabylon = []; // Array with all color values to match with the indices
208
- this._wrappedNormalsForBabylon = []; //Array with all value of normals to match with the indices
209
- this._tuplePosNorm = []; //Create a tuple with indice of Position, Normal, UV [pos, norm, uvs]
210
- this._curPositionInIndices = 0;
211
- this._hasMeshes = false; //Meshes are defined in the file
212
- this._unwrappedPositionsForBabylon = []; //Value of positionForBabylon w/o Vector3() [x,y,z]
213
- this._unwrappedColorsForBabylon = []; // Value of colorForBabylon w/o Color4() [r,g,b,a]
214
- this._unwrappedNormalsForBabylon = []; //Value of normalsForBabylon w/o Vector3() [x,y,z]
215
- this._unwrappedUVForBabylon = []; //Value of uvsForBabylon w/o Vector3() [x,y,z]
216
- this._triangles = []; //Indices from new triangles coming from polygons
217
- this._materialNameFromObj = ""; //The name of the current material
218
- this._objMeshName = ""; //The name of the current obj mesh
219
- this._increment = 1; //Id for meshes created by the multimaterial
220
- this._isFirstMaterial = true;
221
- this._grayColor = new Color4(0.5, 0.5, 0.5, 1);
222
- this._hasLineData = false; //If this mesh has line segment(l) data
223
- this._materialToUse = materialToUse;
224
- this._babylonMeshesArray = babylonMeshesArray;
225
- this._loadingOptions = loadingOptions;
226
- }
227
- /**
228
- * Search for obj in the given array.
229
- * This function is called to check if a couple of data already exists in an array.
230
- *
231
- * If found, returns the index of the founded tuple index. Returns -1 if not found
232
- * @param arr Array<{ normals: Array<number>, idx: Array<number> }>
233
- * @param obj Array<number>
234
- * @returns {boolean}
235
- */
236
- _isInArray(arr, obj) {
237
- if (!arr[obj[0]]) {
238
- arr[obj[0]] = { normals: [], idx: [] };
239
- }
240
- const idx = arr[obj[0]].normals.indexOf(obj[1]);
241
- return idx === -1 ? -1 : arr[obj[0]].idx[idx];
242
- }
243
- _isInArrayUV(arr, obj) {
244
- if (!arr[obj[0]]) {
245
- arr[obj[0]] = { normals: [], idx: [], uv: [] };
246
- }
247
- const idx = arr[obj[0]].normals.indexOf(obj[1]);
248
- if (idx != 1 && obj[2] === arr[obj[0]].uv[idx]) {
249
- return arr[obj[0]].idx[idx];
250
- }
251
- return -1;
252
- }
253
- /**
254
- * This function set the data for each triangle.
255
- * Data are position, normals and uvs
256
- * If a tuple of (position, normal) is not set, add the data into the corresponding array
257
- * If the tuple already exist, add only their indice
258
- *
259
- * @param indicePositionFromObj Integer The index in positions array
260
- * @param indiceUvsFromObj Integer The index in uvs array
261
- * @param indiceNormalFromObj Integer The index in normals array
262
- * @param positionVectorFromOBJ Vector3 The value of position at index objIndice
263
- * @param textureVectorFromOBJ Vector3 The value of uvs
264
- * @param normalsVectorFromOBJ Vector3 The value of normals at index objNormale
265
- * @param positionColorsFromOBJ
266
- */
267
- _setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {
268
- //Check if this tuple already exists in the list of tuples
269
- let _index;
270
- if (this._loadingOptions.optimizeWithUV) {
271
- _index = this._isInArrayUV(this._tuplePosNorm, [indicePositionFromObj, indiceNormalFromObj, indiceUvsFromObj]);
272
- }
273
- else {
274
- _index = this._isInArray(this._tuplePosNorm, [indicePositionFromObj, indiceNormalFromObj]);
275
- }
276
- //If it not exists
277
- if (_index === -1) {
278
- //Add an new indice.
279
- //The array of indices is only an array with his length equal to the number of triangles - 1.
280
- //We add vertices data in this order
281
- this._indicesForBabylon.push(this._wrappedPositionForBabylon.length);
282
- //Push the position of vertice for Babylon
283
- //Each element is a Vector3(x,y,z)
284
- this._wrappedPositionForBabylon.push(positionVectorFromOBJ);
285
- //Push the uvs for Babylon
286
- //Each element is a Vector2(u,v)
287
- //If the UVs are missing, set (u,v)=(0,0)
288
- textureVectorFromOBJ = textureVectorFromOBJ ?? new Vector2(0, 0);
289
- this._wrappedUvsForBabylon.push(textureVectorFromOBJ);
290
- //Push the normals for Babylon
291
- //Each element is a Vector3(x,y,z)
292
- this._wrappedNormalsForBabylon.push(normalsVectorFromOBJ);
293
- if (positionColorsFromOBJ !== undefined) {
294
- //Push the colors for Babylon
295
- //Each element is a BABYLON.Color4(r,g,b,a)
296
- this._wrappedColorsForBabylon.push(positionColorsFromOBJ);
297
- }
298
- //Add the tuple in the comparison list
299
- this._tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
300
- this._tuplePosNorm[indicePositionFromObj].idx.push(this._curPositionInIndices++);
301
- if (this._loadingOptions.optimizeWithUV) {
302
- this._tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
303
- }
304
- }
305
- else {
306
- //The tuple already exists
307
- //Add the index of the already existing tuple
308
- //At this index we can get the value of position, normal, color and uvs of vertex
309
- this._indicesForBabylon.push(_index);
310
- }
311
- }
312
- /**
313
- * Transform Vector() and BABYLON.Color() objects into numbers in an array
314
- */
315
- _unwrapData() {
316
- try {
317
- //Every array has the same length
318
- for (let l = 0; l < this._wrappedPositionForBabylon.length; l++) {
319
- //Push the x, y, z values of each element in the unwrapped array
320
- this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[l].x * this._handednessSign, this._wrappedPositionForBabylon[l].y, this._wrappedPositionForBabylon[l].z);
321
- this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[l].x * this._handednessSign, this._wrappedNormalsForBabylon[l].y, this._wrappedNormalsForBabylon[l].z);
322
- this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[l].x, this._wrappedUvsForBabylon[l].y); //z is an optional value not supported by BABYLON
323
- if (this._loadingOptions.importVertexColors) {
324
- //Push the r, g, b, a values of each element in the unwrapped array
325
- this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[l].r, this._wrappedColorsForBabylon[l].g, this._wrappedColorsForBabylon[l].b, this._wrappedColorsForBabylon[l].a);
326
- }
327
- }
328
- // Reset arrays for the next new meshes
329
- this._wrappedPositionForBabylon.length = 0;
330
- this._wrappedNormalsForBabylon.length = 0;
331
- this._wrappedUvsForBabylon.length = 0;
332
- this._wrappedColorsForBabylon.length = 0;
333
- this._tuplePosNorm.length = 0;
334
- this._curPositionInIndices = 0;
335
- }
336
- catch (e) {
337
- throw new Error("Unable to unwrap data while parsing OBJ data.");
338
- }
339
- }
340
- /**
341
- * Create triangles from polygons
342
- * It is important to notice that a triangle is a polygon
343
- * We get 5 patterns of face defined in OBJ File :
344
- * facePattern1 = ["1","2","3","4","5","6"]
345
- * facePattern2 = ["1/1","2/2","3/3","4/4","5/5","6/6"]
346
- * facePattern3 = ["1/1/1","2/2/2","3/3/3","4/4/4","5/5/5","6/6/6"]
347
- * facePattern4 = ["1//1","2//2","3//3","4//4","5//5","6//6"]
348
- * facePattern5 = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-4/-4/-4","-5/-5/-5","-6/-6/-6"]
349
- * Each pattern is divided by the same method
350
- * @param faces Array[String] The indices of elements
351
- * @param v Integer The variable to increment
352
- */
353
- _getTriangles(faces, v) {
354
- //Work for each element of the array
355
- for (let faceIndex = v; faceIndex < faces.length - 1; faceIndex++) {
356
- //Add on the triangle variable the indexes to obtain triangles
357
- this._pushTriangle(faces, faceIndex);
358
- }
359
- //Result obtained after 2 iterations:
360
- //Pattern1 => triangle = ["1","2","3","1","3","4"];
361
- //Pattern2 => triangle = ["1/1","2/2","3/3","1/1","3/3","4/4"];
362
- //Pattern3 => triangle = ["1/1/1","2/2/2","3/3/3","1/1/1","3/3/3","4/4/4"];
363
- //Pattern4 => triangle = ["1//1","2//2","3//3","1//1","3//3","4//4"];
364
- //Pattern5 => triangle = ["-1/-1/-1","-2/-2/-2","-3/-3/-3","-1/-1/-1","-3/-3/-3","-4/-4/-4"];
365
- }
366
- /**
367
- * To get color between color and extension color
368
- * @param index Integer The index of the element in the array
369
- * @returns value of target color
370
- */
371
- _getColor(index) {
372
- if (this._loadingOptions.importVertexColors) {
373
- return this._extColors[index] ?? this._colors[index];
374
- }
375
- else {
376
- return undefined;
377
- }
378
- }
379
- /**
380
- * Create triangles and push the data for each polygon for the pattern 1
381
- * In this pattern we get vertice positions
382
- * @param face
383
- * @param v
384
- */
385
- _setDataForCurrentFaceWithPattern1(face, v) {
386
- //Get the indices of triangles for each polygon
387
- this._getTriangles(face, v);
388
- //For each element in the triangles array.
389
- //This var could contains 1 to an infinity of triangles
390
- for (let k = 0; k < this._triangles.length; k++) {
391
- // Set position indice
392
- const indicePositionFromObj = parseInt(this._triangles[k]) - 1;
393
- this._setData(indicePositionFromObj, 0, 0, // In the pattern 1, normals and uvs are not defined
394
- this._positions[indicePositionFromObj], // Get the vectors data
395
- Vector2.Zero(), Vector3.Up(), // Create default vectors
396
- this._getColor(indicePositionFromObj));
397
- }
398
- //Reset variable for the next line
399
- this._triangles.length = 0;
400
- }
401
- /**
402
- * Create triangles and push the data for each polygon for the pattern 2
403
- * In this pattern we get vertice positions and uvs
404
- * @param face
405
- * @param v
406
- */
407
- _setDataForCurrentFaceWithPattern2(face, v) {
408
- //Get the indices of triangles for each polygon
409
- this._getTriangles(face, v);
410
- for (let k = 0; k < this._triangles.length; k++) {
411
- //triangle[k] = "1/1"
412
- //Split the data for getting position and uv
413
- const point = this._triangles[k].split("/"); // ["1", "1"]
414
- //Set position indice
415
- const indicePositionFromObj = parseInt(point[0]) - 1;
416
- //Set uv indice
417
- const indiceUvsFromObj = parseInt(point[1]) - 1;
418
- this._setData(indicePositionFromObj, indiceUvsFromObj, 0, //Default value for normals
419
- this._positions[indicePositionFromObj], //Get the values for each element
420
- this._uvs[indiceUvsFromObj] ?? Vector2.Zero(), Vector3.Up(), //Default value for normals
421
- this._getColor(indicePositionFromObj));
422
- }
423
- //Reset variable for the next line
424
- this._triangles.length = 0;
425
- }
426
- /**
427
- * Create triangles and push the data for each polygon for the pattern 3
428
- * In this pattern we get vertice positions, uvs and normals
429
- * @param face
430
- * @param v
431
- */
432
- _setDataForCurrentFaceWithPattern3(face, v) {
433
- //Get the indices of triangles for each polygon
434
- this._getTriangles(face, v);
435
- for (let k = 0; k < this._triangles.length; k++) {
436
- //triangle[k] = "1/1/1"
437
- //Split the data for getting position, uv, and normals
438
- const point = this._triangles[k].split("/"); // ["1", "1", "1"]
439
- // Set position indice
440
- const indicePositionFromObj = parseInt(point[0]) - 1;
441
- // Set uv indice
442
- const indiceUvsFromObj = parseInt(point[1]) - 1;
443
- // Set normal indice
444
- const indiceNormalFromObj = parseInt(point[2]) - 1;
445
- this._setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, this._positions[indicePositionFromObj], this._uvs[indiceUvsFromObj] ?? Vector2.Zero(), this._normals[indiceNormalFromObj] ?? Vector3.Up() //Set the vector for each component
446
- );
447
- }
448
- //Reset variable for the next line
449
- this._triangles.length = 0;
450
- }
451
- /**
452
- * Create triangles and push the data for each polygon for the pattern 4
453
- * In this pattern we get vertice positions and normals
454
- * @param face
455
- * @param v
456
- */
457
- _setDataForCurrentFaceWithPattern4(face, v) {
458
- this._getTriangles(face, v);
459
- for (let k = 0; k < this._triangles.length; k++) {
460
- //triangle[k] = "1//1"
461
- //Split the data for getting position and normals
462
- const point = this._triangles[k].split("//"); // ["1", "1"]
463
- // We check indices, and normals
464
- const indicePositionFromObj = parseInt(point[0]) - 1;
465
- const indiceNormalFromObj = parseInt(point[1]) - 1;
466
- this._setData(indicePositionFromObj, 1, //Default value for uv
467
- indiceNormalFromObj, this._positions[indicePositionFromObj], //Get each vector of data
468
- Vector2.Zero(), this._normals[indiceNormalFromObj], this._getColor(indicePositionFromObj));
469
- }
470
- //Reset variable for the next line
471
- this._triangles.length = 0;
472
- }
473
- /*
474
- * Create triangles and push the data for each polygon for the pattern 3
475
- * In this pattern we get vertice positions, uvs and normals
476
- * @param face
477
- * @param v
478
- */
479
- _setDataForCurrentFaceWithPattern5(face, v) {
480
- //Get the indices of triangles for each polygon
481
- this._getTriangles(face, v);
482
- for (let k = 0; k < this._triangles.length; k++) {
483
- //triangle[k] = "-1/-1/-1"
484
- //Split the data for getting position, uv, and normals
485
- const point = this._triangles[k].split("/"); // ["-1", "-1", "-1"]
486
- // Set position indice
487
- const indicePositionFromObj = this._positions.length + parseInt(point[0]);
488
- // Set uv indice
489
- const indiceUvsFromObj = this._uvs.length + parseInt(point[1]);
490
- // Set normal indice
491
- const indiceNormalFromObj = this._normals.length + parseInt(point[2]);
492
- this._setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, this._positions[indicePositionFromObj], this._uvs[indiceUvsFromObj], this._normals[indiceNormalFromObj], //Set the vector for each component
493
- this._getColor(indicePositionFromObj));
494
- }
495
- //Reset variable for the next line
496
- this._triangles.length = 0;
497
- }
498
- _addPreviousObjMesh() {
499
- //Check if it is not the first mesh. Otherwise we don't have data.
500
- if (this._meshesFromObj.length > 0) {
501
- //Get the previous mesh for applying the data about the faces
502
- //=> in obj file, faces definition append after the name of the mesh
503
- this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1];
504
- //Set the data into Array for the mesh
505
- this._unwrapData();
506
- if (this._loadingOptions.useLegacyBehavior) {
507
- // Reverse tab. Otherwise face are displayed in the wrong sens
508
- this._indicesForBabylon.reverse();
509
- }
510
- //Set the information for the mesh
511
- //Slice the array to avoid rewriting because of the fact this is the same var which be rewrited
512
- this._handledMesh.indices = this._indicesForBabylon.slice();
513
- this._handledMesh.positions = this._unwrappedPositionsForBabylon.slice();
514
- this._handledMesh.normals = this._unwrappedNormalsForBabylon.slice();
515
- this._handledMesh.uvs = this._unwrappedUVForBabylon.slice();
516
- this._handledMesh.hasLines = this._hasLineData;
517
- if (this._loadingOptions.importVertexColors) {
518
- this._handledMesh.colors = this._unwrappedColorsForBabylon.slice();
519
- }
520
- //Reset the array for the next mesh
521
- this._indicesForBabylon.length = 0;
522
- this._unwrappedPositionsForBabylon.length = 0;
523
- this._unwrappedColorsForBabylon.length = 0;
524
- this._unwrappedNormalsForBabylon.length = 0;
525
- this._unwrappedUVForBabylon.length = 0;
526
- this._hasLineData = false;
527
- }
528
- }
529
- _optimizeNormals(mesh) {
530
- const positions = mesh.getVerticesData(VertexBuffer.PositionKind);
531
- const normals = mesh.getVerticesData(VertexBuffer.NormalKind);
532
- const mapVertices = {};
533
- if (!positions || !normals) {
534
- return;
535
- }
536
- for (let i = 0; i < positions.length / 3; i++) {
537
- const x = positions[i * 3 + 0];
538
- const y = positions[i * 3 + 1];
539
- const z = positions[i * 3 + 2];
540
- const key = x + "_" + y + "_" + z;
541
- let lst = mapVertices[key];
542
- if (!lst) {
543
- lst = [];
544
- mapVertices[key] = lst;
545
- }
546
- lst.push(i);
547
- }
548
- const normal = new Vector3();
549
- for (const key in mapVertices) {
550
- const lst = mapVertices[key];
551
- if (lst.length < 2) {
552
- continue;
553
- }
554
- const v0Idx = lst[0];
555
- for (let i = 1; i < lst.length; ++i) {
556
- const vIdx = lst[i];
557
- normals[v0Idx * 3 + 0] += normals[vIdx * 3 + 0];
558
- normals[v0Idx * 3 + 1] += normals[vIdx * 3 + 1];
559
- normals[v0Idx * 3 + 2] += normals[vIdx * 3 + 2];
560
- }
561
- normal.copyFromFloats(normals[v0Idx * 3 + 0], normals[v0Idx * 3 + 1], normals[v0Idx * 3 + 2]);
562
- normal.normalize();
563
- for (let i = 0; i < lst.length; ++i) {
564
- const vIdx = lst[i];
565
- normals[vIdx * 3 + 0] = normal.x;
566
- normals[vIdx * 3 + 1] = normal.y;
567
- normals[vIdx * 3 + 2] = normal.z;
568
- }
569
- }
570
- mesh.setVerticesData(VertexBuffer.NormalKind, normals);
571
- }
572
- static _IsLineElement(line) {
573
- return line.startsWith("l");
574
- }
575
- static _IsObjectElement(line) {
576
- return line.startsWith("o");
577
- }
578
- static _IsGroupElement(line) {
579
- return line.startsWith("g");
580
- }
581
- static _GetZbrushMRGB(line, notParse) {
582
- if (!line.startsWith("mrgb"))
583
- return null;
584
- line = line.replace("mrgb", "").trim();
585
- // if include vertex color , not load mrgb anymore
586
- if (notParse)
587
- return [];
588
- const regex = /[a-z0-9]/g;
589
- const regArray = line.match(regex);
590
- if (!regArray || regArray.length % 8 !== 0) {
591
- return [];
592
- }
593
- const array = [];
594
- for (let regIndex = 0; regIndex < regArray.length / 8; regIndex++) {
595
- //each item is MMRRGGBB, m is material index
596
- // const m = regArray[regIndex * 8 + 0] + regArray[regIndex * 8 + 1];
597
- const r = regArray[regIndex * 8 + 2] + regArray[regIndex * 8 + 3];
598
- const g = regArray[regIndex * 8 + 4] + regArray[regIndex * 8 + 5];
599
- const b = regArray[regIndex * 8 + 6] + regArray[regIndex * 8 + 7];
600
- array.push(new Color4(parseInt(r, 16) / 255, parseInt(g, 16) / 255, parseInt(b, 16) / 255, 1));
601
- }
602
- return array;
603
- }
604
- /**
605
- * Function used to parse an OBJ string
606
- * @param meshesNames defines the list of meshes to load (all if not defined)
607
- * @param data defines the OBJ string
608
- * @param scene defines the hosting scene
609
- * @param assetContainer defines the asset container to load data in
610
- * @param onFileToLoadFound defines a callback that will be called if a MTL file is found
611
- */
612
- parse(meshesNames, data, scene, assetContainer, onFileToLoadFound) {
613
- //Move Santitize here to forbid delete zbrush data
614
- // Sanitize data
615
- data = data.replace(/#MRGB/g, "mrgb");
616
- data = data.replace(/#.*$/gm, "").trim();
617
- if (this._loadingOptions.useLegacyBehavior) {
618
- this._pushTriangle = (faces, faceIndex) => this._triangles.push(faces[0], faces[faceIndex], faces[faceIndex + 1]);
619
- this._handednessSign = 1;
620
- }
621
- else if (scene.useRightHandedSystem) {
622
- this._pushTriangle = (faces, faceIndex) => this._triangles.push(faces[0], faces[faceIndex + 1], faces[faceIndex]);
623
- this._handednessSign = 1;
624
- }
625
- else {
626
- this._pushTriangle = (faces, faceIndex) => this._triangles.push(faces[0], faces[faceIndex], faces[faceIndex + 1]);
627
- this._handednessSign = -1;
628
- }
629
- // Split the file into lines
630
- // Preprocess line data
631
- const linesOBJ = data.split("\n");
632
- const lineLines = [];
633
- let currentGroup = [];
634
- lineLines.push(currentGroup);
635
- for (let i = 0; i < linesOBJ.length; i++) {
636
- const line = linesOBJ[i].trim().replace(/\s\s/g, " ");
637
- // Comment or newLine
638
- if (line.length === 0 || line.charAt(0) === "#") {
639
- continue;
640
- }
641
- if (SolidParser._IsGroupElement(line) || SolidParser._IsObjectElement(line)) {
642
- currentGroup = [];
643
- lineLines.push(currentGroup);
644
- }
645
- if (SolidParser._IsLineElement(line)) {
646
- const lineValues = line.split(" ");
647
- // create line elements with two vertices only
648
- for (let i = 1; i < lineValues.length - 1; i++) {
649
- currentGroup.push(`l ${lineValues[i]} ${lineValues[i + 1]}`);
650
- }
651
- }
652
- else {
653
- currentGroup.push(line);
654
- }
655
- }
656
- const lines = lineLines.flat();
657
- // Look at each line
658
- for (let i = 0; i < lines.length; i++) {
659
- const line = lines[i].trim().replace(/\s\s/g, " ");
660
- let result;
661
- // Comment or newLine
662
- if (line.length === 0 || line.charAt(0) === "#") {
663
- continue;
664
- }
665
- else if (SolidParser.VertexPattern.test(line)) {
666
- //Get information about one position possible for the vertices
667
- result = line.match(/[^ ]+/g); // match will return non-null due to passing regex pattern
668
- // Value of result with line: "v 1.0 2.0 3.0"
669
- // ["v", "1.0", "2.0", "3.0"]
670
- // Create a Vector3 with the position x, y, z
671
- this._positions.push(new Vector3(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
672
- if (this._loadingOptions.importVertexColors) {
673
- if (result.length >= 7) {
674
- const r = parseFloat(result[4]);
675
- const g = parseFloat(result[5]);
676
- const b = parseFloat(result[6]);
677
- this._colors.push(new Color4(r > 1 ? r / 255 : r, g > 1 ? g / 255 : g, b > 1 ? b / 255 : b, result.length === 7 || result[7] === undefined ? 1 : parseFloat(result[7])));
678
- }
679
- else {
680
- // TODO: maybe push NULL and if all are NULL to skip (and remove grayColor var).
681
- this._colors.push(this._grayColor);
682
- }
683
- }
684
- }
685
- else if ((result = SolidParser.NormalPattern.exec(line)) !== null) {
686
- //Create a Vector3 with the normals x, y, z
687
- //Value of result
688
- // ["vn 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
689
- //Add the Vector in the list of normals
690
- this._normals.push(new Vector3(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
691
- }
692
- else if ((result = SolidParser.UVPattern.exec(line)) !== null) {
693
- //Create a Vector2 with the normals u, v
694
- //Value of result
695
- // ["vt 0.1 0.2 0.3", "0.1", "0.2"]
696
- //Add the Vector in the list of uvs
697
- this._uvs.push(new Vector2(parseFloat(result[1]) * this._loadingOptions.UVScaling.x, parseFloat(result[2]) * this._loadingOptions.UVScaling.y));
698
- //Identify patterns of faces
699
- //Face could be defined in different type of pattern
700
- }
701
- else if ((result = SolidParser.FacePattern3.exec(line)) !== null) {
702
- //Value of result:
703
- //["f 1/1/1 2/2/2 3/3/3", "1/1/1 2/2/2 3/3/3"...]
704
- //Set the data for this face
705
- this._setDataForCurrentFaceWithPattern3(result[1].trim().split(" "), // ["1/1/1", "2/2/2", "3/3/3"]
706
- 1);
707
- }
708
- else if ((result = SolidParser.FacePattern4.exec(line)) !== null) {
709
- //Value of result:
710
- //["f 1//1 2//2 3//3", "1//1 2//2 3//3"...]
711
- //Set the data for this face
712
- this._setDataForCurrentFaceWithPattern4(result[1].trim().split(" "), // ["1//1", "2//2", "3//3"]
713
- 1);
714
- }
715
- else if ((result = SolidParser.FacePattern5.exec(line)) !== null) {
716
- //Value of result:
717
- //["f -1/-1/-1 -2/-2/-2 -3/-3/-3", "-1/-1/-1 -2/-2/-2 -3/-3/-3"...]
718
- //Set the data for this face
719
- this._setDataForCurrentFaceWithPattern5(result[1].trim().split(" "), // ["-1/-1/-1", "-2/-2/-2", "-3/-3/-3"]
720
- 1);
721
- }
722
- else if ((result = SolidParser.FacePattern2.exec(line)) !== null) {
723
- //Value of result:
724
- //["f 1/1 2/2 3/3", "1/1 2/2 3/3"...]
725
- //Set the data for this face
726
- this._setDataForCurrentFaceWithPattern2(result[1].trim().split(" "), // ["1/1", "2/2", "3/3"]
727
- 1);
728
- }
729
- else if ((result = SolidParser.FacePattern1.exec(line)) !== null) {
730
- //Value of result
731
- //["f 1 2 3", "1 2 3"...]
732
- //Set the data for this face
733
- this._setDataForCurrentFaceWithPattern1(result[1].trim().split(" "), // ["1", "2", "3"]
734
- 1);
735
- // Define a mesh or an object
736
- // Each time this keyword is analyzed, create a new Object with all data for creating a babylonMesh
737
- }
738
- else if ((result = SolidParser.LinePattern1.exec(line)) !== null) {
739
- //Value of result
740
- //["l 1 2"]
741
- //Set the data for this face
742
- this._setDataForCurrentFaceWithPattern1(result[1].trim().split(" "), // ["1", "2"]
743
- 0);
744
- this._hasLineData = true;
745
- // Define a mesh or an object
746
- // Each time this keyword is analyzed, create a new Object with all data for creating a babylonMesh
747
- }
748
- else if ((result = SolidParser.LinePattern2.exec(line)) !== null) {
749
- //Value of result
750
- //["l 1/1 2/2"]
751
- //Set the data for this face
752
- this._setDataForCurrentFaceWithPattern2(result[1].trim().split(" "), // ["1/1", "2/2"]
753
- 0);
754
- this._hasLineData = true;
755
- // Define a mesh or an object
756
- // Each time this keyword is analyzed, create a new Object with all data for creating a babylonMesh
757
- }
758
- else if ((result = SolidParser._GetZbrushMRGB(line, !this._loadingOptions.importVertexColors))) {
759
- result.forEach((element) => {
760
- this._extColors.push(element);
761
- });
762
- }
763
- else if ((result = SolidParser.LinePattern3.exec(line)) !== null) {
764
- //Value of result
765
- //["l 1/1/1 2/2/2"]
766
- //Set the data for this face
767
- this._setDataForCurrentFaceWithPattern3(result[1].trim().split(" "), // ["1/1/1", "2/2/2"]
768
- 0);
769
- this._hasLineData = true;
770
- // Define a mesh or an object
771
- // Each time this keyword is analyzed, create a new Object with all data for creating a babylonMesh
772
- }
773
- else if (SolidParser.GroupDescriptor.test(line) || SolidParser.ObjectDescriptor.test(line)) {
774
- // Create a new mesh corresponding to the name of the group.
775
- // Definition of the mesh
776
- const objMesh = {
777
- name: line.substring(2).trim(), //Set the name of the current obj mesh
778
- indices: null,
779
- positions: null,
780
- normals: null,
781
- uvs: null,
782
- colors: null,
783
- materialName: this._materialNameFromObj,
784
- isObject: SolidParser.ObjectDescriptor.test(line),
785
- };
786
- this._addPreviousObjMesh();
787
- //Push the last mesh created with only the name
788
- this._meshesFromObj.push(objMesh);
789
- //Set this variable to indicate that now meshesFromObj has objects defined inside
790
- this._hasMeshes = true;
791
- this._isFirstMaterial = true;
792
- this._increment = 1;
793
- //Keyword for applying a material
794
- }
795
- else if (SolidParser.UseMtlDescriptor.test(line)) {
796
- //Get the name of the material
797
- this._materialNameFromObj = line.substring(7).trim();
798
- //If this new material is in the same mesh
799
- if (!this._isFirstMaterial || !this._hasMeshes) {
800
- //Set the data for the previous mesh
801
- this._addPreviousObjMesh();
802
- //Create a new mesh
803
- const objMesh =
804
- //Set the name of the current obj mesh
805
- {
806
- name: (this._objMeshName || "mesh") + "_mm" + this._increment.toString(), //Set the name of the current obj mesh
807
- indices: null,
808
- positions: null,
809
- normals: null,
810
- uvs: null,
811
- colors: null,
812
- materialName: this._materialNameFromObj,
813
- isObject: false,
814
- };
815
- this._increment++;
816
- //If meshes are already defined
817
- this._meshesFromObj.push(objMesh);
818
- this._hasMeshes = true;
819
- }
820
- //Set the material name if the previous line define a mesh
821
- if (this._hasMeshes && this._isFirstMaterial) {
822
- //Set the material name to the previous mesh (1 material per mesh)
823
- this._meshesFromObj[this._meshesFromObj.length - 1].materialName = this._materialNameFromObj;
824
- this._isFirstMaterial = false;
825
- }
826
- // Keyword for loading the mtl file
827
- }
828
- else if (SolidParser.MtlLibGroupDescriptor.test(line)) {
829
- // Get the name of mtl file
830
- onFileToLoadFound(line.substring(7).trim());
831
- // Apply smoothing
832
- }
833
- else if (SolidParser.SmoothDescriptor.test(line)) ;
834
- else {
835
- //If there is another possibility
836
- Logger.Log("Unhandled expression at line : " + line);
837
- }
838
- }
839
- // At the end of the file, add the last mesh into the meshesFromObj array
840
- if (this._hasMeshes) {
841
- // Set the data for the last mesh
842
- this._handledMesh = this._meshesFromObj[this._meshesFromObj.length - 1];
843
- if (this._loadingOptions.useLegacyBehavior) {
844
- //Reverse indices for displaying faces in the good sense
845
- this._indicesForBabylon.reverse();
846
- }
847
- //Get the good array
848
- this._unwrapData();
849
- //Set array
850
- this._handledMesh.indices = this._indicesForBabylon;
851
- this._handledMesh.positions = this._unwrappedPositionsForBabylon;
852
- this._handledMesh.normals = this._unwrappedNormalsForBabylon;
853
- this._handledMesh.uvs = this._unwrappedUVForBabylon;
854
- this._handledMesh.hasLines = this._hasLineData;
855
- if (this._loadingOptions.importVertexColors) {
856
- this._handledMesh.colors = this._unwrappedColorsForBabylon;
857
- }
858
- }
859
- // If any o or g keyword not found, create a mesh with a random id
860
- if (!this._hasMeshes) {
861
- let newMaterial = null;
862
- if (this._indicesForBabylon.length) {
863
- if (this._loadingOptions.useLegacyBehavior) {
864
- // reverse tab of indices
865
- this._indicesForBabylon.reverse();
866
- }
867
- //Get positions normals uvs
868
- this._unwrapData();
869
- }
870
- else {
871
- // There is no indices in the file. We will have to switch to point cloud rendering
872
- for (const pos of this._positions) {
873
- this._unwrappedPositionsForBabylon.push(pos.x, pos.y, pos.z);
874
- }
875
- if (this._normals.length) {
876
- for (const normal of this._normals) {
877
- this._unwrappedNormalsForBabylon.push(normal.x, normal.y, normal.z);
878
- }
879
- }
880
- if (this._uvs.length) {
881
- for (const uv of this._uvs) {
882
- this._unwrappedUVForBabylon.push(uv.x, uv.y);
883
- }
884
- }
885
- if (this._extColors.length) {
886
- for (const color of this._extColors) {
887
- this._unwrappedColorsForBabylon.push(color.r, color.g, color.b, color.a);
888
- }
889
- }
890
- else {
891
- if (this._colors.length) {
892
- for (const color of this._colors) {
893
- this._unwrappedColorsForBabylon.push(color.r, color.g, color.b, color.a);
894
- }
895
- }
896
- }
897
- if (!this._materialNameFromObj) {
898
- // Create a material with point cloud on
899
- newMaterial = new StandardMaterial(Geometry.RandomId(), scene);
900
- newMaterial.pointsCloud = true;
901
- this._materialNameFromObj = newMaterial.name;
902
- if (!this._normals.length) {
903
- newMaterial.disableLighting = true;
904
- newMaterial.emissiveColor = Color3.White();
905
- }
906
- }
907
- }
908
- //Set data for one mesh
909
- this._meshesFromObj.push({
910
- name: Geometry.RandomId(),
911
- indices: this._indicesForBabylon,
912
- positions: this._unwrappedPositionsForBabylon,
913
- colors: this._unwrappedColorsForBabylon,
914
- normals: this._unwrappedNormalsForBabylon,
915
- uvs: this._unwrappedUVForBabylon,
916
- materialName: this._materialNameFromObj,
917
- directMaterial: newMaterial,
918
- isObject: true,
919
- hasLines: this._hasLineData,
920
- });
921
- }
922
- //Set data for each mesh
923
- for (let j = 0; j < this._meshesFromObj.length; j++) {
924
- //check meshesNames (stlFileLoader)
925
- if (meshesNames && this._meshesFromObj[j].name) {
926
- if (meshesNames instanceof Array) {
927
- if (meshesNames.indexOf(this._meshesFromObj[j].name) === -1) {
928
- continue;
929
- }
930
- }
931
- else {
932
- if (this._meshesFromObj[j].name !== meshesNames) {
933
- continue;
934
- }
935
- }
936
- }
937
- //Get the current mesh
938
- //Set the data with VertexBuffer for each mesh
939
- this._handledMesh = this._meshesFromObj[j];
940
- //Create a Mesh with the name of the obj mesh
941
- scene._blockEntityCollection = !!assetContainer;
942
- const babylonMesh = new Mesh(this._meshesFromObj[j].name, scene);
943
- babylonMesh._parentContainer = assetContainer;
944
- scene._blockEntityCollection = false;
945
- this._handledMesh._babylonMesh = babylonMesh;
946
- // If this is a group mesh, it should have an object mesh as a parent. So look for the first object mesh that appears before it.
947
- if (!this._handledMesh.isObject) {
948
- for (let k = j - 1; k >= 0; --k) {
949
- if (this._meshesFromObj[k].isObject && this._meshesFromObj[k]._babylonMesh) {
950
- babylonMesh.parent = this._meshesFromObj[k]._babylonMesh;
951
- break;
952
- }
953
- }
954
- }
955
- //Push the name of the material to an array
956
- //This is indispensable for the importMesh function
957
- this._materialToUse.push(this._meshesFromObj[j].materialName);
958
- //If the mesh is a line mesh
959
- if (this._handledMesh.hasLines) {
960
- babylonMesh._internalMetadata ??= {};
961
- babylonMesh._internalMetadata["_isLine"] = true; //this is a line mesh
962
- }
963
- if (this._handledMesh.positions?.length === 0) {
964
- //Push the mesh into an array
965
- this._babylonMeshesArray.push(babylonMesh);
966
- continue;
967
- }
968
- const vertexData = new VertexData(); //The container for the values
969
- //Set the data for the babylonMesh
970
- vertexData.uvs = this._handledMesh.uvs;
971
- vertexData.indices = this._handledMesh.indices;
972
- vertexData.positions = this._handledMesh.positions;
973
- if (this._loadingOptions.computeNormals) {
974
- const normals = new Array();
975
- VertexData.ComputeNormals(this._handledMesh.positions, this._handledMesh.indices, normals);
976
- vertexData.normals = normals;
977
- }
978
- else {
979
- vertexData.normals = this._handledMesh.normals;
980
- }
981
- if (this._loadingOptions.importVertexColors) {
982
- vertexData.colors = this._handledMesh.colors;
983
- }
984
- //Set the data from the VertexBuffer to the current Mesh
985
- vertexData.applyToMesh(babylonMesh);
986
- if (this._loadingOptions.invertY) {
987
- babylonMesh.scaling.y *= -1;
988
- }
989
- if (this._loadingOptions.optimizeNormals) {
990
- this._optimizeNormals(babylonMesh);
991
- }
992
- //Push the mesh into an array
993
- this._babylonMeshesArray.push(babylonMesh);
994
- if (this._handledMesh.directMaterial) {
995
- babylonMesh.material = this._handledMesh.directMaterial;
996
- }
997
- }
998
- }
999
- }
1000
- // Descriptor
1001
- /** Object descriptor */
1002
- SolidParser.ObjectDescriptor = /^o/;
1003
- /** Group descriptor */
1004
- SolidParser.GroupDescriptor = /^g/;
1005
- /** Material lib descriptor */
1006
- SolidParser.MtlLibGroupDescriptor = /^mtllib /;
1007
- /** Use a material descriptor */
1008
- SolidParser.UseMtlDescriptor = /^usemtl /;
1009
- /** Smooth descriptor */
1010
- SolidParser.SmoothDescriptor = /^s /;
1011
- // Patterns
1012
- /** Pattern used to detect a vertex */
1013
- SolidParser.VertexPattern = /^v(\s+[\d|.|+|\-|e|E]+){3,7}/;
1014
- /** Pattern used to detect a normal */
1015
- SolidParser.NormalPattern = /^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;
1016
- /** Pattern used to detect a UV set */
1017
- SolidParser.UVPattern = /^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;
1018
- /** Pattern used to detect a first kind of face (f vertex vertex vertex) */
1019
- SolidParser.FacePattern1 = /^f\s+(([\d]{1,}[\s]?){3,})+/;
1020
- /** Pattern used to detect a second kind of face (f vertex/uvs vertex/uvs vertex/uvs) */
1021
- SolidParser.FacePattern2 = /^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;
1022
- /** Pattern used to detect a third kind of face (f vertex/uvs/normal vertex/uvs/normal vertex/uvs/normal) */
1023
- SolidParser.FacePattern3 = /^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;
1024
- /** Pattern used to detect a fourth kind of face (f vertex//normal vertex//normal vertex//normal)*/
1025
- SolidParser.FacePattern4 = /^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;
1026
- /** Pattern used to detect a fifth kind of face (f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal) */
1027
- SolidParser.FacePattern5 = /^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
1028
- /** Pattern used to detect a line(l vertex vertex) */
1029
- SolidParser.LinePattern1 = /^l\s+(([\d]{1,}[\s]?){2,})+/;
1030
- /** Pattern used to detect a second kind of line (l vertex/uvs vertex/uvs) */
1031
- SolidParser.LinePattern2 = /^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;
1032
- /** Pattern used to detect a third kind of line (l vertex/uvs/normal vertex/uvs/normal) */
1033
- SolidParser.LinePattern3 = /^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;
1034
-
1035
- /**
1036
- * OBJ file type loader.
1037
- * This is a babylon scene loader plugin.
1038
- */
1039
- class OBJFileLoader {
1040
- /**
1041
- * Invert Y-Axis of referenced textures on load
1042
- */
1043
- static get INVERT_TEXTURE_Y() {
1044
- return MTLFileLoader.INVERT_TEXTURE_Y;
1045
- }
1046
- static set INVERT_TEXTURE_Y(value) {
1047
- MTLFileLoader.INVERT_TEXTURE_Y = value;
1048
- }
1049
- /**
1050
- * Creates loader for .OBJ files
1051
- *
1052
- * @param loadingOptions options for loading and parsing OBJ/MTL files.
1053
- */
1054
- constructor(loadingOptions) {
1055
- /**
1056
- * Defines the name of the plugin.
1057
- */
1058
- this.name = OBJFileLoaderMetadata.name;
1059
- /**
1060
- * Defines the extension the plugin is able to load.
1061
- */
1062
- this.extensions = OBJFileLoaderMetadata.extensions;
1063
- this._assetContainer = null;
1064
- this._loadingOptions = loadingOptions || OBJFileLoader._DefaultLoadingOptions;
1065
- }
1066
- static get _DefaultLoadingOptions() {
1067
- return {
1068
- computeNormals: OBJFileLoader.COMPUTE_NORMALS,
1069
- optimizeNormals: OBJFileLoader.OPTIMIZE_NORMALS,
1070
- importVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS,
1071
- invertY: OBJFileLoader.INVERT_Y,
1072
- invertTextureY: OBJFileLoader.INVERT_TEXTURE_Y,
1073
- // eslint-disable-next-line @typescript-eslint/naming-convention
1074
- UVScaling: OBJFileLoader.UV_SCALING,
1075
- materialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY,
1076
- optimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV,
1077
- skipMaterials: OBJFileLoader.SKIP_MATERIALS,
1078
- useLegacyBehavior: OBJFileLoader.USE_LEGACY_BEHAVIOR,
1079
- };
1080
- }
1081
- /**
1082
- * Calls synchronously the MTL file attached to this obj.
1083
- * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
1084
- * Without this function materials are not displayed in the first frame (but displayed after).
1085
- * In consequence it is impossible to get material information in your HTML file
1086
- *
1087
- * @param url The URL of the MTL file
1088
- * @param rootUrl defines where to load data from
1089
- * @param onSuccess Callback function to be called when the MTL file is loaded
1090
- * @param onFailure
1091
- */
1092
- _loadMTL(url, rootUrl, onSuccess, onFailure) {
1093
- //The complete path to the mtl file
1094
- const pathOfFile = rootUrl + url;
1095
- // Loads through the babylon tools to allow fileInput search.
1096
- Tools.LoadFile(pathOfFile, onSuccess, undefined, undefined, false, (request, exception) => {
1097
- onFailure(pathOfFile, exception);
1098
- });
1099
- }
1100
- /**
1101
- * Instantiates a OBJ file loader plugin.
1102
- * @returns the created plugin
1103
- */
1104
- createPlugin() {
1105
- return new OBJFileLoader(OBJFileLoader._DefaultLoadingOptions);
1106
- }
1107
- /**
1108
- * If the data string can be loaded directly.
1109
- * @returns if the data can be loaded directly
1110
- */
1111
- canDirectLoad() {
1112
- return false;
1113
- }
1114
- /**
1115
- * Imports one or more meshes from the loaded OBJ data and adds them to the scene
1116
- * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
1117
- * @param scene the scene the meshes should be added to
1118
- * @param data the OBJ data to load
1119
- * @param rootUrl root url to load from
1120
- * @returns a promise containing the loaded meshes, particles, skeletons and animations
1121
- */
1122
- importMeshAsync(meshesNames, scene, data, rootUrl) {
1123
- //get the meshes from OBJ file
1124
- return this._parseSolid(meshesNames, scene, data, rootUrl).then((meshes) => {
1125
- return {
1126
- meshes: meshes,
1127
- particleSystems: [],
1128
- skeletons: [],
1129
- animationGroups: [],
1130
- transformNodes: [],
1131
- geometries: [],
1132
- lights: [],
1133
- spriteManagers: [],
1134
- };
1135
- });
1136
- }
1137
- /**
1138
- * Imports all objects from the loaded OBJ data and adds them to the scene
1139
- * @param scene the scene the objects should be added to
1140
- * @param data the OBJ data to load
1141
- * @param rootUrl root url to load from
1142
- * @returns a promise which completes when objects have been loaded to the scene
1143
- */
1144
- loadAsync(scene, data, rootUrl) {
1145
- //Get the 3D model
1146
- return this.importMeshAsync(null, scene, data, rootUrl).then(() => {
1147
- // return void
1148
- });
1149
- }
1150
- /**
1151
- * Load into an asset container.
1152
- * @param scene The scene to load into
1153
- * @param data The data to import
1154
- * @param rootUrl The root url for scene and resources
1155
- * @returns The loaded asset container
1156
- */
1157
- loadAssetContainerAsync(scene, data, rootUrl) {
1158
- const container = new AssetContainer(scene);
1159
- this._assetContainer = container;
1160
- return this.importMeshAsync(null, scene, data, rootUrl)
1161
- .then((result) => {
1162
- result.meshes.forEach((mesh) => container.meshes.push(mesh));
1163
- result.meshes.forEach((mesh) => {
1164
- const material = mesh.material;
1165
- if (material) {
1166
- // Materials
1167
- if (container.materials.indexOf(material) == -1) {
1168
- container.materials.push(material);
1169
- // Textures
1170
- const textures = material.getActiveTextures();
1171
- textures.forEach((t) => {
1172
- if (container.textures.indexOf(t) == -1) {
1173
- container.textures.push(t);
1174
- }
1175
- });
1176
- }
1177
- }
1178
- });
1179
- this._assetContainer = null;
1180
- return container;
1181
- })
1182
- .catch((ex) => {
1183
- this._assetContainer = null;
1184
- throw ex;
1185
- });
1186
- }
1187
- /**
1188
- * Read the OBJ file and create an Array of meshes.
1189
- * Each mesh contains all information given by the OBJ and the MTL file.
1190
- * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
1191
- * @param meshesNames defines a string or array of strings of the mesh names that should be loaded from the file
1192
- * @param scene defines the scene where are displayed the data
1193
- * @param data defines the content of the obj file
1194
- * @param rootUrl defines the path to the folder
1195
- * @returns the list of loaded meshes
1196
- */
1197
- _parseSolid(meshesNames, scene, data, rootUrl) {
1198
- let fileToLoad = ""; //The name of the mtlFile to load
1199
- const materialsFromMTLFile = new MTLFileLoader();
1200
- const materialToUse = [];
1201
- const babylonMeshesArray = []; //The mesh for babylon
1202
- // Sanitize data
1203
- data = data.replace(/#.*$/gm, "").trim();
1204
- // Main function
1205
- const solidParser = new SolidParser(materialToUse, babylonMeshesArray, this._loadingOptions);
1206
- solidParser.parse(meshesNames, data, scene, this._assetContainer, (fileName) => {
1207
- fileToLoad = fileName;
1208
- });
1209
- // load the materials
1210
- const mtlPromises = [];
1211
- // Check if we have a file to load
1212
- if (fileToLoad !== "" && !this._loadingOptions.skipMaterials) {
1213
- //Load the file synchronously
1214
- mtlPromises.push(new Promise((resolve, reject) => {
1215
- this._loadMTL(fileToLoad, rootUrl, (dataLoaded) => {
1216
- try {
1217
- //Create materials thanks MTLLoader function
1218
- materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl, this._assetContainer);
1219
- //Look at each material loaded in the mtl file
1220
- for (let n = 0; n < materialsFromMTLFile.materials.length; n++) {
1221
- //Three variables to get all meshes with the same material
1222
- let startIndex = 0;
1223
- const _indices = [];
1224
- let _index;
1225
- //The material from MTL file is used in the meshes loaded
1226
- //Push the indice in an array
1227
- //Check if the material is not used for another mesh
1228
- while ((_index = materialToUse.indexOf(materialsFromMTLFile.materials[n].name, startIndex)) > -1) {
1229
- _indices.push(_index);
1230
- startIndex = _index + 1;
1231
- }
1232
- //If the material is not used dispose it
1233
- if (_index === -1 && _indices.length === 0) {
1234
- //If the material is not needed, remove it
1235
- materialsFromMTLFile.materials[n].dispose();
1236
- }
1237
- else {
1238
- for (let o = 0; o < _indices.length; o++) {
1239
- //Apply the material to the Mesh for each mesh with the material
1240
- const mesh = babylonMeshesArray[_indices[o]];
1241
- const material = materialsFromMTLFile.materials[n];
1242
- mesh.material = material;
1243
- if (!mesh.getTotalIndices()) {
1244
- // No indices, we need to turn on point cloud
1245
- material.pointsCloud = true;
1246
- }
1247
- }
1248
- }
1249
- }
1250
- resolve();
1251
- }
1252
- catch (e) {
1253
- Tools.Warn(`Error processing MTL file: '${fileToLoad}'`);
1254
- if (this._loadingOptions.materialLoadingFailsSilently) {
1255
- resolve();
1256
- }
1257
- else {
1258
- reject(e);
1259
- }
1260
- }
1261
- }, (pathOfFile, exception) => {
1262
- Tools.Warn(`Error downloading MTL file: '${fileToLoad}'`);
1263
- if (this._loadingOptions.materialLoadingFailsSilently) {
1264
- resolve();
1265
- }
1266
- else {
1267
- reject(exception);
1268
- }
1269
- });
1270
- }));
1271
- }
1272
- //Return an array with all Mesh
1273
- return Promise.all(mtlPromises).then(() => {
1274
- const isLine = (mesh) => Boolean(mesh._internalMetadata?.["_isLine"] ?? false);
1275
- // Iterate over the mesh, determine if it is a line mesh, clone or modify the material to line rendering.
1276
- babylonMeshesArray.forEach((mesh) => {
1277
- if (isLine(mesh)) {
1278
- let mat = mesh.material ?? new StandardMaterial(mesh.name + "_line", scene);
1279
- // If another mesh is using this material and it is not a line then we need to clone it.
1280
- const needClone = mat.getBindedMeshes().filter((e) => !isLine(e)).length > 0;
1281
- if (needClone) {
1282
- mat = mat.clone(mat.name + "_line") ?? mat;
1283
- }
1284
- mat.wireframe = true;
1285
- mesh.material = mat;
1286
- if (mesh._internalMetadata) {
1287
- mesh._internalMetadata["_isLine"] = undefined;
1288
- }
1289
- }
1290
- });
1291
- return babylonMeshesArray;
1292
- });
1293
- }
1294
- }
1295
- /**
1296
- * Defines if UVs are optimized by default during load.
1297
- */
1298
- OBJFileLoader.OPTIMIZE_WITH_UV = true;
1299
- /**
1300
- * Invert model on y-axis (does a model scaling inversion)
1301
- */
1302
- OBJFileLoader.INVERT_Y = false;
1303
- /**
1304
- * Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
1305
- */
1306
- OBJFileLoader.IMPORT_VERTEX_COLORS = false;
1307
- /**
1308
- * Compute the normals for the model, even if normals are present in the file.
1309
- */
1310
- OBJFileLoader.COMPUTE_NORMALS = false;
1311
- /**
1312
- * Optimize the normals for the model. Lighting can be uneven if you use OptimizeWithUV = true because new vertices can be created for the same location if they pertain to different faces.
1313
- * Using OptimizehNormals = true will help smoothing the lighting by averaging the normals of those vertices.
1314
- */
1315
- OBJFileLoader.OPTIMIZE_NORMALS = false;
1316
- /**
1317
- * Defines custom scaling of UV coordinates of loaded meshes.
1318
- */
1319
- OBJFileLoader.UV_SCALING = new Vector2(1, 1);
1320
- /**
1321
- * Skip loading the materials even if defined in the OBJ file (materials are ignored).
1322
- */
1323
- OBJFileLoader.SKIP_MATERIALS = false;
1324
- /**
1325
- * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
1326
- *
1327
- * Defaults to true for backwards compatibility.
1328
- */
1329
- OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = true;
1330
- /**
1331
- * Loads assets without handedness conversions. This flag is for compatibility. Use it only if absolutely required. Defaults to false.
1332
- */
1333
- OBJFileLoader.USE_LEGACY_BEHAVIOR = false;
1334
- //Add this loader into the register plugin
1335
- registerSceneLoaderPlugin(new OBJFileLoader());
1336
-
1337
- export { OBJFileLoader };
1338
- //# sourceMappingURL=objFileLoader-8afS-_hY.esm.js.map