@babylonjs/viewer 7.24.0-alpha → 7.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/configuration/configuration.d.ts +107 -0
  2. package/configuration/configuration.js +16 -0
  3. package/configuration/configuration.js.map +1 -0
  4. package/configuration/configurationCompatibility.d.ts +8 -0
  5. package/configuration/configurationCompatibility.js +66 -0
  6. package/configuration/configurationCompatibility.js.map +1 -0
  7. package/configuration/configurationContainer.d.ts +10 -0
  8. package/configuration/configurationContainer.js +10 -0
  9. package/configuration/configurationContainer.js.map +1 -0
  10. package/configuration/globals.d.ts +6 -0
  11. package/configuration/globals.js +18 -0
  12. package/configuration/globals.js.map +1 -0
  13. package/configuration/index.d.ts +2 -0
  14. package/configuration/index.js +4 -0
  15. package/configuration/index.js.map +1 -0
  16. package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
  17. package/configuration/interfaces/cameraConfiguration.js +2 -0
  18. package/configuration/interfaces/cameraConfiguration.js.map +1 -0
  19. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
  20. package/configuration/interfaces/colorGradingConfiguration.js +2 -0
  21. package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
  22. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
  23. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
  24. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
  25. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
  26. package/configuration/interfaces/environmentMapConfiguration.js +2 -0
  27. package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
  28. package/configuration/interfaces/groundConfiguration.d.ts +24 -0
  29. package/configuration/interfaces/groundConfiguration.js +2 -0
  30. package/configuration/interfaces/groundConfiguration.js.map +1 -0
  31. package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
  32. package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
  33. package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
  34. package/configuration/interfaces/index.d.ts +15 -0
  35. package/configuration/interfaces/index.js +16 -0
  36. package/configuration/interfaces/index.js.map +1 -0
  37. package/configuration/interfaces/lightConfiguration.d.ts +60 -0
  38. package/configuration/interfaces/lightConfiguration.js +2 -0
  39. package/configuration/interfaces/lightConfiguration.js.map +1 -0
  40. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
  41. package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
  42. package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
  43. package/configuration/interfaces/modelConfiguration.d.ts +65 -0
  44. package/configuration/interfaces/modelConfiguration.js +2 -0
  45. package/configuration/interfaces/modelConfiguration.js.map +1 -0
  46. package/configuration/interfaces/observersConfiguration.d.ts +5 -0
  47. package/configuration/interfaces/observersConfiguration.js +2 -0
  48. package/configuration/interfaces/observersConfiguration.js.map +1 -0
  49. package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
  50. package/configuration/interfaces/sceneConfiguration.js +2 -0
  51. package/configuration/interfaces/sceneConfiguration.js.map +1 -0
  52. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
  53. package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
  54. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
  55. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
  56. package/configuration/interfaces/skyboxConfiguration.js +2 -0
  57. package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
  58. package/configuration/interfaces/templateConfiguration.d.ts +67 -0
  59. package/configuration/interfaces/templateConfiguration.js +2 -0
  60. package/configuration/interfaces/templateConfiguration.js.map +1 -0
  61. package/configuration/interfaces/vrConfiguration.d.ts +16 -0
  62. package/configuration/interfaces/vrConfiguration.js +2 -0
  63. package/configuration/interfaces/vrConfiguration.js.map +1 -0
  64. package/configuration/loader.d.ts +4 -0
  65. package/configuration/loader.js +17 -0
  66. package/configuration/loader.js.map +1 -0
  67. package/configuration/mappers.d.ts +43 -0
  68. package/configuration/mappers.js +192 -0
  69. package/configuration/mappers.js.map +1 -0
  70. package/configuration/renderOnlyLoader.d.ts +33 -0
  71. package/configuration/renderOnlyLoader.js +162 -0
  72. package/configuration/renderOnlyLoader.js.map +1 -0
  73. package/configuration/types/default.d.ts +6 -0
  74. package/configuration/types/default.js +121 -0
  75. package/configuration/types/default.js.map +1 -0
  76. package/configuration/types/environmentMap.d.ts +5 -0
  77. package/configuration/types/environmentMap.js +14 -0
  78. package/configuration/types/environmentMap.js.map +1 -0
  79. package/configuration/types/extended.d.ts +6 -0
  80. package/configuration/types/extended.js +317 -0
  81. package/configuration/types/extended.js.map +1 -0
  82. package/configuration/types/index.d.ts +14 -0
  83. package/configuration/types/index.js +51 -0
  84. package/configuration/types/index.js.map +1 -0
  85. package/configuration/types/minimal.d.ts +6 -0
  86. package/configuration/types/minimal.js +43 -0
  87. package/configuration/types/minimal.js.map +1 -0
  88. package/configuration/types/renderOnlyDefault.d.ts +30 -0
  89. package/configuration/types/renderOnlyDefault.js +31 -0
  90. package/configuration/types/renderOnlyDefault.js.map +1 -0
  91. package/configuration/types/shadowLight.d.ts +9 -0
  92. package/configuration/types/shadowLight.js +64 -0
  93. package/configuration/types/shadowLight.js.map +1 -0
  94. package/helper/index.d.ts +29 -0
  95. package/helper/index.js +66 -0
  96. package/helper/index.js.map +1 -0
  97. package/index.d.ts +30 -0
  98. package/index.js +46 -0
  99. package/index.js.map +1 -0
  100. package/initializer.d.ts +11 -0
  101. package/initializer.js +35 -0
  102. package/initializer.js.map +1 -0
  103. package/interfaces.d.ts +5 -0
  104. package/interfaces.js +7 -0
  105. package/interfaces.js.map +1 -0
  106. package/labs/environmentSerializer.d.ts +126 -0
  107. package/labs/environmentSerializer.js +191 -0
  108. package/labs/environmentSerializer.js.map +1 -0
  109. package/labs/texture.d.ts +183 -0
  110. package/labs/texture.js +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 +199 -0
  117. package/loader/modelLoader.js.map +1 -0
  118. package/loader/plugins/applyMaterialConfig.d.ts +12 -0
  119. package/loader/plugins/applyMaterialConfig.js +16 -0
  120. package/loader/plugins/applyMaterialConfig.js.map +1 -0
  121. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
  122. package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
  123. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
  124. package/loader/plugins/index.d.ts +19 -0
  125. package/loader/plugins/index.js +44 -0
  126. package/loader/plugins/index.js.map +1 -0
  127. package/loader/plugins/loaderPlugin.d.ts +24 -0
  128. package/loader/plugins/loaderPlugin.js +2 -0
  129. package/loader/plugins/loaderPlugin.js.map +1 -0
  130. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
  131. package/loader/plugins/msftLodLoaderPlugin.js +21 -0
  132. package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
  133. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
  134. package/loader/plugins/telemetryLoaderPlugin.js +36 -0
  135. package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
  136. package/managers/observablesManager.d.ts +66 -0
  137. package/managers/observablesManager.js +35 -0
  138. package/managers/observablesManager.js.map +1 -0
  139. package/managers/sceneManager.d.ts +245 -0
  140. package/managers/sceneManager.js +1375 -0
  141. package/managers/sceneManager.js.map +1 -0
  142. package/managers/telemetryManager.d.ts +78 -0
  143. package/managers/telemetryManager.js +117 -0
  144. package/managers/telemetryManager.js.map +1 -0
  145. package/model/modelAnimation.d.ts +215 -0
  146. package/model/modelAnimation.js +237 -0
  147. package/model/modelAnimation.js.map +1 -0
  148. package/model/viewerModel.d.ts +233 -0
  149. package/model/viewerModel.js +673 -0
  150. package/model/viewerModel.js.map +1 -0
  151. package/optimizer/custom/extended.d.ts +13 -0
  152. package/optimizer/custom/extended.js +101 -0
  153. package/optimizer/custom/extended.js.map +1 -0
  154. package/optimizer/custom/index.d.ts +9 -0
  155. package/optimizer/custom/index.js +26 -0
  156. package/optimizer/custom/index.js.map +1 -0
  157. package/package.json +27 -17
  158. package/readme.md +21 -35
  159. package/renderOnlyIndex.d.ts +11 -0
  160. package/renderOnlyIndex.js +18 -0
  161. package/renderOnlyIndex.js.map +1 -0
  162. package/templating/eventManager.d.ts +35 -0
  163. package/templating/eventManager.js +66 -0
  164. package/templating/eventManager.js.map +1 -0
  165. package/templating/plugins/hdButtonPlugin.d.ts +9 -0
  166. package/templating/plugins/hdButtonPlugin.js +21 -0
  167. package/templating/plugins/hdButtonPlugin.js.map +1 -0
  168. package/templating/plugins/printButton.d.ts +9 -0
  169. package/templating/plugins/printButton.js +40 -0
  170. package/templating/plugins/printButton.js.map +1 -0
  171. package/templating/templateManager.d.ts +197 -0
  172. package/templating/templateManager.js +561 -0
  173. package/templating/templateManager.js.map +1 -0
  174. package/templating/viewerTemplatePlugin.d.ts +21 -0
  175. package/templating/viewerTemplatePlugin.js +69 -0
  176. package/templating/viewerTemplatePlugin.js.map +1 -0
  177. package/viewer/defaultViewer.d.ts +130 -0
  178. package/viewer/defaultViewer.js +675 -0
  179. package/viewer/defaultViewer.js.map +1 -0
  180. package/viewer/renderOnlyViewer.d.ts +9 -0
  181. package/viewer/renderOnlyViewer.js +46 -0
  182. package/viewer/renderOnlyViewer.js.map +1 -0
  183. package/viewer/viewer.d.ts +258 -0
  184. package/viewer/viewer.js +783 -0
  185. package/viewer/viewer.js.map +1 -0
  186. package/viewer/viewerManager.d.ts +58 -0
  187. package/viewer/viewerManager.js +91 -0
  188. package/viewer/viewerManager.js.map +1 -0
  189. package/viewer/viewerWithTemplate.d.ts +9 -0
  190. package/viewer/viewerWithTemplate.js +20 -0
  191. package/viewer/viewerWithTemplate.js.map +1 -0
  192. package/dist/babylon-viewer.esm.js +0 -2
  193. package/dist/babylon-viewer.esm.js.map +0 -1
  194. package/dist/babylon-viewer.esm.min.js +0 -2
  195. package/dist/babylon-viewer.esm.min.js.map +0 -1
  196. package/dist/chunks/EXT_lights_image_based-C8Zx_zbb.esm.min.js +0 -2
  197. package/dist/chunks/EXT_lights_image_based-C8Zx_zbb.esm.min.js.map +0 -1
  198. package/dist/chunks/EXT_lights_image_based-kduc1dpt.esm.js +0 -170
  199. package/dist/chunks/EXT_lights_image_based-kduc1dpt.esm.js.map +0 -1
  200. package/dist/chunks/EXT_mesh_gpu_instancing-CUpO919s.esm.min.js +0 -2
  201. package/dist/chunks/EXT_mesh_gpu_instancing-CUpO919s.esm.min.js.map +0 -1
  202. package/dist/chunks/EXT_mesh_gpu_instancing-CYGlESBG.esm.js +0 -86
  203. package/dist/chunks/EXT_mesh_gpu_instancing-CYGlESBG.esm.js.map +0 -1
  204. package/dist/chunks/EXT_meshopt_compression-BtWefmPI.esm.js +0 -134
  205. package/dist/chunks/EXT_meshopt_compression-BtWefmPI.esm.js.map +0 -1
  206. package/dist/chunks/EXT_meshopt_compression-DNd-1RJ_.esm.min.js +0 -2
  207. package/dist/chunks/EXT_meshopt_compression-DNd-1RJ_.esm.min.js.map +0 -1
  208. package/dist/chunks/EXT_texture_avif-BgOmraWM.esm.min.js +0 -2
  209. package/dist/chunks/EXT_texture_avif-BgOmraWM.esm.min.js.map +0 -1
  210. package/dist/chunks/EXT_texture_avif-BkBGixX6.esm.js +0 -44
  211. package/dist/chunks/EXT_texture_avif-BkBGixX6.esm.js.map +0 -1
  212. package/dist/chunks/EXT_texture_webp-DEij2Hfd.esm.min.js +0 -2
  213. package/dist/chunks/EXT_texture_webp-DEij2Hfd.esm.min.js.map +0 -1
  214. package/dist/chunks/EXT_texture_webp-Uw1qOCtv.esm.js +0 -43
  215. package/dist/chunks/EXT_texture_webp-Uw1qOCtv.esm.js.map +0 -1
  216. package/dist/chunks/ExtrasAsMetadata-BqsudUT7.esm.min.js +0 -2
  217. package/dist/chunks/ExtrasAsMetadata-BqsudUT7.esm.min.js.map +0 -1
  218. package/dist/chunks/ExtrasAsMetadata-CM2jTjHQ.esm.js +0 -64
  219. package/dist/chunks/ExtrasAsMetadata-CM2jTjHQ.esm.js.map +0 -1
  220. package/dist/chunks/KHR_animation_pointer-DX9lguJB.esm.js +0 -343
  221. package/dist/chunks/KHR_animation_pointer-DX9lguJB.esm.js.map +0 -1
  222. package/dist/chunks/KHR_animation_pointer-D_r3SXH0.esm.min.js +0 -2
  223. package/dist/chunks/KHR_animation_pointer-D_r3SXH0.esm.min.js.map +0 -1
  224. package/dist/chunks/KHR_draco_mesh_compression-Bxjw8_pv.esm.min.js +0 -2
  225. package/dist/chunks/KHR_draco_mesh_compression-Bxjw8_pv.esm.min.js.map +0 -1
  226. package/dist/chunks/KHR_draco_mesh_compression-CbI7tqZf.esm.js +0 -610
  227. package/dist/chunks/KHR_draco_mesh_compression-CbI7tqZf.esm.js.map +0 -1
  228. package/dist/chunks/KHR_interactivity-B9qhnhvi.esm.js +0 -4033
  229. package/dist/chunks/KHR_interactivity-B9qhnhvi.esm.js.map +0 -1
  230. package/dist/chunks/KHR_interactivity-ClkL8PwU.esm.min.js +0 -2
  231. package/dist/chunks/KHR_interactivity-ClkL8PwU.esm.min.js.map +0 -1
  232. package/dist/chunks/KHR_lights_punctual-C7-LlQCf.esm.js +0 -1253
  233. package/dist/chunks/KHR_lights_punctual-C7-LlQCf.esm.js.map +0 -1
  234. package/dist/chunks/KHR_lights_punctual-hn-7LTf-.esm.min.js +0 -2
  235. package/dist/chunks/KHR_lights_punctual-hn-7LTf-.esm.min.js.map +0 -1
  236. package/dist/chunks/KHR_materials_anisotropy-B4Tuk6uT.esm.js +0 -64
  237. package/dist/chunks/KHR_materials_anisotropy-B4Tuk6uT.esm.js.map +0 -1
  238. package/dist/chunks/KHR_materials_anisotropy-CKZ6ypYV.esm.min.js +0 -2
  239. package/dist/chunks/KHR_materials_anisotropy-CKZ6ypYV.esm.min.js.map +0 -1
  240. package/dist/chunks/KHR_materials_clearcoat-B7g-cV_Q.esm.js +0 -96
  241. package/dist/chunks/KHR_materials_clearcoat-B7g-cV_Q.esm.js.map +0 -1
  242. package/dist/chunks/KHR_materials_clearcoat-BBlfAKyA.esm.min.js +0 -2
  243. package/dist/chunks/KHR_materials_clearcoat-BBlfAKyA.esm.min.js.map +0 -1
  244. package/dist/chunks/KHR_materials_diffuse_transmission-Cxa1EzSD.esm.js +0 -96
  245. package/dist/chunks/KHR_materials_diffuse_transmission-Cxa1EzSD.esm.js.map +0 -1
  246. package/dist/chunks/KHR_materials_diffuse_transmission-D7VVR_6W.esm.min.js +0 -2
  247. package/dist/chunks/KHR_materials_diffuse_transmission-D7VVR_6W.esm.min.js.map +0 -1
  248. package/dist/chunks/KHR_materials_dispersion-BD-i4dhK.esm.js +0 -63
  249. package/dist/chunks/KHR_materials_dispersion-BD-i4dhK.esm.js.map +0 -1
  250. package/dist/chunks/KHR_materials_dispersion-DA1pPYlo.esm.min.js +0 -2
  251. package/dist/chunks/KHR_materials_dispersion-DA1pPYlo.esm.min.js.map +0 -1
  252. package/dist/chunks/KHR_materials_emissive_strength-BUG2Suzu.esm.js +0 -55
  253. package/dist/chunks/KHR_materials_emissive_strength-BUG2Suzu.esm.js.map +0 -1
  254. package/dist/chunks/KHR_materials_emissive_strength-Cy4f53O0.esm.min.js +0 -2
  255. package/dist/chunks/KHR_materials_emissive_strength-Cy4f53O0.esm.min.js.map +0 -1
  256. package/dist/chunks/KHR_materials_ior-CXkf52WI.esm.js +0 -64
  257. package/dist/chunks/KHR_materials_ior-CXkf52WI.esm.js.map +0 -1
  258. package/dist/chunks/KHR_materials_ior-Cb18R0md.esm.min.js +0 -2
  259. package/dist/chunks/KHR_materials_ior-Cb18R0md.esm.min.js.map +0 -1
  260. package/dist/chunks/KHR_materials_iridescence-CRrr8cNQ.esm.js +0 -72
  261. package/dist/chunks/KHR_materials_iridescence-CRrr8cNQ.esm.js.map +0 -1
  262. package/dist/chunks/KHR_materials_iridescence-RKidJoeM.esm.min.js +0 -2
  263. package/dist/chunks/KHR_materials_iridescence-RKidJoeM.esm.min.js.map +0 -1
  264. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-CM3wFF_J.esm.min.js +0 -2
  265. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-CM3wFF_J.esm.min.js.map +0 -1
  266. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-JiRlMqAc.esm.js +0 -81
  267. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-JiRlMqAc.esm.js.map +0 -1
  268. package/dist/chunks/KHR_materials_sheen-CFE2-qvr.esm.min.js +0 -2
  269. package/dist/chunks/KHR_materials_sheen-CFE2-qvr.esm.min.js.map +0 -1
  270. package/dist/chunks/KHR_materials_sheen-yahUgSy0.esm.js +0 -85
  271. package/dist/chunks/KHR_materials_sheen-yahUgSy0.esm.js.map +0 -1
  272. package/dist/chunks/KHR_materials_specular-D5MMqFRA.esm.min.js +0 -2
  273. package/dist/chunks/KHR_materials_specular-D5MMqFRA.esm.min.js.map +0 -1
  274. package/dist/chunks/KHR_materials_specular-uE0VOMMR.esm.js +0 -75
  275. package/dist/chunks/KHR_materials_specular-uE0VOMMR.esm.js.map +0 -1
  276. package/dist/chunks/KHR_materials_transmission-BqfkbFTi.esm.js +0 -307
  277. package/dist/chunks/KHR_materials_transmission-BqfkbFTi.esm.js.map +0 -1
  278. package/dist/chunks/KHR_materials_transmission-Cy5bbuBe.esm.min.js +0 -2
  279. package/dist/chunks/KHR_materials_transmission-Cy5bbuBe.esm.min.js.map +0 -1
  280. package/dist/chunks/KHR_materials_unlit-CeAe8MXr.esm.js +0 -74
  281. package/dist/chunks/KHR_materials_unlit-CeAe8MXr.esm.js.map +0 -1
  282. package/dist/chunks/KHR_materials_unlit-D_vQV9wJ.esm.min.js +0 -2
  283. package/dist/chunks/KHR_materials_unlit-D_vQV9wJ.esm.min.js.map +0 -1
  284. package/dist/chunks/KHR_materials_variants-DI_pay4_.esm.js +0 -238
  285. package/dist/chunks/KHR_materials_variants-DI_pay4_.esm.js.map +0 -1
  286. package/dist/chunks/KHR_materials_variants-jFCWO0BP.esm.min.js +0 -2
  287. package/dist/chunks/KHR_materials_variants-jFCWO0BP.esm.min.js.map +0 -1
  288. package/dist/chunks/KHR_materials_volume-CeG8b15V.esm.js +0 -88
  289. package/dist/chunks/KHR_materials_volume-CeG8b15V.esm.js.map +0 -1
  290. package/dist/chunks/KHR_materials_volume-DE_Ylfcc.esm.min.js +0 -2
  291. package/dist/chunks/KHR_materials_volume-DE_Ylfcc.esm.min.js.map +0 -1
  292. package/dist/chunks/KHR_mesh_quantization-CzyL_Cnv.esm.js +0 -26
  293. package/dist/chunks/KHR_mesh_quantization-CzyL_Cnv.esm.js.map +0 -1
  294. package/dist/chunks/KHR_mesh_quantization-DJe_n3uT.esm.min.js +0 -2
  295. package/dist/chunks/KHR_mesh_quantization-DJe_n3uT.esm.min.js.map +0 -1
  296. package/dist/chunks/KHR_texture_basisu-BM_kwHpr.esm.min.js +0 -2
  297. package/dist/chunks/KHR_texture_basisu-BM_kwHpr.esm.min.js.map +0 -1
  298. package/dist/chunks/KHR_texture_basisu-CW33-gFJ.esm.js +0 -43
  299. package/dist/chunks/KHR_texture_basisu-CW33-gFJ.esm.js.map +0 -1
  300. package/dist/chunks/KHR_texture_transform-BvOVd3aP.esm.js +0 -63
  301. package/dist/chunks/KHR_texture_transform-BvOVd3aP.esm.js.map +0 -1
  302. package/dist/chunks/KHR_texture_transform-DP5URy2N.esm.min.js +0 -2
  303. package/dist/chunks/KHR_texture_transform-DP5URy2N.esm.min.js.map +0 -1
  304. package/dist/chunks/KHR_xmp_json_ld-BUxeQ4mX.esm.js +0 -51
  305. package/dist/chunks/KHR_xmp_json_ld-BUxeQ4mX.esm.js.map +0 -1
  306. package/dist/chunks/KHR_xmp_json_ld-CakdJpK8.esm.min.js +0 -2
  307. package/dist/chunks/KHR_xmp_json_ld-CakdJpK8.esm.min.js.map +0 -1
  308. package/dist/chunks/MSFT_audio_emitter-CANraFUR.esm.js +0 -1601
  309. package/dist/chunks/MSFT_audio_emitter-CANraFUR.esm.js.map +0 -1
  310. package/dist/chunks/MSFT_audio_emitter-CCZ2emXW.esm.min.js +0 -2
  311. package/dist/chunks/MSFT_audio_emitter-CCZ2emXW.esm.min.js.map +0 -1
  312. package/dist/chunks/MSFT_lod-B6edIFfM.esm.js +0 -337
  313. package/dist/chunks/MSFT_lod-B6edIFfM.esm.js.map +0 -1
  314. package/dist/chunks/MSFT_lod-CTqZxsr6.esm.min.js +0 -2
  315. package/dist/chunks/MSFT_lod-CTqZxsr6.esm.min.js.map +0 -1
  316. package/dist/chunks/MSFT_minecraftMesh-BQ2-yi3j.esm.min.js +0 -2
  317. package/dist/chunks/MSFT_minecraftMesh-BQ2-yi3j.esm.min.js.map +0 -1
  318. package/dist/chunks/MSFT_minecraftMesh-utO1z3Rb.esm.js +0 -46
  319. package/dist/chunks/MSFT_minecraftMesh-utO1z3Rb.esm.js.map +0 -1
  320. package/dist/chunks/MSFT_sRGBFactors-DcH5vUrm.esm.min.js +0 -2
  321. package/dist/chunks/MSFT_sRGBFactors-DcH5vUrm.esm.min.js.map +0 -1
  322. package/dist/chunks/MSFT_sRGBFactors-Dxlg_cnl.esm.js +0 -47
  323. package/dist/chunks/MSFT_sRGBFactors-Dxlg_cnl.esm.js.map +0 -1
  324. package/dist/chunks/assetContainer-D7kzzGaF.esm.js +0 -1598
  325. package/dist/chunks/assetContainer-D7kzzGaF.esm.js.map +0 -1
  326. package/dist/chunks/assetContainer-DerZknN4.esm.min.js +0 -2
  327. package/dist/chunks/assetContainer-DerZknN4.esm.min.js.map +0 -1
  328. package/dist/chunks/basisTextureLoader-DFUefcfx.esm.js +0 -600
  329. package/dist/chunks/basisTextureLoader-DFUefcfx.esm.js.map +0 -1
  330. package/dist/chunks/basisTextureLoader-DHZAViG3.esm.min.js +0 -2
  331. package/dist/chunks/basisTextureLoader-DHZAViG3.esm.min.js.map +0 -1
  332. package/dist/chunks/ddsTextureLoader-Besuv3in.esm.min.js +0 -2
  333. package/dist/chunks/ddsTextureLoader-Besuv3in.esm.min.js.map +0 -1
  334. package/dist/chunks/ddsTextureLoader-DAJtmdH2.esm.js +0 -87
  335. package/dist/chunks/ddsTextureLoader-DAJtmdH2.esm.js.map +0 -1
  336. package/dist/chunks/default.fragment-Byp0EQWo.esm.js +0 -452
  337. package/dist/chunks/default.fragment-Byp0EQWo.esm.js.map +0 -1
  338. package/dist/chunks/default.fragment-CPrwFLxj.esm.min.js +0 -2
  339. package/dist/chunks/default.fragment-CPrwFLxj.esm.min.js.map +0 -1
  340. package/dist/chunks/default.fragment-CuTK0g2w.esm.min.js +0 -2
  341. package/dist/chunks/default.fragment-CuTK0g2w.esm.min.js.map +0 -1
  342. package/dist/chunks/default.fragment-D4K678XE.esm.js +0 -515
  343. package/dist/chunks/default.fragment-D4K678XE.esm.js.map +0 -1
  344. package/dist/chunks/default.vertex-CBf60jXb.esm.js +0 -178
  345. package/dist/chunks/default.vertex-CBf60jXb.esm.js.map +0 -1
  346. package/dist/chunks/default.vertex-CPLi2rTa.esm.min.js +0 -2
  347. package/dist/chunks/default.vertex-CPLi2rTa.esm.min.js.map +0 -1
  348. package/dist/chunks/default.vertex-DneLJIzI.esm.js +0 -199
  349. package/dist/chunks/default.vertex-DneLJIzI.esm.js.map +0 -1
  350. package/dist/chunks/default.vertex-tjZYwgIm.esm.min.js +0 -2
  351. package/dist/chunks/default.vertex-tjZYwgIm.esm.min.js.map +0 -1
  352. package/dist/chunks/defaultUboDeclaration-5Ze2L4TA.esm.js +0 -15
  353. package/dist/chunks/defaultUboDeclaration-5Ze2L4TA.esm.js.map +0 -1
  354. package/dist/chunks/defaultUboDeclaration-BbZB9zOH.esm.min.js +0 -2
  355. package/dist/chunks/defaultUboDeclaration-BbZB9zOH.esm.min.js.map +0 -1
  356. package/dist/chunks/defaultUboDeclaration-C1D54TCU.esm.min.js +0 -2
  357. package/dist/chunks/defaultUboDeclaration-C1D54TCU.esm.min.js.map +0 -1
  358. package/dist/chunks/defaultUboDeclaration-xq351fzv.esm.js +0 -13
  359. package/dist/chunks/defaultUboDeclaration-xq351fzv.esm.js.map +0 -1
  360. package/dist/chunks/envTextureLoader-Cd87_F9v.esm.js +0 -63
  361. package/dist/chunks/envTextureLoader-Cd87_F9v.esm.js.map +0 -1
  362. package/dist/chunks/envTextureLoader-DDrwMoNn.esm.min.js +0 -2
  363. package/dist/chunks/envTextureLoader-DDrwMoNn.esm.min.js.map +0 -1
  364. package/dist/chunks/environmentTextureTools-Bewx0Dvk.esm.js +0 -381
  365. package/dist/chunks/environmentTextureTools-Bewx0Dvk.esm.js.map +0 -1
  366. package/dist/chunks/environmentTextureTools-CKR4vXo_.esm.min.js +0 -2
  367. package/dist/chunks/environmentTextureTools-CKR4vXo_.esm.min.js.map +0 -1
  368. package/dist/chunks/exrTextureLoader-B5OMTxNT.esm.min.js +0 -2
  369. package/dist/chunks/exrTextureLoader-B5OMTxNT.esm.min.js.map +0 -1
  370. package/dist/chunks/exrTextureLoader-DYief1aQ.esm.js +0 -1682
  371. package/dist/chunks/exrTextureLoader-DYief1aQ.esm.js.map +0 -1
  372. package/dist/chunks/fogFragment-DDtXY8BJ.esm.min.js +0 -2
  373. package/dist/chunks/fogFragment-DDtXY8BJ.esm.min.js.map +0 -1
  374. package/dist/chunks/fogFragment-uA_uzICI.esm.js +0 -102
  375. package/dist/chunks/fogFragment-uA_uzICI.esm.js.map +0 -1
  376. package/dist/chunks/glTFLoader-BYQ5K9Kt.esm.min.js +0 -2
  377. package/dist/chunks/glTFLoader-BYQ5K9Kt.esm.min.js.map +0 -1
  378. package/dist/chunks/glTFLoader-r35szQk2.esm.js +0 -7552
  379. package/dist/chunks/glTFLoader-r35szQk2.esm.js.map +0 -1
  380. package/dist/chunks/glTFLoaderAnimation-CBE8cJ5o.esm.min.js +0 -2
  381. package/dist/chunks/glTFLoaderAnimation-CBE8cJ5o.esm.min.js.map +0 -1
  382. package/dist/chunks/glTFLoaderAnimation-CT3NxYwM.esm.js +0 -77
  383. package/dist/chunks/glTFLoaderAnimation-CT3NxYwM.esm.js.map +0 -1
  384. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
  385. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
  386. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
  387. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
  388. package/dist/chunks/harmonicsFunctions-BFzEbNOc.esm.min.js +0 -2
  389. package/dist/chunks/harmonicsFunctions-BFzEbNOc.esm.min.js.map +0 -1
  390. package/dist/chunks/harmonicsFunctions-BmNqYWse.esm.js +0 -35
  391. package/dist/chunks/harmonicsFunctions-BmNqYWse.esm.js.map +0 -1
  392. package/dist/chunks/harmonicsFunctions-DCYVvJfE.esm.js +0 -34
  393. package/dist/chunks/harmonicsFunctions-DCYVvJfE.esm.js.map +0 -1
  394. package/dist/chunks/harmonicsFunctions-LdNe78Vv.esm.min.js +0 -2
  395. package/dist/chunks/harmonicsFunctions-LdNe78Vv.esm.min.js.map +0 -1
  396. package/dist/chunks/hdrTextureLoader-B4HJ1PIb.esm.js +0 -252
  397. package/dist/chunks/hdrTextureLoader-B4HJ1PIb.esm.js.map +0 -1
  398. package/dist/chunks/hdrTextureLoader-D2de5rCS.esm.min.js +0 -2
  399. package/dist/chunks/hdrTextureLoader-D2de5rCS.esm.min.js.map +0 -1
  400. package/dist/chunks/helperFunctions-B-V3wz1K.esm.js +0 -80
  401. package/dist/chunks/helperFunctions-B-V3wz1K.esm.js.map +0 -1
  402. package/dist/chunks/helperFunctions-B6u0LIQ1.esm.js +0 -108
  403. package/dist/chunks/helperFunctions-B6u0LIQ1.esm.js.map +0 -1
  404. package/dist/chunks/helperFunctions-D3_vTLCV.esm.min.js +0 -2
  405. package/dist/chunks/helperFunctions-D3_vTLCV.esm.min.js.map +0 -1
  406. package/dist/chunks/helperFunctions-DbaT8xhT.esm.min.js +0 -2
  407. package/dist/chunks/helperFunctions-DbaT8xhT.esm.min.js.map +0 -1
  408. package/dist/chunks/index-Bk29Qt-Y.esm.js +0 -81630
  409. package/dist/chunks/index-Bk29Qt-Y.esm.js.map +0 -1
  410. package/dist/chunks/index-BlF30_Ca.esm.min.js +0 -57
  411. package/dist/chunks/index-BlF30_Ca.esm.min.js.map +0 -1
  412. package/dist/chunks/ktxTextureLoader-BTMWrtOa.esm.js +0 -814
  413. package/dist/chunks/ktxTextureLoader-BTMWrtOa.esm.js.map +0 -1
  414. package/dist/chunks/ktxTextureLoader-OqiCvqqP.esm.min.js +0 -2
  415. package/dist/chunks/ktxTextureLoader-OqiCvqqP.esm.min.js.map +0 -1
  416. package/dist/chunks/logDepthDeclaration-BPKYewiS.esm.min.js +0 -2
  417. package/dist/chunks/logDepthDeclaration-BPKYewiS.esm.min.js.map +0 -1
  418. package/dist/chunks/logDepthDeclaration-CB6mwEV4.esm.min.js +0 -2
  419. package/dist/chunks/logDepthDeclaration-CB6mwEV4.esm.min.js.map +0 -1
  420. package/dist/chunks/logDepthDeclaration-CFTIeo9d.esm.js +0 -42
  421. package/dist/chunks/logDepthDeclaration-CFTIeo9d.esm.js.map +0 -1
  422. package/dist/chunks/logDepthDeclaration-DuXLlupN.esm.js +0 -35
  423. package/dist/chunks/logDepthDeclaration-DuXLlupN.esm.js.map +0 -1
  424. package/dist/chunks/logDepthVertex-B7lJf18n.esm.js +0 -605
  425. package/dist/chunks/logDepthVertex-B7lJf18n.esm.js.map +0 -1
  426. package/dist/chunks/logDepthVertex-BlpmPbMu.esm.min.js +0 -2
  427. package/dist/chunks/logDepthVertex-BlpmPbMu.esm.min.js.map +0 -1
  428. package/dist/chunks/logDepthVertex-CS2VncA3.esm.min.js +0 -2
  429. package/dist/chunks/logDepthVertex-CS2VncA3.esm.min.js.map +0 -1
  430. package/dist/chunks/logDepthVertex-DPI-wcrh.esm.js +0 -77
  431. package/dist/chunks/logDepthVertex-DPI-wcrh.esm.js.map +0 -1
  432. package/dist/chunks/mainUVVaryingDeclaration-B7jpQ5Mq.esm.min.js +0 -2
  433. package/dist/chunks/mainUVVaryingDeclaration-B7jpQ5Mq.esm.min.js.map +0 -1
  434. package/dist/chunks/mainUVVaryingDeclaration-Cy__-6Nq.esm.js +0 -11
  435. package/dist/chunks/mainUVVaryingDeclaration-Cy__-6Nq.esm.js.map +0 -1
  436. package/dist/chunks/objFileLoader-BQAlTWHc.esm.min.js +0 -2
  437. package/dist/chunks/objFileLoader-BQAlTWHc.esm.min.js.map +0 -1
  438. package/dist/chunks/objFileLoader-Bi8LHs3e.esm.js +0 -1280
  439. package/dist/chunks/objFileLoader-Bi8LHs3e.esm.js.map +0 -1
  440. package/dist/chunks/oitFragment-Bu6IB_U1.esm.min.js +0 -2
  441. package/dist/chunks/oitFragment-Bu6IB_U1.esm.min.js.map +0 -1
  442. package/dist/chunks/oitFragment-DWPsjeYm.esm.js +0 -1210
  443. package/dist/chunks/oitFragment-DWPsjeYm.esm.js.map +0 -1
  444. package/dist/chunks/oitFragment-DwS3p7os.esm.js +0 -1166
  445. package/dist/chunks/oitFragment-DwS3p7os.esm.js.map +0 -1
  446. package/dist/chunks/oitFragment-Dyo3GCIB.esm.min.js +0 -2
  447. package/dist/chunks/oitFragment-Dyo3GCIB.esm.min.js.map +0 -1
  448. package/dist/chunks/pass.fragment-BbvJLdK0.esm.min.js +0 -2
  449. package/dist/chunks/pass.fragment-BbvJLdK0.esm.min.js.map +0 -1
  450. package/dist/chunks/pass.fragment-CYW_mCe1.esm.js +0 -15
  451. package/dist/chunks/pass.fragment-CYW_mCe1.esm.js.map +0 -1
  452. package/dist/chunks/pbr.fragment-BF_ms0u4.esm.js +0 -3228
  453. package/dist/chunks/pbr.fragment-BF_ms0u4.esm.js.map +0 -1
  454. package/dist/chunks/pbr.fragment-BgRyNZP4.esm.min.js +0 -2
  455. package/dist/chunks/pbr.fragment-BgRyNZP4.esm.min.js.map +0 -1
  456. package/dist/chunks/pbr.fragment-DWDVg0cI.esm.js +0 -3163
  457. package/dist/chunks/pbr.fragment-DWDVg0cI.esm.js.map +0 -1
  458. package/dist/chunks/pbr.fragment-DnANKT1v.esm.min.js +0 -2
  459. package/dist/chunks/pbr.fragment-DnANKT1v.esm.min.js.map +0 -1
  460. package/dist/chunks/pbr.vertex-CtV1eMwZ.esm.js +0 -335
  461. package/dist/chunks/pbr.vertex-CtV1eMwZ.esm.js.map +0 -1
  462. package/dist/chunks/pbr.vertex-Dfv-0mcy.esm.js +0 -208
  463. package/dist/chunks/pbr.vertex-Dfv-0mcy.esm.js.map +0 -1
  464. package/dist/chunks/pbr.vertex-Dqkpv-Eq.esm.min.js +0 -2
  465. package/dist/chunks/pbr.vertex-Dqkpv-Eq.esm.min.js.map +0 -1
  466. package/dist/chunks/pbr.vertex-nSqzmuMh.esm.min.js +0 -2
  467. package/dist/chunks/pbr.vertex-nSqzmuMh.esm.min.js.map +0 -1
  468. package/dist/chunks/postprocess.vertex-CI-eDzvi.esm.js +0 -20
  469. package/dist/chunks/postprocess.vertex-CI-eDzvi.esm.js.map +0 -1
  470. package/dist/chunks/postprocess.vertex-Cs2SUWD0.esm.min.js +0 -2
  471. package/dist/chunks/postprocess.vertex-Cs2SUWD0.esm.min.js.map +0 -1
  472. package/dist/chunks/rawTexture-3oLvc_tp.esm.js +0 -562
  473. package/dist/chunks/rawTexture-3oLvc_tp.esm.js.map +0 -1
  474. package/dist/chunks/rawTexture-BWp9aJpK.esm.min.js +0 -2
  475. package/dist/chunks/rawTexture-BWp9aJpK.esm.min.js.map +0 -1
  476. package/dist/chunks/rgbdDecode.fragment-CYs1lXUB.esm.js +0 -17
  477. package/dist/chunks/rgbdDecode.fragment-CYs1lXUB.esm.js.map +0 -1
  478. package/dist/chunks/rgbdDecode.fragment-DiziHd4D.esm.min.js +0 -2
  479. package/dist/chunks/rgbdDecode.fragment-DiziHd4D.esm.min.js.map +0 -1
  480. package/dist/chunks/rgbdDecode.fragment-N_qzvKhN.esm.min.js +0 -2
  481. package/dist/chunks/rgbdDecode.fragment-N_qzvKhN.esm.min.js.map +0 -1
  482. package/dist/chunks/rgbdDecode.fragment-YPi0juk-.esm.js +0 -17
  483. package/dist/chunks/rgbdDecode.fragment-YPi0juk-.esm.js.map +0 -1
  484. package/dist/chunks/rgbdEncode.fragment-BPNHn1tT.esm.min.js +0 -2
  485. package/dist/chunks/rgbdEncode.fragment-BPNHn1tT.esm.min.js.map +0 -1
  486. package/dist/chunks/rgbdEncode.fragment-BcJhRtQ5.esm.min.js +0 -2
  487. package/dist/chunks/rgbdEncode.fragment-BcJhRtQ5.esm.min.js.map +0 -1
  488. package/dist/chunks/rgbdEncode.fragment-DtkOxT2Y.esm.js +0 -17
  489. package/dist/chunks/rgbdEncode.fragment-DtkOxT2Y.esm.js.map +0 -1
  490. package/dist/chunks/rgbdEncode.fragment-duKOXekg.esm.js +0 -17
  491. package/dist/chunks/rgbdEncode.fragment-duKOXekg.esm.js.map +0 -1
  492. package/dist/chunks/splatFileLoader-CftLaqSo.esm.js +0 -3137
  493. package/dist/chunks/splatFileLoader-CftLaqSo.esm.js.map +0 -1
  494. package/dist/chunks/splatFileLoader-DQY-vSa3.esm.min.js +0 -2
  495. package/dist/chunks/splatFileLoader-DQY-vSa3.esm.min.js.map +0 -1
  496. package/dist/chunks/standardMaterial-1c1C_ZIw.esm.js +0 -1809
  497. package/dist/chunks/standardMaterial-1c1C_ZIw.esm.js.map +0 -1
  498. package/dist/chunks/standardMaterial-CTSzlcu8.esm.min.js +0 -2
  499. package/dist/chunks/standardMaterial-CTSzlcu8.esm.min.js.map +0 -1
  500. package/dist/chunks/stlFileLoader-BGLYbFk2.esm.js +0 -237
  501. package/dist/chunks/stlFileLoader-BGLYbFk2.esm.js.map +0 -1
  502. package/dist/chunks/stlFileLoader-D451o5V4.esm.min.js +0 -2
  503. package/dist/chunks/stlFileLoader-D451o5V4.esm.min.js.map +0 -1
  504. package/dist/chunks/tgaTextureLoader-BLOklZDW.esm.min.js +0 -2
  505. package/dist/chunks/tgaTextureLoader-BLOklZDW.esm.min.js.map +0 -1
  506. package/dist/chunks/tgaTextureLoader-CCYZarL9.esm.js +0 -349
  507. package/dist/chunks/tgaTextureLoader-CCYZarL9.esm.js.map +0 -1
  508. package/dist/chunks/thinInstanceMesh-BuanMsAC.esm.min.js +0 -2
  509. package/dist/chunks/thinInstanceMesh-BuanMsAC.esm.min.js.map +0 -1
  510. package/dist/chunks/thinInstanceMesh-HVLKYr74.esm.js +0 -314
  511. package/dist/chunks/thinInstanceMesh-HVLKYr74.esm.js.map +0 -1
  512. package/dist/chunks/vertexColorMixing-Bhqvyjgc.esm.js +0 -528
  513. package/dist/chunks/vertexColorMixing-Bhqvyjgc.esm.js.map +0 -1
  514. package/dist/chunks/vertexColorMixing-Dgml7nXE.esm.min.js +0 -2
  515. package/dist/chunks/vertexColorMixing-Dgml7nXE.esm.min.js.map +0 -1
  516. package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
  517. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
  518. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
  519. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
  520. package/lib/index.d.ts +0 -237
  521. package/lib/index.js +0 -871
  522. package/lib/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"stlFileLoader-D451o5V4.esm.min.js","sources":["../../../../../dev/loaders/dist/STL/stlFileLoader.js"],"sourcesContent":["import { Tools } from \"core/Misc/tools\";\nimport { VertexBuffer } from \"core/Buffers/buffer\";\nimport { Mesh } from \"core/Meshes/mesh\";\nimport { registerSceneLoaderPlugin } from \"core/Loading/sceneLoader\";\nimport { AssetContainer } from \"core/assetContainer\";\nimport { STLFileLoaderMetadata } from \"./stlFileLoader.metadata\";\n/**\n * STL file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class STLFileLoader {\n constructor() {\n /** @internal */\n this.solidPattern = /solid (\\S*)([\\S\\s]*?)endsolid[ ]*(\\S*)/g;\n /** @internal */\n this.facetsPattern = /facet([\\s\\S]*?)endfacet/g;\n /** @internal */\n this.normalPattern = /normal[\\s]+([-+]?[0-9]+\\.?[0-9]*([eE][-+]?[0-9]+)?)+[\\s]+([-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)+[\\s]+([-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)+/g;\n /** @internal */\n this.vertexPattern = /vertex[\\s]+([-+]?[0-9]+\\.?[0-9]*([eE][-+]?[0-9]+)?)+[\\s]+([-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)+[\\s]+([-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)+/g;\n /**\n * Defines the name of the plugin.\n */\n this.name = STLFileLoaderMetadata.name;\n /**\n * Defines the extensions the stl loader is able to load.\n * force data to come in as an ArrayBuffer\n * we'll convert to string if it looks like it's an ASCII .stl\n */\n this.extensions = STLFileLoaderMetadata.extensions;\n }\n /**\n * Import meshes into a scene.\n * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\n * @param scene The scene to import into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @param meshes The meshes array to import into\n * @returns True if successful or false otherwise\n */\n importMesh(meshesNames, scene, data, rootUrl, meshes) {\n let matches;\n if (typeof data !== \"string\") {\n if (this._isBinary(data)) {\n // binary .stl\n const babylonMesh = new Mesh(\"stlmesh\", scene);\n this._parseBinary(babylonMesh, data);\n if (meshes) {\n meshes.push(babylonMesh);\n }\n return true;\n }\n // ASCII .stl\n // convert to string\n data = new TextDecoder().decode(new Uint8Array(data));\n }\n //if arrived here, data is a string, containing the STLA data.\n while ((matches = this.solidPattern.exec(data))) {\n let meshName = matches[1];\n const meshNameFromEnd = matches[3];\n if (meshNameFromEnd && meshName != meshNameFromEnd) {\n Tools.Error(\"Error in STL, solid name != endsolid name\");\n return false;\n }\n // check meshesNames\n if (meshesNames && meshName) {\n if (meshesNames instanceof Array) {\n if (!meshesNames.indexOf(meshName)) {\n continue;\n }\n }\n else {\n if (meshName !== meshesNames) {\n continue;\n }\n }\n }\n // stl mesh name can be empty as well\n meshName = meshName || \"stlmesh\";\n const babylonMesh = new Mesh(meshName, scene);\n this._parseASCII(babylonMesh, matches[2]);\n if (meshes) {\n meshes.push(babylonMesh);\n }\n }\n return true;\n }\n /**\n * Load into a scene.\n * @param scene The scene to load into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @returns true if successful or false otherwise\n */\n load(scene, data, rootUrl) {\n const result = this.importMesh(null, scene, data, rootUrl, null);\n return result;\n }\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @param rootUrl The root url for scene and resources\n * @returns The loaded asset container\n */\n loadAssetContainer(scene, data, rootUrl) {\n const container = new AssetContainer(scene);\n scene._blockEntityCollection = true;\n this.importMesh(null, scene, data, rootUrl, container.meshes);\n scene._blockEntityCollection = false;\n return container;\n }\n _isBinary(data) {\n // check if file size is correct for binary stl\n const reader = new DataView(data);\n // A Binary STL header is 80 bytes, if the data size is not great than\n // that then it's not a binary STL.\n if (reader.byteLength <= 80) {\n return false;\n }\n const faceSize = (32 / 8) * 3 + (32 / 8) * 3 * 3 + 16 / 8;\n const nFaces = reader.getUint32(80, true);\n if (80 + 32 / 8 + nFaces * faceSize === reader.byteLength) {\n return true;\n }\n // US-ASCII begin with 's', 'o', 'l', 'i', 'd'\n const ascii = [115, 111, 108, 105, 100];\n for (let off = 0; off < 5; off++) {\n if (reader.getUint8(off) !== ascii[off]) {\n return true;\n }\n }\n return false;\n }\n _parseBinary(mesh, data) {\n const reader = new DataView(data);\n const faces = reader.getUint32(80, true);\n const dataOffset = 84;\n const faceLength = 12 * 4 + 2;\n let offset = 0;\n const positions = new Float32Array(faces * 3 * 3);\n const normals = new Float32Array(faces * 3 * 3);\n const indices = new Uint32Array(faces * 3);\n let indicesCount = 0;\n for (let face = 0; face < faces; face++) {\n const start = dataOffset + face * faceLength;\n const normalX = reader.getFloat32(start, true);\n const normalY = reader.getFloat32(start + 4, true);\n const normalZ = reader.getFloat32(start + 8, true);\n for (let i = 1; i <= 3; i++) {\n const vertexstart = start + i * 12;\n // ordering is intentional to match ascii import\n positions[offset] = reader.getFloat32(vertexstart, true);\n normals[offset] = normalX;\n if (!STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES) {\n positions[offset + 2] = reader.getFloat32(vertexstart + 4, true);\n positions[offset + 1] = reader.getFloat32(vertexstart + 8, true);\n normals[offset + 2] = normalY;\n normals[offset + 1] = normalZ;\n }\n else {\n positions[offset + 1] = reader.getFloat32(vertexstart + 4, true);\n positions[offset + 2] = reader.getFloat32(vertexstart + 8, true);\n normals[offset + 1] = normalY;\n normals[offset + 2] = normalZ;\n }\n offset += 3;\n }\n if (STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES) {\n indices[indicesCount] = indicesCount;\n indices[indicesCount + 1] = indicesCount + 2;\n indices[indicesCount + 2] = indicesCount + 1;\n indicesCount += 3;\n }\n else {\n indices[indicesCount] = indicesCount++;\n indices[indicesCount] = indicesCount++;\n indices[indicesCount] = indicesCount++;\n }\n }\n mesh.setVerticesData(VertexBuffer.PositionKind, positions);\n mesh.setVerticesData(VertexBuffer.NormalKind, normals);\n mesh.setIndices(indices);\n mesh.computeWorldMatrix(true);\n }\n _parseASCII(mesh, solidData) {\n const positions = [];\n const normals = [];\n const indices = [];\n let indicesCount = 0;\n //load facets, ignoring loop as the standard doesn't define it can contain more than vertices\n let matches;\n while ((matches = this.facetsPattern.exec(solidData))) {\n const facet = matches[1];\n //one normal per face\n const normalMatches = this.normalPattern.exec(facet);\n this.normalPattern.lastIndex = 0;\n if (!normalMatches) {\n continue;\n }\n const normal = [Number(normalMatches[1]), Number(normalMatches[5]), Number(normalMatches[3])];\n let vertexMatch;\n while ((vertexMatch = this.vertexPattern.exec(facet))) {\n if (!STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES) {\n positions.push(Number(vertexMatch[1]), Number(vertexMatch[5]), Number(vertexMatch[3]));\n normals.push(normal[0], normal[1], normal[2]);\n }\n else {\n positions.push(Number(vertexMatch[1]), Number(vertexMatch[3]), Number(vertexMatch[5]));\n // Flipping the second and third component because inverted\n // when normal was declared.\n normals.push(normal[0], normal[2], normal[1]);\n }\n }\n if (STLFileLoader.DO_NOT_ALTER_FILE_COORDINATES) {\n indices.push(indicesCount, indicesCount + 2, indicesCount + 1);\n indicesCount += 3;\n }\n else {\n indices.push(indicesCount++, indicesCount++, indicesCount++);\n }\n this.vertexPattern.lastIndex = 0;\n }\n this.facetsPattern.lastIndex = 0;\n mesh.setVerticesData(VertexBuffer.PositionKind, positions);\n mesh.setVerticesData(VertexBuffer.NormalKind, normals);\n mesh.setIndices(indices);\n mesh.computeWorldMatrix(true);\n }\n}\n/**\n * Defines if Y and Z axes are swapped or not when loading an STL file.\n * The default is false to maintain backward compatibility. When set to\n * true, coordinates from the STL file are used without change.\n */\nSTLFileLoader.DO_NOT_ALTER_FILE_COORDINATES = false;\nregisterSceneLoaderPlugin(new STLFileLoader());\n//# sourceMappingURL=stlFileLoader.js.map"],"names":["STLFileLoader","constructor","this","solidPattern","facetsPattern","normalPattern","vertexPattern","name","STLFileLoaderMetadata","extensions","importMesh","meshesNames","scene","data","rootUrl","meshes","matches","_isBinary","babylonMesh","Mesh","_parseBinary","push","TextDecoder","decode","Uint8Array","exec","meshName","meshNameFromEnd","Tools","Error","Array","indexOf","_parseASCII","load","loadAssetContainer","container","AssetContainer","_blockEntityCollection","reader","DataView","byteLength","getUint32","ascii","off","getUint8","mesh","faces","offset","positions","Float32Array","normals","indices","Uint32Array","indicesCount","face","start","normalX","getFloat32","normalY","normalZ","i","vertexstart","DO_NOT_ALTER_FILE_COORDINATES","setVerticesData","VertexBuffer","PositionKind","NormalKind","setIndices","computeWorldMatrix","solidData","facet","normalMatches","lastIndex","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A,GAAgB,GAGhBF,EAAQ9B,KAAKgC,IAAgBA,IAAgBA,KAEjDnD,KAAKI,cAAckE,UAAY,CAClC,CACDtE,KAAKE,cAAcoE,UAAY,EAC/B3B,EAAKkB,gBAAgBC,EAAaC,aAAcjB,GAChDH,EAAKkB,gBAAgBC,EAAaE,WAAYhB,GAC9CL,EAAKsB,WAAWhB,GAChBN,EAAKuB,oBAAmB,EAC3B,EAOLpE,EAAc8D,+BAAgC,EAC9Cc,EAA0B,IAAI5E"}
