@arcgis/core 4.28.0-next.20230821 → 4.28.0-next.20230823

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 (668) hide show
  1. package/Basemap.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/functions/geomasync.js +1 -1
  4. package/arcade/portalUtils.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0746319459dbcd3ab6f7.js +1 -0
  7. package/assets/esri/core/workers/chunks/{587437526ea77f764986.js → 0759d4ab9695096d2bbd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d0c4367a197b193e95d4.js → 10c014a6d8767ae8a666.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{5ffabd1a90c5b08109aa.js → 196937631ac20795e0ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e05b54a0b834b4e4268e.js → 1c2b69dfcd0db58150e2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1c2f7c95825fdac790be.js +1 -0
  12. package/assets/esri/core/workers/chunks/1f9c80815f90fd0886d7.js +1 -0
  13. package/assets/esri/core/workers/chunks/217910f88fe2c03e6bdd.js +1 -0
  14. package/assets/esri/core/workers/chunks/238966b2fc6cc3dfcc05.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c9f709d64954b3c1650.js +1 -0
  16. package/assets/esri/core/workers/chunks/35faede04d4539aab6e8.js +1 -0
  17. package/assets/esri/core/workers/chunks/3e3edcbacf8eaf275b97.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b78dc6cbe14e5817b4d9.js → 4968018bc693c053fdd2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{c35b850fbfcb28133235.js → 49a1ba3e7ea204adeddb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{12b8fe0374fa9ab4ca09.js → 49cf3ae224f56f45f65b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5330040eeacc9c03fbdb.js +1 -0
  22. package/assets/esri/core/workers/chunks/54aaa21144431b29b6ed.js +1 -0
  23. package/assets/esri/core/workers/chunks/{6c40f16e6d10321295d8.js → 5b13d28cf5efc312a21c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{d6c96a20e9640b433719.js → 67c6618339d323460d45.js} +57 -57
  25. package/assets/esri/core/workers/chunks/{dd86f43505b636eb41c0.js → 7714c16f9c8860efd461.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{752d389c7bdcbe7004dc.js → 83e0af5522a672c2c73b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{873111ddf4813cdd4903.js → 872d0d4bf364be43a92e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/8a784ddd5607f1ddbb5b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0cad2b991d0d0fd07846.js → 8c9c4162617f31e3f5f2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/8db3ee2931be5cca3f5e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{fd3920159ab9748402a2.js → 92350664e2719a9e860e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{ff755962fd1c771f5be5.js → a3b461174984a1cb92b3.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{dd4c6d000222798a0317.js → a47aff9c97c5ce52d0dc.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{028534e3d4e13c9ea687.js → a645f08a7678f2ca037c.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{d9fe6cfbc9ad2920ca9c.js → aca45e54ec925002df9a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{40ff0e7c948615b8bfc0.js → b07d32a60307d04391fc.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fdc703330bf194a48e0e.js → b086e798f43dacb0175f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/bd0b9647880cbbec95e2.js +1 -0
  39. package/assets/esri/core/workers/chunks/{ab420bacdd63ee8fbd8b.js → bf9b5e2803a5444bd944.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c58ca2685eb7e559f428.js → c0a2a737a3085690afc5.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e04e8af4224fff8c3ec3.js → c34615c0b7ad83d1ad24.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{05ab09713d599687afa3.js → d105ee2e394e2c48303c.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{ef03b78659c72de93076.js → d183144fa504064d23d3.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{4f5207abb034375927c7.js → d8495c6dcd4d9bec8dd6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1a485d63330f5e7fe4e3.js → dba61fa8cbb57dde54b2.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{8a306e3aa210861b8c17.js → deb0bd575c63d9dbcde5.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d0a2f9ca338b60f2ba2a.js → e302fe771d92ccf945a3.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{cb0a5bc6deaa98026bb5.js → ed0dea88b2865fc6e06b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/ed733eea5d065131b159.js +1 -0
  50. package/assets/esri/core/workers/chunks/{1c51c52fb2233153d7ae.js → f3ec53ee9567bb7e4d2f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{4922a0fed7cbc6895882.js → f701a5afa1b730c51a49.js} +1 -1
  52. package/assets/esri/t9n/common.json +1 -1
  53. package/assets/esri/t9n/common_ar.json +1 -1
  54. package/assets/esri/t9n/common_bg.json +1 -1
  55. package/assets/esri/t9n/common_ca.json +1 -1
  56. package/assets/esri/t9n/common_cs.json +1 -1
  57. package/assets/esri/t9n/common_da.json +1 -1
  58. package/assets/esri/t9n/common_de.json +1 -1
  59. package/assets/esri/t9n/common_el.json +1 -1
  60. package/assets/esri/t9n/common_en.json +1 -1
  61. package/assets/esri/t9n/common_es.json +1 -1
  62. package/assets/esri/t9n/common_et.json +1 -1
  63. package/assets/esri/t9n/common_fi.json +1 -1
  64. package/assets/esri/t9n/common_fr.json +1 -1
  65. package/assets/esri/t9n/common_he.json +1 -1
  66. package/assets/esri/t9n/common_hr.json +1 -1
  67. package/assets/esri/t9n/common_hu.json +1 -1
  68. package/assets/esri/t9n/common_id.json +1 -1
  69. package/assets/esri/t9n/common_it.json +1 -1
  70. package/assets/esri/t9n/common_ja.json +1 -1
  71. package/assets/esri/t9n/common_ko.json +1 -1
  72. package/assets/esri/t9n/common_lt.json +1 -1
  73. package/assets/esri/t9n/common_lv.json +1 -1
  74. package/assets/esri/t9n/common_nb.json +1 -1
  75. package/assets/esri/t9n/common_nl.json +1 -1
  76. package/assets/esri/t9n/common_pl.json +1 -1
  77. package/assets/esri/t9n/common_pt-BR.json +1 -1
  78. package/assets/esri/t9n/common_pt-PT.json +1 -1
  79. package/assets/esri/t9n/common_ro.json +1 -1
  80. package/assets/esri/t9n/common_ru.json +1 -1
  81. package/assets/esri/t9n/common_sk.json +1 -1
  82. package/assets/esri/t9n/common_sl.json +1 -1
  83. package/assets/esri/t9n/common_sr.json +1 -1
  84. package/assets/esri/t9n/common_sv.json +1 -1
  85. package/assets/esri/t9n/common_th.json +1 -1
  86. package/assets/esri/t9n/common_tr.json +1 -1
  87. package/assets/esri/t9n/common_uk.json +1 -1
  88. package/assets/esri/t9n/common_vi.json +1 -1
  89. package/assets/esri/t9n/common_zh-CN.json +1 -1
  90. package/assets/esri/t9n/common_zh-TW.json +1 -1
  91. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +10 -17
  92. package/assets/esri/themes/dark/main.css +1 -1
  93. package/assets/esri/themes/light/main.css +1 -1
  94. package/assets/esri/themes/light/view.css +1 -1
  95. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ar.json +1 -0
  96. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bg.json +1 -0
  97. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bs.json +1 -0
  98. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ca.json +1 -0
  99. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_cs.json +1 -0
  100. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_da.json +1 -0
  101. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_de.json +1 -0
  102. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_el.json +1 -0
  103. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_es.json +1 -0
  104. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_et.json +1 -0
  105. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fi.json +1 -0
  106. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fr.json +1 -0
  107. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_he.json +1 -0
  108. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hr.json +1 -0
  109. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hu.json +1 -0
  110. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_id.json +1 -0
  111. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_it.json +1 -0
  112. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ja.json +1 -0
  113. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ko.json +1 -0
  114. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lt.json +1 -0
  115. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lv.json +1 -0
  116. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nb.json +1 -0
  117. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nl.json +1 -0
  118. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pl.json +1 -0
  119. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-BR.json +1 -0
  120. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-PT.json +1 -0
  121. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ro.json +1 -0
  122. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ru.json +1 -0
  123. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sk.json +1 -0
  124. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sl.json +1 -0
  125. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sr.json +1 -0
  126. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sv.json +1 -0
  127. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_th.json +1 -0
  128. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_tr.json +1 -0
  129. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_uk.json +1 -0
  130. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_vi.json +1 -0
  131. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-CN.json +1 -0
  132. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-HK.json +1 -0
  133. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-TW.json +1 -0
  134. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  173. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  174. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  175. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  176. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  177. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  178. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  179. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  180. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  181. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  182. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  183. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  184. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  185. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  186. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  187. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  188. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  189. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  190. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  191. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  192. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  193. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  194. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  195. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  196. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  197. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  198. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  199. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  200. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  201. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  202. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  203. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  204. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  205. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  206. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  207. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  208. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  209. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  210. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  211. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  212. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  213. package/chunks/Clouds.glsl.js +1 -1
  214. package/chunks/CloudsComposition.glsl.js +2 -2
  215. package/chunks/ComponentShader.glsl.js +36 -36
  216. package/chunks/Fog.glsl.js +1 -1
  217. package/chunks/LaserlinePath.glsl.js +1 -1
  218. package/chunks/Laserlines.glsl.js +1 -1
  219. package/chunks/LineSeries.js +1 -1
  220. package/chunks/NativeLine.glsl.js +8 -20
  221. package/chunks/PointRenderer.glsl.js +1 -1
  222. package/chunks/Precipitation.glsl.js +2 -2
  223. package/chunks/SSAOBlur.glsl.js +1 -1
  224. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  225. package/chunks/ShadowCastVisualize.glsl.js +2 -2
  226. package/chunks/ShadowHighlight.glsl.js +1 -1
  227. package/chunks/Stars.glsl.js +1 -1
  228. package/chunks/Terrain.glsl.js +35 -35
  229. package/chunks/TextureOnly.glsl.js +1 -1
  230. package/chunks/Theme.js +1 -1
  231. package/chunks/boundedPlane.js +1 -1
  232. package/chunks/cameraUtilsPlanar.js +1 -1
  233. package/chunks/cameraUtilsSpherical.js +1 -1
  234. package/chunks/chartUtilsAm5.js +1 -1
  235. package/chunks/mat3.js +1 -1
  236. package/chunks/mat3f64.js +1 -1
  237. package/chunks/mat4.js +1 -1
  238. package/chunks/mat4f64.js +1 -1
  239. package/chunks/quat.js +1 -1
  240. package/chunks/quat2.js +1 -1
  241. package/chunks/quatf64.js +1 -1
  242. package/chunks/sphere.js +1 -1
  243. package/chunks/terrainUtilsPlanar.js +1 -1
  244. package/chunks/vec3.js +1 -1
  245. package/chunks/vec3f64.js +1 -1
  246. package/chunks/vec4.js +1 -1
  247. package/chunks/vec4f64.js +1 -1
  248. package/core/VectorStack.js +1 -1
  249. package/core/accessorSupport/decorators/persistable.js +1 -1
  250. package/core/accessorSupport/testSupport.js +1 -1
  251. package/core/colorUtils.js +1 -1
  252. package/core/libs/gl-matrix-2/factories/mat3f64.js +1 -1
  253. package/core/libs/gl-matrix-2/factories/mat4f64.js +1 -1
  254. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  255. package/core/libs/gl-matrix-2/factories/vec3f64.js +1 -1
  256. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  257. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  258. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  259. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  260. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  261. package/core/mathUtils.js +1 -1
  262. package/core/perspectiveUtils.js +1 -1
  263. package/form/elements/inputs/DatePickerInput.d.ts +4 -0
  264. package/form/elements/inputs/DatePickerInput.js +5 -0
  265. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +4 -0
  266. package/form/elements/inputs/DateTimeOffsetPickerInput.js +5 -0
  267. package/form/elements/inputs/TimePickerInput.d.ts +4 -0
  268. package/form/elements/inputs/TimePickerInput.js +5 -0
  269. package/form/elements/support/inputs.js +1 -1
  270. package/geometry/projection/computeTranslationToOriginAndRotation.js +1 -1
  271. package/geometry/projection/projectDirection.js +1 -1
  272. package/geometry/support/MeshTransform.js +1 -1
  273. package/geometry/support/axisAngle.js +1 -1
  274. package/geometry/support/axisAngleDegrees.js +1 -1
  275. package/geometry/support/clipRay.js +1 -1
  276. package/geometry/support/coordinateSystem.js +1 -1
  277. package/geometry/support/frustum.js +1 -1
  278. package/geometry/support/lineSegment.js +1 -1
  279. package/geometry/support/meshUtils/centerAt.js +1 -1
  280. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  281. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  282. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  283. package/geometry/support/meshUtils/georeference.js +1 -1
  284. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  285. package/geometry/support/meshUtils/merge.js +1 -1
  286. package/geometry/support/meshUtils/offset.js +1 -1
  287. package/geometry/support/meshUtils/primitives.js +1 -1
  288. package/geometry/support/meshUtils/projection.js +1 -1
  289. package/geometry/support/meshUtils/rotate.js +1 -1
  290. package/geometry/support/meshUtils/scale.js +1 -1
  291. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  292. package/geometry/support/plane.js +1 -1
  293. package/geometry/support/ray.js +1 -1
  294. package/geometry/support/triangle.js +1 -1
  295. package/geometry/support/vector.js +1 -1
  296. package/interfaces.d.ts +405 -7
  297. package/layers/VoxelWasmPerSceneView.js +1 -1
  298. package/layers/mixins/SceneService.js +1 -1
  299. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  300. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  301. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  302. package/layers/orientedImagery/transformations/utils.js +1 -1
  303. package/layers/support/ControlPointsGeoreference.js +1 -1
  304. package/layers/support/ImageElement.js +1 -1
  305. package/layers/support/SceneFilter.js +1 -1
  306. package/layers/support/layerUtils.js +1 -1
  307. package/layers/video/VideoCameraSensorModel.js +1 -1
  308. package/layers/voxel/VoxelVolume.js +1 -1
  309. package/layers/voxel/voxelPlaneUtils.js +1 -1
  310. package/package.json +1 -1
  311. package/portal/support/resourceExtension.js +1 -1
  312. package/portal/support/resourceUtils.js +1 -1
  313. package/portal/support/utils.js +5 -0
  314. package/smartMapping/popup/support/utils.js +1 -1
  315. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  316. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  317. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  318. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  319. package/support/revision.js +1 -1
  320. package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
  321. package/symbols/support/previewSymbol3D.js +1 -1
  322. package/views/2d/ViewState.js +1 -1
  323. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  324. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  325. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  326. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  327. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  328. package/views/2d/engine/webgl/Overlay.js +1 -1
  329. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  330. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  331. package/views/2d/engine/webgl/WGLTile.js +1 -1
  332. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  333. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  334. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  335. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  336. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  337. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  338. package/views/2d/layers/support/DebugOverlay.js +1 -1
  339. package/views/2d/navigation/actions/Pan.js +1 -1
  340. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  341. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  342. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  343. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  344. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  345. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  346. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  347. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  348. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  349. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  350. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  351. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  352. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  353. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  354. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  355. package/views/3d/analysis/images/Factory.js +5 -0
  356. package/views/3d/analysis/support/measurementUtils.js +1 -1
  357. package/views/3d/analysis/support/viewUtils.js +1 -1
  358. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  359. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  360. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  361. package/views/3d/camera/constraintUtils/common.js +1 -1
  362. package/views/3d/camera/constraintUtils/distance.js +1 -1
  363. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  364. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  365. package/views/3d/camera/intersectionUtils.js +1 -1
  366. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  367. package/views/3d/environment/CloudsGenerator.js +1 -1
  368. package/views/3d/environment/CloudsParameters.js +1 -1
  369. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  370. package/views/3d/environment/Fog.js +1 -1
  371. package/views/3d/environment/LocalAtmosphere.js +1 -1
  372. package/views/3d/environment/MarsAtmosphere.js +1 -1
  373. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  374. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  375. package/views/3d/environment/Stars.js +1 -1
  376. package/views/3d/environment/StarsTechnique.js +1 -1
  377. package/views/3d/externalRenderers.js +1 -1
  378. package/views/3d/glTF/internal/Resource.js +1 -1
  379. package/views/3d/interactive/Manipulator3D.js +1 -1
  380. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  381. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  382. package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
  383. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  384. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  385. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  386. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  387. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  388. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  389. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  390. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  391. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  392. package/views/3d/interactive/manipulatorUtils.js +1 -1
  393. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  394. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  395. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  396. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  397. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  398. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  399. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  400. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  401. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  402. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  403. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  404. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  405. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  406. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  407. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  408. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  409. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  410. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  411. package/views/3d/layers/I3SMeshView3D.js +1 -1
  412. package/views/3d/layers/MediaLayerView3D.js +1 -1
  413. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  414. package/views/3d/layers/PointCloudWorker.js +1 -1
  415. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  416. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  417. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  418. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  419. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  420. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  421. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  422. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  423. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  424. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  425. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  426. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  427. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  428. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  429. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  430. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  431. package/views/3d/layers/graphics/LabelParameters.js +1 -1
  432. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  433. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  434. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  435. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  436. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  437. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  438. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  439. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  440. package/views/3d/layers/i3s/I3SProjectionUtil.js +1 -1
  441. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  442. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  443. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  444. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  445. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  446. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  447. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  448. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  449. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  450. package/views/3d/layers/support/edgeUtils.js +1 -1
  451. package/views/3d/layers/support/patternUtils.js +1 -1
  452. package/views/3d/layers/support/uvUtils.js +1 -1
  453. package/views/3d/state/Frustum.js +1 -1
  454. package/views/3d/state/NearFarHeuristic.js +1 -1
  455. package/views/3d/state/ViewStateManager.js +1 -1
  456. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  457. package/views/3d/state/controllers/RotateController.js +1 -1
  458. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  459. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  460. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  461. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  462. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  463. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  464. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  465. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  466. package/views/3d/state/controllers/momentum/RotationMomentumController.js +1 -1
  467. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  468. package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
  469. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  470. package/views/3d/state/utils/navigationUtils.js +1 -1
  471. package/views/3d/state/utils/viewUtils.js +1 -1
  472. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  473. package/views/3d/support/LaserLineRenderer.js +1 -1
  474. package/views/3d/support/LaserlinePathData.js +1 -1
  475. package/views/3d/support/RenderCoordsHelper.js +1 -1
  476. package/views/3d/support/StreamTextureCollection.js +1 -1
  477. package/views/3d/support/TextureCollection.js +1 -1
  478. package/views/3d/support/cameraUtils.js +1 -1
  479. package/views/3d/support/cameraUtilsInternal.js +1 -1
  480. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  481. package/views/3d/support/geometryUtils/ray.js +1 -1
  482. package/views/3d/support/intersectionUtils.js +1 -1
  483. package/views/3d/support/mathUtils.js +1 -1
  484. package/views/3d/support/orientedBoundingBox.js +1 -1
  485. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  486. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  487. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  488. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  489. package/views/3d/support/sunUtils.js +1 -1
  490. package/views/3d/support/viewpointUtils.js +1 -1
  491. package/views/3d/terrain/Overlay.js +1 -1
  492. package/views/3d/terrain/OverlayContent.js +5 -0
  493. package/views/3d/terrain/OverlayManager.js +1 -1
  494. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchGeometry.js +1 -1
  497. package/views/3d/terrain/PatchRenderData.js +1 -1
  498. package/views/3d/terrain/SphericalPatch.js +1 -1
  499. package/views/3d/terrain/TerrainRenderer.js +1 -1
  500. package/views/3d/terrain/TerrainSurface.js +1 -1
  501. package/views/3d/terrain/TextureReference.js +1 -1
  502. package/views/3d/terrain/Tile.js +1 -1
  503. package/views/3d/terrain/TileCompositor.js +1 -1
  504. package/views/3d/terrain/TileOverlayData.js +1 -1
  505. package/views/3d/terrain/TileRenderInfo.js +1 -1
  506. package/views/3d/terrain/interfaces.js +1 -1
  507. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  508. package/views/3d/webgl-engine/Stage.js +1 -1
  509. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  510. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  511. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  512. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  514. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  515. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  516. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  517. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +1 -1
  518. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  519. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +32 -53
  520. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +6 -6
  521. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  522. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  523. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  524. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  525. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  526. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  527. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  528. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  529. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  530. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  531. package/views/3d/webgl-engine/lib/CascadeCamera.js +1 -1
  532. package/views/3d/webgl-engine/lib/ContentObject.js +1 -1
  533. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  534. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  535. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  536. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  537. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  538. package/views/3d/webgl-engine/lib/ITexture.js +5 -0
  539. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  540. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  541. package/views/3d/webgl-engine/lib/LocalOriginManager.js +1 -1
  542. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  543. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  544. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  545. package/views/3d/webgl-engine/lib/Path.js +1 -1
  546. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  547. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  548. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  549. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  550. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  551. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  552. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  553. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  554. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  555. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  556. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  557. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  558. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  559. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  560. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  561. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  562. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  563. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  564. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  565. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  566. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  567. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  568. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  569. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  570. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  571. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  572. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  573. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  574. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  575. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  576. package/views/3d/webgl-engine/materials/LineDrawParameters.js +1 -1
  577. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  578. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  579. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  580. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  581. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  582. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  583. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  584. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  585. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  586. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  587. package/views/3d/webgl-engine/parts/Model.js +1 -1
  588. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  589. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  590. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  591. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  592. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  593. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  594. package/views/GroundView.js +1 -1
  595. package/views/SceneView.js +1 -1
  596. package/views/draw/DrawManipulator.js +1 -1
  597. package/views/draw/support/createUtils.js +1 -1
  598. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  599. package/views/interactive/GraphicManipulator.js +1 -1
  600. package/views/interactive/ManipulatorCollection.js +1 -1
  601. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  602. package/views/interactive/coordinateHelper.js +1 -1
  603. package/views/interactive/dragEventPipeline.js +1 -1
  604. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  605. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  606. package/views/interactive/sketch/constraints.js +1 -1
  607. package/views/interactive/sketch/normalizedPoint.js +1 -1
  608. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  609. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  610. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  611. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  612. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  613. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  614. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  615. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  616. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  617. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  618. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  619. package/views/interactive/support/viewUtils.js +1 -1
  620. package/views/interactive/tooltip/constraintUtils.js +1 -1
  621. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  622. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  623. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  624. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  625. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  626. package/views/support/geometry3dUtils.js +1 -1
  627. package/views/support/layerViewUtils.js +1 -1
  628. package/webdoc/support/saveUtils.js +1 -1
  629. package/webscene/Slide.js +1 -1
  630. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  631. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  632. package/widgets/Editor/EditorViewModel.js +1 -1
  633. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  634. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  635. package/widgets/Editor/UpdateWorkflow.js +1 -1
  636. package/widgets/Editor/workflowUtils.js +1 -1
  637. package/widgets/Editor.js +1 -1
  638. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  639. package/widgets/ElevationProfile/support/constants.js +1 -1
  640. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  641. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  642. package/widgets/OrientedImageryViewer.js +1 -1
  643. package/widgets/Sketch.js +1 -1
  644. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +4 -0
  645. package/widgets/smartMapping/BinaryColorSizeSlider.d.ts +4 -0
  646. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  647. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  648. package/widgets/support/templateUtils.js +5 -0
  649. package/assets/esri/core/workers/chunks/19857e5420cdf23c5f2e.js +0 -1
  650. package/assets/esri/core/workers/chunks/26289742b9280f0b5247.js +0 -1
  651. package/assets/esri/core/workers/chunks/46f6b77e586d78aeb75c.js +0 -1
  652. package/assets/esri/core/workers/chunks/4e39252f40bc57be9d12.js +0 -1
  653. package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +0 -1
  654. package/assets/esri/core/workers/chunks/8dab0acdbbd5c282645a.js +0 -1
  655. package/assets/esri/core/workers/chunks/8e4b01a0cb8c8926f2b6.js +0 -1
  656. package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +0 -1
  657. package/assets/esri/core/workers/chunks/b2d4a56197dcabdbae35.js +0 -1
  658. package/assets/esri/core/workers/chunks/be0565d923afba7ca300.js +0 -1
  659. package/assets/esri/core/workers/chunks/c99fa4189a114370b004.js +0 -1
  660. package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +0 -1
  661. package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +0 -1
  662. package/assets/esri/core/workers/chunks/f67388c4b7103fda6633.js +0 -1
  663. package/views/3d/analysis/Slice/images/Factory.js +0 -5
  664. /package/assets/esri/views/3d/analysis/{Slice/images → images}/heading-rotate.ts.svg +0 -0
  665. /package/assets/esri/views/3d/analysis/{Slice/images → images}/tilt-rotate.ts.svg +0 -0
  666. /package/views/3d/analysis/{Slice/images → images}/generateTextures.js +0 -0
  667. /package/views/3d/analysis/{Slice/images → images}/heading-rotate-svg.js +0 -0
  668. /package/views/3d/analysis/{Slice/images → images}/tilt-rotate-svg.js +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{lerp as s}from"../../../core/mathUtils.js";import{releaseMaybe as i,disposeMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,initial as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{f as l}from"../../../chunks/mat3.js";import{v as d}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s as m,o as p,j as _}from"../../../chunks/vec2.js";import{a as f}from"../../../chunks/vec2f64.js";import{f as g,z as w}from"../../../chunks/vec3f32.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{C as x,a as v}from"../../../chunks/Clouds.glsl.js";import{CloudsTextureChannels as y,CloudsRenderingStages as C}from"./CloudsData.js";import{FadeMode as b}from"./CloudsParameters.js";import{cloudPresets as P}from"./CloudsPresets.js";import{CloudsTechnique as S}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as j,RayMarchingSteps as I}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as E}from"./NoiseTextureAtlas.js";import{BindParameters as M}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as D}from"../webgl-engine/lib/glUtil3D.js";import{TaskPriority as z,Task as U}from"../../support/Scheduler.js";import{TextureType as q,TextureWrapMode as F}from"../../webgl/enums.js";import{FramebufferObject as R}from"../../webgl/FramebufferObject.js";import{TextureDescriptor as A}from"../../webgl/TextureDescriptor.js";let B=class extends t{constructor(e){super(e),this._techniques=new Array,this._techniqueConfiguration=new j,this._bindParameters=new M(null,null),this._passParameters=new x,this._drawParameters=new v,this._weatherTile=f(),this._weatherTileCount=128,this._faceIndex=0,this._tileIndex=0,this.coverage=s(P.default.coverage[0],P.default.coverage[1],.5),this.density=s(P.default.density[0],P.default.density[1],.5),this.absorption=s(P.default.absorption[0],P.default.absorption[1],.5),this.cloudSize=s(P.default.cloudSize[0],P.default.cloudSize[1],.5),this.detailSize=s(P.default.detailSize[0],P.default.detailSize[1],.5),this.smoothness=s(P.default.smoothness[0],P.default.smoothness[1],.5),this.cloudHeight=s(P.default.cloudHeight[0],P.default.cloudHeight[1],.5),this.raymarchingSteps=P.default.raymarchingSteps,this._viewMatrix=c(),this._dirty=!1,this.running=!1,this._vao=D(e.context.renderContext.rctx)}_getTechnique(e){const t=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,s=t===y.RG?2*e:2*e+1,i=this._techniques[s];return i||(this._techniqueConfiguration.writeTextureChannels=t,this._techniqueConfiguration.steps=e,this._techniques[s]=new S({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[s])}updateWeatherTile(){const e=this.view.camera.position.latitude,t=this.view.camera.position.longitude;if(null==e||null==t)return;m(this._weatherTile,(e+90)/180,(t+180)/360);const s=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1));this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]=Math.floor(4*(this._weatherTileCount-s)*this._weatherTile[1]);let i=0,r=0;if(null!=this.view.environment&&"virtual"!==this.view.environment.lighting.type&&null!=this.view.environment.lighting.date){const e=new Date(this.view.environment.lighting.date);e.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),i=31*e.getUTCMonth()+e.getUTCDate(),r=e.getUTCFullYear()}this._weatherTile[0]=(this._weatherTile[0]+i)%(2*this._weatherTileCount),this._weatherTile[1]=(this._weatherTile[1]+r%100)%(4*this._weatherTileCount),p(this._passParameters.weatherTile,this._weatherTile)||this.setDirty()}initialize(){const e=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius,this.setDirty(),this.updateWeatherTile(),this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o((()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness,this.cloudHeight,this.raymarchingSteps]),(()=>this.setDirty()),n)])}destroy(){this._techniques.forEach((e=>i(e))),this._frameBufferCube=r(this._frameBufferCube),this._techniques.length=0,this._vao.dispose(),this._passParameters.noiseTexture=a(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case I.SIXTEEN:return 1;case I.HUNDRED:return 4;case I.COUNT:case I.TWOHUNDRED:return 8}}get usedMemory(){return(this._frameBufferCube?.gpuMemoryUsage??0)+(this._passParameters.noiseTexture?.textureAtlas?.gpuMemoryUsage??0)}_ensureNoiseTexture(){if(null!=this._passParameters.noiseTexture)this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);else{const e=this.context;this._passParameters.noiseTexture=new E({context:e}),this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile)}return null!=this._passParameters.noiseTexture.textureAtlas}_ensureFrameBufferCube(e){if(null==this._frameBufferCube){const t=new A(e);t.target=q.TEXTURE_CUBE_MAP,t.wrapMode=F.CLAMP_TO_EDGE,this._frameBufferCube=new R(this.context.renderContext.rctx,t)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=r(this._frameBufferCube)}applyPreset(e,t){const i=e.median,r=e=>{const r=s(e[0],e[1],i);return t<.5?s(e[0],r,2*t):s(r,e[1],2*(t-.5))};this.coverage=r(e.coverage),this.density=r(e.density),this.absorption=r(e.absorption),this.cloudSize=r(e.cloudSize),this.detailSize=r(e.detailSize),this.smoothness=r(e.smoothness),this.cloudHeight=r(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(e){0===this._faceIndex&&0===this._tileIndex&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),_(this._passParameters.weatherTile,this._weatherTile));const t=this._getTechnique(this._passParameters.raymarchingSteps);if(!t.compiled)return U.YIELD;if(this.context.renderContext.bindParameters.cloudsFade.fadeMode===b.CROSS_FADE||!this._ensureNoiseTexture())return U.YIELD;0===this._faceIndex&&0===this._tileIndex&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=C.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._dirty=!1);const s=this.context.renderContext.rctx,i=s.bindTechnique(t,this._passParameters,this._bindParameters);s.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao);const r=s.getViewport(),a=t.configuration.cubeMapSize,o=a/this._tilesPerFace,n=this._tileIndex*o;s.setViewport(0,n,a,o);const h=this._ensureFrameBufferCube(a);s.bindFramebuffer(h);const u=H[this._faceIndex],c=O[this._faceIndex];d(this._viewMatrix,N,u,c),l(this._drawParameters.viewMatrix,this._viewMatrix);const m=q.TEXTURE_CUBE_MAP_POSITIVE_X+this._faceIndex;return h.setColorTextureTarget(m),i.bindDraw(this._drawParameters,this._bindParameters,this._passParameters),s.gl.drawArrays(s.gl.TRIANGLE_STRIP,0,4),s.gl.flush(),s.setViewport(r.x,r.y,r.width,r.height),this.requestRender(),++this._tileIndex,4===this._faceIndex&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._faceIndex=0,this._tileIndex=0,this.running||(this.context.renderContext.bindParameters.cloudsFade.renderingStage=C.FADING)):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0),e.madeProgress(),U.YIELD}};e([h({constructOnly:!0})],B.prototype,"context",void 0),e([h({constructOnly:!0})],B.prototype,"view",void 0),e([h({constructOnly:!0})],B.prototype,"requestRender",void 0),e([h()],B.prototype,"coverage",void 0),e([h()],B.prototype,"density",void 0),e([h()],B.prototype,"absorption",void 0),e([h()],B.prototype,"cloudSize",void 0),e([h()],B.prototype,"detailSize",void 0),e([h()],B.prototype,"smoothness",void 0),e([h()],B.prototype,"cloudHeight",void 0),e([h()],B.prototype,"raymarchingSteps",void 0),e([h()],B.prototype,"running",void 0),B=e([u("esri.views.3d.environment.CloudsGenerator")],B);const H=[g(1,0,0),g(-1,0,0),g(0,1,0),g(0,-1,0),g(0,0,1)],O=[g(0,1,0),g(0,1,0),g(0,0,-1),g(0,0,1),g(0,1,0)],N=w();export{B as CloudsGenerator};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{lerp as s}from"../../../core/mathUtils.js";import{releaseMaybe as i,disposeMaybe as r,destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,initial as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{f as l}from"../../../chunks/mat3.js";import{v as d}from"../../../chunks/mat4.js";import{a as c}from"../../../chunks/mat4f64.js";import{s as m,o as p,j as _}from"../../../chunks/vec2.js";import{a as f}from"../../../chunks/vec2f64.js";import{f as g,z as w}from"../../../chunks/vec3f32.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{C as x,a as v}from"../../../chunks/Clouds.glsl.js";import{CloudsTextureChannels as y,CloudsRenderingStages as C}from"./CloudsData.js";import{FadeMode as b}from"./CloudsParameters.js";import{cloudPresets as P}from"./CloudsPresets.js";import{CloudsTechnique as S}from"./CloudsTechnique.js";import{CloudsTechniqueConfiguration as j,RayMarchingSteps as I}from"./CloudsTechniqueConfiguration.js";import{NoiseTextureAtlas as E}from"./NoiseTextureAtlas.js";import{BindParameters as M}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as D}from"../webgl-engine/lib/glUtil3D.js";import{TaskPriority as z,Task as U}from"../../support/Scheduler.js";import{TextureType as q,TextureWrapMode as F}from"../../webgl/enums.js";import{FramebufferObject as R}from"../../webgl/FramebufferObject.js";import{TextureDescriptor as A}from"../../webgl/TextureDescriptor.js";let B=class extends t{constructor(e){super(e),this._techniques=new Array,this._techniqueConfiguration=new j,this._bindParameters=new M(null,null),this._passParameters=new x,this._drawParameters=new v,this._weatherTile=f(),this._weatherTileCount=128,this._faceIndex=0,this._tileIndex=0,this.coverage=s(P.default.coverage[0],P.default.coverage[1],.5),this.density=s(P.default.density[0],P.default.density[1],.5),this.absorption=s(P.default.absorption[0],P.default.absorption[1],.5),this.cloudSize=s(P.default.cloudSize[0],P.default.cloudSize[1],.5),this.detailSize=s(P.default.detailSize[0],P.default.detailSize[1],.5),this.smoothness=s(P.default.smoothness[0],P.default.smoothness[1],.5),this.cloudHeight=s(P.default.cloudHeight[0],P.default.cloudHeight[1],.5),this.raymarchingSteps=P.default.raymarchingSteps,this._viewMatrix=c(),this._dirty=!1,this.running=!1,this._vao=D(e.context.renderContext.rctx)}_getTechnique(e){const t=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,s=t===y.RG?2*e:2*e+1,i=this._techniques[s];return i||(this._techniqueConfiguration.writeTextureChannels=t,this._techniqueConfiguration.steps=e,this._techniques[s]=new S({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[s])}updateWeatherTile(){const e=this.view.camera.position.latitude,t=this.view.camera.position.longitude;if(null==e||null==t)return;m(this._weatherTile,(e+90)/180,(t+180)/360);const s=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1));this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]=Math.floor(4*(this._weatherTileCount-s)*this._weatherTile[1]);let i=0,r=0;if(null!=this.view.environment&&"virtual"!==this.view.environment.lighting.type&&null!=this.view.environment.lighting.date){const e=new Date(this.view.environment.lighting.date);e.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),i=31*e.getUTCMonth()+e.getUTCDate(),r=e.getUTCFullYear()}this._weatherTile[0]=(this._weatherTile[0]+i)%(2*this._weatherTileCount),this._weatherTile[1]=(this._weatherTile[1]+r%100)%(4*this._weatherTileCount),p(this._passParameters.weatherTile,this._weatherTile)||this.setDirty()}initialize(){const e=T(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius,this.setDirty(),this.updateWeatherTile(),this.addHandles([this.view.resourceController.scheduler.registerTask(z.CLOUDS_GENERATOR,this),o((()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness,this.cloudHeight,this.raymarchingSteps]),(()=>this.setDirty()),n)])}destroy(){this._techniques.forEach((e=>i(e))),this._frameBufferCube=r(this._frameBufferCube),this._techniques.length=0,this._vao.dispose(),this._passParameters.noiseTexture=a(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case I.SIXTEEN:return 1;case I.HUNDRED:return 4;case I.COUNT:case I.TWOHUNDRED:return 8}}get usedMemory(){return(this._frameBufferCube?.gpuMemoryUsage??0)+(this._passParameters.noiseTexture?.textureAtlas?.gpuMemoryUsage??0)}_ensureNoiseTexture(){if(null!=this._passParameters.noiseTexture)this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);else{const e=this.context;this._passParameters.noiseTexture=new E({context:e}),this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile)}return null!=this._passParameters.noiseTexture.textureAtlas}_ensureFrameBufferCube(e){if(null==this._frameBufferCube){const t=new A(e);t.target=q.TEXTURE_CUBE_MAP,t.wrapMode=F.CLAMP_TO_EDGE,this._frameBufferCube=new R(this.context.renderContext.rctx,t)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=r(this._frameBufferCube)}applyPreset(e,t){const i=e.median,r=e=>{const r=s(e[0],e[1],i);return t<.5?s(e[0],r,2*t):s(r,e[1],2*(t-.5))};this.coverage=r(e.coverage),this.density=r(e.density),this.absorption=r(e.absorption),this.cloudSize=r(e.cloudSize),this.detailSize=r(e.detailSize),this.smoothness=r(e.smoothness),this.cloudHeight=r(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(e){0===this._faceIndex&&0===this._tileIndex&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),_(this._passParameters.weatherTile,this._weatherTile));const t=this._getTechnique(this._passParameters.raymarchingSteps);if(!t.compiled)return U.YIELD;if(this.context.renderContext.bindParameters.cloudsFade.fadeMode===b.CROSS_FADE||!this._ensureNoiseTexture())return U.YIELD;0===this._faceIndex&&0===this._tileIndex&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=C.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._dirty=!1);const s=this.context.renderContext.rctx,i=s.bindTechnique(t,this._passParameters,this._bindParameters);s.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao);const r=s.getViewport(),a=t.configuration.cubeMapSize,o=a/this._tilesPerFace,n=this._tileIndex*o;s.setViewport(0,n,a,o);const h=this._ensureFrameBufferCube(a);s.bindFramebuffer(h);const u=H[this._faceIndex],c=O[this._faceIndex];d(this._viewMatrix,N,u,c),l(this._drawParameters.viewMatrix,this._viewMatrix);const m=q.TEXTURE_CUBE_MAP_POSITIVE_X+this._faceIndex;return h.setColorTextureTarget(m),i.bindDraw(this._drawParameters,this._bindParameters,this._passParameters),s.gl.drawArrays(s.gl.TRIANGLE_STRIP,0,4),s.gl.flush(),s.setViewport(r.x,r.y,r.width,r.height),this.requestRender(),++this._tileIndex,4===this._faceIndex&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._faceIndex=0,this._tileIndex=0,this.running||(this.context.renderContext.bindParameters.cloudsFade.renderingStage=C.FADING)):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0),e.madeProgress(),U.YIELD}};e([h({constructOnly:!0})],B.prototype,"context",void 0),e([h({constructOnly:!0})],B.prototype,"view",void 0),e([h({constructOnly:!0})],B.prototype,"requestRender",void 0),e([h()],B.prototype,"coverage",void 0),e([h()],B.prototype,"density",void 0),e([h()],B.prototype,"absorption",void 0),e([h()],B.prototype,"cloudSize",void 0),e([h()],B.prototype,"detailSize",void 0),e([h()],B.prototype,"smoothness",void 0),e([h()],B.prototype,"cloudHeight",void 0),e([h()],B.prototype,"raymarchingSteps",void 0),e([h()],B.prototype,"running",void 0),B=e([u("esri.views.3d.environment.CloudsGenerator")],B);const H=[g(1,0,0),g(-1,0,0),g(0,1,0),g(0,-1,0),g(0,0,1)],O=[g(0,1,0),g(0,1,0),g(0,0,-1),g(0,0,1),g(0,1,0)],N=w();export{B as CloudsGenerator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../core/mathUtils.js";import{e as a}from"../../../chunks/mat4.js";import{I as i,c as s}from"../../../chunks/mat4f64.js";import{l as e,n as o,b as r,g as h,i as n}from"../../../chunks/vec3.js";import{c as d,f as c}from"../../../chunks/vec3f64.js";import{create as F,fromPoints as p,axis as f}from"../../../geometry/support/axisAngleDegrees.js";import{earth as l}from"../../../geometry/support/Ellipsoid.js";import{CloudsTextureChannels as u,CloudsRenderingStages as _,ensureClouds as D}from"./CloudsData.js";import{weatherHeightLimit as E}from"./weather.js";import{RenderState as m}from"../../support/RenderState.js";class A{constructor(){this.readChannels=u.RG,this.renderingStage=_.FINISHED,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=d(),this.parallax=new C,this.parallaxNew=new C,this.pointOnGround=d(),this.fadeMode=O.HIDE,this.fadeFactor=0,this.opacity=0}updateParallax(t){const s=this.parallax,o=e(t.eye);if(s.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(o*o-l.radius*l.radius,0))/o,p(S,s.anchorPointClouds,g),a(s.transform,i,g[3],f(g)),this.fadeMode===O.CROSS_FADE){const t=this.parallaxNew;p(S,t.anchorPointClouds,g),a(t.transform,i,g[3],f(g))}}updateFading(t,a,i,s){this.isFading&&this._advanceFading(i,s),this._evaluateFading(t,a,i)}_evaluateFading(t,a,i){const s=t.relativeElevation,e=this._calculateDistanceToAnchorPoint(t);if((s>1.7*E||s<-E||e>v)&&this.opacity>0)this._setFade(O.HIDE,i);else if(!this.isFading)if((s>E||s<-.35*E||e>M)&&this.opacity>0)this._setFade(O.FADE_OUT,i);else if(s<=E&&s>=-.35*E&&a===m.IDLE&&D(this.data)){if(0===this.opacity)return void this._setFade(O.FADE_IN,i);(e>y||this.renderingStage===_.FADING)&&this._setFade(O.CROSS_FADE,i)}}_advanceFading(t,a){this._switchReadChannels(),this._updateAnchorPoint(),this._advanceFadingFactorAndOpacity(t,a)}_advanceFadingFactorAndOpacity(a,i){if(this.fadeFactor<1)return this.fadeFactor=i?t((a-this.startTime)/(I*i),0,1):1,this.fadeMode===O.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===O.FADE_IN&&(this.opacity=this.fadeFactor),void(this.fadeMode===O.CROSS_FADE&&(this.opacity=1));this.fadeFactor=0,this.fadeMode===O.FADE_OUT&&(this.opacity=0),this.fadeMode===O.FADE_IN&&(this.opacity=1),this.fadeMode===O.CROSS_FADE&&(this.opacity=1),this.fadeMode=O.NONE}_switchReadChannels(){const t=this.fadeMode===O.CROSS_FADE&&1===this.fadeFactor,a=this.fadeMode===O.FADE_IN&&0===this.fadeFactor;this.renderingStage===_.FADING&&(t||a)&&(this.readChannels=1-this.readChannels,this.renderingStage=_.FINISHED)}_calculateDistanceToAnchorPoint(t){return o(this.pointOnGround,t.eye),r(this.pointOnGround,this.pointOnGround,l.radius),e(h(N,this.parallax.anchorPointClouds,this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===O.CROSS_FADE&&(0===this.fadeFactor&&n(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&n(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds)),this.fadeMode===O.FADE_IN&&0===this.fadeFactor&&n(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(t,a){switch(t){case O.HIDE:this.opacity=0;break;case O.FADE_OUT:this.opacity=1;break;case O.FADE_IN:this.opacity=0;break;case O.CROSS_FADE:this.opacity=1}this.fadeMode=t,this.fadeFactor=0,this.startTime=a}get isFading(){return this.fadeMode===O.FADE_OUT||this.fadeMode===O.FADE_IN||this.fadeMode===O.CROSS_FADE}}var O;!function(t){t[t.NONE=0]="NONE",t[t.HIDE=1]="HIDE",t[t.FADE_OUT=2]="FADE_OUT",t[t.FADE_IN=3]="FADE_IN",t[t.CROSS_FADE=4]="CROSS_FADE"}(O||(O={}));class C{constructor(){this.anchorPointClouds=d(),this.radiusCurvatureCorrectionFactor=0,this.transform=s()}}const S=c(0,0,1),g=F(),N=d(),I=1.25,y=34e3,M=64e3,v=2e5;export{A as CloudsParameters,O as FadeMode,y as crossFadeDistanceThreshold,M as fadeOutDistanceThreshold,v as hideDistanceThreshold};
5
+ import{clamp as t}from"../../../core/mathUtils.js";import{k as a}from"../../../chunks/mat4.js";import{I as i,a as s}from"../../../chunks/mat4f64.js";import{l as e,n as o,i as r,f as h,c as n}from"../../../chunks/vec3.js";import{c as d,f as c}from"../../../chunks/vec3f64.js";import{create as F,fromPoints as f,axis as p}from"../../../geometry/support/axisAngleDegrees.js";import{earth as l}from"../../../geometry/support/Ellipsoid.js";import{CloudsTextureChannels as u,CloudsRenderingStages as _,ensureClouds as D}from"./CloudsData.js";import{weatherHeightLimit as E}from"./weather.js";import{RenderState as m}from"../../support/RenderState.js";class A{constructor(){this.readChannels=u.RG,this.renderingStage=_.FINISHED,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=d(),this.parallax=new C,this.parallaxNew=new C,this.pointOnGround=d(),this.fadeMode=O.HIDE,this.fadeFactor=0,this.opacity=0}updateParallax(t){const s=this.parallax,o=e(t.eye);if(s.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(o*o-l.radius*l.radius,0))/o,f(S,s.anchorPointClouds,g),a(s.transform,i,g[3],p(g)),this.fadeMode===O.CROSS_FADE){const t=this.parallaxNew;f(S,t.anchorPointClouds,g),a(t.transform,i,g[3],p(g))}}updateFading(t,a,i,s){this.isFading&&this._advanceFading(i,s),this._evaluateFading(t,a,i)}_evaluateFading(t,a,i){const s=t.relativeElevation,e=this._calculateDistanceToAnchorPoint(t);if((s>1.7*E||s<-E||e>v)&&this.opacity>0)this._setFade(O.HIDE,i);else if(!this.isFading)if((s>E||s<-.35*E||e>M)&&this.opacity>0)this._setFade(O.FADE_OUT,i);else if(s<=E&&s>=-.35*E&&a===m.IDLE&&D(this.data)){if(0===this.opacity)return void this._setFade(O.FADE_IN,i);(e>y||this.renderingStage===_.FADING)&&this._setFade(O.CROSS_FADE,i)}}_advanceFading(t,a){this._switchReadChannels(),this._updateAnchorPoint(),this._advanceFadingFactorAndOpacity(t,a)}_advanceFadingFactorAndOpacity(a,i){if(this.fadeFactor<1)return this.fadeFactor=i?t((a-this.startTime)/(I*i),0,1):1,this.fadeMode===O.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===O.FADE_IN&&(this.opacity=this.fadeFactor),void(this.fadeMode===O.CROSS_FADE&&(this.opacity=1));this.fadeFactor=0,this.fadeMode===O.FADE_OUT&&(this.opacity=0),this.fadeMode===O.FADE_IN&&(this.opacity=1),this.fadeMode===O.CROSS_FADE&&(this.opacity=1),this.fadeMode=O.NONE}_switchReadChannels(){const t=this.fadeMode===O.CROSS_FADE&&1===this.fadeFactor,a=this.fadeMode===O.FADE_IN&&0===this.fadeFactor;this.renderingStage===_.FADING&&(t||a)&&(this.readChannels=1-this.readChannels,this.renderingStage=_.FINISHED)}_calculateDistanceToAnchorPoint(t){return o(this.pointOnGround,t.eye),r(this.pointOnGround,this.pointOnGround,l.radius),e(h(N,this.parallax.anchorPointClouds,this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===O.CROSS_FADE&&(0===this.fadeFactor&&n(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&n(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds)),this.fadeMode===O.FADE_IN&&0===this.fadeFactor&&n(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(t,a){switch(t){case O.HIDE:this.opacity=0;break;case O.FADE_OUT:this.opacity=1;break;case O.FADE_IN:this.opacity=0;break;case O.CROSS_FADE:this.opacity=1}this.fadeMode=t,this.fadeFactor=0,this.startTime=a}get isFading(){return this.fadeMode===O.FADE_OUT||this.fadeMode===O.FADE_IN||this.fadeMode===O.CROSS_FADE}}var O;!function(t){t[t.NONE=0]="NONE",t[t.HIDE=1]="HIDE",t[t.FADE_OUT=2]="FADE_OUT",t[t.FADE_IN=3]="FADE_IN",t[t.CROSS_FADE=4]="CROSS_FADE"}(O||(O={}));class C{constructor(){this.anchorPointClouds=d(),this.radiusCurvatureCorrectionFactor=0,this.transform=s()}}const S=c(0,0,1),g=F(),N=d(),I=1.25,y=34e3,M=64e3,v=2e5;export{A as CloudsParameters,O as FadeMode,y as crossFadeDistanceThreshold,M as fadeOutDistanceThreshold,v as hideDistanceThreshold};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{lerp as t}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a,sync as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{l,i as d,f as p}from"../../../chunks/vec3.js";import{f as u}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import{isMoon as _,isEarth as c,isMars as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{AtmosphereType as f}from"./AtmosphereType.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as P}from"./CloudsComposition.js";import{isReadyCloudsData as v,CloudsRenderingStages as b}from"./CloudsData.js";import{CloudsGenerator as R}from"./CloudsGenerator.js";import{FadeMode as A}from"./CloudsParameters.js";import{cloudPresets as x}from"./CloudsPresets.js";import{Fog as F,FogParameters as N}from"./Fog.js";import{LocalAtmosphere as C}from"./LocalAtmosphere.js";import E from"./MarsAtmosphere.js";import{Precipitation as j}from"./Precipitation.js";import{Stars as W}from"./Stars.js";import{weatherHeightLimit as S}from"./weather.js";import{ShaderOutput as O}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as M}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as T}from"../webgl-engine/lib/RenderSlot.js";import{Update as z}from"../webgl-engine/lib/Update.js";var L;let U=L=class extends M{constructor(e){super(e),this.renderSlots=[T.POSTPROCESSING_ENVIRONMENT_OPAQUE,T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT],this._context=null,this._atmosphere=null,this._oldWeatherParameters=new I,this._newWeatherParameters=new I,this._fadedWeatherParameters=new I,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:f.None}produces(){return!(null===this._atmosphere&&null===this._stars)}consumes(e){return e===O.Depth&&this._atmosphereType===f.Realistic}updateAnimation(e){return null!=this._precipitation&&this._precipitation.update(e)}get updating(){return null!=this._stars&&this._stars.updating||null!=this._clouds&&this._clouds.running}get weatherVisible(){return l(this.view.state.camera.eye)-m(this.view.spatialReference).radius<=S}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,r=this._get("_stars");return t&&null!=this._context?null!=r?r:new W({view:e,requestRender:()=>this._setNeedsRender()}):(s(r),null)}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||null==this._context)return s(e),null;const t=this.view,r=this._context;return null!=e&&e.context===r?e:(s(e),new j({context:r,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context;return s(e),new R({context:r,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return s(e),null;const t=this.view.state.viewingMode,r=this._context.renderContext.rctx,i=m(this.view.spatialReference).radius;return null!=e&&e.viewingMode===t&&e.planetRadius===i?e:(s(e),new P({rctx:r,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context,i=this._context.renderContext.rctx,a=this.view.state.viewingMode;return new F({context:r,view:t,rctx:i,viewingMode:a})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e;const t=()=>this._setNeedsRender();this.addHandles([r((()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled})),(e=>this._updateAtmosphere(e)),i),r((()=>this._stars),t),r((()=>this._precipitation),t),r((()=>this._clouds),(()=>this._updateWeather()),a),r((()=>this._fog),(()=>this._updateFogHaze()),a),r((()=>this.view.state.mode),(()=>{this._setNeedsRender()}),o),r((()=>this._weatherUpdateParameters),(()=>{this._updateWeather(),this._updateFogHaze()}),i)])}uninitializeRenderContext(){this._context=null,this._atmosphere=s(this._atmosphere),this._set("_stars",s(this._stars)),this._set("_precipitation",s(this._precipitation)),this._set("_clouds",s(this._clouds)),this._set("_cloudsComposition",s(this._cloudsComposition)),this._set("_fog",s(this._fog))}prepareRender(e){e.bindParameters.cloudsFade.data=v(this._clouds)?this._clouds:null,"local"!==this.view.viewingMode&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&(this._updateWeatherFading(e.bindParameters,e.time),e.bindParameters.cloudsFade.renderingStage===b.FINISHED&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),e.bindParameters.cloudsFade.data=null))}render(e){if(e.output===O.Color)switch(e.bindParameters.slot){case T.POSTPROCESSING_ENVIRONMENT_OPAQUE:null!=this._stars&&this._stars.render(e),null!=this.atmosphere&&(this.atmosphere.render(e,this.view?._stage?.renderer?.fullResolutionAtmosphere),null!=this._cloudsComposition&&null!=e.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(e)),e.bindParameters.cloudsFade.isFading&&null!=this._context&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(null!=this.atmosphere&&(this.atmosphere.renderHaze(e,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._weatherParameters.fog.amount>0&&null!=this._fog&&this._fog.render(e,this._weatherParameters.fog),null!=this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}updateLightSources(e,t,s,r){if(null!=this._context){const i=this._context.renderContext;i.bindParameters.oldLighting.copyFrom(i.bindParameters.lighting),i.bindParameters.newLighting.noonFactor=t,i.bindParameters.newLighting.globalFactor=s,i.bindParameters.newLighting.set(e);r===z.Faded||i.bindParameters.weatherFading?i.bindParameters.fadeLighting(0):i.bindParameters.fadeLighting(1),this._context.requestRender()}}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return null==e?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeatherFading(e,t){e.cloudsFade.updateFading(e.camera,this.view.state.mode,t,this.view.qualitySettings.fadeDuration),e.cloudsFade.updateParallax(e.camera),e.weatherFading&&(this._updateLighting(e),this._updateFogAtmoshpere(e))}_updateLighting(e){e.cloudsFade.fadeMode!==A.CROSS_FADE&&e.cloudsFade.fadeMode!==A.FADE_IN?e.fadeLighting(0):e.fadeLighting(e.cloudsFade.fadeFactor)}_updateFogAtmoshpere(e){e.cloudsFade.fadeMode!==A.CROSS_FADE&&e.cloudsFade.fadeMode!==A.FADE_IN?this._fadeWeather(0):this._fadeWeather(e.cloudsFade.fadeFactor)}_fadeWeather(e){const{_newWeatherParameters:t,_oldWeatherParameters:s}=this;e>=1?this._weatherParameters=t:(this._fadedWeatherParameters.lerp(s,t,e),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const e=this._weatherUpdateParameters;null!=e&&null!=this._clouds&&(this._clouds.applyPreset(x[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){null!=this._context&&this._context.requestRender()}_updateFogHaze(){const e=this._weatherUpdateParameters;if(null==this._fog||null==e||null==this._context)return;const s=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),e.type){case"foggy":this._newWeatherParameters.fog.strength=t(3e-5,.005,e.weatherAdjustment**3),d(this._newWeatherParameters.fog.color,V),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,D),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,V),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}s.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(e){const t=this._selectAtmosphereType(e);if(t!==f.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==t){this._atmosphere=s(this._atmosphere);const e=this._getAtmosphereClass(t);e&&(this._atmosphere=new e(this.view,this._context))}}else this._atmosphere=s(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(e){switch(e){case f.Realistic:return y;case f.Local:return C;case f.Mars:return E;default:case f.None:return null}}_selectAtmosphereType(e){const{enabled:t,viewingMode:s}=e;return!t||_(this.view.spatialReference)?f.None:s===w.Local?f.Local:null!=this._context&&y.isSupported(this._context)&&c(this.view.spatialReference)?f.Realistic:g(this.view.spatialReference)?f.Mars:f.None}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),stubGetAtmosphereClass:e=>{k=L.prototype._getAtmosphereClass,L.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{L.prototype._getAtmosphereClass=k}}}};e([n({constructOnly:!0})],U.prototype,"view",void 0),e([n({readOnly:!0})],U.prototype,"atmosphere",null),e([n({readOnly:!0})],U.prototype,"_atmosphereType",null),e([n({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([n({readOnly:!0})],U.prototype,"weatherVisible",null),e([n()],U.prototype,"_context",void 0),e([n()],U.prototype,"_atmosphere",void 0),e([n({readOnly:!0})],U.prototype,"_stars",null),e([n({readOnly:!0})],U.prototype,"_precipitation",null),e([n({readOnly:!0})],U.prototype,"_clouds",null),e([n({readOnly:!0})],U.prototype,"_cloudsComposition",null),e([n({readOnly:!0})],U.prototype,"_fog",null),e([n({readOnly:!0})],U.prototype,"weatherEnabled",null),e([n({readOnly:!0})],U.prototype,"_precipitationEnabled",null),e([n({readOnly:!0})],U.prototype,"_weatherUpdateParameters",null),U=L=e([h("esri.views.3d.environment.EnvironmentRenderer")],U);class I{constructor(){this.fog=new N,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,d(this.fog.color,e.fog.color)}lerp(e,s,r){this.fog.amount=t(e.fog.amount,s.fog.amount,r),this.hazeAmount=t(e.hazeAmount,s.hazeAmount,r),this.fog.strength=t(e.fog.strength,s.fog.strength,r),p(this.fog.color,e.fog.color,s.fog.color,r)}}const D=u(.5,.5,.5),V=u(1.5,1.5,1.5);let k;export{U as EnvironmentRenderer,I as WeatherParameters};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{lerp as t}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a,sync as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{l,c as d,p}from"../../../chunks/vec3.js";import{f as u}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import{isMoon as c,isEarth as _,isMars as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{AtmosphereType as f}from"./AtmosphereType.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as P}from"./CloudsComposition.js";import{isReadyCloudsData as v,CloudsRenderingStages as b}from"./CloudsData.js";import{CloudsGenerator as R}from"./CloudsGenerator.js";import{FadeMode as A}from"./CloudsParameters.js";import{cloudPresets as x}from"./CloudsPresets.js";import{Fog as F,FogParameters as N}from"./Fog.js";import{LocalAtmosphere as C}from"./LocalAtmosphere.js";import E from"./MarsAtmosphere.js";import{Precipitation as j}from"./Precipitation.js";import{Stars as W}from"./Stars.js";import{weatherHeightLimit as S}from"./weather.js";import{ShaderOutput as O}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as M}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as T}from"../webgl-engine/lib/RenderSlot.js";import{Update as z}from"../webgl-engine/lib/Update.js";var L;let U=L=class extends M{constructor(e){super(e),this.renderSlots=[T.POSTPROCESSING_ENVIRONMENT_OPAQUE,T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT],this._context=null,this._atmosphere=null,this._oldWeatherParameters=new I,this._newWeatherParameters=new I,this._fadedWeatherParameters=new I,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:f.None}produces(){return!(null===this._atmosphere&&null===this._stars)}consumes(e){return e===O.Depth&&this._atmosphereType===f.Realistic}updateAnimation(e){return null!=this._precipitation&&this._precipitation.update(e)}get updating(){return null!=this._stars&&this._stars.updating||null!=this._clouds&&this._clouds.running}get weatherVisible(){return l(this.view.state.camera.eye)-m(this.view.spatialReference).radius<=S}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,r=this._get("_stars");return t&&null!=this._context?null!=r?r:new W({view:e,requestRender:()=>this._setNeedsRender()}):(s(r),null)}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||null==this._context)return s(e),null;const t=this.view,r=this._context;return null!=e&&e.context===r?e:(s(e),new j({context:r,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context;return s(e),new R({context:r,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return s(e),null;const t=this.view.state.viewingMode,r=this._context.renderContext.rctx,i=m(this.view.spatialReference).radius;return null!=e&&e.viewingMode===t&&e.planetRadius===i?e:(s(e),new P({rctx:r,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context,i=this._context.renderContext.rctx,a=this.view.state.viewingMode;return new F({context:r,view:t,rctx:i,viewingMode:a})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e;const t=()=>this._setNeedsRender();this.addHandles([r((()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled})),(e=>this._updateAtmosphere(e)),i),r((()=>this._stars),t),r((()=>this._precipitation),t),r((()=>this._clouds),(()=>this._updateWeather()),a),r((()=>this._fog),(()=>this._updateFogHaze()),a),r((()=>this.view.state.mode),(()=>{this._setNeedsRender()}),o),r((()=>this._weatherUpdateParameters),(()=>{this._updateWeather(),this._updateFogHaze()}),i)])}uninitializeRenderContext(){this._context=null,this._atmosphere=s(this._atmosphere),this._set("_stars",s(this._stars)),this._set("_precipitation",s(this._precipitation)),this._set("_clouds",s(this._clouds)),this._set("_cloudsComposition",s(this._cloudsComposition)),this._set("_fog",s(this._fog))}prepareRender(e){e.bindParameters.cloudsFade.data=v(this._clouds)?this._clouds:null,"local"!==this.view.viewingMode&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&(this._updateWeatherFading(e.bindParameters,e.time),e.bindParameters.cloudsFade.renderingStage===b.FINISHED&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),e.bindParameters.cloudsFade.data=null))}render(e){if(e.output===O.Color)switch(e.bindParameters.slot){case T.POSTPROCESSING_ENVIRONMENT_OPAQUE:null!=this._stars&&this._stars.render(e),null!=this.atmosphere&&(this.atmosphere.render(e,this.view?._stage?.renderer?.fullResolutionAtmosphere),null!=this._cloudsComposition&&null!=e.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(e)),e.bindParameters.cloudsFade.isFading&&null!=this._context&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(null!=this.atmosphere&&(this.atmosphere.renderHaze(e,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._weatherParameters.fog.amount>0&&null!=this._fog&&this._fog.render(e,this._weatherParameters.fog),null!=this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}updateLightSources(e,t,s,r){if(null!=this._context){const i=this._context.renderContext;i.bindParameters.oldLighting.copyFrom(i.bindParameters.lighting),i.bindParameters.newLighting.noonFactor=t,i.bindParameters.newLighting.globalFactor=s,i.bindParameters.newLighting.set(e);r===z.Faded||i.bindParameters.weatherFading?i.bindParameters.fadeLighting(0):i.bindParameters.fadeLighting(1),this._context.requestRender()}}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return null==e?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeatherFading(e,t){e.cloudsFade.updateFading(e.camera,this.view.state.mode,t,this.view.qualitySettings.fadeDuration),e.cloudsFade.updateParallax(e.camera),e.weatherFading&&(this._updateLighting(e),this._updateFogAtmoshpere(e))}_updateLighting(e){e.cloudsFade.fadeMode!==A.CROSS_FADE&&e.cloudsFade.fadeMode!==A.FADE_IN?e.fadeLighting(0):e.fadeLighting(e.cloudsFade.fadeFactor)}_updateFogAtmoshpere(e){e.cloudsFade.fadeMode!==A.CROSS_FADE&&e.cloudsFade.fadeMode!==A.FADE_IN?this._fadeWeather(0):this._fadeWeather(e.cloudsFade.fadeFactor)}_fadeWeather(e){const{_newWeatherParameters:t,_oldWeatherParameters:s}=this;e>=1?this._weatherParameters=t:(this._fadedWeatherParameters.lerp(s,t,e),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const e=this._weatherUpdateParameters;null!=e&&null!=this._clouds&&(this._clouds.applyPreset(x[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){null!=this._context&&this._context.requestRender()}_updateFogHaze(){const e=this._weatherUpdateParameters;if(null==this._fog||null==e||null==this._context)return;const s=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),e.type){case"foggy":this._newWeatherParameters.fog.strength=t(3e-5,.005,e.weatherAdjustment**3),d(this._newWeatherParameters.fog.color,V),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,D),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,V),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}s.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(e){const t=this._selectAtmosphereType(e);if(t!==f.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==t){this._atmosphere=s(this._atmosphere);const e=this._getAtmosphereClass(t);e&&(this._atmosphere=new e(this.view,this._context))}}else this._atmosphere=s(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(e){switch(e){case f.Realistic:return y;case f.Local:return C;case f.Mars:return E;default:case f.None:return null}}_selectAtmosphereType(e){const{enabled:t,viewingMode:s}=e;return!t||c(this.view.spatialReference)?f.None:s===w.Local?f.Local:null!=this._context&&y.isSupported(this._context)&&_(this.view.spatialReference)?f.Realistic:g(this.view.spatialReference)?f.Mars:f.None}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),stubGetAtmosphereClass:e=>{k=L.prototype._getAtmosphereClass,L.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{L.prototype._getAtmosphereClass=k}}}};e([n({constructOnly:!0})],U.prototype,"view",void 0),e([n({readOnly:!0})],U.prototype,"atmosphere",null),e([n({readOnly:!0})],U.prototype,"_atmosphereType",null),e([n({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([n({readOnly:!0})],U.prototype,"weatherVisible",null),e([n()],U.prototype,"_context",void 0),e([n()],U.prototype,"_atmosphere",void 0),e([n({readOnly:!0})],U.prototype,"_stars",null),e([n({readOnly:!0})],U.prototype,"_precipitation",null),e([n({readOnly:!0})],U.prototype,"_clouds",null),e([n({readOnly:!0})],U.prototype,"_cloudsComposition",null),e([n({readOnly:!0})],U.prototype,"_fog",null),e([n({readOnly:!0})],U.prototype,"weatherEnabled",null),e([n({readOnly:!0})],U.prototype,"_precipitationEnabled",null),e([n({readOnly:!0})],U.prototype,"_weatherUpdateParameters",null),U=L=e([h("esri.views.3d.environment.EnvironmentRenderer")],U);class I{constructor(){this.fog=new N,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,d(this.fog.color,e.fog.color)}lerp(e,s,r){this.fog.amount=t(e.fog.amount,s.fog.amount,r),this.hazeAmount=t(e.hazeAmount,s.hazeAmount,r),this.fog.strength=t(e.fog.strength,s.fog.strength,r),p(this.fog.color,e.fog.color,s.fog.color,r)}}const D=u(.5,.5,.5),V=u(1.5,1.5,1.5);let k;export{U as EnvironmentRenderer,I as WeatherParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{smoothstep as s}from"../../../core/mathUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{n as i,d as a,b as n,f as c,l as p}from"../../../chunks/vec3.js";import{c as m}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{atmosphereHeight as u}from"./atmosphereUtils.js";import{F as d}from"../../../chunks/Fog.glsl.js";import{FogTechnique as l}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{Pos2Tex as f}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as _}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as j}from"../../webgl/enums.js";const b=.95,y=1;let v=class extends e{constructor(t){super(t),this._passParameters=new d;const e=t.context.renderContext.rctx;this._vao=_(e,f),this._technique=new l(t);const s=h(t.view.spatialReference);this._planetRadius=s.radius,this._atmosphereRadius=s.radius+u}destroy(){this._technique.release(),this._vao.dispose()}set strength(t){this._passParameters.fogStrength=t}get strength(){return this._passParameters.fogStrength}render(t,e){if(this._update(t,e),this._passParameters.fogAmount<=0)return;const s=this._technique;if(!s.compiled)return void this.context.requestRender();const r=t.offscreenRenderingHelper;r.renderDepthDetached((()=>{this._passParameters.depthTexture=r.depthTexture;const e=t.rctx.bindTechnique(s,this._passParameters,t.bindParameters);this._renderFog(e,t)}))}_renderFog(t,e){const s=e.rctx;s.bindVAO(this._vao),t.assertCompatibleVertexAttributeLocations(this._vao),s.drawArrays(j.TRIANGLE_STRIP,0,4)}_update(t,e){const r=t.bindParameters.camera;i(P,r.eye);const o=Math.max(0,a(P,t.bindParameters.lighting.mainLight.direction)),m=e.color;n(w,m,.1),c(this._passParameters.fogColor,w,m,o);const h=p(r.eye),u=h*h;this._passParameters.atmosphereC=u-this._atmosphereRadius*this._atmosphereRadius,this._passParameters.fogAmount=(1-s(b*g,y*g,Math.abs(h-this._planetRadius)))*e.amount,this._passParameters.fogStrength=e.strength}static isSupported(t){return t.capabilities.depthTexture}};t([r({constructOnly:!0})],v.prototype,"context",void 0),t([r({constructOnly:!0})],v.prototype,"view",void 0),t([r({constructOnly:!0})],v.prototype,"rctx",void 0),t([r({constructOnly:!0})],v.prototype,"viewingMode",void 0),v=t([o("esri.views.3d.environment.Fog")],v);class x{constructor(){this.color=m(),this.strength=0,this.amount=0}}const P=m(),w=m();export{v as Fog,x as FogParameters};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{smoothstep as s}from"../../../core/mathUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{n as i,j as a,i as n,p as c,l as p}from"../../../chunks/vec3.js";import{c as m}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{atmosphereHeight as u}from"./atmosphereUtils.js";import{F as d}from"../../../chunks/Fog.glsl.js";import{FogTechnique as l}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";import{Pos2Tex as f}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as _}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as j}from"../../webgl/enums.js";const y=.95,b=1;let v=class extends e{constructor(t){super(t),this._passParameters=new d;const e=t.context.renderContext.rctx;this._vao=_(e,f),this._technique=new l(t);const s=h(t.view.spatialReference);this._planetRadius=s.radius,this._atmosphereRadius=s.radius+u}destroy(){this._technique.release(),this._vao.dispose()}set strength(t){this._passParameters.fogStrength=t}get strength(){return this._passParameters.fogStrength}render(t,e){if(this._update(t,e),this._passParameters.fogAmount<=0)return;const s=this._technique;if(!s.compiled)return void this.context.requestRender();const r=t.offscreenRenderingHelper;r.renderDepthDetached((()=>{this._passParameters.depthTexture=r.depthTexture;const e=t.rctx.bindTechnique(s,this._passParameters,t.bindParameters);this._renderFog(e,t)}))}_renderFog(t,e){const s=e.rctx;s.bindVAO(this._vao),t.assertCompatibleVertexAttributeLocations(this._vao),s.drawArrays(j.TRIANGLE_STRIP,0,4)}_update(t,e){const r=t.bindParameters.camera;i(P,r.eye);const o=Math.max(0,a(P,t.bindParameters.lighting.mainLight.direction)),m=e.color;n(w,m,.1),c(this._passParameters.fogColor,w,m,o);const h=p(r.eye),u=h*h;this._passParameters.atmosphereC=u-this._atmosphereRadius*this._atmosphereRadius,this._passParameters.fogAmount=(1-s(y*g,b*g,Math.abs(h-this._planetRadius)))*e.amount,this._passParameters.fogStrength=e.strength}static isSupported(t){return t.capabilities.depthTexture}};t([r({constructOnly:!0})],v.prototype,"context",void 0),t([r({constructOnly:!0})],v.prototype,"view",void 0),t([r({constructOnly:!0})],v.prototype,"rctx",void 0),t([r({constructOnly:!0})],v.prototype,"viewingMode",void 0),v=t([o("esri.views.3d.environment.Fog")],v);class x{constructor(){this.color=m(),this.strength=0,this.amount=0}}const P=m(),w=m();export{v as Fog,x as FogParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../core/maybe.js";import{c as t}from"../../../chunks/mat4.js";import{c as r}from"../../../chunks/mat4f64.js";import{AtmosphereType as s}from"./AtmosphereType.js";import{S as o}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as i}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as m,SimpleAtmosphereGeometry as a}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as n}from"./resources/SimpleAtmosphereTexture.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as c}from"../support/buffer/InterleavedLayout.js";import{Default3D as u}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createPolySphereData as f}from"../webgl-engine/lib/GeometryUtil.js";import{VertexArrayObject as h}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as l}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as b}from"../../webgl/BufferObject.js";import{TextureWrapMode as g,PrimitiveType as j,Usage as _}from"../../webgl/enums.js";import{Texture as x}from"../../webgl/Texture.js";import{TextureDescriptor as w}from"../../webgl/TextureDescriptor.js";import{vertexCount as A}from"../../webgl/Util.js";class d{constructor(e,t){this.type=s.Local,this._configuration=new m,this._passParameters=new o,this._configuration.geometry=a.Cylinder,this._technique=t.techniqueRepository.acquire(i,this._configuration);const r=t.renderContext.rctx;this._vao=this._createVertexArrayObject(r),this._vaoCount=A(this._vao,"geometry");const p=new w;p.wrapMode=g.CLAMP_TO_EDGE,p.flipped=!0,p.width=1,p.height=512,this._passParameters.texture=new x(r,p,n)}destroy(){this._passParameters.texture=e(this._passParameters.texture),this._vao.dispose(),this._technique.release()}render(e){const t=e.rctx,r=t.bindTechnique(this._technique,this._passParameters,e.bindParameters);y(v,e.bindParameters.camera.viewMatrix),r.setUniformMatrix4fv("view",v),t.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),t.drawArrays(j.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=f(1,2,!1),r=t.indices[0][1],s=t.vertexAttributes[0][1];for(let a=0;a<r.length;a+=3){const e=r[a];r[a]=r[a+2],r[a+2]=e}const o=s.data,i=T.createBuffer(r.length),m=i.position;for(let a=0;a<r.length;++a){const e=3*r[a];m.set(a,0,o[e]),m.set(a,1,o[e+1]),m.set(a,2,o[e+2])}return new h(e,u,{geometry:p(T)},{geometry:b.createVertex(e,_.STATIC_DRAW,i.buffer)})}}function y(e,r){t(e,r),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const v=r(),T=c().vec3f(l.POSITION);export{d as LocalAtmosphere};
5
+ import{disposeMaybe as e}from"../../../core/maybe.js";import{h as t}from"../../../chunks/mat4.js";import{a as r}from"../../../chunks/mat4f64.js";import{AtmosphereType as s}from"./AtmosphereType.js";import{S as o}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as i}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as a,SimpleAtmosphereGeometry as m}from"./SimpleAtmosphereTechniqueConfiguration.js";import{earthAtmosphereTextureSimple as n}from"./resources/SimpleAtmosphereTexture.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as c}from"../support/buffer/InterleavedLayout.js";import{Default3D as u}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createPolySphereData as f}from"../webgl-engine/lib/GeometryUtil.js";import{VertexArrayObject as h}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as l}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as b}from"../../webgl/BufferObject.js";import{TextureWrapMode as g,PrimitiveType as j,Usage as _}from"../../webgl/enums.js";import{Texture as x}from"../../webgl/Texture.js";import{TextureDescriptor as w}from"../../webgl/TextureDescriptor.js";import{vertexCount as A}from"../../webgl/Util.js";class d{constructor(e,t){this.type=s.Local,this._configuration=new a,this._passParameters=new o,this._configuration.geometry=m.Cylinder,this._technique=t.techniqueRepository.acquire(i,this._configuration);const r=t.renderContext.rctx;this._vao=this._createVertexArrayObject(r),this._vaoCount=A(this._vao,"geometry");const p=new w;p.wrapMode=g.CLAMP_TO_EDGE,p.flipped=!0,p.width=1,p.height=512,this._passParameters.texture=new x(r,p,n)}destroy(){this._passParameters.texture=e(this._passParameters.texture),this._vao.dispose(),this._technique.release()}render(e){const t=e.rctx,r=t.bindTechnique(this._technique,this._passParameters,e.bindParameters);y(v,e.bindParameters.camera.viewMatrix),r.setUniformMatrix4fv("view",v),t.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),t.drawArrays(j.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const t=f(1,2,!1),r=t.indices[0][1],s=t.vertexAttributes[0][1];for(let m=0;m<r.length;m+=3){const e=r[m];r[m]=r[m+2],r[m+2]=e}const o=s.data,i=T.createBuffer(r.length),a=i.position;for(let m=0;m<r.length;++m){const e=3*r[m];a.set(m,0,o[e]),a.set(m,1,o[e+1]),a.set(m,2,o[e+2])}return new h(e,u,{geometry:p(T)},{geometry:b.createVertex(e,_.STATIC_DRAW,i.buffer)})}}function y(e,r){t(e,r),e[12]=0,e[13]=0,e[14]=0,e[15]=1}const v=r(),T=c().vec3f(l.POSITION);export{d as LocalAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{u as o}from"../../../chunks/mat4.js";import{c as a}from"../../../chunks/mat4f64.js";import{s as n}from"../../../chunks/vec2.js";import{l as h,b as m,e as p,h as u,c,p as _}from"../../../chunks/vec3.js";import{c as l}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as f}from"../../../geometry/support/FloatArray.js";import{AtmosphereType as g}from"./AtmosphereType.js";import{computeInnerAltitudeFade as b,innerAtmosphereDepth as R}from"./atmosphereUtils.js";import{S as j}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as x}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as V,SimpleAtmosphereGeometry as y}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as w}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as A}from"../support/mathUtils.js";import{glLayout as P}from"../support/buffer/glUtil.js";import{newLayout as T}from"../support/buffer/InterleavedLayout.js";import{Default3D as q}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{project as S}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as F}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as C}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as M}from"../../webgl/BufferObject.js";import{TextureWrapMode as U,PrimitiveType as W,Usage as I}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";import{vertexCount as D}from"../../webgl/Util.js";const L=128,E=-R,G=0,H=50,N=()=>1-511/512,B=A([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class z{constructor(e,t){this.view=e,this.type=g.Mars,this._passParameters=new j,this._vaoCount=0,this._texV1=1;const s=d(e.spatialReference);this._planetRadius=s.radius,this._outerRimWidth=s.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+E)/this._planetRadius,this._middleRimFactor=(this._planetRadius+G)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=G/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniqueRepository=t.techniqueRepository;const o=t.renderContext.rctx;this._cameraChangeHandle=r((()=>this.view.state?.camera),(()=>t.requestRender()),i),this._vao=this._createRibbon(o),this._vaoCount=D(this._vao,"geometry"),this._fadeVao=v(o),this._fadeVaoCount=D(this._fadeVao,"geometry");const a=new k;a.wrapMode=U.CLAMP_TO_EDGE,a.flipped=!0,a.width=1,a.height=512,this._passParameters.texture=new O(o,a,w);const n=new V;n.geometry=y.Cone,this._coneTechnique=this._techniqueRepository.acquire(x,n),n.geometry=y.Underground,this._undergroundTechnique=this._techniqueRepository.acquire(x,n)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=s(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._vao),s.drawArrays(W.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._fadeVao),s.drawArrays(W.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=l(),i=this._planetRadius,o=h(s.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const p=Math.max(H,a),u=i+E;this._passParameters.innerScale=Y(i+p,i,u)-1,this._passParameters.altitudeFade=b(a),m(r,s.eye,(i+H)/o),J(r,s.center,s.up,i,this._passParameters.silhouette);const c=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),_=N(),d=B(a);let f=this._texV0+_*this._texVScale,g=this._texV0+c*d*this._texVScale;if(a>H){J(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),o=t((r-1.5)/(c-1.5),0,1);f=this._texV0+o*_*this._texVScale,g=this._texV0+e(this._texV1,c*d,o)*this._texVScale}n(this._passParameters.texV,f,g)}_createRibbon(e){const t=f(3+3*L*3),s=new Uint32Array(3*L*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<L;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*o+1,i=o===L-1?1:r+3,a=15*o;s[a]=r,s[a+1]=r+1,s[a+2]=i+1,s[a+3]=i+1,s[a+4]=i,s[a+5]=r,s[a+6]=r+1,s[a+7]=r+2,s[a+8]=i+2,s[a+9]=i+2,s[a+10]=i+1,s[a+11]=r+1,s[a+12]=r,s[a+13]=i,s[a+14]=0}const r=Z.createBuffer(s.length),i=r.position;for(let o=0;o<s.length;++o){const e=3*s[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new F(e,q,{geometry:P(Z)},{geometry:M.createVertex(e,I.STATIC_DRAW,r.buffer)})}_computeScreenRimWidth(e,t,s,r){return p(Q,r.center,r.v2),m(X,Q,this._outerRimFactor),o(K,t,Q,s),S(Q,K,e.projectionMatrix,e.viewport,Q),S(X,K,e.projectionMatrix,e.viewport,X),u(Q,X)/e.height}}function J(e,t,s,r,i){const o=h(e),a=r*Math.sqrt(o*o-r*r)/o,n=Math.sqrt(r*r-a*a),p=i.v1,u=i.v2;return m(i.center,e,n/o),c(p,e,t),_(p)<1&&c(p,e,s),m(p,p,a/h(p)),c(u,p,e),m(u,u,a/h(u)),a}const K=a(),Q=l(),X=l();function Y(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const Z=T().vec3f(C.POSITION);export{z as default};
5
+ import{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{u as o}from"../../../chunks/mat4.js";import{a}from"../../../chunks/mat4f64.js";import{s as n}from"../../../chunks/vec2.js";import{l as h,i as m,g as p,m as u,b as c,o as _}from"../../../chunks/vec3.js";import{c as l}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as f}from"../../../geometry/support/FloatArray.js";import{AtmosphereType as g}from"./AtmosphereType.js";import{computeInnerAltitudeFade as b,innerAtmosphereDepth as R}from"./atmosphereUtils.js";import{S as j}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as x}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as V,SimpleAtmosphereGeometry as y}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as w}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as A}from"../support/mathUtils.js";import{glLayout as P}from"../support/buffer/glUtil.js";import{newLayout as T}from"../support/buffer/InterleavedLayout.js";import{Default3D as q}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{project as S}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as F}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as C}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as M}from"../../webgl/BufferObject.js";import{TextureWrapMode as U,PrimitiveType as W,Usage as I}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";import{vertexCount as D}from"../../webgl/Util.js";const L=128,E=-R,G=0,H=50,N=()=>1-511/512,B=A([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class z{constructor(e,t){this.view=e,this.type=g.Mars,this._passParameters=new j,this._vaoCount=0,this._texV1=1;const s=d(e.spatialReference);this._planetRadius=s.radius,this._outerRimWidth=s.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+E)/this._planetRadius,this._middleRimFactor=(this._planetRadius+G)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=G/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniqueRepository=t.techniqueRepository;const o=t.renderContext.rctx;this._cameraChangeHandle=r((()=>this.view.state?.camera),(()=>t.requestRender()),i),this._vao=this._createRibbon(o),this._vaoCount=D(this._vao,"geometry"),this._fadeVao=v(o),this._fadeVaoCount=D(this._fadeVao,"geometry");const a=new k;a.wrapMode=U.CLAMP_TO_EDGE,a.flipped=!0,a.width=1,a.height=512,this._passParameters.texture=new O(o,a,w);const n=new V;n.geometry=y.Cone,this._coneTechnique=this._techniqueRepository.acquire(x,n),n.geometry=y.Underground,this._undergroundTechnique=this._techniqueRepository.acquire(x,n)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=s(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._vao),s.drawArrays(W.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),s.bindVAO(this._fadeVao),s.drawArrays(W.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=l(),i=this._planetRadius,o=h(s.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const p=Math.max(H,a),u=i+E;this._passParameters.innerScale=Y(i+p,i,u)-1,this._passParameters.altitudeFade=b(a),m(r,s.eye,(i+H)/o),J(r,s.center,s.up,i,this._passParameters.silhouette);const c=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),_=N(),d=B(a);let f=this._texV0+_*this._texVScale,g=this._texV0+c*d*this._texVScale;if(a>H){J(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),o=t((r-1.5)/(c-1.5),0,1);f=this._texV0+o*_*this._texVScale,g=this._texV0+e(this._texV1,c*d,o)*this._texVScale}n(this._passParameters.texV,f,g)}_createRibbon(e){const t=f(3+3*L*3),s=new Uint32Array(3*L*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<L;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*o+1,i=o===L-1?1:r+3,a=15*o;s[a]=r,s[a+1]=r+1,s[a+2]=i+1,s[a+3]=i+1,s[a+4]=i,s[a+5]=r,s[a+6]=r+1,s[a+7]=r+2,s[a+8]=i+2,s[a+9]=i+2,s[a+10]=i+1,s[a+11]=r+1,s[a+12]=r,s[a+13]=i,s[a+14]=0}const r=Z.createBuffer(s.length),i=r.position;for(let o=0;o<s.length;++o){const e=3*s[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new F(e,q,{geometry:P(Z)},{geometry:M.createVertex(e,I.STATIC_DRAW,r.buffer)})}_computeScreenRimWidth(e,t,s,r){return p(Q,r.center,r.v2),m(X,Q,this._outerRimFactor),o(K,t,Q,s),S(Q,K,e.projectionMatrix,e.viewport,Q),S(X,K,e.projectionMatrix,e.viewport,X),u(Q,X)/e.height}}function J(e,t,s,r,i){const o=h(e),a=r*Math.sqrt(o*o-r*r)/o,n=Math.sqrt(r*r-a*a),p=i.v1,u=i.v2;return m(i.center,e,n/o),c(p,e,t),_(p)<1&&c(p,e,s),m(p,p,a/h(p)),c(u,p,e),m(u,u,a/h(u)),a}const K=a(),Q=l(),X=l();function Y(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const Z=T().vec3f(C.POSITION);export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{neverReached as i}from"../../../core/compilerUtils.js";import{clone as e}from"../../../core/lang.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{cast as r}from"../../../core/accessorSupport/decorators/cast.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureOneOfType as o}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as g}from"./lightingUtils.js";import{SceneViewAtmosphere as h}from"./SceneViewAtmosphere.js";import l from"./SunLighting.js";import c from"./VirtualLighting.js";import a from"../../../webscene/Environment.js";import p from"../../../webscene/SunLighting.js";import m from"../../../webscene/VirtualLighting.js";var u;let b=u=class extends a{constructor(t){super(t),this.atmosphere=new h,this.lighting=new l,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new u({...i,lighting:i.lighting?"virtual"===i.lighting.type?c.fromWebsceneLighting(i.lighting):l.fromWebsceneLighting(i.lighting):void 0})}castLighting(t){return this._convertLighting(t)}applyLighting(t){this.lighting=this._convertLighting(t)}_convertLighting(t){return t?t instanceof l||t instanceof c?t:t instanceof p?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new l({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof m?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new c({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):o(g,t):new l}clone(){return new u({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:e(this.background)})}cloneWithWebsceneEnvironment(t){return new u({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:e(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):l.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):c.fromWebsceneLighting(t.lighting);default:return i(t.lighting),l.fromWebsceneLighting(t.lighting)}}};t([n({type:h,json:{read:!1},nonNullable:!0})],b.prototype,"atmosphere",void 0),t([n({nonNullable:!0})],b.prototype,"lighting",void 0),t([r("lighting")],b.prototype,"castLighting",null),b=u=t([s("esri.views.3d.environment.SceneViewEnvironment")],b);const f=b;export{f as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{neverReached as i}from"../../../core/compilerUtils.js";import{destroyHandle as e}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/lang.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import{cast as s}from"../../../core/accessorSupport/decorators/cast.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureOneOfType as g}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as h}from"./lightingUtils.js";import{SceneViewAtmosphere as l}from"./SceneViewAtmosphere.js";import c from"./SunLighting.js";import a from"./VirtualLighting.js";import p from"../../../webscene/Environment.js";import m from"../../../webscene/SunLighting.js";import u from"../../../webscene/VirtualLighting.js";var b;let d=b=class extends p{constructor(t){super(t),this.atmosphere=new l,this.lighting=this.castLighting(),this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new b({...i,lighting:i.lighting?"virtual"===i.lighting.type?a.fromWebsceneLighting(i.lighting):c.fromWebsceneLighting(i.lighting):void 0})}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const i=this._convertLighting(t);return i!==t&&this.addHandles(e(i)),i}_convertLighting(t){return t?t instanceof c||t instanceof a?t:t instanceof m?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new c({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof u?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new a({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):g(h,t):new c}clone(){return new b({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background)})}cloneWithWebsceneEnvironment(t){return new b({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):c.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):a.fromWebsceneLighting(t.lighting);default:return i(t.lighting),c.fromWebsceneLighting(t.lighting)}}};t([r({type:l,json:{read:!1},nonNullable:!0})],d.prototype,"atmosphere",void 0),t([r({nonNullable:!0})],d.prototype,"lighting",void 0),t([s("lighting")],d.prototype,"castLighting",null),d=b=t([o("esri.views.3d.environment.SceneViewEnvironment")],d);const f=d;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{after as i}from"../../../core/promiseUtils.js";import{watch as s,sync as n,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{s as l,b as c,i as d,f as p}from"../../../chunks/vec3.js";import{c as _,f as u}from"../../../chunks/vec3f64.js";import{canProjectToWGS84ComparableLonLat as m}from"../../../geometry/projection.js";import{projectPointToWGS84ComparableLonLat as f}from"../../../geometry/projection/projectPointToWGS84ComparableLonLat.js";import{isEarth as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as P}from"../../ViewingMode.js";import{EnvironmentRenderer as v}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{computeColorAndIntensity as y,computeVirtualLightDirection as w,computeShadowsEnabled as C,ColorAndIntensity as U}from"../support/sunUtils.js";import{Update as S}from"../webgl-engine/lib/Update.js";import{MainLight as T,AmbientLight as R,FillLight as M}from"../webgl-engine/lighting/Lightsources.js";let W=class extends t.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandlesKey="viewHandles",this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new T,this._ambientLight=new R,this._moonLight=new M,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===P.Global&&g(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new v({view:e});const t=()=>this._updateRenderParameters(),r=()=>this._cameraHandler();this.addHandles([s((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),n),s((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),n),s((()=>e.stationary),(()=>this._interactingStationaryHandler())),s((()=>e.environment.lighting.directShadowsEnabled),t,n),s((()=>e.qualitySettings.ambientOcclusion),t,n),s((()=>e.qualitySettings.reflections),t,n),s((()=>e.environment.background?.color),t,n),s((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),n),s((()=>e.environment.weather.type),(()=>this._updateLighting(null,S.Faded)),n),s((()=>this.weatherEnabled),(()=>this._updateLighting(null,S.Faded)),n),s((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),o),s((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),o),s((()=>e.state.camera),r,o),s((()=>this.disableQueries),r)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=r(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!m(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),null!=this._referencePosWGS84Comparable){const e=b(this._referencePosWGS84Comparable,j);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=g(this._view.spatialReference);if(r&&!m(this._view.spatialReference))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;const i=e.position;return null==this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable=_()),r?f(i,this._referencePosWGS84Comparable):l(this._referencePosWGS84Comparable,i.longitude??0,i.latitude??0,i.z??0),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLighting(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=(t.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,t=S.Immediate){const r=this._view;e=e||("virtual"===r.environment.lighting.type?null:r.environment.lighting.date);const i=this._referencePosWGS84Comparable,s=null!=i?H:G,n=this.weatherVisible?r.environment.weather.type:"disabled";null!=i?y(e,i,r.state.viewingMode,n,r.state.camera,s):"virtual"===r.environment.lighting.type&&w(r.state.camera,r.state.viewingMode,s.direct.directionToLightSource);const o=this._mainLight,a=s.direct;c(o.intensity,a.color,a.intensity*Math.PI),d(o.direction,a.directionToLightSource),o.specularStrength=s.specularStrength,o.environmentStrength=s.environmentStrength;const h=this._ambientLight;c(h.intensity,s.ambient.color,s.ambient.intensity);const l=this._moonLight;p(l.intensity,q,E,s.globalFactor);const _=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));c(l.intensity,l.intensity,_),d(l.direction,a.directionToLightSource),this._renderer.updateLightSources([o,h,l],s.noonFactor,s.globalFactor,t),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const r=L;r.setTime((t||this._view.environment.lighting.date).getTime());const i=b(e,j);if(null==i)return!1;let s=this._view.environment.lighting.positionTimezoneInfo;if(s.autoUpdated){if(s.hours===i.hours&&s.minutes===i.minutes&&s.seconds===i.seconds)return!1}else s=i;const n=r.getUTCHours()-(i.hours-s.hours),o=r.getUTCMinutes()-(i.minutes-s.minutes),a=r.getUTCSeconds()-(i.seconds-s.seconds);return r.setUTCHours(n),r.setUTCMinutes(o),r.setUTCSeconds(a),!t&&this._view.environment.lighting.autoUpdate(r,i)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const t=null==this._referencePosWGS84Comparable||C(this._referencePosWGS84Comparable[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=i(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=i(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([a({type:Boolean,readOnly:!0})],W.prototype,"updating",null),e([a()],W.prototype,"disableQueries",void 0),e([a()],W.prototype,"_disableWeather",void 0),e([a()],W.prototype,"weatherEnabled",null),e([a()],W.prototype,"weatherVisible",null),e([a()],W.prototype,"referencePositionWGS84Comparable",null),e([a()],W.prototype,"_renderer",void 0),e([a()],W.prototype,"_referencePosWGS84Comparable",void 0),W=e([h("esri.views.3d.environment.SceneViewEnvironmentManager")],W);const H=new U,G=new U,L=new Date,j={hours:0,minutes:0,seconds:0},q=u(.22,.22,.33),E=u(.22,.22,.22);export{W as SceneViewEnvironmentManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{after as i}from"../../../core/promiseUtils.js";import{watch as s,sync as n,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{s as c,i as l,c as d,p}from"../../../chunks/vec3.js";import{c as _,f as u}from"../../../chunks/vec3f64.js";import{canProjectToWGS84ComparableLonLat as m}from"../../../geometry/projection.js";import{projectPointToWGS84ComparableLonLat as f}from"../../../geometry/projection/projectPointToWGS84ComparableLonLat.js";import{isEarth as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as P}from"../../ViewingMode.js";import{EnvironmentRenderer as v}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{computeColorAndIntensity as y,computeVirtualLightDirection as w,computeShadowsEnabled as C,ColorAndIntensity as U}from"../support/sunUtils.js";import{Update as S}from"../webgl-engine/lib/Update.js";import{MainLight as T,AmbientLight as R,FillLight as M}from"../webgl-engine/lighting/Lightsources.js";let W=class extends t.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandlesKey="viewHandles",this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new T,this._ambientLight=new R,this._moonLight=new M,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!this._renderer?.updating)}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===P.Global&&g(this._view.spatialReference)}get weatherVisible(){return this.weatherEnabled&&this._renderer?.weatherVisible}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new v({view:e});const t=()=>this._updateRenderParameters(),r=()=>this._cameraHandler();this.addHandles([s((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),n),s((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),n),s((()=>e.stationary),(()=>this._interactingStationaryHandler())),s((()=>e.environment.lighting.directShadowsEnabled),t,n),s((()=>e.qualitySettings.ambientOcclusion),t,n),s((()=>e.qualitySettings.reflections),t,n),s((()=>e.environment.background?.color),t,n),s((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),n),s((()=>e.environment.weather.type),(()=>this._updateLighting(null,S.Faded)),n),s((()=>this.weatherEnabled),(()=>this._updateLighting(null,S.Faded)),n),s((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),o),s((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),o),s((()=>e.state.camera),r,o),s((()=>this.disableQueries),r)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=r(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!m(r)){const e=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(e))return void this._requestReferencePositionUpdate(e)}if(this._preupdateTracking(e),null!=this._referencePosWGS84Comparable){const e=b(this._referencePosWGS84Comparable,j);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const r=t.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,t){const r=g(this._view.spatialReference);if(r&&!m(this._view.spatialReference))return"virtual"===this._view.environment.lighting.type&&this._updateLighting(),!1;const i=e.position;return null==this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable=_()),r?f(i,this._referencePosWGS84Comparable):c(this._referencePosWGS84Comparable,i.longitude??0,i.latitude??0,i.z??0),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,t)||this._updateLighting(t),!0}_cameraHandlerServerSide(e){const t=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(t))&&this._requestReferencePositionUpdate(t,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=(t.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,t=S.Immediate){const r=this._view;e=e||("virtual"===r.environment.lighting.type?null:r.environment.lighting.date);const i=this._referencePosWGS84Comparable,s=null!=i?H:G,n=this.weatherVisible?r.environment.weather.type:"disabled";null!=i?y(e,i,r.state.viewingMode,n,r.state.camera,s):"virtual"===r.environment.lighting.type&&w(r.state.camera,r.state.viewingMode,s.direct.directionToLightSource);const o=this._mainLight,a=s.direct;l(o.intensity,a.color,a.intensity*Math.PI),d(o.direction,a.directionToLightSource),o.specularStrength=s.specularStrength,o.environmentStrength=s.environmentStrength;const h=this._ambientLight;l(h.intensity,s.ambient.color,s.ambient.intensity);const c=this._moonLight;p(c.intensity,q,E,s.globalFactor);const _=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));l(c.intensity,c.intensity,_),d(c.direction,a.directionToLightSource),this._renderer.updateLightSources([o,h,c],s.noonFactor,s.globalFactor,t),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const r=L;r.setTime((t||this._view.environment.lighting.date).getTime());const i=b(e,j);if(null==i)return!1;let s=this._view.environment.lighting.positionTimezoneInfo;if(s.autoUpdated){if(s.hours===i.hours&&s.minutes===i.minutes&&s.seconds===i.seconds)return!1}else s=i;const n=r.getUTCHours()-(i.hours-s.hours),o=r.getUTCMinutes()-(i.minutes-s.minutes),a=r.getUTCSeconds()-(i.seconds-s.seconds);return r.setUTCHours(n),r.setUTCMinutes(o),r.setUTCSeconds(a),!t&&this._view.environment.lighting.autoUpdate(r,i)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const t=null==this._referencePosWGS84Comparable||C(this._referencePosWGS84Comparable[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,t=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!t,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const e=this._referencePosUpdateQuery=i(this._referencePointUpdateDelay).then((()=>{if(this._referencePosUpdateQuery===e){const t=()=>this._referencePosUpdateQuery!==e;return this._doReferencePositionUpdateQuery(t)}})).catch((e=>{"mapcoordshelper:missing-geometry-service"===e.name&&(this.disableQueries=!0)})).then((()=>{this._referencePosUpdateQuery===e&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))})),t=this._referencePosUpdateTimer=i(this._referencePointUpdateInterval).then((()=>{this._referencePosUpdateTimer===t&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())}));this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const t=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(t[0])&&!isNaN(t[1])){const e=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=t[0],this._referencePosWGS84Comparable[1]=t[1],this._referencePosWGS84Comparable[2]=e):this._referencePosWGS84Comparable=[t[0],t[1],e],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let t=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(t*=this._view.mapCoordsHelper.unitInMeters),t>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(t){e._referencePointUpdateInterval=t},set referencePointUpdateDistThreshold(t){e._referencePointUpdateDistThreshold=t},set referencePosUpdateTimer(t){e._referencePosUpdateTimer=t},set referencePointUpdateDelay(t){e._referencePointUpdateDelay=t},set disableWeather(t){e._disableWeather=t}}}};e([a({type:Boolean,readOnly:!0})],W.prototype,"updating",null),e([a()],W.prototype,"disableQueries",void 0),e([a()],W.prototype,"_disableWeather",void 0),e([a()],W.prototype,"weatherEnabled",null),e([a()],W.prototype,"weatherVisible",null),e([a()],W.prototype,"referencePositionWGS84Comparable",null),e([a()],W.prototype,"_renderer",void 0),e([a()],W.prototype,"_referencePosWGS84Comparable",void 0),W=e([h("esri.views.3d.environment.SceneViewEnvironmentManager")],W);const H=new U,G=new U,L=new Date,j={hours:0,minutes:0,seconds:0},q=u(.22,.22,.33),E=u(.22,.22,.22);export{W as SceneViewEnvironmentManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import{createTask as s}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import a from"../../../core/Logger.js";import{abortMaybe as o,releaseMaybe as n,disposeMaybe as c}from"../../../core/maybe.js";import{isAbortError as f}from"../../../core/promiseUtils.js";import{initial as u}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{c as l,o as p,m}from"../../../chunks/mat4.js";import{f as g}from"../../../chunks/mat4f64.js";import{UpdatingHandles as _}from"../../../core/support/UpdatingHandles.js";import{StarPassParameters as b,StarsTechnique as y}from"./StarsTechnique.js";import{glLayout as v}from"../support/buffer/glUtil.js";import{newLayout as j}from"../support/buffer/InterleavedLayout.js";import{Default3D as w}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as k}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as D}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as A}from"../../webgl/enums.js";let x=class extends r{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return null!=this._loadDataTask&&!this._loadDataTask.finished}constructor(t){super(t),this._loadDataTask=null,this._numPoints=0,this._renderParameter=new b,this._updatingTracking=new _}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=o(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=n(this._technique),this._vao=c(this._vao),L=null}render(t){const{rctx:e}=t;if(this._ensureResources(e),null==this._technique||null==this._vao)return;if(!this._technique.compiled)return void this.requestRender();const r=e.bindTechnique(this._technique,this._renderParameter,t.bindParameters);e.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),e.drawArrays(P.POINTS,0,this._numPoints)}_ensureResources(t){if(null!=this._technique||null==L)return;this._technique=new y({rctx:t,viewingMode:this.view.state.viewingMode}),this._numPoints=L.byteLength/I;const e=new Float32Array(L,0,2*this._numPoints),r=new Uint8Array(L,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(t,e,r,this._numPoints),this._updatingTracking.add((()=>"virtual"!==this.view.environment.lighting.type?this.view.environment.lighting.date:null),(t=>this._update(t)),u)}_computeDayDuration(t){const e=t,r=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+r)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+r)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,r=2*this._computeDayDuration(t),s=l(this._renderParameter.modelMatrix,S);p(s,s,-r*Math.PI),m(s,O,s),p(s,s,-e*Math.PI),this.requestRender()}_hexToRGB(t){return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}_unpackUint8Attributes(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}_createVertexArrayObject(t,e,r,s){const i=M.createBuffer(s),a=i.position,o=i.color,n=i.size;for(let c=0;c<s;c++){const t=e[2*c],s=e[2*c+1];a.set(c,0,-Math.cos(t)*Math.sin(s)),a.set(c,1,-Math.sin(t)*Math.sin(s)),a.set(c,2,-Math.cos(s));const i=this._unpackUint8Attributes(r[c]),f=this._hexToRGB(q[i[1]]);o.set(c,0,255*f[0]),o.set(c,1,255*f[1]),o.set(c,2,255*f[2]),o.set(c,3,255),n.set(c,i[0])}return new T(t,w,{geometry:v(M)},{geometry:D.createVertex(t,A.STATIC_DRAW,i.buffer)})}_createLoadDataTask(){if(null!=L)return null;const t=s((async t=>{const{data:r}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});this._verifyStarData(r),L=r}));return t.promise.catch((t=>{f(t)||a.getLogger(this).error(t)})).then((()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))})),t}_verifyStarData(t){if(!t)throw new i("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/I;if(e%1!=0||e>5e4||e<5e3)throw new i("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};t([h({constructOnly:!0})],x.prototype,"view",void 0),t([h({constructOnly:!0})],x.prototype,"requestRender",void 0),t([h({readOnly:!0})],x.prototype,"updating",null),t([h()],x.prototype,"_loadDataTask",void 0),t([h()],x.prototype,"_updatingTracking",void 0),x=t([d("esri.views.3d.environment.Stars")],x);const q=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],O=g(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),S=g(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),I=9,M=j().vec3f(k.POSITION).vec4u8(k.COLOR).f32(k.SIZE);let L=null;export{x as Stars};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{fetchAsset as e}from"../../../assets.js";import r from"../../../core/Accessor.js";import{createTask as s}from"../../../core/asyncUtils.js";import i from"../../../core/Error.js";import a from"../../../core/Logger.js";import{abortMaybe as o,releaseMaybe as n,disposeMaybe as f}from"../../../core/maybe.js";import{isAbortError as c}from"../../../core/promiseUtils.js";import{initial as u}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{h as l,o as p,m}from"../../../chunks/mat4.js";import{f as g}from"../../../chunks/mat4f64.js";import{UpdatingHandles as _}from"../../../core/support/UpdatingHandles.js";import{StarPassParameters as b,StarsTechnique as y}from"./StarsTechnique.js";import{glLayout as v}from"../support/buffer/glUtil.js";import{newLayout as j}from"../support/buffer/InterleavedLayout.js";import{Default3D as w}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as k}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as D}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as A}from"../../webgl/enums.js";let x=class extends r{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return null!=this._loadDataTask&&!this._loadDataTask.finished}constructor(t){super(t),this._loadDataTask=null,this._numPoints=0,this._renderParameter=new b,this._updatingTracking=new _}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=o(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=n(this._technique),this._vao=f(this._vao),L=null}render(t){const{rctx:e}=t;if(this._ensureResources(e),null==this._technique||null==this._vao)return;if(!this._technique.compiled)return void this.requestRender();const r=e.bindTechnique(this._technique,this._renderParameter,t.bindParameters);e.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),e.drawArrays(P.POINTS,0,this._numPoints)}_ensureResources(t){if(null!=this._technique||null==L)return;this._technique=new y({rctx:t,viewingMode:this.view.state.viewingMode}),this._numPoints=L.byteLength/I;const e=new Float32Array(L,0,2*this._numPoints),r=new Uint8Array(L,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(t,e,r,this._numPoints),this._updatingTracking.add((()=>"virtual"!==this.view.environment.lighting.type?this.view.environment.lighting.date:null),(t=>this._update(t)),u)}_computeDayDuration(t){const e=t,r=new Date(t.getFullYear(),0,1,11,58,56);return(+e-+r)/(+new Date(t.getFullYear()+1,0,1,11,58,55)-+r)}_update(t){if(!t)return;const e=(t.getHours()/12+t.getMinutes()/60*(2/24)+t.getSeconds()/60*(2/1440)-.9972222)%2,r=2*this._computeDayDuration(t),s=l(this._renderParameter.modelMatrix,S);p(s,s,-r*Math.PI),m(s,O,s),p(s,s,-e*Math.PI),this.requestRender()}_hexToRGB(t){return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}_unpackUint8Attributes(t){return t>=192?[2.9,t-192]:t>=160?[2.5,t-160]:t>=128?[2,t-128]:t>=96?[1.5,t-96]:t>=64?[1,t-64]:t>=32?[.7,t-32]:[.4,t]}_createVertexArrayObject(t,e,r,s){const i=M.createBuffer(s),a=i.position,o=i.color,n=i.size;for(let f=0;f<s;f++){const t=e[2*f],s=e[2*f+1];a.set(f,0,-Math.cos(t)*Math.sin(s)),a.set(f,1,-Math.sin(t)*Math.sin(s)),a.set(f,2,-Math.cos(s));const i=this._unpackUint8Attributes(r[f]),c=this._hexToRGB(q[i[1]]);o.set(f,0,255*c[0]),o.set(f,1,255*c[1]),o.set(f,2,255*c[2]),o.set(f,3,255),n.set(f,i[0])}return new T(t,w,{geometry:v(M)},{geometry:D.createVertex(t,A.STATIC_DRAW,i.buffer)})}_createLoadDataTask(){if(null!=L)return null;const t=s((async t=>{const{data:r}=await e("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:t});this._verifyStarData(r),L=r}));return t.promise.catch((t=>{c(t)||a.getLogger(this).error(t)})).then((()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))})),t}_verifyStarData(t){if(!t)throw new i("stars:no-data-received","Failed to create stars because star catalogue is missing");const e=t.byteLength/I;if(e%1!=0||e>5e4||e<5e3)throw new i("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};t([h({constructOnly:!0})],x.prototype,"view",void 0),t([h({constructOnly:!0})],x.prototype,"requestRender",void 0),t([h({readOnly:!0})],x.prototype,"updating",null),t([h()],x.prototype,"_loadDataTask",void 0),t([h()],x.prototype,"_updatingTracking",void 0),x=t([d("esri.views.3d.environment.Stars")],x);const q=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],O=g(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),S=g(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),I=9,M=j().vec3f(k.POSITION).vec4u8(k.COLOR).f32(k.SIZE);let L=null;export{x as Stars};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{c as e}from"../../../chunks/mat4f64.js";import{S as r}from"../../../chunks/Stars.glsl.js";import{NoParameters as i}from"../webgl-engine/core/shaderModules/interfaces.js";import{ReloadableShaderModule as t}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{ShaderTechniqueConfiguration as s}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as n}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l,CompareFunction as m}from"../../webgl/enums.js";import{makePipelineState as c,separateBlendingParams as g,defaultColorWriteParams as u}from"../../webgl/renderState.js";class d extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class h extends o{constructor(e){super(e,new s,(()=>this.destroy()))}initializeProgram(e){return new a(e.rctx,h.shader.get().build(),n)}initializePipeline(){return c({blending:g(l.SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),depthTest:{func:m.LEQUAL},colorWrite:u})}}h.shader=new t(r,(()=>import("./Stars.glsl.js")));export{d as StarPassParameters,h as StarsTechnique};
5
+ import{a as e}from"../../../chunks/mat4f64.js";import{S as r}from"../../../chunks/Stars.glsl.js";import{NoParameters as i}from"../webgl-engine/core/shaderModules/interfaces.js";import{ReloadableShaderModule as t}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{ShaderTechniqueConfiguration as s}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as n}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l,CompareFunction as m}from"../../webgl/enums.js";import{makePipelineState as c,separateBlendingParams as g,defaultColorWriteParams as u}from"../../webgl/renderState.js";class d extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class h extends o{constructor(e){super(e,new s,(()=>this.destroy()))}initializeProgram(e){return new a(e.rctx,h.shader.get().build(),n)}initializePipeline(){return c({blending:g(l.SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),depthTest:{func:m.LEQUAL},colorWrite:u})}}h.shader=new t(r,(()=>import("./Stars.glsl.js")));export{d as StarPassParameters,h as StarsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{deprecatedFunction as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{c as n}from"../../chunks/mat4f64.js";import{computeTranslationToOriginAndRotation as t}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as o}from"../../geometry/projection/projectBuffer.js";import s from"./externalRenderers/ExternalRendererStore.js";const i=new s;function a(e,r){i.add(e,r)}function d(e,r){i.remove(e,r)}function c(e){e._stage.renderView.requestRender()}function f(e,r,n,t,s,i,a){return t=t||e.spatialReference,o(r,t,n,s,e.renderCoordsHelper.spatialReference,i,a)?s:null}function m(e,r,n,t,s,i,a){return i=i||e.spatialReference,o(r,e.renderCoordsHelper.spatialReference,n,t,i,s,a)?t:null}function p(e,r,o,s){return s||(s=n()),o=o||e.spatialReference,t(o,r,s,e.renderCoordsHelper.spatialReference)?s:null}function u(e){return e.state.camera.clone()}function l(e){return{add:a.bind(this,e),remove:d.bind(this,e),requestRender:c.bind(this,e),toRenderCoordinates:f.bind(this,e),fromRenderCoordinates:m.bind(this,e),renderCoordinateTransformAt:p.bind(this,e)}}function R(n){const t=r.getLogger("esri/views/3d/externalRenderers");e(t,"forceWebGLContext",{moduleName:"esri/views/3d/externalRenderers",version:"4.27",see:"https://developers.arcgis.com/javascript/latest/system-requirements/"}),2!==n&&t.warn(`Requested context version '${n}' is not supported! Using a WebGL2 context.`)}export{a as add,l as bind,R as forceWebGLContext,m as fromRenderCoordinates,u as getRenderCamera,d as remove,p as renderCoordinateTransformAt,c as requestRender,f as toRenderCoordinates};
5
+ import{deprecatedFunction as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{a as n}from"../../chunks/mat4f64.js";import{computeTranslationToOriginAndRotation as t}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as o}from"../../geometry/projection/projectBuffer.js";import s from"./externalRenderers/ExternalRendererStore.js";const i=new s;function a(e,r){i.add(e,r)}function d(e,r){i.remove(e,r)}function c(e){e._stage.renderView.requestRender()}function f(e,r,n,t,s,i,a){return t=t||e.spatialReference,o(r,t,n,s,e.renderCoordsHelper.spatialReference,i,a)?s:null}function m(e,r,n,t,s,i,a){return i=i||e.spatialReference,o(r,e.renderCoordsHelper.spatialReference,n,t,i,s,a)?t:null}function p(e,r,o,s){return s||(s=n()),o=o||e.spatialReference,t(o,r,s,e.renderCoordsHelper.spatialReference)?s:null}function u(e){return e.state.camera.clone()}function l(e){return{add:a.bind(this,e),remove:d.bind(this,e),requestRender:c.bind(this,e),toRenderCoordinates:f.bind(this,e),fromRenderCoordinates:m.bind(this,e),renderCoordinateTransformAt:p.bind(this,e)}}function R(n){const t=r.getLogger("esri/views/3d/externalRenderers");e(t,"forceWebGLContext",{moduleName:"esri/views/3d/externalRenderers",version:"4.27",see:"https://developers.arcgis.com/javascript/latest/system-requirements/"}),2!==n&&t.warn(`Requested context version '${n}' is not supported! Using a WebGL2 context.`)}export{a as add,l as bind,R as forceWebGLContext,m as fromRenderCoordinates,u as getRenderCamera,d as remove,p as renderCoordinateTransformAt,c as requestRender,f as toRenderCoordinates};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{allSettledValues as o}from"../../../../core/promiseUtils.js";import{isDataProtocol as n,dataComponents as s,dataToArrayBuffer as a,makeAbsolute as i}from"../../../../core/urlUtils.js";import{Version as u}from"../../../../core/Version.js";import{A as f,m as c,w as d,e as l,k as p}from"../../../../chunks/mat4.js";import{c as h,b as m}from"../../../../chunks/mat4f64.js";import{g as w}from"../../../../chunks/quat.js";import{b as y}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as T,BufferViewUint16 as b,BufferViewUint8 as _,BufferViewVec3f as g,BufferViewVec4f as x,BufferViewVec2f as O,BufferViewVec4u8 as N,BufferViewVec4u16 as S,BufferViewVec3u8 as C,BufferViewVec3u16 as A,BufferViewVec2u32 as L,BufferViewVec2u16 as E,BufferViewVec2i16 as I,BufferViewVec2u8 as R,BufferViewVec2i8 as B}from"../../../../geometry/support/buffer/BufferView.js";import{m as v}from"../../../../chunks/scalar.js";import"../../../../core/has.js";import{BinaryStreamReader as U}from"./BinaryStreamReader.js";import{AttributeType as D}from"./enums.js";import{material as G,textureSampler as M}from"./fillDefaults.js";import{splitURI as j}from"./pathUtils.js";import{jsonFromBinaryData as F,EncodedMeshTexture as H,imageFromBinaryData as P,isEncodedMeshTexture as V}from"./resourceUtils.js";import{DataType as k}from"../../../webgl/enums.js";const K={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu"],this._baseUri=j(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if(n(t)){const r=s(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const o=JSON.parse(r.isBase64?atob(r.data):r.data);return new Y(e,t,o)}catch{}const o=a(t);if(Y._isGLBData(o))return this._fromGLBData(e,t,o)}if(t.endsWith(".gltf")){const o=await e.loadJSON(t,r);return new Y(e,t,o)}const o=await e.loadBinary(t,r);if(Y._isGLBData(o))return this._fromGLBData(e,t,o);const i=await e.loadJSON(t,r);return new Y(e,t,i)}static _isGLBData(e){if(null==e)return!1;const t=new U(e);return t.remainingBytes()>=4&&t.readUint32()===K.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new U(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","GLB binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==K.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected GLB value.");if(r.byteLength<a)throw new e("gltf-loader-error","GLB binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported GLB container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==K.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First GLB chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await F(o.readUint8Array(r))}else if(1===f){if(n!==K.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second GLB chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 GLB chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No GLB JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","GLB buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(t,r){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const o=this.json.accessors[t];if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(o.type in[D.MAT2,D.MAT3,D.MAT4])throw new e("gltf-loader-unsupported-feature",`AttributeType ${o.type} is not supported`);const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=X[o.type],i=W[o.componentType],u=a*i,f=n.byteStride||u;return{raw:s.buffer,byteStride:f,byteOffset:s.byteOffset+(n.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===u,componentCount:a,componentByteSize:i,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case k.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case k.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case k.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case k.UNSIGNED_BYTE:return v(this._wrapAccessor(_,r));case k.UNSIGNED_SHORT:return v(this._wrapAccessor(b,r));case k.UNSIGNED_INT:return v(this._wrapAccessor(T,r))}}async getPositionData(t,r){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const o=await this.getAccessor(t.attributes.POSITION,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+k[o.componentType]);if(3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+o.componentCount.toFixed());return this._wrapAccessor(g,o)}async getNormalData(t,r){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const o=await this.getAccessor(t.attributes.NORMAL,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+k[o.componentType]);if(3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+o.componentCount.toFixed());return this._wrapAccessor(g,o)}async getTangentData(t,r){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const o=await this.getAccessor(t.attributes.TANGENT,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+k[o.componentType]);if(4!==o.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+o.componentCount.toFixed());return new x(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}async getTextureCoordinates(t,r){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const o=await this.getAccessor(t.attributes.TEXCOORD_0,r);if(2!==o.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+o.componentCount.toFixed());if(o.componentType===k.FLOAT)return this._wrapAccessor(O,o);if(!o.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return $(o)}async getVertexColors(t,r){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const o=await this.getAccessor(t.attributes.COLOR_0,r);if(4!==o.componentCount&&3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+o.componentCount.toFixed());if(4===o.componentCount){if(o.componentType===k.FLOAT)return this._wrapAccessor(x,o);if(o.componentType===k.UNSIGNED_BYTE)return this._wrapAccessor(N,o);if(o.componentType===k.UNSIGNED_SHORT)return this._wrapAccessor(S,o)}else if(3===o.componentCount){if(o.componentType===k.FLOAT)return this._wrapAccessor(g,o);if(o.componentType===k.UNSIGNED_BYTE)return this._wrapAccessor(C,o);if(o.componentType===k.UNSIGNED_SHORT)return this._wrapAccessor(A,o)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+k[o.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let o=e.material?this._materialCache.get(e.material):void 0;if(!o){const n=null!=e.material?G(this.json.materials[e.material]):G(),s=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),f=r?this.getTexture(n.occlusionTexture,t):void 0,c=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,l=null!=e.material?e.material:-1;o={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:s.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:l,occlusionTexture:await f,emissiveTexture:await c,emissiveFactor:n.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return o}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=M(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=this._getTextureSourceId(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,(()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}}))}getNodeTransform(e){if(void 0===e)return q;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=c(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=m(r),o.translation&&d(t,t,o.translation),o.rotation&&(z[3]=w(z,o.rotation),l(t,t,z[3],z)),o.scale&&p(t,t,o.scale)):t=m(r),this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return i(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=u.parse(this.json.asset.version,"glTF");J.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every((e=>this._supportedExtensions.includes(e))))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}_getTextureSourceId(t){if(void 0!==t.extensions&&null!==t.extensions.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(t,r){const o=this._getTextureSourceId(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new H(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return P(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await o(Array.from(this._bufferLoaders.values())),t=await o(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+t.reduce(((e,t)=>e+(t?V(t)?t.data.byteLength:t.width*t.height*4:0)),0)}}const q=f(h(),Math.PI/2),J=new u(2,0,"glTF"),z=y(),X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[k.BYTE]:1,[k.UNSIGNED_BYTE]:1,[k.SHORT]:2,[k.UNSIGNED_SHORT]:2,[k.FLOAT]:4,[k.INT]:4,[k.UNSIGNED_INT]:4};function $(e){switch(e.componentType){case k.BYTE:return new B(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_BYTE:return new R(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_SHORT:return new E(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_INT:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.FLOAT:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}export{Y as GLTFResource,q as TRANSFORM_GLTF_TO_ENGINE};
5
+ import e from"../../../../core/Error.js";import t from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{allSettledValues as o}from"../../../../core/promiseUtils.js";import{isDataProtocol as n,dataComponents as s,dataToArrayBuffer as a,makeAbsolute as i}from"../../../../core/urlUtils.js";import{Version as u}from"../../../../core/Version.js";import{A as f,m as c,w as d,k as l,b as p}from"../../../../chunks/mat4.js";import{a as h,b as m}from"../../../../chunks/mat4f64.js";import{g as w}from"../../../../chunks/quat.js";import{a as y}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as T,BufferViewUint16 as b,BufferViewUint8 as _,BufferViewVec3f as g,BufferViewVec4f as x,BufferViewVec2f as O,BufferViewVec4u8 as N,BufferViewVec4u16 as S,BufferViewVec3u8 as C,BufferViewVec3u16 as A,BufferViewVec2u32 as L,BufferViewVec2u16 as E,BufferViewVec2i16 as I,BufferViewVec2u8 as R,BufferViewVec2i8 as B}from"../../../../geometry/support/buffer/BufferView.js";import{m as v}from"../../../../chunks/scalar.js";import"../../../../core/has.js";import{BinaryStreamReader as U}from"./BinaryStreamReader.js";import{AttributeType as D}from"./enums.js";import{material as G,textureSampler as M}from"./fillDefaults.js";import{splitURI as j}from"./pathUtils.js";import{jsonFromBinaryData as F,EncodedMeshTexture as H,imageFromBinaryData as P,isEncodedMeshTexture as V}from"./resourceUtils.js";import{DataType as k}from"../../../webgl/enums.js";const K={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class Y{constructor(t,r,o,n){if(this._context=t,this.uri=r,this.json=o,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu"],this._baseUri=j(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==o.scenes)throw new e("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==o.meshes)throw new e("gltf-loader-unsupported-feature","Meshes must be defined");if(null==o.nodes)throw new e("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if(n(t)){const r=s(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const o=JSON.parse(r.isBase64?atob(r.data):r.data);return new Y(e,t,o)}catch{}const o=a(t);if(Y._isGLBData(o))return this._fromGLBData(e,t,o)}if(t.endsWith(".gltf")){const o=await e.loadJSON(t,r);return new Y(e,t,o)}const o=await e.loadBinary(t,r);if(Y._isGLBData(o))return this._fromGLBData(e,t,o);const i=await e.loadJSON(t,r);return new Y(e,t,i)}static _isGLBData(e){if(null==e)return!1;const t=new U(e);return t.remainingBytes()>=4&&t.readUint32()===K.MAGIC}static async _fromGLBData(e,t,r){const o=await Y._parseGLBData(r);return new Y(e,t,o.json,o.binaryData)}static async _parseGLBData(r){const o=new U(r);if(o.remainingBytes()<12)throw new e("gltf-loader-error","GLB binary data is insufficiently large.");const n=o.readUint32(),s=o.readUint32(),a=o.readUint32();if(n!==K.MAGIC)throw new e("gltf-loader-error","Magic first 4 bytes do not fit to expected GLB value.");if(r.byteLength<a)throw new e("gltf-loader-error","GLB binary data is smaller than header specifies.");if(2!==s)throw new e("gltf-loader-unsupported-feature","An unsupported GLB container version was detected. Only version 2 is supported.");let i,u,f=0;for(;o.remainingBytes()>=8;){const r=o.readUint32(),n=o.readUint32();if(0===f){if(n!==K.CHUNK_TYPE_JSON)throw new e("gltf-loader-error","First GLB chunk must be JSON.");if(r<0)throw new e("gltf-loader-error","No JSON data found.");i=await F(o.readUint8Array(r))}else if(1===f){if(n!==K.CHUNK_TYPE_BIN)throw new e("gltf-loader-unsupported-feature","Second GLB chunk expected to be BIN.");u=o.readUint8Array(r)}else t.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 GLB chunks detected. Skipping.");f+=1}if(!i)throw new e("gltf-loader-error","No GLB JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(t,r){const o=this.json.buffers[t];if(null==o.uri){if(null==this._glbBuffer)throw new e("gltf-loader-error","GLB buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(t,r);if(n.byteLength!==o.byteLength)throw new e("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(t,r){if(!this.json.accessors)throw new e("gltf-loader-unsupported-feature","Accessors missing.");const o=this.json.accessors[t];if(null==o?.bufferView)throw new e("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(o.type in[D.MAT2,D.MAT3,D.MAT4])throw new e("gltf-loader-unsupported-feature",`AttributeType ${o.type} is not supported`);const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,r),a=X[o.type],i=W[o.componentType],u=a*i,f=n.byteStride||u;return{raw:s.buffer,byteStride:f,byteOffset:s.byteOffset+(n.byteOffset||0)+(o.byteOffset||0),entryCount:o.count,isDenselyPacked:f===u,componentCount:a,componentByteSize:i,componentType:o.componentType,min:o.min,max:o.max,normalized:!!o.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case k.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case k.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case k.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case k.UNSIGNED_BYTE:return v(this._wrapAccessor(_,r));case k.UNSIGNED_SHORT:return v(this._wrapAccessor(b,r));case k.UNSIGNED_INT:return v(this._wrapAccessor(T,r))}}async getPositionData(t,r){if(null==t.attributes.POSITION)throw new e("gltf-loader-unsupported-feature","No POSITION vertex data found.");const o=await this.getAccessor(t.attributes.POSITION,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+k[o.componentType]);if(3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+o.componentCount.toFixed());return this._wrapAccessor(g,o)}async getNormalData(t,r){if(null==t.attributes.NORMAL)throw new e("gltf-loader-error","No NORMAL vertex data found.");const o=await this.getAccessor(t.attributes.NORMAL,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+k[o.componentType]);if(3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+o.componentCount.toFixed());return this._wrapAccessor(g,o)}async getTangentData(t,r){if(null==t.attributes.TANGENT)throw new e("gltf-loader-error","No TANGENT vertex data found.");const o=await this.getAccessor(t.attributes.TANGENT,r);if(o.componentType!==k.FLOAT)throw new e("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+k[o.componentType]);if(4!==o.componentCount)throw new e("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+o.componentCount.toFixed());return new x(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}async getTextureCoordinates(t,r){if(null==t.attributes.TEXCOORD_0)throw new e("gltf-loader-error","No TEXCOORD_0 vertex data found.");const o=await this.getAccessor(t.attributes.TEXCOORD_0,r);if(2!==o.componentCount)throw new e("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+o.componentCount.toFixed());if(o.componentType===k.FLOAT)return this._wrapAccessor(O,o);if(!o.normalized)throw new e("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return $(o)}async getVertexColors(t,r){if(null==t.attributes.COLOR_0)throw new e("gltf-loader-error","No COLOR_0 vertex data found.");const o=await this.getAccessor(t.attributes.COLOR_0,r);if(4!==o.componentCount&&3!==o.componentCount)throw new e("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+o.componentCount.toFixed());if(4===o.componentCount){if(o.componentType===k.FLOAT)return this._wrapAccessor(x,o);if(o.componentType===k.UNSIGNED_BYTE)return this._wrapAccessor(N,o);if(o.componentType===k.UNSIGNED_SHORT)return this._wrapAccessor(S,o)}else if(3===o.componentCount){if(o.componentType===k.FLOAT)return this._wrapAccessor(g,o);if(o.componentType===k.UNSIGNED_BYTE)return this._wrapAccessor(C,o);if(o.componentType===k.UNSIGNED_SHORT)return this._wrapAccessor(A,o)}throw new e("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+k[o.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let o=e.material?this._materialCache.get(e.material):void 0;if(!o){const n=null!=e.material?G(this.json.materials[e.material]):G(),s=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),f=r?this.getTexture(n.occlusionTexture,t):void 0,c=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,l=null!=e.material?e.material:-1;o={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:s.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:l,occlusionTexture:await f,emissiveTexture:await c,emissiveFactor:n.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return o}async getTexture(t,o){if(!t)return;if(0!==(t.texCoord||0))throw new e("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const n=t.index,s=this.json.textures[n],a=M(null!=s.sampler?this.json.samplers[s.sampler]:{}),i=this._getTextureSourceId(s),u=this.json.images[i],f=await this._loadTextureImageData(n,s,o);return r(this._textureCache,n,(()=>{const t=e=>33071===e||33648===e||10497===e,r=t=>{throw new e("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${t}`)};return{data:f,wrapS:t(a.wrapS)?a.wrapS:r(a.wrapS),wrapT:t(a.wrapT)?a.wrapT:r(a.wrapT),minFilter:a.minFilter,name:u.name,id:n}}))}getNodeTransform(e){if(void 0===e)return q;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=c(h(),r,o.matrix):o.translation||o.rotation||o.scale?(t=m(r),o.translation&&d(t,t,o.translation),o.rotation&&(z[3]=w(z,o.rotation),l(t,t,z[3],z)),o.scale&&p(t,t,o.scale)):t=m(r),this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return i(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=u.parse(this.json.asset.version,"glTF");J.validate(e)}_checkRequiredExtensionsSupported(){const t=this.json;if(t.extensionsRequired){if(!t.extensionsRequired.every((e=>this._supportedExtensions.includes(e))))throw new e("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+t.extensionsRequired.join(", "))}}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}_getTextureSourceId(t){if(void 0!==t.extensions&&null!==t.extensions.KHR_texture_basisu)return t.extensions.KHR_texture_basisu.source;if(null!==t.source)return t.source;throw new e("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(t,r){const o=this._getTextureSourceId(t),n=this.json.images[o];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),r);return new H(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(null==n.bufferView)throw new e("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new e("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(null!=s.byteStride)throw new e("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return P(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await o(Array.from(this._bufferLoaders.values())),t=await o(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+t.reduce(((e,t)=>e+(t?V(t)?t.data.byteLength:t.width*t.height*4:0)),0)}}const q=f(h(),Math.PI/2),J=new u(2,0,"glTF"),z=y(),X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={[k.BYTE]:1,[k.UNSIGNED_BYTE]:1,[k.SHORT]:2,[k.UNSIGNED_SHORT]:2,[k.FLOAT]:4,[k.INT]:4,[k.UNSIGNED_INT]:4};function $(e){switch(e.componentType){case k.BYTE:return new B(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_BYTE:return new R(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_SHORT:return new E(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.UNSIGNED_INT:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case k.FLOAT:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}export{Y as GLTFResource,q as TRANSFORM_GLTF_TO_ENGINE};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as r,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{f as l}from"../../../chunks/mat3.js";import{c as h}from"../../../chunks/mat3f64.js";import{c as d,s as _,m as u,i as g}from"../../../chunks/mat4.js";import{c as m}from"../../../chunks/mat4f64.js";import{k as f}from"../../../chunks/vec2.js";import{e as p,t as b,m as v,b as y,i as j,a as L,s as S,g as R}from"../../../chunks/vec3.js";import{c as O,Z as w}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E}from"../../../geometry/projection.js";import{computeENUToSphericalPCPFLocalRotation as D}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as F}from"../../../geometry/projection/projectors.js";import{containsPointObject as k}from"../../../geometry/support/aaBoundingRect.js";import{create as z,distance2 as P,fromPoints as C,closestRayDistance2 as I}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as x,intersectRay as U}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as W}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as G}from"../support/geometryUtils/ray.js";import{Camera as Y}from"../webgl-engine/lib/Camera.js";import{Object3D as Z}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as J}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as K,ManipulatorStateFlags as Q}from"../../interactive/interfaces.js";import X from"../../../geometry/Point.js";class ${constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new X({x:0,y:0,z:0}),this._elevationAlignedLocation=new X,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=K.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=fe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){ee(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),te(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(ee(this._modelTransform)){const t=this._calculateModelTransformOffset(ge);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,ie),o=this._getCollisionRadius(i),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+n;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae),r=o*this.screenLocation.pixelSize,a=G(this._camera,s,oe);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],i);for(let t=1;t<s.length;t++){const o=v(he,s[t],i),l=I(C(e,o,se),a);if(null!=l&&l<r*r){const t=p(W.get(),e,o);y(t,t,.5);const i=c(W.get());return this._camera.projectToRenderScreen(t,i),i[2]+n}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=o*this.screenLocation.pixelSize,c=G(this._camera,s,oe);if(null==c)return null;const h=l(ne,r),d=b(_e,e,h),_=v(ue,t,r);x(_,d,ce);const u=de;if(U(ce,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+n;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=G(this._camera,s,oe);if(null==h)return null;const d=l(ne,r),_=b(_e,t,d),u=this._calculateModelTransformPosition(ue);x(u,_,ce);const g=de;if(!U(ce,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],r);for(let t=1;t<s.length;t++){const i=v(he,s[t],r),o=P(C(e,i,se),g);if(null!=o&&o<a*a){const t=p(W.get(),e,i);y(t,t,.5);const s=c(W.get());return this._camera.projectToRenderScreen(t,s),s[2]+n}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new J(t,{pickable:!1,updatePolicy:q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new X({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,me,e.spatialReference)&&k(e.extent,me)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=this.elevationInfo.offset??0;switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ae;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Q.Focused:Q.Unfocused)|(this.selected?Q.Selected:Q.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=(n&Q.All)!==Q.None,i=(n&K.All)!==K.None,a=!e||(s&n)==(n&Q.All),c=!i||(this.state&n)==(n&K.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new Z({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,re);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){let e=!1;if(null!=this._engineResources)for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function ee(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function te(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return F(t,0,le,0,o.radius),D(s(le[0]),s(le[1]),i),!0}}}const ie=n(),se=z(),oe=B(),ne=h(),re=m(),ae=m(),ce=M(),le=O(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=new X({x:0,y:0,z:0,spatialReference:null}),fe=()=>{};export{$ as Manipulator3D};
5
+ import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as r,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{f as l}from"../../../chunks/mat3.js";import{a as h}from"../../../chunks/mat3f64.js";import{h as d,s as _,m as u,g}from"../../../chunks/mat4.js";import{a as m}from"../../../chunks/mat4f64.js";import{k as f}from"../../../chunks/vec2.js";import{g as p,t as b,e as v,i as y,c as j,a as L,s as S,f as R}from"../../../chunks/vec3.js";import{c as O,Z as w}from"../../../chunks/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E}from"../../../geometry/projection.js";import{computeENUToSphericalPCPFLocalRotation as D}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as k}from"../../../geometry/projection/projectors.js";import{containsPointObject as F}from"../../../geometry/support/aaBoundingRect.js";import{create as z,distance2 as C,fromPoints as P,closestRayDistance2 as I}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as x,intersectRay as U}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as W}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as G}from"../support/geometryUtils/ray.js";import{Camera as Y}from"../webgl-engine/lib/Camera.js";import{Object3D as Z}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as J}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as K,ManipulatorStateFlags as Q}from"../../interactive/interfaces.js";import X from"../../../geometry/Point.js";class ${constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new X({x:0,y:0,z:0}),this._elevationAlignedLocation=new X,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=K.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=fe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){ee(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),te(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(ee(this._modelTransform)){const t=this._calculateModelTransformOffset(ge);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,ie),o=this._getCollisionRadius(i),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+n;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae),r=o*this.screenLocation.pixelSize,a=G(this._camera,s,oe);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],i);for(let t=1;t<s.length;t++){const o=v(he,s[t],i),l=I(P(e,o,se),a);if(null!=l&&l<r*r){const t=p(W.get(),e,o);y(t,t,.5);const i=c(W.get());return this._camera.projectToRenderScreen(t,i),i[2]+n}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=o*this.screenLocation.pixelSize,c=G(this._camera,s,oe);if(null==c)return null;const h=l(ne,r),d=b(_e,e,h),_=v(ue,t,r);x(_,d,ce);const u=de;if(U(ce,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+n;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ae),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=G(this._camera,s,oe);if(null==h)return null;const d=l(ne,r),_=b(_e,t,d),u=this._calculateModelTransformPosition(ue);x(u,_,ce);const g=de;if(!U(ce,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(le,s[0],r);for(let t=1;t<s.length;t++){const i=v(he,s[t],r),o=C(P(e,i,se),g);if(null!=o&&o<a*a){const t=p(W.get(),e,i);y(t,t,.5);const s=c(W.get());return this._camera.projectToRenderScreen(t,s),s[2]+n}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new J(t,{pickable:!1,updatePolicy:q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new X({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,me,e.spatialReference)&&F(e.extent,me)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=this.elevationInfo.offset??0;switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ae;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Q.Focused:Q.Unfocused)|(this.selected?Q.Selected:Q.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=(n&Q.All)!==Q.None,i=(n&K.All)!==K.None,a=!e||(s&n)==(n&Q.All),c=!i||(this.state&n)==(n&K.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new Z({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,re);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){let e=!1;if(null!=this._engineResources)for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function ee(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function te(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return k(t,0,le,0,o.radius),D(s(le[0]),s(le[1]),i),!0}}}const ie=n(),se=z(),oe=B(),ne=h(),re=m(),ae=m(),ce=M(),le=O(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=new X({x:0,y:0,z:0,spatialReference:null}),fe=()=>{};export{$ as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Color.js";import{multiplyOpacity as n}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as i}from"../../../core/handleUtils.js";import{f as t}from"../../../chunks/vec3.js";import{c as r}from"../../../chunks/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as a,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{ExtendedLineVisualElement as s,ExtensionType as p}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as c}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{DrapedRenderGroup as m}from"../layers/interfaces.js";import{RenderOccludedFlag as f}from"../webgl-engine/lib/Material.js";import{toDehydratedPoint as g,create as v}from"../../interactive/sketch/normalizedPoint.js";import{defaults as h}from"../../interactive/snapping/Settings.js";import{SnappingDomain as E}from"../../interactive/snapping/SnappingDomain.js";import{LineSegmentHintType as C}from"../../interactive/snapping/snappingUtils.js";import{SnappingVisualizer as S}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as j}from"../../interactive/snapping/hints/LineSnappingHint.js";import{vectorToRender as w}from"../../interactive/support/viewUtils.js";class O extends S{sortUniqueHints(e){return e.sort(((e,n)=>(n instanceof j?n.length:0)-(e instanceof j?e.length:0)))}visualizeIntersectionPoint(e,n){const{spatialReference:t,view:r}=n,o=D(n);return i(new d({view:r,primitive:"circle",geometry:g(e.intersectionPoint,t),elevationInfo:e.isDraped?a:l,size:20,outlineSize:2,color:o.intersectionPointColor,outlineColor:o.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=R(e.point,e.domain,n);return i(new d({view:t,primitive:"circle",geometry:g(a,r),elevationInfo:A(e,n),size:20,outlineSize:2,color:o.pointColor,outlineColor:o.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=R(e.lineStart,e.domain,n),l=R(e.lineEnd,e.domain,n);return i(this._createLineSegmentHint(e.type,a,l,r,A(e,n),t,o,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,n){const{view:r,spatialReference:o}=n,a=D(n),{isDraped:l}=e,s=A(e,n),p=R(e.lineStart,e.domain,n),d=R(e.lineEnd,e.domain,n),u=x(p,o,s,r,l),g=x(d,o,s,r,l),v=t(g,u,g,.5),E=new c({view:r,attached:!1,offset:h.parallelLineHintOffset,length:h.parallelLineHintLength,width:h.parallelLineHintWidth,color:a.parallelSignColor,location:v,renderOccluded:l?f.OccludeAndTransparent:f.Opaque,isDraped:l,renderGroup:m.SnappingHint,isDecoration:!0});return E.setDirectionFromPoints(u,v),E.attached=!0,i(E)}visualizeRightAngleQuad(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=A(e,n),{isDraped:l}=e,s=R(e.previousVertex,e.domain,n),p=R(e.centerVertex,e.domain,n),c=R(e.nextVertex,e.domain,n),d=x(s,r,a,t,l),g=x(p,r,a,t,l),v=x(c,r,a,t,l);return i(new u({view:t,attached:!0,color:l?o.rightAngleColorDraped:o.rightAngleColor,renderOccluded:l?f.OccludeAndTransparent:f.Transparent,outlineRenderOccluded:l?f.OccludeAndTransparent:f.Opaque,outlineColor:o.rightAngleOutlineColor,outlineSize:h.rightAngleHintOutlineSize,size:h.rightAngleHintSize,isDraped:l,geometry:{previous:d,center:g,next:v},renderGroup:m.SnappingHint,isDecoration:!0}))}_createLineSegmentHint(e,n,i,t,r,o,a,l=!1,c=!0,d=!0){const u=x(n,t,r,o,l),g=x(i,t,r,o,l),v=new s({view:o,extensionType:p.FADED,start:u,end:g,isDraped:l,color:a.lineColor,renderOccluded:l?f.OccludeAndTransparent:f.Opaque,renderGroup:m.SnappingHint,isDecoration:!0});switch(e){case C.TARGET:v.width=h.lineHintWidthTarget,v.fadedExtensions={start:0,end:h.lineHintFadedExtensions};break;case C.REFERENCE_EXTENSION:v.width=h.lineHintWidthReference,v.fadedExtensions={start:0,end:0};break;case C.REFERENCE:v.width=h.lineHintWidthReference,v.fadedExtensions={start:c?h.lineHintFadedExtensions:0,end:d?h.lineHintFadedExtensions:0}}return v.attached=!0,v}}function D(i){const{effectiveTheme:t}=i.view,r=e.toUnitRGBA(t.accentColor),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:r,pointColor:o,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e.toUnitRGBA(n(t.accentColor,.5)),rightAngleOutlineColor:r}}function R(e,n,i){const t=H(n,i);return null==t?e:v(e[0],e[1],t)}function A(e,n){return null!=H(e.domain,n)?n.selfSnappingZ.elevationInfo:e.isDraped?a:l}function H(e,{selfSnappingZ:n}){return e===E.SELF&&null!=n?n.value:null}function x(e,n,i,t,a,l=r()){if(a){const i=t.basemapTerrain.overlayManager.renderer.spatialReference;o(e,n,l,i)}else w(e,n,i,t,l);return l}export{O as SnappingVisualizer3D};
5
+ import e from"../../../Color.js";import{multiplyOpacity as n}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as i}from"../../../core/handleUtils.js";import{p as t}from"../../../chunks/vec3.js";import{c as r}from"../../../chunks/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as a,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{ExtendedLineVisualElement as s,ExtensionType as p}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as c}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{DrapedRenderGroup as m}from"../layers/interfaces.js";import{RenderOccludedFlag as f}from"../webgl-engine/lib/Material.js";import{toDehydratedPoint as g,create as v}from"../../interactive/sketch/normalizedPoint.js";import{defaults as h}from"../../interactive/snapping/Settings.js";import{SnappingDomain as E}from"../../interactive/snapping/SnappingDomain.js";import{LineSegmentHintType as C}from"../../interactive/snapping/snappingUtils.js";import{SnappingVisualizer as S}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as j}from"../../interactive/snapping/hints/LineSnappingHint.js";import{vectorToRender as w}from"../../interactive/support/viewUtils.js";class O extends S{sortUniqueHints(e){return e.sort(((e,n)=>(n instanceof j?n.length:0)-(e instanceof j?e.length:0)))}visualizeIntersectionPoint(e,n){const{spatialReference:t,view:r}=n,o=D(n);return i(new d({view:r,primitive:"circle",geometry:g(e.intersectionPoint,t),elevationInfo:e.isDraped?a:l,size:20,outlineSize:2,color:o.intersectionPointColor,outlineColor:o.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=R(e.point,e.domain,n);return i(new d({view:t,primitive:"circle",geometry:g(a,r),elevationInfo:A(e,n),size:20,outlineSize:2,color:o.pointColor,outlineColor:o.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=R(e.lineStart,e.domain,n),l=R(e.lineEnd,e.domain,n);return i(this._createLineSegmentHint(e.type,a,l,r,A(e,n),t,o,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,n){const{view:r,spatialReference:o}=n,a=D(n),{isDraped:l}=e,s=A(e,n),p=R(e.lineStart,e.domain,n),d=R(e.lineEnd,e.domain,n),u=x(p,o,s,r,l),g=x(d,o,s,r,l),v=t(g,u,g,.5),E=new c({view:r,attached:!1,offset:h.parallelLineHintOffset,length:h.parallelLineHintLength,width:h.parallelLineHintWidth,color:a.parallelSignColor,location:v,renderOccluded:l?f.OccludeAndTransparent:f.Opaque,isDraped:l,renderGroup:m.SnappingHint,isDecoration:!0});return E.setDirectionFromPoints(u,v),E.attached=!0,i(E)}visualizeRightAngleQuad(e,n){const{view:t,spatialReference:r}=n,o=D(n),a=A(e,n),{isDraped:l}=e,s=R(e.previousVertex,e.domain,n),p=R(e.centerVertex,e.domain,n),c=R(e.nextVertex,e.domain,n),d=x(s,r,a,t,l),g=x(p,r,a,t,l),v=x(c,r,a,t,l);return i(new u({view:t,attached:!0,color:l?o.rightAngleColorDraped:o.rightAngleColor,renderOccluded:l?f.OccludeAndTransparent:f.Transparent,outlineRenderOccluded:l?f.OccludeAndTransparent:f.Opaque,outlineColor:o.rightAngleOutlineColor,outlineSize:h.rightAngleHintOutlineSize,size:h.rightAngleHintSize,isDraped:l,geometry:{previous:d,center:g,next:v},renderGroup:m.SnappingHint,isDecoration:!0}))}_createLineSegmentHint(e,n,i,t,r,o,a,l=!1,c=!0,d=!0){const u=x(n,t,r,o,l),g=x(i,t,r,o,l),v=new s({view:o,extensionType:p.FADED,start:u,end:g,isDraped:l,color:a.lineColor,renderOccluded:l?f.OccludeAndTransparent:f.Opaque,renderGroup:m.SnappingHint,isDecoration:!0});switch(e){case C.TARGET:v.width=h.lineHintWidthTarget,v.fadedExtensions={start:0,end:h.lineHintFadedExtensions};break;case C.REFERENCE_EXTENSION:v.width=h.lineHintWidthReference,v.fadedExtensions={start:0,end:0};break;case C.REFERENCE:v.width=h.lineHintWidthReference,v.fadedExtensions={start:c?h.lineHintFadedExtensions:0,end:d?h.lineHintFadedExtensions:0}}return v.attached=!0,v}}function D(i){const{effectiveTheme:t}=i.view,r=e.toUnitRGBA(t.accentColor),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:r,pointColor:o,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e.toUnitRGBA(n(t.accentColor,.5)),rightAngleOutlineColor:r}}function R(e,n,i){const t=H(n,i);return null==t?e:v(e[0],e[1],t)}function A(e,n){return null!=H(e.domain,n)?n.selfSnappingZ.elevationInfo:e.isDraped?a:l}function H(e,{selfSnappingZ:n}){return e===E.SELF&&null!=n?n.value:null}function x(e,n,i,t,a,l=r()){if(a){const i=t.basemapTerrain.overlayManager.renderer.spatialReference;o(e,n,l,i)}else w(e,n,i,t,l);return l}export{O as SnappingVisualizer3D};