@@ -1,2 +0,0 @@
1
- import{L as t}from"./index-BlF30_Ca.esm.min.js";function e(t){let e=0;return{id_length:t[e++],colormap_type:t[e++],image_type:t[e++],colormap_index:t[e++]|t[e++]<<8,colormap_length:t[e++]|t[e++]<<8,colormap_size:t[e++],origin:[t[e++]|t[e++]<<8,t[e++]|t[e++]<<8],width:t[e++]|t[e++]<<8,height:t[e++]|t[e++]<<8,pixel_size:t[e++],flags:t[e++]}}function r(r,a){if(a.length<19)return void t.Error("Unable to load TGA file - Not enough data to contain header");let i=18;const o=e(a);if(o.id_length+i>a.length)return void t.Error("Unable to load TGA file - Not enough data");i+=o.id_length;let s,h=!1,c=!1,g=!1;switch(o.image_type){case 9:h=!0;case 1:c=!0;break;case 10:h=!0;case 2:break;case 11:h=!0;case 3:g=!0}const l=o.pixel_size>>3,f=o.width*o.height*l;let d,u,w,p,_,b,y;if(c&&(d=a.subarray(i,i+=o.colormap_length*(o.colormap_size>>3))),h){let t,e,r;s=new Uint8Array(f);let n=0;const o=new Uint8Array(l);for(;i<f&&n<f;)if(t=a[i++],e=1+(127&t),128&t){for(r=0;r<l;++r)o[r]=a[i++];for(r=0;r<e;++r)s.set(o,n+r*l);n+=l*e}else{for(e*=l,r=0;r<e;++r)s[n+r]=a[i++];n+=e}}else s=a.subarray(i,i+=c?o.width*o.height:f);switch((48&o.flags)>>4){default:case 2:u=0,p=1,y=o.width,w=0,_=1,b=o.height;break;case 0:u=0,p=1,y=o.width,w=o.height-1,_=-1,b=-1;break;case 3:u=o.width-1,p=-1,y=-1,w=0,_=1,b=o.height;break;case 1:u=o.width-1,p=-1,y=-1,w=o.height-1,_=-1,b=-1}const m="_getImageData"+(g?"Grey":"")+o.pixel_size+"bits",A=n[m](o,d,s,w,_,b,u,p,y);r.getEngine()._uploadDataToTextureDirectly(r,A)}const n={GetTGAHeader:e,UploadContent:r,_getImageData8bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=e,l=t.width,f=t.height;let d,u,w,p=0;const _=new Uint8Array(l*f*4);for(w=n;w!==i;w+=a)for(u=o;u!==h;u+=s,p++)d=c[p],_[4*(u+l*w)+3]=255,_[4*(u+l*w)+2]=g[3*d+0],_[4*(u+l*w)+1]=g[3*d+1],_[4*(u+l*w)+0]=g[3*d+2];return _},_getImageData16bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=t.width,l=t.height;let f,d,u,w=0;const p=new Uint8Array(g*l*4);for(u=n;u!==i;u+=a)for(d=o;d!==h;d+=s,w+=2){f=c[w+0]+(c[w+1]<<8);const t=255*((31744&f)>>10)/31|0,e=255*((992&f)>>5)/31|0,r=255*(31&f)/31|0;p[4*(d+g*u)+0]=t,p[4*(d+g*u)+1]=e,p[4*(d+g*u)+2]=r,p[4*(d+g*u)+3]=32768&f?0:255}return p},_getImageData24bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=t.width,l=t.height;let f,d,u=0;const w=new Uint8Array(g*l*4);for(d=n;d!==i;d+=a)for(f=o;f!==h;f+=s,u+=3)w[4*(f+g*d)+3]=255,w[4*(f+g*d)+2]=c[u+0],w[4*(f+g*d)+1]=c[u+1],w[4*(f+g*d)+0]=c[u+2];return w},_getImageData32bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=t.width,l=t.height;let f,d,u=0;const w=new Uint8Array(g*l*4);for(d=n;d!==i;d+=a)for(f=o;f!==h;f+=s,u+=4)w[4*(f+g*d)+2]=c[u+0],w[4*(f+g*d)+1]=c[u+1],w[4*(f+g*d)+0]=c[u+2],w[4*(f+g*d)+3]=c[u+3];return w},_getImageDataGrey8bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=t.width,l=t.height;let f,d,u,w=0;const p=new Uint8Array(g*l*4);for(u=n;u!==i;u+=a)for(d=o;d!==h;d+=s,w++)f=c[w],p[4*(d+g*u)+0]=f,p[4*(d+g*u)+1]=f,p[4*(d+g*u)+2]=f,p[4*(d+g*u)+3]=255;return p},_getImageDataGrey16bits:function(t,e,r,n,a,i,o,s,h){const c=r,g=t.width,l=t.height;let f,d,u=0;const w=new Uint8Array(g*l*4);for(d=n;d!==i;d+=a)for(f=o;f!==h;f+=s,u+=2)w[4*(f+g*d)+0]=c[u+0],w[4*(f+g*d)+1]=c[u+0],w[4*(f+g*d)+2]=c[u+0],w[4*(f+g*d)+3]=c[u+1];return w}};class a{constructor(){this.supportCascades=!1}loadCubeData(){throw".env not supported in Cube."}loadData(t,n,a){const i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=e(i);a(o.width,o.height,n.generateMipMaps,!1,(()=>{r(n,i)}))}}export{a as _TGATextureLoader};
2
- //# sourceMappingURL=tgaTextureLoader-BLOklZDW.esm.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tgaTextureLoader-BLOklZDW.esm.min.js","sources":["../../../../../dev/core/dist/Misc/tga.js","../../../../../dev/core/dist/Materials/Textures/Loaders/tgaTextureLoader.js"],"sourcesContent":["import { Logger } from \"../Misc/logger\";\n//private static _TYPE_NO_DATA = 0;\nconst _TYPE_INDEXED = 1;\nconst _TYPE_RGB = 2;\nconst _TYPE_GREY = 3;\nconst _TYPE_RLE_INDEXED = 9;\nconst _TYPE_RLE_RGB = 10;\nconst _TYPE_RLE_GREY = 11;\nconst _ORIGIN_MASK = 0x30;\nconst _ORIGIN_SHIFT = 0x04;\nconst _ORIGIN_BL = 0x00;\nconst _ORIGIN_BR = 0x01;\nconst _ORIGIN_UL = 0x02;\nconst _ORIGIN_UR = 0x03;\n/**\n * Gets the header of a TGA file\n * @param data defines the TGA data\n * @returns the header\n */\nexport function GetTGAHeader(data) {\n let offset = 0;\n const header = {\n id_length: data[offset++],\n colormap_type: data[offset++],\n image_type: data[offset++],\n colormap_index: data[offset++] | (data[offset++] << 8),\n colormap_length: data[offset++] | (data[offset++] << 8),\n colormap_size: data[offset++],\n origin: [data[offset++] | (data[offset++] << 8), data[offset++] | (data[offset++] << 8)],\n width: data[offset++] | (data[offset++] << 8),\n height: data[offset++] | (data[offset++] << 8),\n pixel_size: data[offset++],\n flags: data[offset++],\n };\n return header;\n}\n/**\n * Uploads TGA content to a Babylon Texture\n * @internal\n */\nexport function UploadContent(texture, data) {\n // Not enough data to contain header ?\n if (data.length < 19) {\n Logger.Error(\"Unable to load TGA file - Not enough data to contain header\");\n return;\n }\n // Read Header\n let offset = 18;\n const header = GetTGAHeader(data);\n // Assume it's a valid Targa file.\n if (header.id_length + offset > data.length) {\n Logger.Error(\"Unable to load TGA file - Not enough data\");\n return;\n }\n // Skip not needed data\n offset += header.id_length;\n let use_rle = false;\n let use_pal = false;\n let use_grey = false;\n // Get some informations.\n switch (header.image_type) {\n case _TYPE_RLE_INDEXED:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_INDEXED:\n use_pal = true;\n break;\n case _TYPE_RLE_RGB:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_RGB:\n // use_rgb = true;\n break;\n case _TYPE_RLE_GREY:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_GREY:\n use_grey = true;\n break;\n }\n let pixel_data;\n // var numAlphaBits = header.flags & 0xf;\n const pixel_size = header.pixel_size >> 3;\n const pixel_total = header.width * header.height * pixel_size;\n // Read palettes\n let palettes;\n if (use_pal) {\n palettes = data.subarray(offset, (offset += header.colormap_length * (header.colormap_size >> 3)));\n }\n // Read LRE\n if (use_rle) {\n pixel_data = new Uint8Array(pixel_total);\n let c, count, i;\n let localOffset = 0;\n const pixels = new Uint8Array(pixel_size);\n while (offset < pixel_total && localOffset < pixel_total) {\n c = data[offset++];\n count = (c & 0x7f) + 1;\n // RLE pixels\n if (c & 0x80) {\n // Bind pixel tmp array\n for (i = 0; i < pixel_size; ++i) {\n pixels[i] = data[offset++];\n }\n // Copy pixel array\n for (i = 0; i < count; ++i) {\n pixel_data.set(pixels, localOffset + i * pixel_size);\n }\n localOffset += pixel_size * count;\n }\n // Raw pixels\n else {\n count *= pixel_size;\n for (i = 0; i < count; ++i) {\n pixel_data[localOffset + i] = data[offset++];\n }\n localOffset += count;\n }\n }\n }\n // RAW Pixels\n else {\n pixel_data = data.subarray(offset, (offset += use_pal ? header.width * header.height : pixel_total));\n }\n // Load to texture\n let x_start, y_start, x_step, y_step, y_end, x_end;\n switch ((header.flags & _ORIGIN_MASK) >> _ORIGIN_SHIFT) {\n default:\n case _ORIGIN_UL:\n x_start = 0;\n x_step = 1;\n x_end = header.width;\n y_start = 0;\n y_step = 1;\n y_end = header.height;\n break;\n case _ORIGIN_BL:\n x_start = 0;\n x_step = 1;\n x_end = header.width;\n y_start = header.height - 1;\n y_step = -1;\n y_end = -1;\n break;\n case _ORIGIN_UR:\n x_start = header.width - 1;\n x_step = -1;\n x_end = -1;\n y_start = 0;\n y_step = 1;\n y_end = header.height;\n break;\n case _ORIGIN_BR:\n x_start = header.width - 1;\n x_step = -1;\n x_end = -1;\n y_start = header.height - 1;\n y_step = -1;\n y_end = -1;\n break;\n }\n // Load the specify method\n const func = \"_getImageData\" + (use_grey ? \"Grey\" : \"\") + header.pixel_size + \"bits\";\n const imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end);\n const engine = texture.getEngine();\n engine._uploadDataToTextureDirectly(texture, imageData);\n}\n/**\n * @internal\n */\nfunction _getImageData8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data, colormap = palettes;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i++) {\n color = image[i];\n imageData[(x + width * y) * 4 + 3] = 255;\n imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0];\n imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1];\n imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 2) {\n color = image[i + 0] + (image[i + 1] << 8); // Inversed ?\n const r = ((((color & 0x7c00) >> 10) * 255) / 0x1f) | 0;\n const g = ((((color & 0x03e0) >> 5) * 255) / 0x1f) | 0;\n const b = (((color & 0x001f) * 255) / 0x1f) | 0;\n imageData[(x + width * y) * 4 + 0] = r;\n imageData[(x + width * y) * 4 + 1] = g;\n imageData[(x + width * y) * 4 + 2] = b;\n imageData[(x + width * y) * 4 + 3] = color & 0x8000 ? 0 : 255;\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData24bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 3) {\n imageData[(x + width * y) * 4 + 3] = 255;\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 1];\n imageData[(x + width * y) * 4 + 0] = image[i + 2];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData32bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 4) {\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 1];\n imageData[(x + width * y) * 4 + 0] = image[i + 2];\n imageData[(x + width * y) * 4 + 3] = image[i + 3];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageDataGrey8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i++) {\n color = image[i];\n imageData[(x + width * y) * 4 + 0] = color;\n imageData[(x + width * y) * 4 + 1] = color;\n imageData[(x + width * y) * 4 + 2] = color;\n imageData[(x + width * y) * 4 + 3] = 255;\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageDataGrey16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 2) {\n imageData[(x + width * y) * 4 + 0] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 0];\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 3] = image[i + 1];\n }\n }\n return imageData;\n}\n/**\n * Based on jsTGALoader - Javascript loader for TGA file\n * By Vincent Thibault\n * @see http://blog.robrowser.com/javascript-tga-loader.html\n */\nexport const TGATools = {\n /**\n * Gets the header of a TGA file\n * @param data defines the TGA data\n * @returns the header\n */\n GetTGAHeader,\n /**\n * Uploads TGA content to a Babylon Texture\n * @internal\n */\n UploadContent,\n /** @internal */\n _getImageData8bits,\n /** @internal */\n _getImageData16bits,\n /** @internal */\n _getImageData24bits,\n /** @internal */\n _getImageData32bits,\n /** @internal */\n _getImageDataGrey8bits,\n /** @internal */\n _getImageDataGrey16bits,\n};\n//# sourceMappingURL=tga.js.map","import { GetTGAHeader, UploadContent } from \"../../../Misc/tga\";\n/**\n * Implementation of the TGA Texture Loader.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _TGATextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n */\n loadCubeData() {\n // eslint-disable-next-line no-throw-literal\n throw \".env not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n loadData(data, texture, callback) {\n const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n const header = GetTGAHeader(bytes);\n callback(header.width, header.height, texture.generateMipMaps, false, () => {\n UploadContent(texture, bytes);\n });\n }\n}\n//# sourceMappingURL=tgaTextureLoader.js.map"],"names":["GetTGAHeader","data","offset","id_length","colormap_type","image_type","colormap_index","colormap_length","colormap_size","origin","width","height","pixel_size","flags","UploadContent","texture","length","Logger","Error","header","pixel_data","use_rle","use_pal","use_grey","pixel_total","palettes","x_start","y_start","x_step","y_step","y_end","x_end","subarray","c","count","i","Uint8Array","localOffset","pixels","set","func","imageData","TGATools","getEngine","_uploadDataToTextureDirectly","_getImageData8bits","image","colormap","color","x","y","_getImageData16bits","r","g","b","_getImageData24bits","_getImageData32bits","_getImageDataGrey8bits","_getImageDataGrey16bits","_TGATextureLoader","constructor","this","supportCascades","loadCubeData","loadData","callback","bytes","buffer","byteOffset","byteLength","generateMipMaps"],"mappings":"gDAmBO,SAASA,EAAaC,GACzB,IAAIC,EAAS,EAcb,MAbe,CACXC,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,EAAIvB,EAASuB,IAAMpB,EAAOoB,GAAKrB,EAChC,IAAKoB,EAAIvB,EAASuB,IAAMlB,EAAOkB,GAAKrB,EAAQO,GAAK,EAC7CM,EAA4B,GAAjBQ,EAAIvC,EAAQwC,GAAS,GAAKJ,EAAMX,EAAI,GAC/CM,EAA4B,GAAjBQ,EAAIvC,EAAQwC,GAAS,GAAKJ,EAAMX,EAAI,GAC/CM,EAA4B,GAAjBQ,EAAIvC,EAAQwC,GAAS,GAAKJ,EAAMX,EAAI,GAC/CM,EAA4B,GAAjBQ,EAAIvC,EAAQwC,GAAS,GAAKJ,EAAMX,EAAI,GAGvD,OAAOM,CACX,GClRO,MAAMkB,EACT,WAAAC,GAIIC,KAAKC,iBAAkB,CAC1B,CAID,YAAAC,GAEI,KAAM,6BACT,CAOD,QAAAC,CAAS/D,EAAMc,EAASkD,GACpB,MAAMC,EAAQ,IAAI9B,WAAWnC,EAAKkE,OAAQlE,EAAKmE,WAAYnE,EAAKoE,YAC1DlD,EAASnB,EAAakE,GAC5BD,EAAS9C,EAAOT,MAAOS,EAAOR,OAAQI,EAAQuD,iBAAiB,GAAO,KAClExD,EAAcC,EAASmD,EAAM,GAEpC"}
@@ -1,349 +0,0 @@
1
- import { L as Logger } from './index-Bk29Qt-Y.esm.js';
2
-
3
- //private static _TYPE_NO_DATA = 0;
4
- const _TYPE_INDEXED = 1;
5
- const _TYPE_RGB = 2;
6
- const _TYPE_GREY = 3;
7
- const _TYPE_RLE_INDEXED = 9;
8
- const _TYPE_RLE_RGB = 10;
9
- const _TYPE_RLE_GREY = 11;
10
- const _ORIGIN_MASK = 0x30;
11
- const _ORIGIN_SHIFT = 0x04;
12
- const _ORIGIN_BL = 0x00;
13
- const _ORIGIN_BR = 0x01;
14
- const _ORIGIN_UL = 0x02;
15
- const _ORIGIN_UR = 0x03;
16
- /**
17
- * Gets the header of a TGA file
18
- * @param data defines the TGA data
19
- * @returns the header
20
- */
21
- function GetTGAHeader(data) {
22
- let offset = 0;
23
- const header = {
24
- id_length: data[offset++],
25
- colormap_type: data[offset++],
26
- image_type: data[offset++],
27
- colormap_index: data[offset++] | (data[offset++] << 8),
28
- colormap_length: data[offset++] | (data[offset++] << 8),
29
- colormap_size: data[offset++],
30
- origin: [data[offset++] | (data[offset++] << 8), data[offset++] | (data[offset++] << 8)],
31
- width: data[offset++] | (data[offset++] << 8),
32
- height: data[offset++] | (data[offset++] << 8),
33
- pixel_size: data[offset++],
34
- flags: data[offset++],
35
- };
36
- return header;
37
- }
38
- /**
39
- * Uploads TGA content to a Babylon Texture
40
- * @internal
41
- */
42
- function UploadContent(texture, data) {
43
- // Not enough data to contain header ?
44
- if (data.length < 19) {
45
- Logger.Error("Unable to load TGA file - Not enough data to contain header");
46
- return;
47
- }
48
- // Read Header
49
- let offset = 18;
50
- const header = GetTGAHeader(data);
51
- // Assume it's a valid Targa file.
52
- if (header.id_length + offset > data.length) {
53
- Logger.Error("Unable to load TGA file - Not enough data");
54
- return;
55
- }
56
- // Skip not needed data
57
- offset += header.id_length;
58
- let use_rle = false;
59
- let use_pal = false;
60
- let use_grey = false;
61
- // Get some informations.
62
- switch (header.image_type) {
63
- case _TYPE_RLE_INDEXED:
64
- use_rle = true;
65
- // eslint-disable-next-line no-fallthrough
66
- case _TYPE_INDEXED:
67
- use_pal = true;
68
- break;
69
- case _TYPE_RLE_RGB:
70
- use_rle = true;
71
- // eslint-disable-next-line no-fallthrough
72
- case _TYPE_RGB:
73
- // use_rgb = true;
74
- break;
75
- case _TYPE_RLE_GREY:
76
- use_rle = true;
77
- // eslint-disable-next-line no-fallthrough
78
- case _TYPE_GREY:
79
- use_grey = true;
80
- break;
81
- }
82
- let pixel_data;
83
- // var numAlphaBits = header.flags & 0xf;
84
- const pixel_size = header.pixel_size >> 3;
85
- const pixel_total = header.width * header.height * pixel_size;
86
- // Read palettes
87
- let palettes;
88
- if (use_pal) {
89
- palettes = data.subarray(offset, (offset += header.colormap_length * (header.colormap_size >> 3)));
90
- }
91
- // Read LRE
92
- if (use_rle) {
93
- pixel_data = new Uint8Array(pixel_total);
94
- let c, count, i;
95
- let localOffset = 0;
96
- const pixels = new Uint8Array(pixel_size);
97
- while (offset < pixel_total && localOffset < pixel_total) {
98
- c = data[offset++];
99
- count = (c & 0x7f) + 1;
100
- // RLE pixels
101
- if (c & 0x80) {
102
- // Bind pixel tmp array
103
- for (i = 0; i < pixel_size; ++i) {
104
- pixels[i] = data[offset++];
105
- }
106
- // Copy pixel array
107
- for (i = 0; i < count; ++i) {
108
- pixel_data.set(pixels, localOffset + i * pixel_size);
109
- }
110
- localOffset += pixel_size * count;
111
- }
112
- // Raw pixels
113
- else {
114
- count *= pixel_size;
115
- for (i = 0; i < count; ++i) {
116
- pixel_data[localOffset + i] = data[offset++];
117
- }
118
- localOffset += count;
119
- }
120
- }
121
- }
122
- // RAW Pixels
123
- else {
124
- pixel_data = data.subarray(offset, (offset += use_pal ? header.width * header.height : pixel_total));
125
- }
126
- // Load to texture
127
- let x_start, y_start, x_step, y_step, y_end, x_end;
128
- switch ((header.flags & _ORIGIN_MASK) >> _ORIGIN_SHIFT) {
129
- default:
130
- case _ORIGIN_UL:
131
- x_start = 0;
132
- x_step = 1;
133
- x_end = header.width;
134
- y_start = 0;
135
- y_step = 1;
136
- y_end = header.height;
137
- break;
138
- case _ORIGIN_BL:
139
- x_start = 0;
140
- x_step = 1;
141
- x_end = header.width;
142
- y_start = header.height - 1;
143
- y_step = -1;
144
- y_end = -1;
145
- break;
146
- case _ORIGIN_UR:
147
- x_start = header.width - 1;
148
- x_step = -1;
149
- x_end = -1;
150
- y_start = 0;
151
- y_step = 1;
152
- y_end = header.height;
153
- break;
154
- case _ORIGIN_BR:
155
- x_start = header.width - 1;
156
- x_step = -1;
157
- x_end = -1;
158
- y_start = header.height - 1;
159
- y_step = -1;
160
- y_end = -1;
161
- break;
162
- }
163
- // Load the specify method
164
- const func = "_getImageData" + (use_grey ? "Grey" : "") + header.pixel_size + "bits";
165
- const imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end);
166
- const engine = texture.getEngine();
167
- engine._uploadDataToTextureDirectly(texture, imageData);
168
- }
169
- /**
170
- * @internal
171
- */
172
- function _getImageData8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
173
- const image = pixel_data, colormap = palettes;
174
- const width = header.width, height = header.height;
175
- let color, i = 0, x, y;
176
- const imageData = new Uint8Array(width * height * 4);
177
- for (y = y_start; y !== y_end; y += y_step) {
178
- for (x = x_start; x !== x_end; x += x_step, i++) {
179
- color = image[i];
180
- imageData[(x + width * y) * 4 + 3] = 255;
181
- imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0];
182
- imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1];
183
- imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2];
184
- }
185
- }
186
- return imageData;
187
- }
188
- /**
189
- * @internal
190
- */
191
- function _getImageData16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
192
- const image = pixel_data;
193
- const width = header.width, height = header.height;
194
- let color, i = 0, x, y;
195
- const imageData = new Uint8Array(width * height * 4);
196
- for (y = y_start; y !== y_end; y += y_step) {
197
- for (x = x_start; x !== x_end; x += x_step, i += 2) {
198
- color = image[i + 0] + (image[i + 1] << 8); // Inversed ?
199
- const r = ((((color & 0x7c00) >> 10) * 255) / 0x1f) | 0;
200
- const g = ((((color & 0x03e0) >> 5) * 255) / 0x1f) | 0;
201
- const b = (((color & 0x001f) * 255) / 0x1f) | 0;
202
- imageData[(x + width * y) * 4 + 0] = r;
203
- imageData[(x + width * y) * 4 + 1] = g;
204
- imageData[(x + width * y) * 4 + 2] = b;
205
- imageData[(x + width * y) * 4 + 3] = color & 0x8000 ? 0 : 255;
206
- }
207
- }
208
- return imageData;
209
- }
210
- /**
211
- * @internal
212
- */
213
- function _getImageData24bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
214
- const image = pixel_data;
215
- const width = header.width, height = header.height;
216
- let i = 0, x, y;
217
- const imageData = new Uint8Array(width * height * 4);
218
- for (y = y_start; y !== y_end; y += y_step) {
219
- for (x = x_start; x !== x_end; x += x_step, i += 3) {
220
- imageData[(x + width * y) * 4 + 3] = 255;
221
- imageData[(x + width * y) * 4 + 2] = image[i + 0];
222
- imageData[(x + width * y) * 4 + 1] = image[i + 1];
223
- imageData[(x + width * y) * 4 + 0] = image[i + 2];
224
- }
225
- }
226
- return imageData;
227
- }
228
- /**
229
- * @internal
230
- */
231
- function _getImageData32bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
232
- const image = pixel_data;
233
- const width = header.width, height = header.height;
234
- let i = 0, x, y;
235
- const imageData = new Uint8Array(width * height * 4);
236
- for (y = y_start; y !== y_end; y += y_step) {
237
- for (x = x_start; x !== x_end; x += x_step, i += 4) {
238
- imageData[(x + width * y) * 4 + 2] = image[i + 0];
239
- imageData[(x + width * y) * 4 + 1] = image[i + 1];
240
- imageData[(x + width * y) * 4 + 0] = image[i + 2];
241
- imageData[(x + width * y) * 4 + 3] = image[i + 3];
242
- }
243
- }
244
- return imageData;
245
- }
246
- /**
247
- * @internal
248
- */
249
- function _getImageDataGrey8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
250
- const image = pixel_data;
251
- const width = header.width, height = header.height;
252
- let color, i = 0, x, y;
253
- const imageData = new Uint8Array(width * height * 4);
254
- for (y = y_start; y !== y_end; y += y_step) {
255
- for (x = x_start; x !== x_end; x += x_step, i++) {
256
- color = image[i];
257
- imageData[(x + width * y) * 4 + 0] = color;
258
- imageData[(x + width * y) * 4 + 1] = color;
259
- imageData[(x + width * y) * 4 + 2] = color;
260
- imageData[(x + width * y) * 4 + 3] = 255;
261
- }
262
- }
263
- return imageData;
264
- }
265
- /**
266
- * @internal
267
- */
268
- function _getImageDataGrey16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
269
- const image = pixel_data;
270
- const width = header.width, height = header.height;
271
- let i = 0, x, y;
272
- const imageData = new Uint8Array(width * height * 4);
273
- for (y = y_start; y !== y_end; y += y_step) {
274
- for (x = x_start; x !== x_end; x += x_step, i += 2) {
275
- imageData[(x + width * y) * 4 + 0] = image[i + 0];
276
- imageData[(x + width * y) * 4 + 1] = image[i + 0];
277
- imageData[(x + width * y) * 4 + 2] = image[i + 0];
278
- imageData[(x + width * y) * 4 + 3] = image[i + 1];
279
- }
280
- }
281
- return imageData;
282
- }
283
- /**
284
- * Based on jsTGALoader - Javascript loader for TGA file
285
- * By Vincent Thibault
286
- * @see http://blog.robrowser.com/javascript-tga-loader.html
287
- */
288
- const TGATools = {
289
- /**
290
- * Gets the header of a TGA file
291
- * @param data defines the TGA data
292
- * @returns the header
293
- */
294
- GetTGAHeader,
295
- /**
296
- * Uploads TGA content to a Babylon Texture
297
- * @internal
298
- */
299
- UploadContent,
300
- /** @internal */
301
- _getImageData8bits,
302
- /** @internal */
303
- _getImageData16bits,
304
- /** @internal */
305
- _getImageData24bits,
306
- /** @internal */
307
- _getImageData32bits,
308
- /** @internal */
309
- _getImageDataGrey8bits,
310
- /** @internal */
311
- _getImageDataGrey16bits,
312
- };
313
-
314
- /**
315
- * Implementation of the TGA Texture Loader.
316
- * @internal
317
- */
318
- // eslint-disable-next-line @typescript-eslint/naming-convention
319
- class _TGATextureLoader {
320
- constructor() {
321
- /**
322
- * Defines whether the loader supports cascade loading the different faces.
323
- */
324
- this.supportCascades = false;
325
- }
326
- /**
327
- * Uploads the cube texture data to the WebGL texture. It has already been bound.
328
- */
329
- loadCubeData() {
330
- // eslint-disable-next-line no-throw-literal
331
- throw ".env not supported in Cube.";
332
- }
333
- /**
334
- * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
335
- * @param data contains the texture data
336
- * @param texture defines the BabylonJS internal texture
337
- * @param callback defines the method to call once ready to upload
338
- */
339
- loadData(data, texture, callback) {
340
- const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
341
- const header = GetTGAHeader(bytes);
342
- callback(header.width, header.height, texture.generateMipMaps, false, () => {
343
- UploadContent(texture, bytes);
344
- });
345
- }
346
- }
347
-
348
- export { _TGATextureLoader };
349
- //# sourceMappingURL=tgaTextureLoader-CCYZarL9.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tgaTextureLoader-CCYZarL9.esm.js","sources":["../../../../../dev/core/dist/Misc/tga.js","../../../../../dev/core/dist/Materials/Textures/Loaders/tgaTextureLoader.js"],"sourcesContent":["import { Logger } from \"../Misc/logger\";\n//private static _TYPE_NO_DATA = 0;\nconst _TYPE_INDEXED = 1;\nconst _TYPE_RGB = 2;\nconst _TYPE_GREY = 3;\nconst _TYPE_RLE_INDEXED = 9;\nconst _TYPE_RLE_RGB = 10;\nconst _TYPE_RLE_GREY = 11;\nconst _ORIGIN_MASK = 0x30;\nconst _ORIGIN_SHIFT = 0x04;\nconst _ORIGIN_BL = 0x00;\nconst _ORIGIN_BR = 0x01;\nconst _ORIGIN_UL = 0x02;\nconst _ORIGIN_UR = 0x03;\n/**\n * Gets the header of a TGA file\n * @param data defines the TGA data\n * @returns the header\n */\nexport function GetTGAHeader(data) {\n let offset = 0;\n const header = {\n id_length: data[offset++],\n colormap_type: data[offset++],\n image_type: data[offset++],\n colormap_index: data[offset++] | (data[offset++] << 8),\n colormap_length: data[offset++] | (data[offset++] << 8),\n colormap_size: data[offset++],\n origin: [data[offset++] | (data[offset++] << 8), data[offset++] | (data[offset++] << 8)],\n width: data[offset++] | (data[offset++] << 8),\n height: data[offset++] | (data[offset++] << 8),\n pixel_size: data[offset++],\n flags: data[offset++],\n };\n return header;\n}\n/**\n * Uploads TGA content to a Babylon Texture\n * @internal\n */\nexport function UploadContent(texture, data) {\n // Not enough data to contain header ?\n if (data.length < 19) {\n Logger.Error(\"Unable to load TGA file - Not enough data to contain header\");\n return;\n }\n // Read Header\n let offset = 18;\n const header = GetTGAHeader(data);\n // Assume it's a valid Targa file.\n if (header.id_length + offset > data.length) {\n Logger.Error(\"Unable to load TGA file - Not enough data\");\n return;\n }\n // Skip not needed data\n offset += header.id_length;\n let use_rle = false;\n let use_pal = false;\n let use_grey = false;\n // Get some informations.\n switch (header.image_type) {\n case _TYPE_RLE_INDEXED:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_INDEXED:\n use_pal = true;\n break;\n case _TYPE_RLE_RGB:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_RGB:\n // use_rgb = true;\n break;\n case _TYPE_RLE_GREY:\n use_rle = true;\n // eslint-disable-next-line no-fallthrough\n case _TYPE_GREY:\n use_grey = true;\n break;\n }\n let pixel_data;\n // var numAlphaBits = header.flags & 0xf;\n const pixel_size = header.pixel_size >> 3;\n const pixel_total = header.width * header.height * pixel_size;\n // Read palettes\n let palettes;\n if (use_pal) {\n palettes = data.subarray(offset, (offset += header.colormap_length * (header.colormap_size >> 3)));\n }\n // Read LRE\n if (use_rle) {\n pixel_data = new Uint8Array(pixel_total);\n let c, count, i;\n let localOffset = 0;\n const pixels = new Uint8Array(pixel_size);\n while (offset < pixel_total && localOffset < pixel_total) {\n c = data[offset++];\n count = (c & 0x7f) + 1;\n // RLE pixels\n if (c & 0x80) {\n // Bind pixel tmp array\n for (i = 0; i < pixel_size; ++i) {\n pixels[i] = data[offset++];\n }\n // Copy pixel array\n for (i = 0; i < count; ++i) {\n pixel_data.set(pixels, localOffset + i * pixel_size);\n }\n localOffset += pixel_size * count;\n }\n // Raw pixels\n else {\n count *= pixel_size;\n for (i = 0; i < count; ++i) {\n pixel_data[localOffset + i] = data[offset++];\n }\n localOffset += count;\n }\n }\n }\n // RAW Pixels\n else {\n pixel_data = data.subarray(offset, (offset += use_pal ? header.width * header.height : pixel_total));\n }\n // Load to texture\n let x_start, y_start, x_step, y_step, y_end, x_end;\n switch ((header.flags & _ORIGIN_MASK) >> _ORIGIN_SHIFT) {\n default:\n case _ORIGIN_UL:\n x_start = 0;\n x_step = 1;\n x_end = header.width;\n y_start = 0;\n y_step = 1;\n y_end = header.height;\n break;\n case _ORIGIN_BL:\n x_start = 0;\n x_step = 1;\n x_end = header.width;\n y_start = header.height - 1;\n y_step = -1;\n y_end = -1;\n break;\n case _ORIGIN_UR:\n x_start = header.width - 1;\n x_step = -1;\n x_end = -1;\n y_start = 0;\n y_step = 1;\n y_end = header.height;\n break;\n case _ORIGIN_BR:\n x_start = header.width - 1;\n x_step = -1;\n x_end = -1;\n y_start = header.height - 1;\n y_step = -1;\n y_end = -1;\n break;\n }\n // Load the specify method\n const func = \"_getImageData\" + (use_grey ? \"Grey\" : \"\") + header.pixel_size + \"bits\";\n const imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end);\n const engine = texture.getEngine();\n engine._uploadDataToTextureDirectly(texture, imageData);\n}\n/**\n * @internal\n */\nfunction _getImageData8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data, colormap = palettes;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i++) {\n color = image[i];\n imageData[(x + width * y) * 4 + 3] = 255;\n imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0];\n imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1];\n imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 2) {\n color = image[i + 0] + (image[i + 1] << 8); // Inversed ?\n const r = ((((color & 0x7c00) >> 10) * 255) / 0x1f) | 0;\n const g = ((((color & 0x03e0) >> 5) * 255) / 0x1f) | 0;\n const b = (((color & 0x001f) * 255) / 0x1f) | 0;\n imageData[(x + width * y) * 4 + 0] = r;\n imageData[(x + width * y) * 4 + 1] = g;\n imageData[(x + width * y) * 4 + 2] = b;\n imageData[(x + width * y) * 4 + 3] = color & 0x8000 ? 0 : 255;\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData24bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 3) {\n imageData[(x + width * y) * 4 + 3] = 255;\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 1];\n imageData[(x + width * y) * 4 + 0] = image[i + 2];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageData32bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 4) {\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 1];\n imageData[(x + width * y) * 4 + 0] = image[i + 2];\n imageData[(x + width * y) * 4 + 3] = image[i + 3];\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageDataGrey8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let color, i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i++) {\n color = image[i];\n imageData[(x + width * y) * 4 + 0] = color;\n imageData[(x + width * y) * 4 + 1] = color;\n imageData[(x + width * y) * 4 + 2] = color;\n imageData[(x + width * y) * 4 + 3] = 255;\n }\n }\n return imageData;\n}\n/**\n * @internal\n */\nfunction _getImageDataGrey16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {\n const image = pixel_data;\n const width = header.width, height = header.height;\n let i = 0, x, y;\n const imageData = new Uint8Array(width * height * 4);\n for (y = y_start; y !== y_end; y += y_step) {\n for (x = x_start; x !== x_end; x += x_step, i += 2) {\n imageData[(x + width * y) * 4 + 0] = image[i + 0];\n imageData[(x + width * y) * 4 + 1] = image[i + 0];\n imageData[(x + width * y) * 4 + 2] = image[i + 0];\n imageData[(x + width * y) * 4 + 3] = image[i + 1];\n }\n }\n return imageData;\n}\n/**\n * Based on jsTGALoader - Javascript loader for TGA file\n * By Vincent Thibault\n * @see http://blog.robrowser.com/javascript-tga-loader.html\n */\nexport const TGATools = {\n /**\n * Gets the header of a TGA file\n * @param data defines the TGA data\n * @returns the header\n */\n GetTGAHeader,\n /**\n * Uploads TGA content to a Babylon Texture\n * @internal\n */\n UploadContent,\n /** @internal */\n _getImageData8bits,\n /** @internal */\n _getImageData16bits,\n /** @internal */\n _getImageData24bits,\n /** @internal */\n _getImageData32bits,\n /** @internal */\n _getImageDataGrey8bits,\n /** @internal */\n _getImageDataGrey16bits,\n};\n//# sourceMappingURL=tga.js.map","import { GetTGAHeader, UploadContent } from \"../../../Misc/tga\";\n/**\n * Implementation of the TGA Texture Loader.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _TGATextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n */\n loadCubeData() {\n // eslint-disable-next-line no-throw-literal\n throw \".env not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n loadData(data, texture, callback) {\n const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n const header = GetTGAHeader(bytes);\n callback(header.width, header.height, texture.generateMipMaps, false, () => {\n UploadContent(texture, bytes);\n });\n }\n}\n//# sourceMappingURL=tgaTextureLoader.js.map"],"names":[],"mappings":";;AACA;AACA,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,IAAI,EAAE;AACnC,IAAI,IAAI,MAAM,GAAG,CAAC,CAAC;AACnB,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AACjC,QAAQ,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AACrC,QAAQ,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAClC,QAAQ,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;AAC9D,QAAQ,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/D,QAAQ,aAAa,EAAE,IAAI,CAAC,M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ACA;AACA;AACA;AACO,MAAM,QAAQ,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA,IAAI,YAAY;AAChB;AACA;AACA;AACA;AACA,IAAI,aAAa;AACjB;AACA,IAAI,kBAAkB;AACtB;AACA,IAAI,mBAAmB;AACvB;AACA,IAAI,mBAAmB;AACvB;AACA,IAAI,mBAAmB;AACvB;AACA,IAAI,sBAAsB;AAC1B;AACA,IAAI,uBAAuB;AAC3B,CAAC;;ACrTD;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB,CAAC;AAC/B,IAAI,WAAW,GAAG;AAClB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;AACrC,KAAK;AACL;AACA;AACA;AACA,IAAI,YAAY,GAAG;AACnB;AACA,QAAQ,MAAM,6BAA6B,CAAC;AAC5C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE;AACtC,QAAQ,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AACpF,QAAQ,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAC3C,QAAQ,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM;AACpF,YAAY,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;;;"}
@@ -1,2 +0,0 @@
1
- import{M as t,L as e,q as n,c as a,am as s,an as i,t as r,b as o}from"./index-BlF30_Ca.esm.min.js";t.prototype.thinInstanceAdd=function(t,n=!0){if(!this.getScene().getEngine().getCaps().instancedArrays)return e.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(t)?t.length:1);const a=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(t))for(let e=0;e<t.length;++e)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,t[e],e===t.length-1&&n);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,t,n);return a},t.prototype.thinInstanceAddSelf=function(t=!0){return this.thinInstanceAdd(n.IdentityReadOnly,t)},t.prototype.thinInstanceRegisterAttribute=function(t,e){t===a.ColorKind&&(t=a.ColorInstanceKind),this.removeVerticesData(t),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[t]=e,this._userThinInstanceBuffersStorage.sizes[t]=e*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[t]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[t]),this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a(this.getEngine(),this._userThinInstanceBuffersStorage.data[t],t,!0,!1,e,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t])},t.prototype.thinInstanceSetMatrixAt=function(t,e,n=!0){if(!this._thinInstanceDataStorage.matrixData||t>=this._thinInstanceDataStorage.instancesCount)return!1;const a=this._thinInstanceDataStorage.matrixData;return e.copyToArray(a,16*t),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[t]=e),n&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},t.prototype.thinInstanceSetAttributeAt=function(t,e,n,s=!0){return t===a.ColorKind&&(t=a.ColorInstanceKind),!(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[t]||e>=this._thinInstanceDataStorage.instancesCount)&&(this._thinInstanceUpdateBufferSize(t,0),this._userThinInstanceBuffersStorage.data[t].set(n,e*this._userThinInstanceBuffersStorage.strides[t]),s&&this.thinInstanceBufferUpdated(t),!0)},Object.defineProperty(t.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(t){const e=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData;t<=(e?e.length/16:0)&&(this._thinInstanceDataStorage.instancesCount=t)},enumerable:!0,configurable:!0}),t.prototype._thinInstanceCreateMatrixBuffer=function(t,e,n=!0){const a=new s(this.getEngine(),e,!n,16,!1,!0);for(let e=0;e<4;e++)this.setVerticesBuffer(a.createVertexBuffer(t+e,4*e,4));return a},t.prototype.thinInstanceSetBuffer=function(t,e,n=0,s=!0){n=n||16,"matrix"===t?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*n,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,null!==e?(this._thinInstanceDataStorage.instancesCount=e.length/n,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,s),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo())):"previousMatrix"===t?(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,null!==e&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,s))):(t===a.ColorKind&&(t=a.ColorInstanceKind),null===e?this._userThinInstanceBuffersStorage?.data[t]&&(this.removeVerticesData(t),delete this._userThinInstanceBuffersStorage.data[t],delete this._userThinInstanceBuffersStorage.strides[t],delete this._userThinInstanceBuffersStorage.sizes[t],delete this._userThinInstanceBuffersStorage.vertexBuffers[t]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[t]=e,this._userThinInstanceBuffersStorage.strides[t]=n,this._userThinInstanceBuffersStorage.sizes[t]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a(this.getEngine(),e,t,!s,!1,n,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t])))},t.prototype.thinInstanceBufferUpdated=function(t){"matrix"===t?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):"previousMatrix"===t?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):(t===a.ColorKind&&(t=a.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[t].isUpdatable()&&this._thinInstanceRecreateBuffer(t),this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(this._userThinInstanceBuffersStorage.data[t],0)))},t.prototype.thinInstancePartialBufferUpdate=function(t,e,n){"matrix"===t?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,n):(t===a.ColorKind&&(t=a.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[t]&&this._userThinInstanceBuffersStorage.vertexBuffers[t].updateDirectly(e,n))},t.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const t=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let e=0;e<this._thinInstanceDataStorage.instancesCount;++e)this._thinInstanceDataStorage.worldMatrices[e]=n.FromArray(t,16*e)}return this._thinInstanceDataStorage.worldMatrices},t.prototype.thinInstanceRefreshBoundingInfo=function(t=!1,e=!1,a=!1){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return;const s=this._thinInstanceDataStorage.boundingVectors;if(t||!this.rawBoundingInfo){s.length=0,this.refreshBoundingInfo(e,a);const t=this.getBoundingInfo();this.rawBoundingInfo=new i(t.minimum,t.maximum)}const h=this.getBoundingInfo(),f=this._thinInstanceDataStorage.matrixData;if(0===s.length)for(let t=0;t<h.boundingBox.vectors.length;++t)s.push(h.boundingBox.vectors[t].clone());r.Vector3[0].setAll(Number.POSITIVE_INFINITY),r.Vector3[1].setAll(Number.NEGATIVE_INFINITY);for(let t=0;t<this._thinInstanceDataStorage.instancesCount;++t){n.FromArrayToRef(f,16*t,r.Matrix[0]);for(let t=0;t<s.length;++t)o.TransformCoordinatesToRef(s[t],r.Matrix[0],r.Vector3[2]),r.Vector3[0].minimizeInPlace(r.Vector3[2]),r.Vector3[1].maximizeInPlace(r.Vector3[2])}h.reConstruct(r.Vector3[0],r.Vector3[1]),this._updateBoundingInfo()},t.prototype._thinInstanceRecreateBuffer=function(t,e=!0){"matrix"===t?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",this._thinInstanceDataStorage.matrixData,e)):"previousMatrix"===t?this._scene.needsPreviousWorldMatrices&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.previousMatrixData??this._thinInstanceDataStorage.matrixData,e)):(t===a.ColorKind&&(t=a.ColorInstanceKind),this._userThinInstanceBuffersStorage.vertexBuffers[t]?.dispose(),this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a(this.getEngine(),this._userThinInstanceBuffersStorage.data[t],t,!e,!1,this._userThinInstanceBuffersStorage.strides[t],!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))},t.prototype._thinInstanceUpdateBufferSize=function(t,e=1){t===a.ColorKind&&(t=a.ColorInstanceKind);const n="matrix"===t;if(!(n||this._userThinInstanceBuffersStorage&&this._userThinInstanceBuffersStorage.strides[t]))return;const s=n?16:this._userThinInstanceBuffersStorage.strides[t],i=n?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[t];let r=n?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[t];const o=(this._thinInstanceDataStorage.instancesCount+e)*s;let h=i;for(;h<o;)h*=2;if(!r||i!=h){if(r){const t=new Float32Array(h);t.set(r,0),r=t}else r=new Float32Array(h);n?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",r,!1),this._thinInstanceDataStorage.matrixData=r,this._thinInstanceDataStorage.matrixBufferSize=h,this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",r,!1))):(this._userThinInstanceBuffersStorage.vertexBuffers[t]?.dispose(),this._userThinInstanceBuffersStorage.data[t]=r,this._userThinInstanceBuffersStorage.sizes[t]=h,this._userThinInstanceBuffersStorage.vertexBuffers[t]=new a(this.getEngine(),r,t,!0,!1,s,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[t]))}},t.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},t.prototype._disposeThinInstanceSpecificData=function(){this._thinInstanceDataStorage?.matrixBuffer&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null)};
2
- //# sourceMappingURL=thinInstanceMesh-BuanMsAC.esm.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"thinInstanceMesh-BuanMsAC.esm.min.js","sources":["../../../../../dev/core/dist/Meshes/thinInstanceMesh.js"],"sourcesContent":["import { Mesh } from \"../Meshes/mesh\";\nimport { VertexBuffer, Buffer } from \"../Buffers/buffer\";\nimport { Matrix, Vector3, TmpVectors } from \"../Maths/math.vector\";\nimport { Logger } from \"../Misc/logger\";\nimport { BoundingInfo } from \"core/Culling/boundingInfo\";\nMesh.prototype.thinInstanceAdd = function (matrix, refresh = true) {\n if (!this.getScene().getEngine().getCaps().instancedArrays) {\n Logger.Error(\"Thin Instances are not supported on this device as Instanced Array extension not supported\");\n return -1;\n }\n this._thinInstanceUpdateBufferSize(\"matrix\", Array.isArray(matrix) ? matrix.length : 1);\n const index = this._thinInstanceDataStorage.instancesCount;\n if (Array.isArray(matrix)) {\n for (let i = 0; i < matrix.length; ++i) {\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh);\n }\n }\n else {\n this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh);\n }\n return index;\n};\nMesh.prototype.thinInstanceAddSelf = function (refresh = true) {\n return this.thinInstanceAdd(Matrix.IdentityReadOnly, refresh);\n};\nMesh.prototype.thinInstanceRegisterAttribute = function (kind, stride) {\n // preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n this.removeVerticesData(kind);\n this._thinInstanceInitializeUserStorage();\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\n this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); // Initial size\n this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]);\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true);\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);\n};\nMesh.prototype.thinInstanceSetMatrixAt = function (index, matrix, refresh = true) {\n if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) {\n return false;\n }\n const matrixData = this._thinInstanceDataStorage.matrixData;\n matrix.copyToArray(matrixData, index * 16);\n if (this._thinInstanceDataStorage.worldMatrices) {\n this._thinInstanceDataStorage.worldMatrices[index] = matrix;\n }\n if (refresh) {\n this.thinInstanceBufferUpdated(\"matrix\");\n if (!this.doNotSyncBoundingInfo) {\n this.thinInstanceRefreshBoundingInfo(false);\n }\n }\n return true;\n};\nMesh.prototype.thinInstanceSetAttributeAt = function (kind, index, value, refresh = true) {\n // preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) {\n return false;\n }\n this._thinInstanceUpdateBufferSize(kind, 0); // make sur the buffer for the kind attribute is big enough\n this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]);\n if (refresh) {\n this.thinInstanceBufferUpdated(kind);\n }\n return true;\n};\nObject.defineProperty(Mesh.prototype, \"thinInstanceCount\", {\n get: function () {\n return this._thinInstanceDataStorage.instancesCount;\n },\n set: function (value) {\n const matrixData = this._thinInstanceDataStorage.matrixData ?? this.source?._thinInstanceDataStorage.matrixData;\n const numMaxInstances = matrixData ? matrixData.length / 16 : 0;\n if (value <= numMaxInstances) {\n this._thinInstanceDataStorage.instancesCount = value;\n }\n },\n enumerable: true,\n configurable: true,\n});\nMesh.prototype._thinInstanceCreateMatrixBuffer = function (kind, buffer, staticBuffer = true) {\n const matrixBuffer = new Buffer(this.getEngine(), buffer, !staticBuffer, 16, false, true);\n for (let i = 0; i < 4; i++) {\n this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4));\n }\n return matrixBuffer;\n};\nMesh.prototype.thinInstanceSetBuffer = function (kind, buffer, stride = 0, staticBuffer = true) {\n stride = stride || 16;\n if (kind === \"matrix\") {\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\n this._thinInstanceDataStorage.matrixBuffer = null;\n this._thinInstanceDataStorage.matrixBufferSize = buffer ? buffer.length : 32 * stride;\n this._thinInstanceDataStorage.matrixData = buffer;\n this._thinInstanceDataStorage.worldMatrices = null;\n if (buffer !== null) {\n this._thinInstanceDataStorage.instancesCount = buffer.length / stride;\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", buffer, staticBuffer);\n if (!this.doNotSyncBoundingInfo) {\n this.thinInstanceRefreshBoundingInfo(false);\n }\n }\n else {\n this._thinInstanceDataStorage.instancesCount = 0;\n if (!this.doNotSyncBoundingInfo) {\n // mesh has no more thin instances, so need to recompute the bounding box because it's the regular mesh that will now be displayed\n this.refreshBoundingInfo();\n }\n }\n }\n else if (kind === \"previousMatrix\") {\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\n this._thinInstanceDataStorage.previousMatrixBuffer = null;\n this._thinInstanceDataStorage.previousMatrixData = buffer;\n if (buffer !== null) {\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", buffer, staticBuffer);\n }\n }\n else {\n // color for instanced mesh is ColorInstanceKind and not ColorKind because of native that needs to do the differenciation\n // hot switching kind here to preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n if (buffer === null) {\n if (this._userThinInstanceBuffersStorage?.data[kind]) {\n this.removeVerticesData(kind);\n delete this._userThinInstanceBuffersStorage.data[kind];\n delete this._userThinInstanceBuffersStorage.strides[kind];\n delete this._userThinInstanceBuffersStorage.sizes[kind];\n delete this._userThinInstanceBuffersStorage.vertexBuffers[kind];\n }\n }\n else {\n this._thinInstanceInitializeUserStorage();\n this._userThinInstanceBuffersStorage.data[kind] = buffer;\n this._userThinInstanceBuffersStorage.strides[kind] = stride;\n this._userThinInstanceBuffersStorage.sizes[kind] = buffer.length;\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), buffer, kind, !staticBuffer, false, stride, true);\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);\n }\n }\n};\nMesh.prototype.thinInstanceBufferUpdated = function (kind) {\n if (kind === \"matrix\") {\n if (this.thinInstanceAllowAutomaticStaticBufferRecreation && this._thinInstanceDataStorage.matrixBuffer && !this._thinInstanceDataStorage.matrixBuffer.isUpdatable()) {\n this._thinInstanceRecreateBuffer(kind);\n }\n this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount);\n }\n else if (kind === \"previousMatrix\") {\n if (this.thinInstanceAllowAutomaticStaticBufferRecreation &&\n this._thinInstanceDataStorage.previousMatrixBuffer &&\n !this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()) {\n this._thinInstanceRecreateBuffer(kind);\n }\n this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount);\n }\n else {\n // preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\n if (this.thinInstanceAllowAutomaticStaticBufferRecreation && !this._userThinInstanceBuffersStorage.vertexBuffers[kind].isUpdatable()) {\n this._thinInstanceRecreateBuffer(kind);\n }\n this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0);\n }\n }\n};\nMesh.prototype.thinInstancePartialBufferUpdate = function (kind, data, offset) {\n if (kind === \"matrix\") {\n if (this._thinInstanceDataStorage.matrixBuffer) {\n this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset);\n }\n }\n else {\n // preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {\n this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(data, offset);\n }\n }\n};\nMesh.prototype.thinInstanceGetWorldMatrices = function () {\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\n return [];\n }\n const matrixData = this._thinInstanceDataStorage.matrixData;\n if (!this._thinInstanceDataStorage.worldMatrices) {\n this._thinInstanceDataStorage.worldMatrices = [];\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\n this._thinInstanceDataStorage.worldMatrices[i] = Matrix.FromArray(matrixData, i * 16);\n }\n }\n return this._thinInstanceDataStorage.worldMatrices;\n};\nMesh.prototype.thinInstanceRefreshBoundingInfo = function (forceRefreshParentInfo = false, applySkeleton = false, applyMorph = false) {\n if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {\n return;\n }\n const vectors = this._thinInstanceDataStorage.boundingVectors;\n if (forceRefreshParentInfo || !this.rawBoundingInfo) {\n vectors.length = 0;\n this.refreshBoundingInfo(applySkeleton, applyMorph);\n const boundingInfo = this.getBoundingInfo();\n this.rawBoundingInfo = new BoundingInfo(boundingInfo.minimum, boundingInfo.maximum);\n }\n const boundingInfo = this.getBoundingInfo();\n const matrixData = this._thinInstanceDataStorage.matrixData;\n if (vectors.length === 0) {\n for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) {\n vectors.push(boundingInfo.boundingBox.vectors[v].clone());\n }\n }\n TmpVectors.Vector3[0].setAll(Number.POSITIVE_INFINITY); // min\n TmpVectors.Vector3[1].setAll(Number.NEGATIVE_INFINITY); // max\n for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {\n Matrix.FromArrayToRef(matrixData, i * 16, TmpVectors.Matrix[0]);\n for (let v = 0; v < vectors.length; ++v) {\n Vector3.TransformCoordinatesToRef(vectors[v], TmpVectors.Matrix[0], TmpVectors.Vector3[2]);\n TmpVectors.Vector3[0].minimizeInPlace(TmpVectors.Vector3[2]);\n TmpVectors.Vector3[1].maximizeInPlace(TmpVectors.Vector3[2]);\n }\n }\n boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]);\n this._updateBoundingInfo();\n};\nMesh.prototype._thinInstanceRecreateBuffer = function (kind, staticBuffer = true) {\n if (kind === \"matrix\") {\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", this._thinInstanceDataStorage.matrixData, staticBuffer);\n }\n else if (kind === \"previousMatrix\") {\n if (this._scene.needsPreviousWorldMatrices) {\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", this._thinInstanceDataStorage.previousMatrixData ?? this._thinInstanceDataStorage.matrixData, staticBuffer);\n }\n }\n else {\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, !staticBuffer, false, this._userThinInstanceBuffersStorage.strides[kind], true);\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);\n }\n};\nMesh.prototype._thinInstanceUpdateBufferSize = function (kind, numInstances = 1) {\n // preserve backward compatibility\n if (kind === VertexBuffer.ColorKind) {\n kind = VertexBuffer.ColorInstanceKind;\n }\n const kindIsMatrix = kind === \"matrix\";\n if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) {\n return;\n }\n const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind];\n const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind];\n let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind];\n const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride;\n let newSize = currentSize;\n while (newSize < bufferSize) {\n newSize *= 2;\n }\n if (!data || currentSize != newSize) {\n if (!data) {\n data = new Float32Array(newSize);\n }\n else {\n const newData = new Float32Array(newSize);\n newData.set(data, 0);\n data = newData;\n }\n if (kindIsMatrix) {\n this._thinInstanceDataStorage.matrixBuffer?.dispose();\n this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer(\"world\", data, false);\n this._thinInstanceDataStorage.matrixData = data;\n this._thinInstanceDataStorage.matrixBufferSize = newSize;\n if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) {\n this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();\n this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer(\"previousWorld\", data, false);\n }\n }\n else {\n this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();\n this._userThinInstanceBuffersStorage.data[kind] = data;\n this._userThinInstanceBuffersStorage.sizes[kind] = newSize;\n this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), data, kind, true, false, stride, true);\n this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);\n }\n }\n};\nMesh.prototype._thinInstanceInitializeUserStorage = function () {\n if (!this._userThinInstanceBuffersStorage) {\n this._userThinInstanceBuffersStorage = {\n data: {},\n sizes: {},\n vertexBuffers: {},\n strides: {},\n };\n }\n};\nMesh.prototype._disposeThinInstanceSpecificData = function () {\n if (this._thinInstanceDataStorage?.matrixBuffer) {\n this._thinInstanceDataStorage.matrixBuffer.dispose();\n this._thinInstanceDataStorage.matrixBuffer = null;\n }\n};\n//# sourceMappingURL=thinInstanceMesh.js.map"],"names":["Mesh","prototype","thinInstanceAdd","matrix","refresh","this","getScene","getEngine","getCaps","instancedArrays","Logger","Error","_thinInstanceUpdateBufferSize","Array","isArray","length","index","_thinInstanceDataStorage","instancesCount","i","thinInstanceSetMatrixAt","thinInstanceAddSelf","Matrix","IdentityReadOnly","thinInstanceRegisterAttribute","kind","stride","VertexBuffer","ColorKind","ColorInstanceKind","removeVerticesData","_thinInstanceInitializeUserStorage","_userThinInstanceBuffersStorage","strides","sizes","Math","max","data","Float32Array","vertexBuffers","setVerticesBuffer","matrixData","copyToArray","worldMatrices","thinInstanceBufferUpdated","doNotSyncBoundingInfo","thinInstanceRefreshBoundingInfo","thinInstanceSetAttributeAt","value","set","Object","defineProperty","get","source","enumerable","configurable","_thinInstanceCreateMatrixBuffer","buffer","staticBuffer","matrixBuffer","Buffer","createVertexBuffer","thinInstanceSetBuffer","dispose","matrixBufferSize","refreshBoundingInfo","previousMatrixBuffer","previousMatrixData","thinInstanceAllowAutomaticStaticBufferRecreation","isUpdatable","_thinInstanceRecreateBuffer","updateDirectly","thinInstancePartialBufferUpdate","offset","thinInstanceGetWorldMatrices","FromArray","forceRefreshParentInfo","applySkeleton","applyMorph","vectors","boundingVectors","rawBoundingInfo","boundingInfo","getBoundingInfo","BoundingInfo","minimum","maximum","v","boundingBox","push","clone","TmpVectors","Vector3","setAll","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","FromArrayToRef","TransformCoordinatesToRef","minimizeInPlace","maximizeInPlace","reConstruct","_updateBoundingInfo","_scene","needsPreviousWorldMatrices","numInstances","kindIsMatrix","currentSize","bufferSize","newSize","newData","_disposeThinInstanceSpecificData"],"mappings":"m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