@arcgis/core 4.25.0-next.20220920 → 4.25.0-next.20220921

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 (460) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{d5650f455ce5ba15ad10.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4969b64dc17378d7781f.js → 7ce250cc6fbe68aef50d.js} +3 -3
  15. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  23. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  24. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  28. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  29. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  32. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  33. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  34. package/assets/esri/t9n/common_ar.json +1 -1
  35. package/assets/esri/t9n/common_bg.json +1 -1
  36. package/assets/esri/t9n/common_bs.json +1 -1
  37. package/assets/esri/t9n/common_ca.json +1 -1
  38. package/assets/esri/t9n/common_cs.json +1 -1
  39. package/assets/esri/t9n/common_da.json +1 -1
  40. package/assets/esri/t9n/common_de.json +1 -1
  41. package/assets/esri/t9n/common_el.json +1 -1
  42. package/assets/esri/t9n/common_es.json +1 -1
  43. package/assets/esri/t9n/common_et.json +1 -1
  44. package/assets/esri/t9n/common_fi.json +1 -1
  45. package/assets/esri/t9n/common_fr.json +1 -1
  46. package/assets/esri/t9n/common_he.json +1 -1
  47. package/assets/esri/t9n/common_hr.json +1 -1
  48. package/assets/esri/t9n/common_hu.json +1 -1
  49. package/assets/esri/t9n/common_id.json +1 -1
  50. package/assets/esri/t9n/common_it.json +1 -1
  51. package/assets/esri/t9n/common_ja.json +1 -1
  52. package/assets/esri/t9n/common_ko.json +1 -1
  53. package/assets/esri/t9n/common_lt.json +1 -1
  54. package/assets/esri/t9n/common_lv.json +1 -1
  55. package/assets/esri/t9n/common_nb.json +1 -1
  56. package/assets/esri/t9n/common_nl.json +1 -1
  57. package/assets/esri/t9n/common_pl.json +1 -1
  58. package/assets/esri/t9n/common_pt-BR.json +1 -1
  59. package/assets/esri/t9n/common_pt-PT.json +1 -1
  60. package/assets/esri/t9n/common_ro.json +1 -1
  61. package/assets/esri/t9n/common_ru.json +1 -1
  62. package/assets/esri/t9n/common_sk.json +1 -1
  63. package/assets/esri/t9n/common_sl.json +1 -1
  64. package/assets/esri/t9n/common_sr.json +1 -1
  65. package/assets/esri/t9n/common_sv.json +1 -1
  66. package/assets/esri/t9n/common_th.json +1 -1
  67. package/assets/esri/t9n/common_tr.json +1 -1
  68. package/assets/esri/t9n/common_uk.json +1 -1
  69. package/assets/esri/t9n/common_vi.json +1 -1
  70. package/assets/esri/t9n/common_zh-CN.json +1 -1
  71. package/assets/esri/t9n/common_zh-HK.json +1 -1
  72. package/assets/esri/t9n/common_zh-TW.json +1 -1
  73. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  74. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  75. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  76. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  77. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  78. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  79. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  80. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  81. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  82. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  83. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  84. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  85. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  86. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  87. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  88. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  89. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  90. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  112. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  113. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  114. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  115. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  116. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  117. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  118. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  119. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  120. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  121. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  122. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  123. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  124. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  125. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  126. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  127. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  128. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  129. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  151. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  152. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  153. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  154. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  155. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  156. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  157. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  158. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  159. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  160. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  161. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  162. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  163. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  164. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  165. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  166. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  167. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  168. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  190. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  191. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  192. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  193. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  194. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  195. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  196. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  197. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  198. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  199. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  200. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  201. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  202. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  203. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  204. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  205. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  206. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  207. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  229. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  230. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  231. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  232. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  233. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  234. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  235. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  236. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  237. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  238. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  239. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  240. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  241. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  242. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  243. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  244. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  245. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  246. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  268. package/chunks/Compositing.glsl.js +4 -19
  269. package/chunks/HUDCompositing.glsl.js +7 -0
  270. package/chunks/Laserlines.glsl.js +5 -5
  271. package/chunks/OITCompositing.glsl.js +13 -0
  272. package/chunks/OverlayCompositing.glsl.js +8 -0
  273. package/chunks/Precipitation.glsl.js +1 -1
  274. package/chunks/ShadowHighlight.glsl.js +1 -1
  275. package/chunks/boundedPlane.js +1 -1
  276. package/chunks/cameraUtilsPlanar.js +1 -1
  277. package/chunks/cameraUtilsSpherical.js +1 -1
  278. package/chunks/mat3.js +1 -1
  279. package/chunks/quat.js +1 -1
  280. package/chunks/quat2.js +1 -1
  281. package/chunks/quatf64.js +1 -1
  282. package/chunks/sphere.js +1 -1
  283. package/chunks/vec3.js +1 -1
  284. package/chunks/vec3f32.js +1 -1
  285. package/chunks/vec4f64.js +1 -1
  286. package/core/VectorStack.js +1 -1
  287. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  288. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  289. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  290. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  291. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  292. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  293. package/core/perspectiveUtils.js +1 -1
  294. package/geohash/GeohashTree.js +1 -1
  295. package/geometry/support/MeshTransform.js +1 -1
  296. package/geometry/support/axisAngle.js +1 -1
  297. package/geometry/support/axisAngleDegrees.js +1 -1
  298. package/geometry/support/lineSegment.js +1 -1
  299. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  300. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  301. package/geometry/support/meshUtils/georeference.js +1 -1
  302. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  303. package/geometry/support/meshUtils/projection.js +1 -1
  304. package/geometry/support/meshUtils/rotate.js +1 -1
  305. package/geometry/support/plane.js +1 -1
  306. package/interfaces.d.ts +70 -0
  307. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  308. package/layers/graphics/featureConversionUtils.js +1 -1
  309. package/layers/mixins/EditBusLayer.js +1 -1
  310. package/layers/support/AggregateField.js +1 -1
  311. package/layers/support/ControlPointsGeoreference.js +1 -1
  312. package/layers/support/OutStatistic.js +1 -1
  313. package/layers/support/VoxelVolume.js +1 -1
  314. package/layers/support/voxelPlaneUtils.js +1 -1
  315. package/package.json +1 -1
  316. package/rest/support/AggregateFeatureSet.js +5 -0
  317. package/support/revision.js +1 -1
  318. package/views/2d/ViewState.js +1 -1
  319. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  320. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  321. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  322. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  323. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  324. package/views/2d/engine/webgl/WGLTile.js +1 -1
  325. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  326. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  327. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  328. package/views/2d/layers/features/schemaUtils.js +1 -1
  329. package/views/2d/layers/features/support/BinStore.js +1 -1
  330. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  331. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  332. package/views/2d/layers/support/DebugOverlay.js +1 -1
  333. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  334. package/views/2d/layers/support/clusterUtils.js +1 -1
  335. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  336. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  337. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  338. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  339. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  340. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  341. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  342. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  343. package/views/3d/camera/constraintUtils/distance.js +1 -1
  344. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  345. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  347. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  348. package/views/3d/glTF/internal/Resource.js +1 -1
  349. package/views/3d/interactive/Manipulator3D.js +1 -1
  350. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  351. package/views/3d/interactive/editingTools/settings.js +1 -1
  352. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  353. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  354. package/views/3d/interactive/manipulatorUtils.js +1 -1
  355. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  356. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  357. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  358. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  359. package/views/3d/layers/I3SMeshView3D.js +1 -1
  360. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  361. package/views/3d/layers/PointCloudWorker.js +1 -1
  362. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  363. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  364. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  365. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  366. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  367. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  368. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  369. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  370. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  371. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  372. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  373. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  374. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  375. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  376. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  377. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  378. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  379. package/views/3d/layers/support/edgeUtils.js +1 -1
  380. package/views/3d/layers/support/uvUtils.js +1 -1
  381. package/views/3d/state/Frustum.js +1 -1
  382. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  383. package/views/3d/state/controllers/RotateController.js +1 -1
  384. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  385. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  386. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  387. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  388. package/views/3d/state/utils/navigationUtils.js +1 -1
  389. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  390. package/views/3d/support/orientedBoundingBox.js +1 -1
  391. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  392. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  393. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  394. package/views/3d/support/sunUtils.js +1 -1
  395. package/views/3d/terrain/OverlayRenderer.js +1 -1
  396. package/views/3d/terrain/PatchRenderData.js +1 -1
  397. package/views/3d/terrain/TerrainSurface.js +1 -1
  398. package/views/3d/terrain/Tile.js +1 -1
  399. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  400. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  401. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  402. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  403. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  404. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  405. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  406. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  407. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  408. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  409. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  410. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  411. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  412. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  413. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  414. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  415. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  416. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  417. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  418. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  420. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  422. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  423. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  424. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  425. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  426. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  427. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  428. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  429. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  433. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  434. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  435. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  436. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  437. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  438. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  439. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  440. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  441. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  442. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  443. package/views/interactive/coordinateHelper.js +1 -1
  444. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  445. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  446. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  447. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  448. package/views/layers/FeatureLayerView.js +1 -1
  449. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  450. package/views/support/Scheduler.js +1 -1
  451. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  452. package/views/support/geometry3dUtils.js +1 -1
  453. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  454. package/widgets/ElevationProfile/support/constants.js +1 -1
  455. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  456. package/widgets/Feature/FeatureRelationship.js +1 -1
  457. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  458. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  459. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  460. package/assets/esri/core/workers/chunks/e00327925ca82b63fded.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,c as t}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h,c as m}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{MaterialPassParameters as o,ShadowMapPassParameters as P,HighlightPassParameters as l,MaterialSubPass as d,RenderPassIdentifier as p}from"./AllRenderPasses.js";import{RenderPass as c,RenderPassSorting as u}from"./RenderPass.js";import{ShaderOutput as _}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{union as b}from"../../lib/depthRange.js";import{RenderSlot as w}from"../../lib/RenderSlot.js";class f{constructor(s,a){this.rctx=s,this.shaderTechniqueRepository=a,this.canRender=!0,this._materialPassParameters=new o,this._shadowPassParameters=new P,this._highlightPassParameters=new l,this._systems=new Set,this._passes={materialOpaque:new c(s,a),materialTransparent:new c(s,a,u.BackToFront),materialIntegratedMesh:new c(s,a),shadowMap:new c(s,a),highlight:new c(s,a),highlightIntegratedMesh:new c(s,a),highlightShadowMap:new c(s,a),defaultShadowMap:new c(s,a)}}register(s){this._systems.add(s)}prepareRender(s){if(0!==this._systems.size){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((a=>a.submit(this._passes,s.bindParameters)));for(const s of Object.values(this._passes))s.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}render(s){if(0!==this._systems.size)switch(this._configure(s),s.bindParameters.slot){case w.OPAQUE_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlight.dispatch(this._highlightPassParameters,s.bindParameters);case _.Shadow:return this._passes.shadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowHighlight:return this._passes.highlightShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowExludeHighlight:return this._passes.defaultShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.TRANSPARENT_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Alpha:return this._materialPassParameters.subPass=d.Alpha,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.INTEGRATED_MESH:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlightIntegratedMesh.dispatch(this._highlightPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters)}return}}notifyDirty(){this._context.requestRender()}slots(){return[w.OPAQUE_MATERIAL,w.TRANSPARENT_MATERIAL,w.INTEGRATED_MESH]}initializeRenderContext(s){this._context=s}uninitializeRenderContext(){}queryDepthRange(a){const e={near:1/0,far:-1/0};return this._systems.forEach((t=>{const r=t.queryShadowCasterDepthRange(a);s(r)&&b(e,r,e)})),e}_configure(s){const a=s.output===_.Shadow||s.output===_.ShadowHighlight||s.output===_.ShadowExludeHighlight?this._shadowPassParameters:s.output===_.Highlight?this._highlightPassParameters:this._materialPassParameters;this._updateParameters(s,a)}_updateParameters(s,r){const n=s.bindParameters.camera,o=n.viewInverseTransposeMatrix;h(T,o[3],o[7],o[11]),A.set(T),m(r.transformWorldFromViewTH,A.high),m(r.transformWorldFromViewTL,A.low),m(r.slicePlaneLocalOrigin,T),a(r.transformViewFromCameraRelativeRS,n.viewMatrix),i(r.transformProjFromView,n.projectionMatrix),r.identifier===p.Material&&(this._materialPassParameters.transparent=s.bindParameters.slot===w.TRANSPARENT_MATERIAL,this._materialPassParameters.integratedMesh=s.bindParameters.slot===w.INTEGRATED_MESH,e(R,r.transformViewFromCameraRelativeRS),t(r.transformNormalViewFromGlobal,R))}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}get needsTransparentPass(){return this._passes.materialTransparent.count>0}}const T=n(),R=r(),A=new g;export{f as RenderPassManager};
5
+ import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,e as t}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h,c as m}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{MaterialPassParameters as o,ShadowMapPassParameters as P,HighlightPassParameters as l,MaterialSubPass as d,RenderPassIdentifier as p}from"./AllRenderPasses.js";import{RenderPass as c,RenderPassSorting as u}from"./RenderPass.js";import{ShaderOutput as _}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{union as b}from"../../lib/depthRange.js";import{RenderSlot as w}from"../../lib/RenderSlot.js";class f{constructor(s,a){this.rctx=s,this.shaderTechniqueRepository=a,this.canRender=!0,this._materialPassParameters=new o,this._shadowPassParameters=new P,this._highlightPassParameters=new l,this._systems=new Set,this._passes={materialOpaque:new c(s,a),materialTransparent:new c(s,a,u.BackToFront),materialIntegratedMesh:new c(s,a),shadowMap:new c(s,a),highlight:new c(s,a),highlightIntegratedMesh:new c(s,a),highlightShadowMap:new c(s,a),defaultShadowMap:new c(s,a)}}register(s){this._systems.add(s)}prepareRender(s){if(0!==this._systems.size){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((a=>a.submit(this._passes,s.bindParameters)));for(const s of Object.values(this._passes))s.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}render(s){if(0!==this._systems.size)switch(this._configure(s),s.bindParameters.slot){case w.OPAQUE_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlight.dispatch(this._highlightPassParameters,s.bindParameters);case _.Shadow:return this._passes.shadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowHighlight:return this._passes.highlightShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowExludeHighlight:return this._passes.defaultShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.TRANSPARENT_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Alpha:return this._materialPassParameters.subPass=d.Alpha,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.INTEGRATED_MESH:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlightIntegratedMesh.dispatch(this._highlightPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters)}return}}notifyDirty(){this._context.requestRender()}slots(){return[w.OPAQUE_MATERIAL,w.TRANSPARENT_MATERIAL,w.INTEGRATED_MESH]}initializeRenderContext(s){this._context=s}uninitializeRenderContext(){}queryDepthRange(a){const e={near:1/0,far:-1/0};return this._systems.forEach((t=>{const r=t.queryShadowCasterDepthRange(a);s(r)&&b(e,r,e)})),e}_configure(s){const a=s.output===_.Shadow||s.output===_.ShadowHighlight||s.output===_.ShadowExludeHighlight?this._shadowPassParameters:s.output===_.Highlight?this._highlightPassParameters:this._materialPassParameters;this._updateParameters(s,a)}_updateParameters(s,r){const n=s.bindParameters.camera,o=n.viewInverseTransposeMatrix;h(T,o[3],o[7],o[11]),A.set(T),m(r.transformWorldFromViewTH,A.high),m(r.transformWorldFromViewTL,A.low),m(r.slicePlaneLocalOrigin,T),a(r.transformViewFromCameraRelativeRS,n.viewMatrix),i(r.transformProjFromView,n.projectionMatrix),r.identifier===p.Material&&(this._materialPassParameters.transparent=s.bindParameters.slot===w.TRANSPARENT_MATERIAL,this._materialPassParameters.integratedMesh=s.bindParameters.slot===w.INTEGRATED_MESH,e(R,r.transformViewFromCameraRelativeRS),t(r.transformNormalViewFromGlobal,R))}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}get needsTransparentPass(){return this._passes.materialTransparent.count>0}}const T=n(),R=r(),A=new g;export{f as RenderPassManager};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as e,isNone as s,isSome as i}from"../../../../../core/maybe.js";import{v as a}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{m as c,a as r,b as l,s as t}from"../../../../../chunks/vec3.js";import{Z as n,c as f}from"../../../../../chunks/vec3f64.js";import{Float3DrawUniform as d}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as _}from"../shaderModules/Float3PassUniform.js";import{NoParameters as P,glsl as h}from"../shaderModules/interfaces.js";class m extends P{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function p(s,i){H(s,i,[new _("slicePlaneOrigin",((e,s)=>b(i,e,s))),new _("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new _("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function u(s,i){H(s,i,[new d("slicePlaneOrigin",((e,s)=>b(i,e,s))),new d("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new d("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function H(e,s,i){if(!s.hasSlicePlane){const i=h`#define rejectBySlice(_pos_) false
5
+ import{unwrap as e,isNone as s,isSome as i}from"../../../../../core/maybe.js";import{v as a}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{v as c,a as r,b as l,s as t}from"../../../../../chunks/vec3.js";import{Z as n,c as f}from"../../../../../chunks/vec3f64.js";import{Float3DrawUniform as d}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as _}from"../shaderModules/Float3PassUniform.js";import{NoParameters as P,glsl as h}from"../shaderModules/interfaces.js";class m extends P{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function p(s,i){H(s,i,[new _("slicePlaneOrigin",((e,s)=>b(i,e,s))),new _("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new _("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function u(s,i){H(s,i,[new d("slicePlaneOrigin",((e,s)=>b(i,e,s))),new d("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new d("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function H(e,s,i){if(!s.hasSlicePlane){const i=h`#define rejectBySlice(_pos_) false
6
6
  #define discardBySlice(_pos_) {}
7
7
  #define highlightSlice(_color_, _pos_) (_color_)`;return s.hasSliceInVertexProgram&&e.vertex.code.add(i),void e.fragment.code.add(i)}e.extensions.add("GL_OES_standard_derivatives"),s.hasSliceInVertexProgram&&e.vertex.uniforms.add(i),e.fragment.uniforms.add(i);const a=h`struct SliceFactors {
8
8
  float front;
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{c as r}from"../../../../../../chunks/mat3f64.js";import{c as o}from"../../../../../../chunks/mat4f64.js";import{c as e}from"../../../../../../chunks/vec3f32.js";import{c as t}from"../../../../../../chunks/vec3f64.js";import{PositionAttribute as a}from"./PositionAttribute.glsl.js";import{DoublePrecision as s}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as i}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as m}from"../../shaderModules/Float3PassUniform.js";import{glsl as d,NoParameters as n}from"../../shaderModules/interfaces.js";import{Matrix3DrawUniform as l}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as f}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as v}from"../../shaderModules/Matrix4PassUniform.js";function F(r,o){r.include(a);const e=r.vertex;e.include(s,o),r.varyings.add("vPositionWorldCameraRelative","vec3"),r.varyings.add("vPosition_view","vec3"),e.uniforms.add([new m("transformWorldFromViewTH",(r=>r.transformWorldFromViewTH)),new m("transformWorldFromViewTL",(r=>r.transformWorldFromViewTL)),new f("transformViewFromCameraRelativeRS",(r=>r.transformViewFromCameraRelativeRS)),new v("transformProjFromView",(r=>r.transformProjFromView)),new l("transformWorldFromModelRS",(r=>r.transformWorldFromModelRS)),new i("transformWorldFromModelTH",(r=>r.transformWorldFromModelTH)),new i("transformWorldFromModelTL",(r=>r.transformWorldFromModelTL))]),e.code.add(d`vec3 positionWorldCameraRelative() {
5
+ import{c as r}from"../../../../../../chunks/mat3f64.js";import{c as o}from"../../../../../../chunks/mat4f64.js";import{b as e}from"../../../../../../chunks/vec3f32.js";import{c as t}from"../../../../../../chunks/vec3f64.js";import{PositionAttribute as a}from"./PositionAttribute.glsl.js";import{DoublePrecision as s}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as i}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as m}from"../../shaderModules/Float3PassUniform.js";import{glsl as d,NoParameters as n}from"../../shaderModules/interfaces.js";import{Matrix3DrawUniform as l}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as f}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as v}from"../../shaderModules/Matrix4PassUniform.js";function F(r,o){r.include(a);const e=r.vertex;e.include(s,o),r.varyings.add("vPositionWorldCameraRelative","vec3"),r.varyings.add("vPosition_view","vec3"),e.uniforms.add([new m("transformWorldFromViewTH",(r=>r.transformWorldFromViewTH)),new m("transformWorldFromViewTL",(r=>r.transformWorldFromViewTL)),new f("transformViewFromCameraRelativeRS",(r=>r.transformViewFromCameraRelativeRS)),new v("transformProjFromView",(r=>r.transformProjFromView)),new l("transformWorldFromModelRS",(r=>r.transformWorldFromModelRS)),new i("transformWorldFromModelTH",(r=>r.transformWorldFromModelTH)),new i("transformWorldFromModelTL",(r=>r.transformWorldFromModelTL))]),e.code.add(d`vec3 positionWorldCameraRelative() {
6
6
  vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
7
7
  vec3 transform_CameraRelativeFromModel = dpAdd(
8
8
  transformWorldFromModelTL,
@@ -25,4 +25,4 @@ return transform_CameraRelativeFromModel + rotatedModelPosition;
25
25
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
26
26
  }`),r.fragment.code.add(d`vec3 positionWorld() {
27
27
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
28
- }`)}class c extends n{constructor(){super(...arguments),this.transformWorldFromViewTH=t(),this.transformWorldFromViewTL=t(),this.transformViewFromCameraRelativeRS=r(),this.transformProjFromView=o()}}class W extends n{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=e(),this.transformWorldFromModelTL=e()}}export{F as VertexPosition,W as VertexPositionDrawParameters,c as VertexPositionPassParameters};
28
+ }`)}class W extends n{constructor(){super(...arguments),this.transformWorldFromViewTH=t(),this.transformWorldFromViewTL=t(),this.transformViewFromCameraRelativeRS=r(),this.transformProjFromView=o()}}class c extends n{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=e(),this.transformWorldFromModelTL=e()}}export{F as VertexPosition,c as VertexPositionDrawParameters,W as VertexPositionPassParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e,isSome as t}from"../../../../../core/maybe.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";class s{constructor(e){this._context=e,this._perConstructorInstances=new r,this._frameCounter=0,this._keepAliveFrameCount=o}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}dispose(){this._perConstructorInstances.forEach((e=>e.forEach((e=>e.technique.destroy())))),this._perConstructorInstances.clear()}acquire(t,r){const s=r.key;let o=this._perConstructorInstances.get(t,s);if(e(o)){const e=new t(this._context,r,(()=>this.release(e)));o=new n(e),this._perConstructorInstances.set(t,s,o)}return++o.refCount,o.technique}releaseAndAcquire(e,r,s){if(t(s)){if(r.key===s.key)return s;this.release(s)}return this.acquire(e,r)}release(t){if(e(t)||this._perConstructorInstances.empty)return;const r=this._perConstructorInstances.get(t.constructor,t.key);e(r)||(--r.refCount,0===r.refCount&&(r.refZeroFrame=this._frameCounter))}frameUpdate(){this._frameCounter++,this._keepAliveFrameCount!==o&&this._perConstructorInstances.forEach(((e,t)=>{e.forEach(((e,r)=>{0===e.refCount&&e.refZeroFrame+this._keepAliveFrameCount<this._frameCounter&&(e.technique.destroy(),this._perConstructorInstances.delete(t,r))}))}))}async reloadAll(){const e=new Array;this._perConstructorInstances.forEach(((t,r)=>{const s=async(e,t)=>{const r=t.shader;r&&(await r.reload(),e.forEach((e=>e.technique.reload(this._context))))};e.push(s(t,r))})),await Promise.all(e)}}class n{constructor(e){this.technique=e,this.refCount=0,this.refZeroFrame=0}}const o=-1;export{s as ShaderTechniqueRepository};
5
+ import{isNone as e,isSome as t}from"../../../../../core/maybe.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";import{ShaderTechniqueConfiguration as s}from"./ShaderTechniqueConfiguration.js";class n{constructor(e){this._context=e,this._perConstructorInstances=new r,this._frameCounter=0,this._keepAliveFrameCount=c}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}dispose(){this._perConstructorInstances.forEach((e=>e.forEach((e=>e.technique.destroy())))),this._perConstructorInstances.clear()}acquire(t,r=i){const s=r.key;let n=this._perConstructorInstances.get(t,s);if(e(n)){const e=new t(this._context,r,(()=>this.release(e)));n=new o(e),this._perConstructorInstances.set(t,s,n)}return++n.refCount,n.technique}releaseAndAcquire(e,r,s){if(t(s)){if(r.key===s.key)return s;this.release(s)}return this.acquire(e,r)}release(t){if(e(t)||this._perConstructorInstances.empty)return;const r=this._perConstructorInstances.get(t.constructor,t.key);e(r)||(--r.refCount,0===r.refCount&&(r.refZeroFrame=this._frameCounter))}frameUpdate(){this._frameCounter++,this._keepAliveFrameCount!==c&&this._perConstructorInstances.forEach(((e,t)=>{e.forEach(((e,r)=>{0===e.refCount&&e.refZeroFrame+this._keepAliveFrameCount<this._frameCounter&&(e.technique.destroy(),this._perConstructorInstances.delete(t,r))}))}))}async reloadAll(){const e=new Array;this._perConstructorInstances.forEach(((t,r)=>{const s=async(e,t)=>{const r=t.shader;r&&(await r.reload(),e.forEach((e=>e.technique.reload(this._context))))};e.push(s(t,r))})),await Promise.all(e)}}class o{constructor(e){this.technique=e,this.refCount=0,this.refZeroFrame=0}}const c=-1,i=new s;export{n as ShaderTechniqueRepository};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{c as s,y as t,s as h,a as e,g as i}from"../../../../../chunks/vec3.js";import{c as o}from"../../../../../chunks/vec3f32.js";import{c as r}from"../../../../../chunks/vec3f64.js";class c{constructor(s){this._low=o(),this._high=o(),s&&this.set(s)}get low(){return this._low}get high(){return this._high}set(h){const e=this._low,i=this._high;s(e,h),t(i,h,e)}setElements(s,t,e){h(n,s,t,e),this.set(n)}get(s){return e(s,this._low,this._high)}getLowScaled(s){return i(s,this._low,1)}}const n=r();export{c as TwoVectorPosition};
5
+ import{c as s,p as t,s as h,a as e,g as i}from"../../../../../chunks/vec3.js";import{b as o}from"../../../../../chunks/vec3f32.js";import{c as r}from"../../../../../chunks/vec3f64.js";class c{constructor(s){this._low=o(),this._high=o(),s&&this.set(s)}get low(){return this._low}get high(){return this._high}set(h){const e=this._low,i=this._high;s(e,h),t(i,h,e)}setElements(s,t,e){h(n,s,t,e),this.set(n)}get(s){return e(s,this._low,this._high)}getLowScaled(s){return i(s,this._low,1)}}const n=r();export{c as TwoVectorPosition};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Logger.js";import{lerp as i}from"../../../../core/mathUtils.js";import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{c as o,m as n,p as a,a as _,t as p,q as u}from"../../../../chunks/mat4.js";import{c as v}from"../../../../chunks/mat4f64.js";import{c,m as w}from"../../../../chunks/vec2.js";import{f as l}from"../../../../chunks/vec2f64.js";import{c as d,b as y,i as g,k as m,y as f,e as D,D as x,E as j,g as M,l as T,s as P,f as R,n as F,r as O}from"../../../../chunks/vec3.js";import{c as V,a as I,f as S}from"../../../../chunks/vec3f64.js";import{c as E,g as L,i as b,t as H}from"../../../../chunks/vec4.js";import{f as k,c as B}from"../../../../chunks/vec4f64.js";import{create as G,copy as U,fromMatrix as A}from"../../../../geometry/support/frustum.js";import{create as C}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as z}from"../../../../geometry/support/vector.js";import{ViewingMode as W}from"../../../ViewingMode.js";import{fovd2fovx as X,fovx2fovd as Y,fovd2fovy as q,fovy2fovd as N}from"./Util.js";class J{constructor(t=null,i=null,r=null){this._viewUp=V(),this._viewForward=V(),this._viewRight=V(),this._ray=C(),this._viewport=k(0,0,1,1),this._padding=k(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=l(1,1e3),this._viewDirty=!0,this._viewMatrix=v(),this._projectionDirty=!0,this._projectionMatrix=v(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=v(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=v(),this._inverseProjectionDirty=!0,this._inverseProjectionMatrix=null,this._frustumDirty=!0,this._frustum=G(),this._fullViewport=B(),this._pixelRatio=1,this.relativeElevation=0,e(t)&&d(this._ray.origin,t),this._center=e(i)?I(i):V(),this._up=e(r)?I(r):S(0,0,1)}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center)}get ray(){return y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up)}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){o(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get x(){return this._viewport[0]}set x(t){t+=this._padding[it.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get y(){return this._viewport[1]}set y(t){t+=this._padding[it.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get fullWidth(){return this._viewport[2]+this._padding[it.RIGHT]+this._padding[it.LEFT]}set fullWidth(t){this.width=t-(this._padding[it.RIGHT]+this._padding[it.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[it.TOP]+this._padding[it.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[it.TOP]+this._padding[it.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[it.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[it.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){this._padding[it.TOP]===t[it.TOP]&&this._padding[it.RIGHT]===t[it.RIGHT]&&this._padding[it.BOTTOM]===t[it.BOTTOM]&&this._padding[it.LEFT]===t[it.LEFT]||(this._viewport[0]+=t[it.LEFT]-this._padding[it.LEFT],this._viewport[1]+=t[it.BOTTOM]-this._padding[it.BOTTOM],this._viewport[2]-=t[it.RIGHT]+t[it.LEFT]-(this._padding[it.RIGHT]+this._padding[it.LEFT]),this._viewport[3]-=t[it.TOP]+t[it.BOTTOM]-(this._padding[it.TOP]+this._padding[it.BOTTOM]),E(this._padding,t),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get viewProjectionMatrix(){return this._viewProjectionDirty&&(n(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){if(this._projectionDirty){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this.aspect;a(this._projectionMatrix,-r*(1+2*this._padding[it.LEFT]/t),r*(1+2*this._padding[it.RIGHT]/t),-e*(1+2*this._padding[it.BOTTOM]/i),e*(1+2*this._padding[it.TOP]/i),this.near,this.far),this._projectionDirty=!1}return this._projectionMatrix}get inverseProjectionMatrix(){return r(this._inverseProjectionMatrix)&&(this._inverseProjectionMatrix=v()),this._inverseProjectionDirty&&_(this._inverseProjectionMatrix,this.projectionMatrix),this._inverseProjectionMatrix}set projectionMatrix(t){o(this._projectionMatrix,t),this._projectionDirty=!1,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fov(){return this._fov}set fov(t){this._fov=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return X(this._fov,this.width,this.height)}set fovX(t){this._fov=Y(t,this.width,this.height),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return q(this._fov,this.width,this.height)}set fovY(t){this._fov=N(t,this.width,this.height),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return g(this._center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(_(this._viewInverseTransposeMatrix,this.viewMatrix),p(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this._pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){d(this._ray.origin,t.eye),d(this._center,t.center),d(this._up,t.up),E(this._viewport,t.viewport),E(this._padding,t.padding),c(this._nearFar,t.nearFar),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(o(this._viewMatrix,t.viewMatrix),d(this._viewRight,t.viewRight),d(this._viewUp,t.viewUp),d(this._viewForward,t.viewForward)),i._projectionDirty?this._projectionDirty=!0:(o(this._projectionMatrix,t.projectionMatrix),this._projectionDirty=!1),this._viewProjectionDirty=!0,this._inverseProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(U(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(o(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),E(this._fullViewport,t.fullViewport),this._pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new J).copyFrom(this)}equals(t){return m(this.eye,t.eye)&&m(this._center,t.center)&&m(this._up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&w(this._nearFar,t.nearFar)&&this._fov===t.fov&&this._pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(this._pixelRatio!==t.pixelRatio||Math.abs(t.fov-this._fov)>=.001)return!1;const i=5e-4,e=1-1e-10;f(Z,t.eye,t.center),f($,this.eye,this._center);const r=D(Z,$),s=x(Z),h=x($);return r*r>=e*s*h&&j(t.eye,this.eye)<Math.max(s,h)*i*i&&b(t.padding,this._padding)<.5&&b(t.viewport,this._viewport)<.5}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(z(this.viewForward,y(Z,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[it.LEFT]+this.width/2)/this._pixelRatio,t[1]=(this.padding[it.TOP]+this.height/2)/this._pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[it.LEFT]+this.width*i,t[1]=this.padding[it.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,e){t!==K&&d(K,t),K[3]=1,H(K,K,this.projectionMatrix);const r=Math.abs(K[3]);M(K,K,1/r);const s=this.fullViewport;e[0]=i(0,s[0]+s[2],.5+.5*K[0]),e[1]=i(0,s[1]+s[3],.5+.5*K[1]),e[2]=.5*(K[2]+1),e[3]=r}unapplyProjection(t,i){const e=this.fullViewport;K[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],K[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],K[2]=(2*t[2]-1)*t[3],K[3]=t[3],H(K,K,this.inverseProjectionMatrix),i[0]=K[0],i[1]=K[1],i[2]=K[2]}projectToScreen(t,i){this.projectToRenderScreen(t,tt),this.renderToScreen(tt,i)}projectToRenderScreen(t,e){if(K[0]=t[0],K[1]=t[1],K[2]=t[2],K[3]=1,H(K,K,this.viewProjectionMatrix),0===K[3])return null;M(K,K,1/Math.abs(K[3]));const r=this.fullViewport;return"x"in e?(e.x=i(0,r[0]+r[2],.5+.5*K[0]),e.y=i(0,r[1]+r[3],.5+.5*K[1])):(e[0]=i(0,r[0]+r[2],.5+.5*K[0]),e[1]=i(0,r[1]+r[3],.5+.5*K[1]),e.length>2&&(e[2]=.5*(K[2]+1))),e}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,tt),i)}unprojectFromRenderScreen(t,i){if(n(Q,this.projectionMatrix,this.viewMatrix),!_(Q,Q))return null;const e=this.fullViewport;return K[0]=2*(t[0]-e[0])/e[2]-1,K[1]=2*(t[1]-e[1])/e[3]-1,K[2]=2*t[2]-1,K[3]=1,H(K,K,Q),0===K[3]?null:(i[0]=K[0]/K[3],i[1]=K[1]/K[3],i[2]=K[2]/K[3],i)}constrainWindowSize(t,i,e,r=e){const s=t*this._pixelRatio,h=i*this._pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),_=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-_- -Math.min(h-r/2,0)]}computeUp(t){t===W.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this._pixelRatio,r=this.fullHeight-t[1]*this._pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this._pixelRatio,r=(this.fullHeight-t[1])/this._pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){y(Z,this.center,this.eye);const t=T(this.center);t<1?(P(this._up,0,0,1),this._markViewDirty()):Math.abs(D(Z,this.center))>.9999*T(Z)*t||(R(this._up,Z,this.center),R(this._up,this._up,Z),F(this._up,this._up),this._markViewDirty())}_computeUpLocal(){O(Z,this.eye,this.center),Math.abs(Z[2])<=.9999&&(M(Z,Z,Z[2]),P(this._up,-Z[0],-Z[1],1-Z[2]),F(this._up,this._up),this._markViewDirty())}_compareAndSetView(i,e){"number"==typeof i[0]&&isFinite(i[0])&&"number"==typeof i[1]&&isFinite(i[1])&&"number"==typeof i[2]&&isFinite(i[2])?m(i,e)||(d(e,i),this._markViewDirty()):t.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(A(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(u(this._viewMatrix,this.eye,this._center,this._up),P(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),P(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),P(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}}const K=B(),Q=v(),Z=V(),$=V(),tt=h();var it;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(it||(it={}));export{J as Camera,it as PaddingSide};
5
+ import t from"../../../../core/Logger.js";import{lerp as i}from"../../../../core/mathUtils.js";import{isSome as e,isNone as r}from"../../../../core/maybe.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{c as o,m as n,p as a,a as _,t as p,q as u}from"../../../../chunks/mat4.js";import{c as v}from"../../../../chunks/mat4f64.js";import{c,m as w}from"../../../../chunks/vec2.js";import{f as l}from"../../../../chunks/vec2f64.js";import{c as d,b as y,i as g,w as m,p as f,e as D,D as x,E as j,g as M,l as T,s as P,f as R,n as F,A as O}from"../../../../chunks/vec3.js";import{c as V,a as I,f as S}from"../../../../chunks/vec3f64.js";import{c as E,g as L,i as b,t as H}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as U,copy as k,fromMatrix as A}from"../../../../geometry/support/frustum.js";import{create as C}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as z}from"../../../../geometry/support/vector.js";import{ViewingMode as W}from"../../../ViewingMode.js";import{fovd2fovx as X,fovx2fovd as Y,fovd2fovy as q,fovy2fovd as N}from"./Util.js";class J{constructor(t=null,i=null,r=null){this._viewUp=V(),this._viewForward=V(),this._viewRight=V(),this._ray=C(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=l(1,1e3),this._viewDirty=!0,this._viewMatrix=v(),this._projectionDirty=!0,this._projectionMatrix=v(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=v(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=v(),this._inverseProjectionDirty=!0,this._inverseProjectionMatrix=null,this._frustumDirty=!0,this._frustum=U(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0,e(t)&&d(this._ray.origin,t),this._center=e(i)?I(i):V(),this._up=e(r)?I(r):S(0,0,1)}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center)}get ray(){return y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up)}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){o(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get x(){return this._viewport[0]}set x(t){t+=this._padding[it.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get y(){return this._viewport[1]}set y(t){t+=this._padding[it.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get fullWidth(){return this._viewport[2]+this._padding[it.RIGHT]+this._padding[it.LEFT]}set fullWidth(t){this.width=t-(this._padding[it.RIGHT]+this._padding[it.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[it.TOP]+this._padding[it.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[it.TOP]+this._padding[it.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[it.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[it.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){this._padding[it.TOP]===t[it.TOP]&&this._padding[it.RIGHT]===t[it.RIGHT]&&this._padding[it.BOTTOM]===t[it.BOTTOM]&&this._padding[it.LEFT]===t[it.LEFT]||(this._viewport[0]+=t[it.LEFT]-this._padding[it.LEFT],this._viewport[1]+=t[it.BOTTOM]-this._padding[it.BOTTOM],this._viewport[2]-=t[it.RIGHT]+t[it.LEFT]-(this._padding[it.RIGHT]+this._padding[it.LEFT]),this._viewport[3]-=t[it.TOP]+t[it.BOTTOM]-(this._padding[it.TOP]+this._padding[it.BOTTOM]),E(this._padding,t),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0)}get viewProjectionMatrix(){return this._viewProjectionDirty&&(n(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){if(this._projectionDirty){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this.aspect;a(this._projectionMatrix,-r*(1+2*this._padding[it.LEFT]/t),r*(1+2*this._padding[it.RIGHT]/t),-e*(1+2*this._padding[it.BOTTOM]/i),e*(1+2*this._padding[it.TOP]/i),this.near,this.far),this._projectionDirty=!1}return this._projectionMatrix}get inverseProjectionMatrix(){return r(this._inverseProjectionMatrix)&&(this._inverseProjectionMatrix=v()),this._inverseProjectionDirty&&_(this._inverseProjectionMatrix,this.projectionMatrix),this._inverseProjectionMatrix}set projectionMatrix(t){o(this._projectionMatrix,t),this._projectionDirty=!1,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fov(){return this._fov}set fov(t){this._fov=t,this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return X(this._fov,this.width,this.height)}set fovX(t){this._fov=Y(t,this.width,this.height),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return q(this._fov,this.width,this.height)}set fovY(t){this._fov=N(t,this.width,this.height),this._projectionDirty=!0,this._inverseProjectionDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return g(this._center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(_(this._viewInverseTransposeMatrix,this.viewMatrix),p(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this._pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){d(this._ray.origin,t.eye),d(this._center,t.center),d(this._up,t.up),E(this._viewport,t.viewport),E(this._padding,t.padding),c(this._nearFar,t.nearFar),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(o(this._viewMatrix,t.viewMatrix),d(this._viewRight,t.viewRight),d(this._viewUp,t.viewUp),d(this._viewForward,t.viewForward)),i._projectionDirty?this._projectionDirty=!0:(o(this._projectionMatrix,t.projectionMatrix),this._projectionDirty=!1),this._viewProjectionDirty=!0,this._inverseProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(k(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(o(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),E(this._fullViewport,t.fullViewport),this._pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new J).copyFrom(this)}equals(t){return m(this.eye,t.eye)&&m(this._center,t.center)&&m(this._up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&w(this._nearFar,t.nearFar)&&this._fov===t.fov&&this._pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(this._pixelRatio!==t.pixelRatio||Math.abs(t.fov-this._fov)>=.001)return!1;const i=5e-4,e=1-1e-10;f(Z,t.eye,t.center),f($,this.eye,this._center);const r=D(Z,$),s=x(Z),h=x($);return r*r>=e*s*h&&j(t.eye,this.eye)<Math.max(s,h)*i*i&&b(t.padding,this._padding)<.5&&b(t.viewport,this._viewport)<.5}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(z(this.viewForward,y(Z,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[it.LEFT]+this.width/2)/this._pixelRatio,t[1]=(this.padding[it.TOP]+this.height/2)/this._pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[it.LEFT]+this.width*i,t[1]=this.padding[it.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,e){t!==K&&d(K,t),K[3]=1,H(K,K,this.projectionMatrix);const r=Math.abs(K[3]);M(K,K,1/r);const s=this.fullViewport;e[0]=i(0,s[0]+s[2],.5+.5*K[0]),e[1]=i(0,s[1]+s[3],.5+.5*K[1]),e[2]=.5*(K[2]+1),e[3]=r}unapplyProjection(t,i){const e=this.fullViewport;K[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],K[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],K[2]=(2*t[2]-1)*t[3],K[3]=t[3],H(K,K,this.inverseProjectionMatrix),i[0]=K[0],i[1]=K[1],i[2]=K[2]}projectToScreen(t,i){this.projectToRenderScreen(t,tt),this.renderToScreen(tt,i)}projectToRenderScreen(t,e){if(K[0]=t[0],K[1]=t[1],K[2]=t[2],K[3]=1,H(K,K,this.viewProjectionMatrix),0===K[3])return null;M(K,K,1/Math.abs(K[3]));const r=this.fullViewport;return"x"in e?(e.x=i(0,r[0]+r[2],.5+.5*K[0]),e.y=i(0,r[1]+r[3],.5+.5*K[1])):(e[0]=i(0,r[0]+r[2],.5+.5*K[0]),e[1]=i(0,r[1]+r[3],.5+.5*K[1]),e.length>2&&(e[2]=.5*(K[2]+1))),e}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,tt),i)}unprojectFromRenderScreen(t,i){if(n(Q,this.projectionMatrix,this.viewMatrix),!_(Q,Q))return null;const e=this.fullViewport;return K[0]=2*(t[0]-e[0])/e[2]-1,K[1]=2*(t[1]-e[1])/e[3]-1,K[2]=2*t[2]-1,K[3]=1,H(K,K,Q),0===K[3]?null:(i[0]=K[0]/K[3],i[1]=K[1]/K[3],i[2]=K[2]/K[3],i)}constrainWindowSize(t,i,e,r=e){const s=t*this._pixelRatio,h=i*this._pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),_=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-_- -Math.min(h-r/2,0)]}computeUp(t){t===W.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this._pixelRatio,r=this.fullHeight-t[1]*this._pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this._pixelRatio,r=(this.fullHeight-t[1])/this._pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){y(Z,this.center,this.eye);const t=T(this.center);t<1?(P(this._up,0,0,1),this._markViewDirty()):Math.abs(D(Z,this.center))>.9999*T(Z)*t||(R(this._up,Z,this.center),R(this._up,this._up,Z),F(this._up,this._up),this._markViewDirty())}_computeUpLocal(){O(Z,this.eye,this.center),Math.abs(Z[2])<=.9999&&(M(Z,Z,Z[2]),P(this._up,-Z[0],-Z[1],1-Z[2]),F(this._up,this._up),this._markViewDirty())}_compareAndSetView(i,e){"number"==typeof i[0]&&isFinite(i[0])&&"number"==typeof i[1]&&isFinite(i[1])&&"number"==typeof i[2]&&isFinite(i[2])?m(i,e)||(d(e,i),this._markViewDirty()):t.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(A(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(u(this._viewMatrix,this.eye,this._center,this._up),P(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),P(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),P(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}}const K=G(),Q=v(),Z=V(),$=V(),tt=h();var it;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(it||(it={}));export{J as Camera,it as PaddingSide};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as s,isNone as t}from"../../../../core/maybe.js";import{OverlayIndex as i}from"../../terrain/interfaces.js";import{createQuadVAO as r}from"./glUtil3D.js";import{C as e}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as a}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as o,AlphaMode as n,CompositingFunction as h}from"../shaders/CompositingTechniqueConfiguration.js";import{PrimitiveType as c}from"../../../webgl/enums.js";import{vertexCount as p}from"../../../webgl/Util.js";class _{constructor(s,t){this._rctx=s,this._techniqueRepository=t,this._configuration=new o,this._passParameters=new e}dispose(){this._vao=s(this._vao)}compositeTransparent(s,t,i,r,e=1){this._configuration.alphaMode=n.Alpha,this._configuration.function=h.Transparency,this._configuration.hasOpacityFactor=1!==e,this._passParameters.colorTexture=t,this._passParameters.alphaTexture=i,this._passParameters.frontFaceTexture=r;const o=this._rctx,_=this._techniqueRepository.acquire(a,this._configuration);o.bindTechnique(_,this._passParameters,s);const m=this._ensureVAO();o.bindVAO(m),o.drawArrays(c.TRIANGLE_STRIP,0,p(m,"geometry")),_.release()}composite(s,t,r=n.None,e=1,o=h.Standard,_=i.INNER){const m=this._rctx;this._configuration.alphaMode=r,this._configuration.function=o,this._configuration.hasOpacityFactor=1!==e,this._passParameters.overlayIndex=_,this._passParameters.texture=t,this._passParameters.opacity=e;const u=this._techniqueRepository.acquire(a,this._configuration);m.bindTechnique(u,this._passParameters,s);const f=this._ensureVAO();m.bindVAO(f),m.drawArrays(c.TRIANGLE_STRIP,0,p(f,"geometry")),u.release()}_ensureVAO(){return t(this._vao)&&(this._vao=r(this._rctx)),this._vao}}export{_ as default};
5
+ import{disposeMaybe as e,isNone as s}from"../../../../core/maybe.js";import{createQuadVAO as t}from"./glUtil3D.js";import{C as r}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as i}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as o,AlphaMode as a}from"../shaders/CompositingTechniqueConfiguration.js";import{H as h}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as n}from"../shaders/HUDCompositingTechnique.js";import{O as m}from"../../../../chunks/OITCompositing.glsl.js";import{OITCompositingTechnique as c}from"../shaders/OITCompositingTechnique.js";import{O as _}from"../../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as u}from"../shaders/OverlayCompositingTechnique.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{vertexCount as l}from"../../../webgl/Util.js";class y{constructor(e,s){this._rctx=e,this._techniqueRepository=s,this._configuration=new o,this._passParameters=new r,this._oitParameters=new m,this._hudParameters=new h,this._overlayParameters=new _}dispose(){this._vao=e(this._vao)}compositeOIT(e,s,t,r){this._oitParameters.colorTexture=s,this._oitParameters.alphaTexture=t,this._oitParameters.frontFaceTexture=r;const i=this._rctx,o=this._techniqueRepository.acquire(c);i.bindTechnique(o,this._oitParameters,e);const a=this._ensureVAO();i.bindVAO(a),i.drawArrays(p.TRIANGLE_STRIP,0,l(a,"geometry")),o.release()}compositeHUD(e,s){this._hudParameters.texture=s;const t=this._rctx,r=this._techniqueRepository.acquire(n);t.bindTechnique(r,this._hudParameters,e);const i=this._ensureVAO();t.bindVAO(i),t.drawArrays(p.TRIANGLE_STRIP,0,l(i,"geometry")),r.release()}compositeOverlay(e,s,t,r){this._overlayParameters.texture=s,this._overlayParameters.opacity=t,this._overlayParameters.overlayIndex=r;const i=this._rctx,o=this._techniqueRepository.acquire(u);i.bindTechnique(o,this._overlayParameters,e);const a=this._ensureVAO();i.bindVAO(a),i.drawArrays(p.TRIANGLE_STRIP,0,l(a,"geometry")),o.release()}composite(e,s,t=a.None,r=1){const o=this._rctx;this._configuration.alphaMode=t,this._configuration.hasOpacityFactor=1!==r,this._passParameters.texture=s,this._passParameters.opacity=r;const h=this._techniqueRepository.acquire(i,this._configuration);o.bindTechnique(h,this._passParameters,e);const n=this._ensureVAO();o.bindVAO(n),o.drawArrays(p.TRIANGLE_STRIP,0,l(n,"geometry")),h.release()}_ensureVAO(){return s(this._vao)&&(this._vao=t(this._rctx)),this._vao}}export{y 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../../../core/maybe.js";import r from"../../../../core/ObjectPool.js";import{generateUID as s}from"../../../../core/uid.js";import{m as i}from"../../../../chunks/vec3.js";class o{constructor(){this._disposed=!1}get disposed(){return this._disposed}get shaderTransformation(){return this._shaderTransformation}acquire(t,r,i,o,e,a){this.id=s(),this.geometry=t,this.material=r,this.transformation=i,this.instanceParameters=o,this.origin=e,this._shaderTransformation=a,this._disposed=!1}release(){this._disposed=!1}dispose(){this._disposed=!0}getStaticTransformation(){return this.transformation}getShaderTransformation(){return t(this._shaderTransformation)?this._shaderTransformation(this.transformation):this.transformation}computeAttachmentOrigin(t){return!!(this.material.computeAttachmentOrigin?this.material.computeAttachmentOrigin(this.geometry,t):this.geometry.computeAttachmentOrigin(t))&&(i(t,t,this.getStaticTransformation()),!0)}}o.pool=new r(o);export{o as GeometryRecord};
5
+ import{isSome as t}from"../../../../core/maybe.js";import r from"../../../../core/ObjectPool.js";import{generateUID as s}from"../../../../core/uid.js";import{v as i}from"../../../../chunks/vec3.js";class o{constructor(){this._disposed=!1}get disposed(){return this._disposed}get shaderTransformation(){return this._shaderTransformation}acquire(t,r,i,o,e,a){this.id=s(),this.geometry=t,this.material=r,this.transformation=i,this.instanceParameters=o,this.origin=e,this._shaderTransformation=a,this._disposed=!1}release(){this._disposed=!1}dispose(){this._disposed=!0}getStaticTransformation(){return this.transformation}getShaderTransformation(){return t(this._shaderTransformation)?this._shaderTransformation(this.transformation):this.transformation}computeAttachmentOrigin(t){return!!(this.material.computeAttachmentOrigin?this.material.computeAttachmentOrigin(this.geometry,t):this.geometry.computeAttachmentOrigin(t))&&(i(t,t,this.getStaticTransformation()),!0)}}o.pool=new r(o);export{o as GeometryRecord};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{b as t,f as e,n,g as s,a,e as r,s as o,c as l,m as u}from"../../../../chunks/vec3.js";import{f as c,c as i,b as h}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{create as O,fromPositionAndNormal as p,intersectRay as A}from"../../../../geometry/support/plane.js";import{wrap as I}from"../../../../geometry/support/ray.js";import{PrimitiveType as M}from"./basicInterfaces.js";import{Vec3Compact as g}from"./BufferVectorMath.js";import{Geometry as y}from"./Geometry.js";import{generateDefaultIndexArray as d}from"./Indices.js";import{assert as N}from"./Util.js";import{VertexAttribute as w}from"./VertexAttribute.js";const P=g;var m,S,z;!function(t){const e=.5,n=[[-e,-e,e],[e,-e,e],[e,e,e],[-e,e,e],[-e,-e,-e],[e,-e,-e],[e,e,-e],[-e,e,-e]],s=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],a=[0,0,1,0,1,1,0,1],r=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],o=new Array(36);for(let c=0;c<6;c++)for(let t=0;t<6;t++)o[6*c+t]=c;const l=new Array(36);for(let c=0;c<6;c++)l[6*c+0]=0,l[6*c+1]=1,l[6*c+2]=2,l[6*c+3]=2,l[6*c+4]=3,l[6*c+5]=0;function u(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(24);for(let s=0;s<8;s++)e[3*s]=n[s][0]*t[0],e[3*s+1]=n[s][1]*t[1],e[3*s+2]=n[s][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s}],[w.UV0,{size:2,data:a}]],[[w.POSITION,r],[w.NORMAL,o],[w.UV0,l]])}t.createGeometry=u}(m||(m={})),function(t){const e=.5,n=[[-e,0,-e],[e,0,-e],[e,0,e],[-e,0,e],[0,-e,0],[0,e,0]],s=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],a=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],r=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function o(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(18);for(let s=0;s<6;s++)e[3*s]=n[s][0]*t[0],e[3*s+1]=n[s][1]*t[1],e[3*s+2]=n[s][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s}]],[[w.POSITION,a],[w.NORMAL,r]])}t.createGeometry=o}(S||(S={})),function(s){const a=.5,r=0,o=c(-a,r,-a),l=c(a,r,-a),u=c(0,r,a),h=c(0,r+a,0),f=i(),O=i(),p=i(),A=i(),I=i();t(f,o,h),t(O,o,l),e(p,f,O),n(p,p),t(f,l,h),t(O,l,u),e(A,f,O),n(A,A),t(f,u,h),t(O,u,o),e(I,f,O),n(I,I);const M=[o,l,u,h],g=[0,-1,0,p[0],p[1],p[2],A[0],A[1],A[2],I[0],I[1],I[2]],d=[0,1,2,3,1,0,3,2,1,3,0,2],N=[0,0,0,1,1,1,2,2,2,3,3,3];function P(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(12);for(let n=0;n<4;n++)e[3*n]=M[n][0]*t[0],e[3*n+1]=M[n][1]*t[1],e[3*n+2]=M[n][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:g}]],[[w.POSITION,d],[w.NORMAL,N]])}s.createGeometry=P}(z||(z={}));const v=m.createGeometry,x=S.createGeometry,L=z.createGeometry;function T(t,e,n,s={uv:!0}){const a=-Math.PI,r=2*Math.PI,o=-Math.PI/2,l=Math.PI,u=Math.max(3,Math.floor(e)),c=Math.max(2,Math.floor(n)),i=(u+1)*(c+1),h=new Float32Array(3*i),f=new Float32Array(3*i),O=new Float32Array(2*i),p=[];let A=0;for(let y=0;y<=c;y++){const e=[],n=y/c,s=o+n*l,i=Math.cos(s);for(let o=0;o<=u;o++){const l=o/u,c=a+l*r,p=Math.cos(c)*i,I=Math.sin(s),M=-Math.sin(c)*i;h[3*A]=p*t,h[3*A+1]=I*t,h[3*A+2]=M*t,f[3*A]=p,f[3*A+1]=I,f[3*A+2]=M,O[2*A]=l,O[2*A+1]=n,e.push(A),++A}p.push(e)}const I=new Array;for(let y=0;y<c;y++)for(let t=0;t<u;t++){const e=p[y][t],n=p[y][t+1],s=p[y+1][t+1],a=p[y+1][t];0===y?(I.push(e),I.push(s),I.push(a)):y===c-1?(I.push(e),I.push(n),I.push(s)):(I.push(e),I.push(n),I.push(s),I.push(s),I.push(a),I.push(e))}const M=[[w.POSITION,I],[w.NORMAL,I]],g=[[w.POSITION,{size:3,data:h,exclusive:!0}],[w.NORMAL,{size:3,data:f,exclusive:!0}]];return s.uv&&(g.push([w.UV0,{size:2,data:O,exclusive:!0}]),M.push([w.UV0,I])),s.offset&&(M[0][0]=w.OFFSET,g[0][0]=w.OFFSET,M.push([w.POSITION,new Array(I.length).fill(0)]),g.push([w.POSITION,{size:3,data:Float64Array.from(s.offset),exclusive:!0}])),new y(g,M)}function R(t,e,n){const s=t;let a,r;if(n)a=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=s*(1+Math.sqrt(5))/2;a=[-s,t,0,s,t,0,-s,-t,0,s,-t,0,0,-s,t,0,s,t,0,-s,-t,0,s,-t,t,0,-s,t,0,s,-t,0,-s,-t,0,s],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let h=0;h<a.length;h+=3)P.scale(a,h,t/P.length(a,h));let o={};function l(e,n){e>n&&([e,n]=[n,e]);const s=e.toString()+"."+n.toString();if(o[s])return o[s];let r=a.length;return a.length+=3,P.add(a,3*e,a,3*n,a,r),P.scale(a,r,t/P.length(a,r)),r/=3,o[s]=r,r}for(let h=0;h<e;h++){const t=r.length,e=new Array(4*t);for(let n=0;n<t;n+=3){const t=r[n],s=r[n+1],a=r[n+2],o=l(t,s),u=l(s,a),c=l(a,t),i=4*n;e[i]=t,e[i+1]=o,e[i+2]=c,e[i+3]=s,e[i+4]=u,e[i+5]=o,e[i+6]=a,e[i+7]=c,e[i+8]=u,e[i+9]=o,e[i+10]=u,e[i+11]=c}r=e,o={}}const u=new Float32Array(a);for(let h=0;h<u.length;h+=3)P.normalize(u,h);const c=[[w.POSITION,r],[w.NORMAL,r]],i=[[w.POSITION,{size:3,data:new Float32Array(a),exclusive:!0}],[w.NORMAL,{size:3,data:u,exclusive:!0}]];return new y(i,c)}function b(t,e,n,s,a,r,o,l){const u=e?[e[0],e[1],e[2]]:[0,0,0],c=t?[t[0],t[1],t[2]]:[0,0,1];r=r||[0,0];const i=n?[255*n[0],255*n[1],255*n[2],n.length>3?255*n[3]:255]:[255,255,255,255],h=null!=s&&2===s.length?s:[1,1],f=[[w.POSITION,{size:3,data:u,exclusive:!0}],[w.NORMAL,{size:3,data:c,exclusive:!0}],[w.UV0,{size:r.length,data:r}],[w.COLOR,{size:4,data:i,exclusive:!0}],[w.SIZE,{size:2,data:h}]];if(null!=a){const t=new Float32Array([a[0],a[1],a[2],a[3]]);f.push([w.AUXPOS1,{size:4,data:t}])}if(null!=o){const t=new Float32Array([o[0],o[1],o[2],o[3]]);f.push([w.AUXPOS2,{size:4,data:t}])}return new y(f,null,M.Point,l)}function F(t,e,n,s,a,r,o,l){if(null!=t){const{data:e}=l.getMutableAttribute(w.NORMAL);e[0]=t[0],e[1]=t[1],e[2]=t[2]}if(null!=e){const{data:t}=l.getMutableAttribute(w.POSITION);t[0]=e[0],t[1]=e[1],t[2]=e[2]}if(null!=n){const{data:t}=l.getMutableAttribute(w.COLOR);t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3]}if(null!=s){const{data:t}=l.getMutableAttribute(w.SIZE);t[0]=s[0],t[1]=s[1]}if(null!=a){const{data:t}=l.getMutableAttribute(w.AUXPOS1);t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3]}if(null!=r){const{data:t}=l.getMutableAttribute(w.UV0);t[0]=r[0],t[1]=r[1]}if(null!=o){const{data:t}=l.getMutableAttribute(w.AUXPOS2);t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3]}}function U(t,e){const n=new Float32Array(3*t.length),s=new Float32Array(e?3*t.length:3),a=new Array(t.length),r=new Array(t.length).fill(0);for(let c=0;c<t.length;c++)n[3*c]=t[c][0],n[3*c+1]=t[c][1],n[3*c+2]=t[c][2],e&&(s[3*c]=e[c][0],s[3*c+1]=e[c][1],s[3*c+2]=e[c][2]),a[c]=c;e||(s[0]=0,s[1]=1,s[2]=0);const o=[0,0],l=[[w.POSITION,a],[w.NORMAL,e?a:r],[w.UV0,r]],u=[[w.POSITION,{size:3,data:n,exclusive:!0}],[w.NORMAL,{size:3,data:s,exclusive:!0}],[w.UV0,{size:2,data:o,exclusive:!0}]];return new y(u,l,M.Point)}function V(){const t=[0,0,0,0,0,100,100,0,0],e=[0,1,2],n=[0,1,0],s=[0,0,0],a=[0,0],r=[0,0,0],o=[[w.POSITION,e],[w.NORMAL,s],[w.UV0,r]],l=[[w.POSITION,{size:3,data:t,exclusive:!0}],[w.NORMAL,{size:3,data:n,exclusive:!0}],[w.UV0,{size:2,data:a,exclusive:!0}]];return new y(l,o)}const j=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function G(t=j){const e=new Array(12);for(let c=0;c<4;c++)for(let n=0;n<3;n++)e[3*c+n]=t[c][n];const n=[0,1,2,2,3,0],s=[0,0,1],a=[0,0,0,0,0,0],r=[0,0,1,0,1,1,0,1],o=[255,255,255,255],l=[[w.POSITION,n],[w.NORMAL,a],[w.UV0,n],[w.COLOR,a]],u=[[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s,exclusive:!0}],[w.UV0,{size:2,data:r,exclusive:!0}],[w.COLOR,{size:4,data:o,exclusive:!0}]];return new y(u,l)}function C(t,e,n,s,a=!0,r=!0){let o=0;const l=e,u=t;let i=c(0,o,0),h=c(0,o+u,0),f=c(0,-1,0),O=c(0,1,0);s&&(o=u,h=c(0,0,0),i=c(0,o,0),f=c(0,1,0),O=c(0,-1,0));const p=[h,i],A=[f,O],I=n+2,M=Math.sqrt(u*u+l*l);if(s)for(let y=n-1;y>=0;y--){const t=y*(2*Math.PI/n),e=c(Math.cos(t)*l,o,Math.sin(t)*l);p.push(e);const s=c(u*Math.cos(t)/M,-l/M,u*Math.sin(t)/M);A.push(s)}else for(let y=0;y<n;y++){const t=y*(2*Math.PI/n),e=c(Math.cos(t)*l,o,Math.sin(t)*l);p.push(e);const s=c(u*Math.cos(t)/M,l/M,u*Math.sin(t)/M);A.push(s)}const g=new Array,d=new Array;if(a){for(let t=3;t<p.length;t++)g.push(1),g.push(t-1),g.push(t),d.push(0),d.push(0),d.push(0);g.push(p.length-1),g.push(2),g.push(1),d.push(0),d.push(0),d.push(0)}if(r){for(let t=3;t<p.length;t++)g.push(t),g.push(t-1),g.push(0),d.push(t),d.push(t-1),d.push(1);g.push(0),g.push(2),g.push(p.length-1),d.push(1),d.push(2),d.push(A.length-1)}const N=new Float32Array(3*I);for(let c=0;c<I;c++)N[3*c]=p[c][0],N[3*c+1]=p[c][1],N[3*c+2]=p[c][2];const P=new Float32Array(3*I);for(let c=0;c<I;c++)P[3*c]=A[c][0],P[3*c+1]=A[c][1],P[3*c+2]=A[c][2];const m=[[w.POSITION,g],[w.NORMAL,d]],S=[[w.POSITION,{size:3,data:N,exclusive:!0}],[w.NORMAL,{size:3,data:P,exclusive:!0}]];return new y(S,m)}function E(t,l,u,f,O,p){const A=f?h(f):c(1,0,0),I=O?h(O):c(0,0,0);p=p??!0;const M=i();n(M,A);const g=i();s(g,M,Math.abs(t));const d=i();s(d,g,-.5),a(d,d,I);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&o(N,0,0,1);const P=i();e(P,M,N),n(P,P),e(N,P,M);const m=2*u+(p?2:0),S=u+(p?2:0),z=new Float32Array(3*m),v=new Float32Array(3*S),x=new Float32Array(2*m),L=new Array(3*u*(p?4:2)),T=new Array(3*u*(p?4:2));p&&(z[3*(m-2)+0]=d[0],z[3*(m-2)+1]=d[1],z[3*(m-2)+2]=d[2],x[2*(m-2)]=0,x[2*(m-2)+1]=0,z[3*(m-1)+0]=z[3*(m-2)+0]+g[0],z[3*(m-1)+1]=z[3*(m-2)+1]+g[1],z[3*(m-1)+2]=z[3*(m-2)+2]+g[2],x[2*(m-1)]=1,x[2*(m-1)+1]=1,v[3*(S-2)+0]=-M[0],v[3*(S-2)+1]=-M[1],v[3*(S-2)+2]=-M[2],v[3*(S-1)+0]=M[0],v[3*(S-1)+1]=M[1],v[3*(S-1)+2]=M[2]);const R=(t,e,n)=>{L[t]=e,T[t]=n};let b=0;const F=i(),U=i();for(let e=0;e<u;e++){const t=e*(2*Math.PI/u);s(F,N,Math.sin(t)),s(U,P,Math.cos(t)),a(F,F,U),v[3*e+0]=F[0],v[3*e+1]=F[1],v[3*e+2]=F[2],s(F,F,l),a(F,F,d),z[3*e+0]=F[0],z[3*e+1]=F[1],z[3*e+2]=F[2],x[2*e+0]=e/u,x[2*e+1]=0,z[3*(e+u)+0]=z[3*e+0]+g[0],z[3*(e+u)+1]=z[3*e+1]+g[1],z[3*(e+u)+2]=z[3*e+2]+g[2],x[2*(e+u)+0]=e/u,x[2*e+1]=1;const n=(e+1)%u;R(b++,e,e),R(b++,e+u,e),R(b++,n,n),R(b++,n,n),R(b++,e+u,e),R(b++,n+u,n)}if(p){for(let t=0;t<u;t++){const e=(t+1)%u;R(b++,m-2,S-2),R(b++,t,S-2),R(b++,e,S-2)}for(let t=0;t<u;t++){const e=(t+1)%u;R(b++,t+u,S-1),R(b++,m-1,S-1),R(b++,e+u,S-1)}}const V=[[w.POSITION,L],[w.NORMAL,T],[w.UV0,L]],j=[[w.POSITION,{size:3,data:z,exclusive:!0}],[w.NORMAL,{size:3,data:v,exclusive:!0}],[w.UV0,{size:2,data:x,exclusive:!0}]];return new y(j,V)}function X(t,e,n,s,a){n=n||10,s=null==s||s,N(t.length>1);const r=[[0,0,0]],o=[],l=[];for(let u=0;u<n;u++){o.push([0,-u-1,-(u+1)%n-1]);const t=u/n*2*Math.PI;l.push([Math.cos(t)*e,Math.sin(t)*e])}return k(l,t,r,o,s,a)}function k(r,u,h,M,g,d=c(0,0,0)){const N=r.length,P=new Float32Array(u.length*N*3+(6*h.length||0)),m=new Float32Array(u.length*N*3+(h?6:0)),S=new Array,z=new Array;let v=0,x=0;const L=i(),T=i(),R=i(),b=i(),F=i(),U=i(),V=i(),j=f(),G=i(),C=i(),E=i(),X=i(),k=i(),q=O();o(G,0,1,0),t(T,u[1],u[0]),n(T,T),g?(a(j,u[0],d),n(R,j)):o(R,0,0,1),J(T,R,G,G,F,R,K),l(b,R),l(X,F);for(let t=0;t<h.length;t++)s(U,F,h[t][0]),s(j,R,h[t][2]),a(U,U,j),a(U,U,u[0]),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2];m[x++]=-T[0],m[x++]=-T[1],m[x++]=-T[2];for(let t=0;t<M.length;t++)S.push(M[t][0]>0?M[t][0]:-M[t][0]-1+h.length),S.push(M[t][1]>0?M[t][1]:-M[t][1]-1+h.length),S.push(M[t][2]>0?M[t][2]:-M[t][2]-1+h.length),z.push(0),z.push(0),z.push(0);let Z=h.length;const B=h.length-1;for(let o=0;o<u.length;o++){let c=!1;if(o>0){l(L,T),o<u.length-1?(t(T,u[o+1],u[o]),n(T,T)):c=!0,a(C,L,T),n(C,C),a(E,u[o-1],b),p(u[o],C,q);A(q,I(E,L),j)?(t(j,j,u[o]),n(R,j),e(F,C,R),n(F,F)):J(C,b,X,G,F,R,K),l(b,R),l(X,F)}g&&(a(j,u[o],d),n(k,j));for(let t=0;t<N;t++)if(s(U,F,r[t][0]),s(j,R,r[t][1]),a(U,U,j),n(V,U),m[x++]=V[0],m[x++]=V[1],m[x++]=V[2],a(U,U,u[o]),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2],!c){const e=(t+1)%N;S.push(Z+t),S.push(Z+N+t),S.push(Z+e),S.push(Z+e),S.push(Z+N+t),S.push(Z+N+e);for(let t=0;t<6;t++){const e=S.length-6;z.push(S[e+t]-B)}}Z+=N}const D=u[u.length-1];for(let t=0;t<h.length;t++)s(U,F,h[t][0]),s(j,R,h[t][1]),a(U,U,j),a(U,U,D),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2];const H=x/3;m[x++]=T[0],m[x++]=T[1],m[x++]=T[2];const Q=Z-N;for(let t=0;t<M.length;t++)S.push(M[t][0]>=0?Z+M[t][0]:-M[t][0]-1+Q),S.push(M[t][2]>=0?Z+M[t][2]:-M[t][2]-1+Q),S.push(M[t][1]>=0?Z+M[t][1]:-M[t][1]-1+Q),z.push(H),z.push(H),z.push(H);const W=[[w.POSITION,S],[w.NORMAL,z]],Y=[[w.POSITION,{size:3,data:P,exclusive:!0}],[w.NORMAL,{size:3,data:m,exclusive:!0}]];return new y(Y,W)}function q(t,e,n){N(t.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),N(3===t[0].length,"createPolylineGeometry(): malformed vertex"),N(null==e||e.length===t.length,"createPolylineGeometry: need same number of points and normals"),N(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=new Float64Array(3*t.length),a=new Array(2*(t.length-1));let r=0,o=0;for(let c=0;c<t.length;c++){for(let e=0;e<3;e++)s[r++]=t[c][e];c>0&&(a[o++]=c-1,a[o++]=c)}const l=[],u=[];if(l.push([w.POSITION,a]),u.push([w.POSITION,{size:3,data:s,exclusive:!0}]),e){const n=new Float32Array(3*e.length);let s=0;for(let a=0;a<t.length;a++)for(let t=0;t<3;t++)n[s++]=e[a][t];l.push([w.NORMAL,a]),u.push([w.NORMAL,{size:3,data:n,exclusive:!0}])}return n&&(u.push([w.COLOR,{size:4,data:n}]),l.push([w.COLOR,d(n.length/4)])),new y(u,l,M.Line)}function Z(t,e,n,s,a=0){const r=new Array(18),o=[[-e,a,s/2],[n,a,s/2],[0,t+a,s/2],[-e,a,-s/2],[n,a,-s/2],[0,t+a,-s/2]],l=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let u=0;u<6;u++)r[3*u]=o[u][0],r[3*u+1]=o[u][1],r[3*u+2]=o[u][2];return new y([[w.POSITION,{size:3,data:r,exclusive:!0}]],[[w.POSITION,l]])}function B(t,e){const n=t.getMutableAttribute(w.POSITION).data;for(let s=0;s<n.length;s+=3){const t=n[s],a=n[s+1],r=n[s+2];o(Q,t,a,r),u(Q,Q,e),n[s]=Q[0],n[s+1]=Q[1],n[s+2]=Q[2]}}function D(t,e=t){const n=t.vertexAttributes,s=n.get(w.POSITION).data,a=n.get(w.NORMAL).data;if(a){const t=e.getMutableAttribute(w.NORMAL).data;for(let e=0;e<a.length;e+=3){const n=a[e+1];t[e+1]=-a[e+2],t[e+2]=n}}if(s){const t=e.getMutableAttribute(w.POSITION).data;for(let e=0;e<s.length;e+=3){const n=s[e+1];t[e+1]=-s[e+2],t[e+2]=n}}return e}function H(t,s,a,o,l){return!(Math.abs(r(s,t))>l)&&(e(a,t,s),n(a,a),e(o,a,t),n(o,o),!0)}function J(t,e,n,s,a,r,o){return H(t,e,a,r,o)||H(t,n,a,r,o)||H(t,s,a,r,o)}const K=.99619469809,Q=i();export{D as cgToGIS,v as createBoxGeometry,C as createConeGeometry,E as createCylinderGeometry,x as createDiamondGeometry,Z as createExtrudedTriangle,k as createPathExtrusionGeometry,U as createPointArrayGeometry,b as createPointGeometry,R as createPolySphereGeometry,q as createPolylineGeometry,T as createSphereGeometry,G as createSquareGeometry,L as createTetrahedronGeometry,V as createTriangleGeometry,X as createTubeGeometry,H as makeOrthoBasisDirUp,J as makeOrthoBasisDirUpFallback,B as transformInPlace,F as updatePointGeometry};
5
+ import{b as t,f as e,n,g as s,a,e as r,s as o,c as l,v as u}from"../../../../chunks/vec3.js";import{f as c,b as i,a as h}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{create as O,fromPositionAndNormal as p,intersectRay as A}from"../../../../geometry/support/plane.js";import{wrap as I}from"../../../../geometry/support/ray.js";import{PrimitiveType as M}from"./basicInterfaces.js";import{Vec3Compact as g}from"./BufferVectorMath.js";import{Geometry as y}from"./Geometry.js";import{generateDefaultIndexArray as d}from"./Indices.js";import{assert as N}from"./Util.js";import{VertexAttribute as w}from"./VertexAttribute.js";const P=g;var m,S,z;!function(t){const e=.5,n=[[-e,-e,e],[e,-e,e],[e,e,e],[-e,e,e],[-e,-e,-e],[e,-e,-e],[e,e,-e],[-e,e,-e]],s=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],a=[0,0,1,0,1,1,0,1],r=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],o=new Array(36);for(let c=0;c<6;c++)for(let t=0;t<6;t++)o[6*c+t]=c;const l=new Array(36);for(let c=0;c<6;c++)l[6*c+0]=0,l[6*c+1]=1,l[6*c+2]=2,l[6*c+3]=2,l[6*c+4]=3,l[6*c+5]=0;function u(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(24);for(let s=0;s<8;s++)e[3*s]=n[s][0]*t[0],e[3*s+1]=n[s][1]*t[1],e[3*s+2]=n[s][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s}],[w.UV0,{size:2,data:a}]],[[w.POSITION,r],[w.NORMAL,o],[w.UV0,l]])}t.createGeometry=u}(m||(m={})),function(t){const e=.5,n=[[-e,0,-e],[e,0,-e],[e,0,e],[-e,0,e],[0,-e,0],[0,e,0]],s=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],a=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],r=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function o(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(18);for(let s=0;s<6;s++)e[3*s]=n[s][0]*t[0],e[3*s+1]=n[s][1]*t[1],e[3*s+2]=n[s][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s}]],[[w.POSITION,a],[w.NORMAL,r]])}t.createGeometry=o}(S||(S={})),function(s){const a=.5,r=0,o=c(-a,r,-a),l=c(a,r,-a),u=c(0,r,a),h=c(0,r+a,0),f=i(),O=i(),p=i(),A=i(),I=i();t(f,o,h),t(O,o,l),e(p,f,O),n(p,p),t(f,l,h),t(O,l,u),e(A,f,O),n(A,A),t(f,u,h),t(O,u,o),e(I,f,O),n(I,I);const M=[o,l,u,h],g=[0,-1,0,p[0],p[1],p[2],A[0],A[1],A[2],I[0],I[1],I[2]],d=[0,1,2,3,1,0,3,2,1,3,0,2],N=[0,0,0,1,1,1,2,2,2,3,3,3];function P(t){Array.isArray(t)||(t=[t,t,t]);const e=new Array(12);for(let n=0;n<4;n++)e[3*n]=M[n][0]*t[0],e[3*n+1]=M[n][1]*t[1],e[3*n+2]=M[n][2]*t[2];return new y([[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:g}]],[[w.POSITION,d],[w.NORMAL,N]])}s.createGeometry=P}(z||(z={}));const v=m.createGeometry,x=S.createGeometry,L=z.createGeometry;function T(t,e,n,s={uv:!0}){const a=-Math.PI,r=2*Math.PI,o=-Math.PI/2,l=Math.PI,u=Math.max(3,Math.floor(e)),c=Math.max(2,Math.floor(n)),i=(u+1)*(c+1),h=new Float32Array(3*i),f=new Float32Array(3*i),O=new Float32Array(2*i),p=[];let A=0;for(let y=0;y<=c;y++){const e=[],n=y/c,s=o+n*l,i=Math.cos(s);for(let o=0;o<=u;o++){const l=o/u,c=a+l*r,p=Math.cos(c)*i,I=Math.sin(s),M=-Math.sin(c)*i;h[3*A]=p*t,h[3*A+1]=I*t,h[3*A+2]=M*t,f[3*A]=p,f[3*A+1]=I,f[3*A+2]=M,O[2*A]=l,O[2*A+1]=n,e.push(A),++A}p.push(e)}const I=new Array;for(let y=0;y<c;y++)for(let t=0;t<u;t++){const e=p[y][t],n=p[y][t+1],s=p[y+1][t+1],a=p[y+1][t];0===y?(I.push(e),I.push(s),I.push(a)):y===c-1?(I.push(e),I.push(n),I.push(s)):(I.push(e),I.push(n),I.push(s),I.push(s),I.push(a),I.push(e))}const M=[[w.POSITION,I],[w.NORMAL,I]],g=[[w.POSITION,{size:3,data:h,exclusive:!0}],[w.NORMAL,{size:3,data:f,exclusive:!0}]];return s.uv&&(g.push([w.UV0,{size:2,data:O,exclusive:!0}]),M.push([w.UV0,I])),s.offset&&(M[0][0]=w.OFFSET,g[0][0]=w.OFFSET,M.push([w.POSITION,new Array(I.length).fill(0)]),g.push([w.POSITION,{size:3,data:Float64Array.from(s.offset),exclusive:!0}])),new y(g,M)}function R(t,e,n){const s=t;let a,r;if(n)a=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=s*(1+Math.sqrt(5))/2;a=[-s,t,0,s,t,0,-s,-t,0,s,-t,0,0,-s,t,0,s,t,0,-s,-t,0,s,-t,t,0,-s,t,0,s,-t,0,-s,-t,0,s],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let h=0;h<a.length;h+=3)P.scale(a,h,t/P.length(a,h));let o={};function l(e,n){e>n&&([e,n]=[n,e]);const s=e.toString()+"."+n.toString();if(o[s])return o[s];let r=a.length;return a.length+=3,P.add(a,3*e,a,3*n,a,r),P.scale(a,r,t/P.length(a,r)),r/=3,o[s]=r,r}for(let h=0;h<e;h++){const t=r.length,e=new Array(4*t);for(let n=0;n<t;n+=3){const t=r[n],s=r[n+1],a=r[n+2],o=l(t,s),u=l(s,a),c=l(a,t),i=4*n;e[i]=t,e[i+1]=o,e[i+2]=c,e[i+3]=s,e[i+4]=u,e[i+5]=o,e[i+6]=a,e[i+7]=c,e[i+8]=u,e[i+9]=o,e[i+10]=u,e[i+11]=c}r=e,o={}}const u=new Float32Array(a);for(let h=0;h<u.length;h+=3)P.normalize(u,h);const c=[[w.POSITION,r],[w.NORMAL,r]],i=[[w.POSITION,{size:3,data:new Float32Array(a),exclusive:!0}],[w.NORMAL,{size:3,data:u,exclusive:!0}]];return new y(i,c)}function b(t,e,n,s,a,r,o,l){const u=e?[e[0],e[1],e[2]]:[0,0,0],c=t?[t[0],t[1],t[2]]:[0,0,1];r=r||[0,0];const i=n?[255*n[0],255*n[1],255*n[2],n.length>3?255*n[3]:255]:[255,255,255,255],h=null!=s&&2===s.length?s:[1,1],f=[[w.POSITION,{size:3,data:u,exclusive:!0}],[w.NORMAL,{size:3,data:c,exclusive:!0}],[w.UV0,{size:r.length,data:r}],[w.COLOR,{size:4,data:i,exclusive:!0}],[w.SIZE,{size:2,data:h}]];if(null!=a){const t=new Float32Array([a[0],a[1],a[2],a[3]]);f.push([w.AUXPOS1,{size:4,data:t}])}if(null!=o){const t=new Float32Array([o[0],o[1],o[2],o[3]]);f.push([w.AUXPOS2,{size:4,data:t}])}return new y(f,null,M.Point,l)}function F(t,e,n,s,a,r,o,l){if(null!=t){const{data:e}=l.getMutableAttribute(w.NORMAL);e[0]=t[0],e[1]=t[1],e[2]=t[2]}if(null!=e){const{data:t}=l.getMutableAttribute(w.POSITION);t[0]=e[0],t[1]=e[1],t[2]=e[2]}if(null!=n){const{data:t}=l.getMutableAttribute(w.COLOR);t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3]}if(null!=s){const{data:t}=l.getMutableAttribute(w.SIZE);t[0]=s[0],t[1]=s[1]}if(null!=a){const{data:t}=l.getMutableAttribute(w.AUXPOS1);t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3]}if(null!=r){const{data:t}=l.getMutableAttribute(w.UV0);t[0]=r[0],t[1]=r[1]}if(null!=o){const{data:t}=l.getMutableAttribute(w.AUXPOS2);t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3]}}function U(t,e){const n=new Float32Array(3*t.length),s=new Float32Array(e?3*t.length:3),a=new Array(t.length),r=new Array(t.length).fill(0);for(let c=0;c<t.length;c++)n[3*c]=t[c][0],n[3*c+1]=t[c][1],n[3*c+2]=t[c][2],e&&(s[3*c]=e[c][0],s[3*c+1]=e[c][1],s[3*c+2]=e[c][2]),a[c]=c;e||(s[0]=0,s[1]=1,s[2]=0);const o=[0,0],l=[[w.POSITION,a],[w.NORMAL,e?a:r],[w.UV0,r]],u=[[w.POSITION,{size:3,data:n,exclusive:!0}],[w.NORMAL,{size:3,data:s,exclusive:!0}],[w.UV0,{size:2,data:o,exclusive:!0}]];return new y(u,l,M.Point)}function V(){const t=[0,0,0,0,0,100,100,0,0],e=[0,1,2],n=[0,1,0],s=[0,0,0],a=[0,0],r=[0,0,0],o=[[w.POSITION,e],[w.NORMAL,s],[w.UV0,r]],l=[[w.POSITION,{size:3,data:t,exclusive:!0}],[w.NORMAL,{size:3,data:n,exclusive:!0}],[w.UV0,{size:2,data:a,exclusive:!0}]];return new y(l,o)}const j=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function G(t=j){const e=new Array(12);for(let c=0;c<4;c++)for(let n=0;n<3;n++)e[3*c+n]=t[c][n];const n=[0,1,2,2,3,0],s=[0,0,1],a=[0,0,0,0,0,0],r=[0,0,1,0,1,1,0,1],o=[255,255,255,255],l=[[w.POSITION,n],[w.NORMAL,a],[w.UV0,n],[w.COLOR,a]],u=[[w.POSITION,{size:3,data:e,exclusive:!0}],[w.NORMAL,{size:3,data:s,exclusive:!0}],[w.UV0,{size:2,data:r,exclusive:!0}],[w.COLOR,{size:4,data:o,exclusive:!0}]];return new y(u,l)}function C(t,e,n,s,a=!0,r=!0){let o=0;const l=e,u=t;let i=c(0,o,0),h=c(0,o+u,0),f=c(0,-1,0),O=c(0,1,0);s&&(o=u,h=c(0,0,0),i=c(0,o,0),f=c(0,1,0),O=c(0,-1,0));const p=[h,i],A=[f,O],I=n+2,M=Math.sqrt(u*u+l*l);if(s)for(let y=n-1;y>=0;y--){const t=y*(2*Math.PI/n),e=c(Math.cos(t)*l,o,Math.sin(t)*l);p.push(e);const s=c(u*Math.cos(t)/M,-l/M,u*Math.sin(t)/M);A.push(s)}else for(let y=0;y<n;y++){const t=y*(2*Math.PI/n),e=c(Math.cos(t)*l,o,Math.sin(t)*l);p.push(e);const s=c(u*Math.cos(t)/M,l/M,u*Math.sin(t)/M);A.push(s)}const g=new Array,d=new Array;if(a){for(let t=3;t<p.length;t++)g.push(1),g.push(t-1),g.push(t),d.push(0),d.push(0),d.push(0);g.push(p.length-1),g.push(2),g.push(1),d.push(0),d.push(0),d.push(0)}if(r){for(let t=3;t<p.length;t++)g.push(t),g.push(t-1),g.push(0),d.push(t),d.push(t-1),d.push(1);g.push(0),g.push(2),g.push(p.length-1),d.push(1),d.push(2),d.push(A.length-1)}const N=new Float32Array(3*I);for(let c=0;c<I;c++)N[3*c]=p[c][0],N[3*c+1]=p[c][1],N[3*c+2]=p[c][2];const P=new Float32Array(3*I);for(let c=0;c<I;c++)P[3*c]=A[c][0],P[3*c+1]=A[c][1],P[3*c+2]=A[c][2];const m=[[w.POSITION,g],[w.NORMAL,d]],S=[[w.POSITION,{size:3,data:N,exclusive:!0}],[w.NORMAL,{size:3,data:P,exclusive:!0}]];return new y(S,m)}function E(t,l,u,f,O,p){const A=f?h(f):c(1,0,0),I=O?h(O):c(0,0,0);p=p??!0;const M=i();n(M,A);const g=i();s(g,M,Math.abs(t));const d=i();s(d,g,-.5),a(d,d,I);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&o(N,0,0,1);const P=i();e(P,M,N),n(P,P),e(N,P,M);const m=2*u+(p?2:0),S=u+(p?2:0),z=new Float32Array(3*m),v=new Float32Array(3*S),x=new Float32Array(2*m),L=new Array(3*u*(p?4:2)),T=new Array(3*u*(p?4:2));p&&(z[3*(m-2)+0]=d[0],z[3*(m-2)+1]=d[1],z[3*(m-2)+2]=d[2],x[2*(m-2)]=0,x[2*(m-2)+1]=0,z[3*(m-1)+0]=z[3*(m-2)+0]+g[0],z[3*(m-1)+1]=z[3*(m-2)+1]+g[1],z[3*(m-1)+2]=z[3*(m-2)+2]+g[2],x[2*(m-1)]=1,x[2*(m-1)+1]=1,v[3*(S-2)+0]=-M[0],v[3*(S-2)+1]=-M[1],v[3*(S-2)+2]=-M[2],v[3*(S-1)+0]=M[0],v[3*(S-1)+1]=M[1],v[3*(S-1)+2]=M[2]);const R=(t,e,n)=>{L[t]=e,T[t]=n};let b=0;const F=i(),U=i();for(let e=0;e<u;e++){const t=e*(2*Math.PI/u);s(F,N,Math.sin(t)),s(U,P,Math.cos(t)),a(F,F,U),v[3*e+0]=F[0],v[3*e+1]=F[1],v[3*e+2]=F[2],s(F,F,l),a(F,F,d),z[3*e+0]=F[0],z[3*e+1]=F[1],z[3*e+2]=F[2],x[2*e+0]=e/u,x[2*e+1]=0,z[3*(e+u)+0]=z[3*e+0]+g[0],z[3*(e+u)+1]=z[3*e+1]+g[1],z[3*(e+u)+2]=z[3*e+2]+g[2],x[2*(e+u)+0]=e/u,x[2*e+1]=1;const n=(e+1)%u;R(b++,e,e),R(b++,e+u,e),R(b++,n,n),R(b++,n,n),R(b++,e+u,e),R(b++,n+u,n)}if(p){for(let t=0;t<u;t++){const e=(t+1)%u;R(b++,m-2,S-2),R(b++,t,S-2),R(b++,e,S-2)}for(let t=0;t<u;t++){const e=(t+1)%u;R(b++,t+u,S-1),R(b++,m-1,S-1),R(b++,e+u,S-1)}}const V=[[w.POSITION,L],[w.NORMAL,T],[w.UV0,L]],j=[[w.POSITION,{size:3,data:z,exclusive:!0}],[w.NORMAL,{size:3,data:v,exclusive:!0}],[w.UV0,{size:2,data:x,exclusive:!0}]];return new y(j,V)}function X(t,e,n,s,a){n=n||10,s=null==s||s,N(t.length>1);const r=[[0,0,0]],o=[],l=[];for(let u=0;u<n;u++){o.push([0,-u-1,-(u+1)%n-1]);const t=u/n*2*Math.PI;l.push([Math.cos(t)*e,Math.sin(t)*e])}return k(l,t,r,o,s,a)}function k(r,u,h,M,g,d=c(0,0,0)){const N=r.length,P=new Float32Array(u.length*N*3+(6*h.length||0)),m=new Float32Array(u.length*N*3+(h?6:0)),S=new Array,z=new Array;let v=0,x=0;const L=i(),T=i(),R=i(),b=i(),F=i(),U=i(),V=i(),j=f(),G=i(),C=i(),E=i(),X=i(),k=i(),q=O();o(G,0,1,0),t(T,u[1],u[0]),n(T,T),g?(a(j,u[0],d),n(R,j)):o(R,0,0,1),J(T,R,G,G,F,R,K),l(b,R),l(X,F);for(let t=0;t<h.length;t++)s(U,F,h[t][0]),s(j,R,h[t][2]),a(U,U,j),a(U,U,u[0]),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2];m[x++]=-T[0],m[x++]=-T[1],m[x++]=-T[2];for(let t=0;t<M.length;t++)S.push(M[t][0]>0?M[t][0]:-M[t][0]-1+h.length),S.push(M[t][1]>0?M[t][1]:-M[t][1]-1+h.length),S.push(M[t][2]>0?M[t][2]:-M[t][2]-1+h.length),z.push(0),z.push(0),z.push(0);let Z=h.length;const B=h.length-1;for(let o=0;o<u.length;o++){let c=!1;if(o>0){l(L,T),o<u.length-1?(t(T,u[o+1],u[o]),n(T,T)):c=!0,a(C,L,T),n(C,C),a(E,u[o-1],b),p(u[o],C,q);A(q,I(E,L),j)?(t(j,j,u[o]),n(R,j),e(F,C,R),n(F,F)):J(C,b,X,G,F,R,K),l(b,R),l(X,F)}g&&(a(j,u[o],d),n(k,j));for(let t=0;t<N;t++)if(s(U,F,r[t][0]),s(j,R,r[t][1]),a(U,U,j),n(V,U),m[x++]=V[0],m[x++]=V[1],m[x++]=V[2],a(U,U,u[o]),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2],!c){const e=(t+1)%N;S.push(Z+t),S.push(Z+N+t),S.push(Z+e),S.push(Z+e),S.push(Z+N+t),S.push(Z+N+e);for(let t=0;t<6;t++){const e=S.length-6;z.push(S[e+t]-B)}}Z+=N}const D=u[u.length-1];for(let t=0;t<h.length;t++)s(U,F,h[t][0]),s(j,R,h[t][1]),a(U,U,j),a(U,U,D),P[v++]=U[0],P[v++]=U[1],P[v++]=U[2];const H=x/3;m[x++]=T[0],m[x++]=T[1],m[x++]=T[2];const Q=Z-N;for(let t=0;t<M.length;t++)S.push(M[t][0]>=0?Z+M[t][0]:-M[t][0]-1+Q),S.push(M[t][2]>=0?Z+M[t][2]:-M[t][2]-1+Q),S.push(M[t][1]>=0?Z+M[t][1]:-M[t][1]-1+Q),z.push(H),z.push(H),z.push(H);const W=[[w.POSITION,S],[w.NORMAL,z]],Y=[[w.POSITION,{size:3,data:P,exclusive:!0}],[w.NORMAL,{size:3,data:m,exclusive:!0}]];return new y(Y,W)}function q(t,e,n){N(t.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),N(3===t[0].length,"createPolylineGeometry(): malformed vertex"),N(null==e||e.length===t.length,"createPolylineGeometry: need same number of points and normals"),N(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=new Float64Array(3*t.length),a=new Array(2*(t.length-1));let r=0,o=0;for(let c=0;c<t.length;c++){for(let e=0;e<3;e++)s[r++]=t[c][e];c>0&&(a[o++]=c-1,a[o++]=c)}const l=[],u=[];if(l.push([w.POSITION,a]),u.push([w.POSITION,{size:3,data:s,exclusive:!0}]),e){const n=new Float32Array(3*e.length);let s=0;for(let a=0;a<t.length;a++)for(let t=0;t<3;t++)n[s++]=e[a][t];l.push([w.NORMAL,a]),u.push([w.NORMAL,{size:3,data:n,exclusive:!0}])}return n&&(u.push([w.COLOR,{size:4,data:n}]),l.push([w.COLOR,d(n.length/4)])),new y(u,l,M.Line)}function Z(t,e,n,s,a=0){const r=new Array(18),o=[[-e,a,s/2],[n,a,s/2],[0,t+a,s/2],[-e,a,-s/2],[n,a,-s/2],[0,t+a,-s/2]],l=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let u=0;u<6;u++)r[3*u]=o[u][0],r[3*u+1]=o[u][1],r[3*u+2]=o[u][2];return new y([[w.POSITION,{size:3,data:r,exclusive:!0}]],[[w.POSITION,l]])}function B(t,e){const n=t.getMutableAttribute(w.POSITION).data;for(let s=0;s<n.length;s+=3){const t=n[s],a=n[s+1],r=n[s+2];o(Q,t,a,r),u(Q,Q,e),n[s]=Q[0],n[s+1]=Q[1],n[s+2]=Q[2]}}function D(t,e=t){const n=t.vertexAttributes,s=n.get(w.POSITION).data,a=n.get(w.NORMAL).data;if(a){const t=e.getMutableAttribute(w.NORMAL).data;for(let e=0;e<a.length;e+=3){const n=a[e+1];t[e+1]=-a[e+2],t[e+2]=n}}if(s){const t=e.getMutableAttribute(w.POSITION).data;for(let e=0;e<s.length;e+=3){const n=s[e+1];t[e+1]=-s[e+2],t[e+2]=n}}return e}function H(t,s,a,o,l){return!(Math.abs(r(s,t))>l)&&(e(a,t,s),n(a,a),e(o,a,t),n(o,o),!0)}function J(t,e,n,s,a,r,o){return H(t,e,a,r,o)||H(t,n,a,r,o)||H(t,s,a,r,o)}const K=.99619469809,Q=i();export{D as cgToGIS,v as createBoxGeometry,C as createConeGeometry,E as createCylinderGeometry,x as createDiamondGeometry,Z as createExtrudedTriangle,k as createPathExtrusionGeometry,U as createPointArrayGeometry,b as createPointGeometry,R as createPolySphereGeometry,q as createPolylineGeometry,T as createSphereGeometry,G as createSquareGeometry,L as createTetrahedronGeometry,V as createTriangleGeometry,X as createTubeGeometry,H as makeOrthoBasisDirUp,J as makeOrthoBasisDirUpFallback,B as transformInPlace,F as updatePointGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e,disposeMaybe as t,isSome as r}from"../../../../core/maybe.js";import{s as i}from"../../../../chunks/vec2.js";import{c as s}from"../../../../chunks/vec4.js";import{c as a}from"../../../../chunks/vec4f64.js";import{ShaderTechniqueConfiguration as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as h}from"./DefaultVertexAttributeLocations.js";import{Pos2Tex as l}from"./DefaultVertexBufferLayouts.js";import{createQuadVAO as p}from"./glUtil3D.js";import{VertexArrayObject as u}from"./VertexArrayObject.js";import{HighlightApplyTechnique as m}from"../shaders/HighlightApplyTechnique.js";import{H as c}from"../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as _}from"../shaders/HighlightBlurTechnique.js";import{H as n}from"../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as g}from"../shaders/HighlightDownsampleTechnique.js";import{HighlightPassParameters as d}from"../shaders/HighlightPassParameters.js";import{BufferObject as b}from"../../../webgl/BufferObject.js";import{TargetType as w,DepthStencilTargetType as T,TextureType as v,PixelFormat as f,PixelType as M,TextureSamplingMode as q,TextureWrapMode as x,ClearBufferBit as P,Usage as F,PrimitiveType as R}from"../../../webgl/enums.js";import{FramebufferObject as y}from"../../../webgl/FramebufferObject.js";import{vertexCount as A}from"../../../webgl/Util.js";const D=32;class O{constructor(e,t){this._techniqueRep=e,this._rctx=t,this._viewportToRestore=a(),this._passParameters=new d,this._downsampleDrawParameters=new n,this._blurDrawParameters=new c,this._grid={coverageMipmap:null,vao:null,verticalCellCount:0,horizontalCellCount:0,cellPixelSize:0,mipmapLevels:0,viewportWidth:0,viewportHeight:0}}_assertResources(){if(this._quadVAO)return;this._quadVAO=p(this._rctx);const e={colorTarget:w.TEXTURE,depthStencilTarget:T.NONE,width:0,height:0},t={target:v.TEXTURE_2D,pixelFormat:f.RGBA,dataType:M.UNSIGNED_BYTE,samplingMode:q.LINEAR,wrapMode:x.CLAMP_TO_EDGE,width:0,height:0};this._blur0Fbo=new y(this._rctx,e,t),this._blur1Fbo=new y(this._rctx,e,t);const r=new o;this._blurTechnique=this._techniqueRep.acquire(_,r),this._downsampleTechnique=this._techniqueRep.acquire(g,r),this._applyTechnique=this._techniqueRep.acquire(m,r)}dispose(){if(this._blurTechnique=e(this._blurTechnique),this._downsampleTechnique=e(this._downsampleTechnique),this._applyTechnique=e(this._applyTechnique),this._grid.coverageMipmap)for(let e=1;e<this._grid.coverageMipmap.length;e++)this._grid.coverageMipmap[e].dispose();this._grid.vao&&this._grid.vao.dispose(!0),this._quadVAO&&(this._quadVAO.dispose(!0),this._quadVAO=null),this._blur0Fbo=t(this._blur0Fbo),this._blur1Fbo=t(this._blur1Fbo)}setDefaultOptions(e){this._passParameters={...new d,...e}}render(e,t,r){this._passParameters.highlightColorTexture=t.colorTexture,this._assertResources();const a=e.camera;s(this._viewportToRestore,a.fullViewport);const o=a.fullWidth,h=a.fullHeight,l=a.pixelRatio,p=Math.ceil(o/l),u=Math.ceil(h/l);this._blur0Fbo.resize(p,u),this._blur1Fbo.resize(p,u);const m=this._rctx;m.bindVAO(this._quadVAO);let c=null;this._gridUpdateResources(t,D),this._gridComputeMipmap(e),this._passParameters.coverageTexture=this._grid.coverageMipmap[this._grid.mipmapLevels].colorTexture,c=this._grid.vao;const _=m.bindTechnique(this._blurTechnique,this._passParameters,e);m.bindVAO(c),m.bindFramebuffer(this._blur0Fbo),m.setViewport(0,0,p,u),m.setClearColor(0,0,0,0),m.clear(P.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=t.colorTexture,i(this._blurDrawParameters.blurSize,1/p,0),_.bindDraw(this._blurDrawParameters,e,this._passParameters),m.drawArrays(this._blurTechnique.primitiveType,0,A(c,"geometry")),m.bindFramebuffer(this._blur1Fbo),m.clear(P.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=this._blur0Fbo.colorTexture,i(this._blurDrawParameters.blurSize,0,1/u),_.bindDraw(this._blurDrawParameters,e,this._passParameters),m.drawArrays(this._blurTechnique.primitiveType,0,A(c,"geometry")),m.bindFramebuffer(r),m.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3]),this._passParameters.blurColorTexture=this._blur1Fbo.colorTexture,m.bindTechnique(this._applyTechnique,this._passParameters,e),m.drawArrays(this._applyTechnique.primitiveType,0,A(c,"geometry")),m.bindVAO(null)}_gridUpdateResources(e,t){const r=this._rctx,i=this._grid;let s=!1;if(null===i.coverageMipmap&&(i.coverageMipmap=[e],s=!0),i.viewportWidth===e.width&&i.viewportHeight===e.height||(s=!0,i.viewportWidth=e.width,i.viewportHeight=e.height),i.coverageMipmap[0]=e,i.cellPixelSize!==t&&(i.cellPixelSize=t,s=!0),s){for(let e=1;e<i.coverageMipmap.length;e++)i.coverageMipmap[e].dispose();i.mipmapLevels=Math.ceil(Math.log(i.cellPixelSize)*Math.LOG2E),i.coverageMipmap.length=i.mipmapLevels+1;for(let e=0;e<i.mipmapLevels;e++){const t=i.coverageMipmap[e],s={target:v.TEXTURE_2D,pixelFormat:f.RGB,dataType:M.UNSIGNED_SHORT_5_6_5,samplingMode:q.LINEAR,wrapMode:x.CLAMP_TO_EDGE,width:Math.ceil(t.width/2),height:Math.ceil(t.height/2)},a={colorTarget:w.TEXTURE,depthStencilTarget:T.NONE,width:Math.ceil(t.width/2),height:Math.ceil(t.height/2)};i.coverageMipmap[e+1]=new y(r,a,s)}}const a=Math.ceil(e.height/i.cellPixelSize),o=Math.ceil(e.width/i.cellPixelSize);if(!i.vao||i.verticalCellCount!==a||i.horizontalCellCount!==o){i.verticalCellCount=a,i.horizontalCellCount=o;const e=a+1,t=o+1,s=1/a,p=1/o,m=6,c=4,_=new Float32Array(m*c*e*t);let n=0;for(let r=0;r<e;r++)for(let e=0;e<t;e++)_[n+0]=(e-.5)*p*2-1,_[n+1]=(r-.5)*s*2-1,_[n+2]=e*p,_[n+3]=r*s,_[n+4]=(e+.5)*p*2-1,_[n+5]=(r-.5)*s*2-1,_[n+6]=e*p,_[n+7]=r*s,_[n+8]=(e-.5)*p*2-1,_[n+9]=(r+.5)*s*2-1,_[n+10]=e*p,_[n+11]=r*s,_[n+12]=(e-.5)*p*2-1,_[n+13]=(r+.5)*s*2-1,_[n+14]=e*p,_[n+15]=r*s,_[n+16]=(e+.5)*p*2-1,_[n+17]=(r-.5)*s*2-1,_[n+18]=e*p,_[n+19]=r*s,_[n+20]=(e+.5)*p*2-1,_[n+21]=(r+.5)*s*2-1,_[n+22]=e*p,_[n+23]=r*s,n+=m*c;i.vao&&i.vao.dispose(!0),i.vao=new u(r,h,{geometry:l},{geometry:b.createVertex(r,F.STATIC_DRAW,_)})}}_gridComputeMipmap(e){const t=this._rctx,r=this._grid,s=t.bindTechnique(this._downsampleTechnique,this._passParameters,e);t.bindVAO(this._quadVAO);for(let a=0;a<r.mipmapLevels;a++){t.bindFramebuffer(r.coverageMipmap[a+1]);const o=r.coverageMipmap[a+1].width,h=r.coverageMipmap[a+1].height;this._downsampleDrawParameters.inputTexture=r.coverageMipmap[a].colorTexture,i(this._downsampleDrawParameters.invFramebufferDim,1/o,1/h),s.bindDraw(this._downsampleDrawParameters,e,this._passParameters),t.setViewport(0,0,o,h),t.drawArrays(R.TRIANGLE_STRIP,0,A(this._quadVAO,"geometry"))}}get gpuMemoryUsage(){let e=(r(this._blur0Fbo)?this._blur0Fbo.gpuMemoryUsage:0)+(r(this._blur1Fbo)?this._blur1Fbo.gpuMemoryUsage:0);if(this._grid.coverageMipmap)for(const t of this._grid.coverageMipmap)e+=t.gpuMemoryUsage;return e}get test(){return{coverage:this._grid.coverageMipmap,blur:[this._blur0Fbo,this._blur1Fbo]}}}export{O as Highlight};
5
+ import{releaseMaybe as e,disposeMaybe as t,isSome as r}from"../../../../core/maybe.js";import{s as i}from"../../../../chunks/vec2.js";import{c as s}from"../../../../chunks/vec4.js";import{c as a}from"../../../../chunks/vec4f64.js";import{Default3D as o}from"./DefaultVertexAttributeLocations.js";import{Pos2Tex as h}from"./DefaultVertexBufferLayouts.js";import{createQuadVAO as l}from"./glUtil3D.js";import{VertexArrayObject as p}from"./VertexArrayObject.js";import{HighlightApplyTechnique as u}from"../shaders/HighlightApplyTechnique.js";import{H as m}from"../../../../chunks/HighlightBlur.glsl.js";import{HighlightBlurTechnique as c}from"../shaders/HighlightBlurTechnique.js";import{H as _}from"../../../../chunks/HighlightDownsample.glsl.js";import{HighlightDownsampleTechnique as n}from"../shaders/HighlightDownsampleTechnique.js";import{HighlightPassParameters as g}from"../shaders/HighlightPassParameters.js";import{BufferObject as d}from"../../../webgl/BufferObject.js";import{TargetType as b,DepthStencilTargetType as w,TextureType as T,PixelFormat as v,PixelType as f,TextureSamplingMode as M,TextureWrapMode as q,ClearBufferBit as x,Usage as P,PrimitiveType as F}from"../../../webgl/enums.js";import{FramebufferObject as R}from"../../../webgl/FramebufferObject.js";import{vertexCount as y}from"../../../webgl/Util.js";const A=32;class D{constructor(e,t){this._techniqueRep=e,this._rctx=t,this._viewportToRestore=a(),this._passParameters=new g,this._downsampleDrawParameters=new _,this._blurDrawParameters=new m,this._grid={coverageMipmap:null,vao:null,verticalCellCount:0,horizontalCellCount:0,cellPixelSize:0,mipmapLevels:0,viewportWidth:0,viewportHeight:0}}_assertResources(){if(this._quadVAO)return;this._quadVAO=l(this._rctx);const e={colorTarget:b.TEXTURE,depthStencilTarget:w.NONE,width:0,height:0},t={target:T.TEXTURE_2D,pixelFormat:v.RGBA,dataType:f.UNSIGNED_BYTE,samplingMode:M.LINEAR,wrapMode:q.CLAMP_TO_EDGE,width:0,height:0};this._blur0Fbo=new R(this._rctx,e,t),this._blur1Fbo=new R(this._rctx,e,t),this._blurTechnique=this._techniqueRep.acquire(c),this._downsampleTechnique=this._techniqueRep.acquire(n),this._applyTechnique=this._techniqueRep.acquire(u)}dispose(){if(this._blurTechnique=e(this._blurTechnique),this._downsampleTechnique=e(this._downsampleTechnique),this._applyTechnique=e(this._applyTechnique),this._grid.coverageMipmap)for(let e=1;e<this._grid.coverageMipmap.length;e++)this._grid.coverageMipmap[e].dispose();this._grid.vao&&this._grid.vao.dispose(!0),this._quadVAO&&(this._quadVAO.dispose(!0),this._quadVAO=null),this._blur0Fbo=t(this._blur0Fbo),this._blur1Fbo=t(this._blur1Fbo)}setDefaultOptions(e){this._passParameters={...new g,...e}}render(e,t,r){this._passParameters.highlightColorTexture=t.colorTexture,this._assertResources();const a=e.camera;s(this._viewportToRestore,a.fullViewport);const o=a.fullWidth,h=a.fullHeight,l=a.pixelRatio,p=Math.ceil(o/l),u=Math.ceil(h/l);this._blur0Fbo.resize(p,u),this._blur1Fbo.resize(p,u);const m=this._rctx;m.bindVAO(this._quadVAO);let c=null;this._gridUpdateResources(t,A),this._gridComputeMipmap(e),this._passParameters.coverageTexture=this._grid.coverageMipmap[this._grid.mipmapLevels].colorTexture,c=this._grid.vao;const _=m.bindTechnique(this._blurTechnique,this._passParameters,e);m.bindVAO(c),m.bindFramebuffer(this._blur0Fbo),m.setViewport(0,0,p,u),m.setClearColor(0,0,0,0),m.clear(x.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=t.colorTexture,i(this._blurDrawParameters.blurSize,1/p,0),_.bindDraw(this._blurDrawParameters,e,this._passParameters),m.drawArrays(this._blurTechnique.primitiveType,0,y(c,"geometry")),m.bindFramebuffer(this._blur1Fbo),m.clear(x.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=this._blur0Fbo.colorTexture,i(this._blurDrawParameters.blurSize,0,1/u),_.bindDraw(this._blurDrawParameters,e,this._passParameters),m.drawArrays(this._blurTechnique.primitiveType,0,y(c,"geometry")),m.bindFramebuffer(r),m.setViewport(this._viewportToRestore[0],this._viewportToRestore[1],this._viewportToRestore[2],this._viewportToRestore[3]),this._passParameters.blurColorTexture=this._blur1Fbo.colorTexture,m.bindTechnique(this._applyTechnique,this._passParameters,e),m.drawArrays(this._applyTechnique.primitiveType,0,y(c,"geometry")),m.bindVAO(null)}_gridUpdateResources(e,t){const r=this._rctx,i=this._grid;let s=!1;if(null===i.coverageMipmap&&(i.coverageMipmap=[e],s=!0),i.viewportWidth===e.width&&i.viewportHeight===e.height||(s=!0,i.viewportWidth=e.width,i.viewportHeight=e.height),i.coverageMipmap[0]=e,i.cellPixelSize!==t&&(i.cellPixelSize=t,s=!0),s){for(let e=1;e<i.coverageMipmap.length;e++)i.coverageMipmap[e].dispose();i.mipmapLevels=Math.ceil(Math.log(i.cellPixelSize)*Math.LOG2E),i.coverageMipmap.length=i.mipmapLevels+1;for(let e=0;e<i.mipmapLevels;e++){const t=i.coverageMipmap[e],s={target:T.TEXTURE_2D,pixelFormat:v.RGB,dataType:f.UNSIGNED_SHORT_5_6_5,samplingMode:M.LINEAR,wrapMode:q.CLAMP_TO_EDGE,width:Math.ceil(t.width/2),height:Math.ceil(t.height/2)},a={colorTarget:b.TEXTURE,depthStencilTarget:w.NONE,width:Math.ceil(t.width/2),height:Math.ceil(t.height/2)};i.coverageMipmap[e+1]=new R(r,a,s)}}const a=Math.ceil(e.height/i.cellPixelSize),l=Math.ceil(e.width/i.cellPixelSize);if(!i.vao||i.verticalCellCount!==a||i.horizontalCellCount!==l){i.verticalCellCount=a,i.horizontalCellCount=l;const e=a+1,t=l+1,s=1/a,u=1/l,m=6,c=4,_=new Float32Array(m*c*e*t);let n=0;for(let r=0;r<e;r++)for(let e=0;e<t;e++)_[n+0]=(e-.5)*u*2-1,_[n+1]=(r-.5)*s*2-1,_[n+2]=e*u,_[n+3]=r*s,_[n+4]=(e+.5)*u*2-1,_[n+5]=(r-.5)*s*2-1,_[n+6]=e*u,_[n+7]=r*s,_[n+8]=(e-.5)*u*2-1,_[n+9]=(r+.5)*s*2-1,_[n+10]=e*u,_[n+11]=r*s,_[n+12]=(e-.5)*u*2-1,_[n+13]=(r+.5)*s*2-1,_[n+14]=e*u,_[n+15]=r*s,_[n+16]=(e+.5)*u*2-1,_[n+17]=(r-.5)*s*2-1,_[n+18]=e*u,_[n+19]=r*s,_[n+20]=(e+.5)*u*2-1,_[n+21]=(r+.5)*s*2-1,_[n+22]=e*u,_[n+23]=r*s,n+=m*c;i.vao&&i.vao.dispose(!0),i.vao=new p(r,o,{geometry:h},{geometry:d.createVertex(r,P.STATIC_DRAW,_)})}}_gridComputeMipmap(e){const t=this._rctx,r=this._grid,s=t.bindTechnique(this._downsampleTechnique,this._passParameters,e);t.bindVAO(this._quadVAO);for(let a=0;a<r.mipmapLevels;a++){t.bindFramebuffer(r.coverageMipmap[a+1]);const o=r.coverageMipmap[a+1].width,h=r.coverageMipmap[a+1].height;this._downsampleDrawParameters.inputTexture=r.coverageMipmap[a].colorTexture,i(this._downsampleDrawParameters.invFramebufferDim,1/o,1/h),s.bindDraw(this._downsampleDrawParameters,e,this._passParameters),t.setViewport(0,0,o,h),t.drawArrays(F.TRIANGLE_STRIP,0,y(this._quadVAO,"geometry"))}}get gpuMemoryUsage(){let e=(r(this._blur0Fbo)?this._blur0Fbo.gpuMemoryUsage:0)+(r(this._blur1Fbo)?this._blur1Fbo.gpuMemoryUsage:0);if(this._grid.coverageMipmap)for(const t of this._grid.coverageMipmap)e+=t.gpuMemoryUsage;return e}get test(){return{coverage:this._grid.coverageMipmap,blur:[this._blur0Fbo,this._blur1Fbo]}}}export{D as Highlight};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{c as s}from"../../../../chunks/mat4.js";import{c as i,I as e}from"../../../../chunks/mat4f64.js";import{a,m as n,g as o,l as h,c as d,n as c}from"../../../../chunks/vec3.js";import{c as l,U as m}from"../../../../chunks/vec3f64.js";import{t as f}from"../../../../chunks/vec4.js";import{c as y}from"../../../../chunks/vec4f64.js";import{create as u,fromPoints as p,copy as g}from"../../../../geometry/support/ray.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{IntersectorOptions as O,StoreResults as L,IntersectorType as j}from"./IntersectorInterfaces.js";import{isValidIntersectorResult as E}from"./intersectorUtils.js";import{IntersectorTransform as v,getVerticalOffsetObject3D as w}from"./verticalOffsetUtils.js";import{isInstanceHidden as b}from"../materials/renderers/utils.js";const A=1e-5;class T{constructor(t){this.options=new O,this._results=new I,this.transform=new v,this.tolerance=A,this.verticalOffset=null,this._ray=u(),this._rayEnd=l(),this._rayBeginTransformed=l(),this._rayEndTransformed=l(),this.viewingMode=t??_.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,r,s){this.resetWithRay(p(t,r,this._ray),s)}resetWithRay(t,r){this.camera=r,t!==this._ray&&g(t,this._ray),0!==this.options.verticalOffset?this.viewingMode===_.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,a(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(r=null,s,i,e,a){this.point=s,this.filterPredicate=e,this.tolerance=i??A;const n=w(this.verticalOffset);if(t(r)&&r.length>0){const s=a?t=>{a(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const i of r){const r=i.getSpatialQueryAccelerator&&i.getSpatialQueryAccelerator();t(r)?(t(n)?r.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,s,n):r.forEachAlongRay(this._ray.origin,this._ray.direction,s),this.options.selectionMode&&this.options.hud&&r.forEachDegenerateObject(s)):i.objects.forAll((t=>s(t)))}}this.sortResults()}intersectObject(r){const s=r.geometryRecords;if(!s)return;const i=r.transformation,a=w(this.verticalOffset);for(const o of s){const{geometry:s,material:h,instanceParameters:d}=o;if(b(d))continue;const c=s.id;this.transform.setAndInvalidateLazyTransforms(i,o.getShaderTransformation()),n(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),n(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const l=this.transform.transform;t(a)&&(a.objectTransform=this.transform),h.intersect(s,d,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,((s,i,a,n,o,h)=>{if(s>=0){if(t(this.filterPredicate)&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const d=n?this._results.hud:this._results,m=n?n=>{const d={object:r,geometryId:c,triangleNr:a,center:t(h)?[h[0],h[1],h[2]]:null};n.set(j.HUD,d,s,i,e,o)}:t=>t.set(j.OBJECT,{object:r,geometryId:c,triangleNr:a},s,i,l,o);if((null==d.min.drapedLayerOrder||o>=d.min.drapedLayerOrder)&&(null==d.min.dist||s<d.min.dist)&&m(d.min),this.options.store!==L.MIN&&(null==d.max.drapedLayerOrder||o<d.max.drapedLayerOrder)&&(null==d.max.dist||s>d.max.dist)&&m(d.max),this.options.store===L.ALL)if(n){const t=new M(this._ray);m(t),this._results.hud.all.push(t)}else{const t=new N(this._ray);m(t),this._results.all.push(t)}}}),o.shaderTransformation)}}sortResults(t=this._results.all){t.sort(((t,s)=>t.dist!==s.dist?r(t.dist,0)-r(s.dist,0):t.drapedLayerOrder!==s.drapedLayerOrder?r(t.drapedLayerOrder,Number.MAX_VALUE)-r(s.drapedLayerOrder,Number.MAX_VALUE):r(s.drapedLayerGraphicOrder,Number.MIN_VALUE)-r(t.drapedLayerGraphicOrder,Number.MIN_VALUE)))}}function x(t){return new T(t)}class I{constructor(){this.min=new N(u()),this.max=new N(u()),this.hud={min:new M(u()),max:new M(u()),all:new Array},this.ground=new N(u()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}class N{constructor(t){this.intersector=j.OBJECT,this.normal=l(),this.transformation=i(),this._ray=u(),this.init(t)}get ray(){return this._ray}get distanceInRenderSpace(){return t(this.dist)?(o(B,this.ray.direction,this.dist),h(B)):null}getIntersectionPoint(t){return!!E(this)&&(o(B,this.ray.direction,this.dist),a(t,this.ray.origin,B),!0)}getTransformedNormal(t){return d(R,this.normal),R[3]=0,f(R,R,this.transformation),d(t,R),c(t,t)}init(t){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=j.OBJECT,g(t,this._ray)}set(t,i,a,n,o,h,c){this.intersector=t,this.dist=a,d(this.normal,r(n,m)),s(this.transformation,r(o,e)),this.target=i,this.drapedLayerOrder=h,this.drapedLayerGraphicOrder=c}copy(t){g(t.ray,this._ray),this.intersector=t.intersector,this.dist=t.dist,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.drapedLayerGraphicOrder=t.drapedLayerGraphicOrder,d(this.normal,t.normal),s(this.transformation,t.transformation)}}class M extends N{constructor(){super(...arguments),this.intersector=j.HUD}}function U(t){return new N(t)}const B=l(),R=y();export{A as DEFAULT_TOLERANCE,x as newIntersector,U as newIntersectorResult};
5
+ import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{c as s}from"../../../../chunks/mat4.js";import{c as i,I as e}from"../../../../chunks/mat4f64.js";import{a,v as n,g as o,l as h,c as d,n as c}from"../../../../chunks/vec3.js";import{c as l,U as m}from"../../../../chunks/vec3f64.js";import{t as f}from"../../../../chunks/vec4.js";import{c as y}from"../../../../chunks/vec4f64.js";import{create as u,fromPoints as p,copy as g}from"../../../../geometry/support/ray.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{IntersectorOptions as O,StoreResults as L,IntersectorType as j}from"./IntersectorInterfaces.js";import{isValidIntersectorResult as v}from"./intersectorUtils.js";import{IntersectorTransform as E,getVerticalOffsetObject3D as w}from"./verticalOffsetUtils.js";import{isInstanceHidden as b}from"../materials/renderers/utils.js";const A=1e-5;class T{constructor(t){this.options=new O,this._results=new I,this.transform=new E,this.tolerance=A,this.verticalOffset=null,this._ray=u(),this._rayEnd=l(),this._rayBeginTransformed=l(),this._rayEndTransformed=l(),this.viewingMode=t??_.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,r,s){this.resetWithRay(p(t,r,this._ray),s)}resetWithRay(t,r){this.camera=r,t!==this._ray&&g(t,this._ray),0!==this.options.verticalOffset?this.viewingMode===_.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,a(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(r=null,s,i,e,a){this.point=s,this.filterPredicate=e,this.tolerance=i??A;const n=w(this.verticalOffset);if(t(r)&&r.length>0){const s=a?t=>{a(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const i of r){const r=i.getSpatialQueryAccelerator&&i.getSpatialQueryAccelerator();t(r)?(t(n)?r.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,s,n):r.forEachAlongRay(this._ray.origin,this._ray.direction,s),this.options.selectionMode&&this.options.hud&&r.forEachDegenerateObject(s)):i.objects.forAll((t=>s(t)))}}this.sortResults()}intersectObject(r){const s=r.geometryRecords;if(!s)return;const i=r.transformation,a=w(this.verticalOffset);for(const o of s){const{geometry:s,material:h,instanceParameters:d}=o;if(b(d))continue;const c=s.id;this.transform.setAndInvalidateLazyTransforms(i,o.getShaderTransformation()),n(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),n(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const l=this.transform.transform;t(a)&&(a.objectTransform=this.transform),h.intersect(s,d,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,((s,i,a,n,o,h)=>{if(s>=0){if(t(this.filterPredicate)&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const d=n?this._results.hud:this._results,m=n?n=>{const d={object:r,geometryId:c,triangleNr:a,center:t(h)?[h[0],h[1],h[2]]:null};n.set(j.HUD,d,s,i,e,o)}:t=>t.set(j.OBJECT,{object:r,geometryId:c,triangleNr:a},s,i,l,o);if((null==d.min.drapedLayerOrder||o>=d.min.drapedLayerOrder)&&(null==d.min.dist||s<d.min.dist)&&m(d.min),this.options.store!==L.MIN&&(null==d.max.drapedLayerOrder||o<d.max.drapedLayerOrder)&&(null==d.max.dist||s>d.max.dist)&&m(d.max),this.options.store===L.ALL)if(n){const t=new M(this._ray);m(t),this._results.hud.all.push(t)}else{const t=new N(this._ray);m(t),this._results.all.push(t)}}}),o.shaderTransformation)}}sortResults(t=this._results.all){t.sort(((t,s)=>t.dist!==s.dist?r(t.dist,0)-r(s.dist,0):t.drapedLayerOrder!==s.drapedLayerOrder?r(t.drapedLayerOrder,Number.MAX_VALUE)-r(s.drapedLayerOrder,Number.MAX_VALUE):r(s.drapedLayerGraphicOrder,Number.MIN_VALUE)-r(t.drapedLayerGraphicOrder,Number.MIN_VALUE)))}}function x(t){return new T(t)}class I{constructor(){this.min=new N(u()),this.max=new N(u()),this.hud={min:new M(u()),max:new M(u()),all:new Array},this.ground=new N(u()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}class N{constructor(t){this.intersector=j.OBJECT,this.normal=l(),this.transformation=i(),this._ray=u(),this.init(t)}get ray(){return this._ray}get distanceInRenderSpace(){return t(this.dist)?(o(B,this.ray.direction,this.dist),h(B)):null}getIntersectionPoint(t){return!!v(this)&&(o(B,this.ray.direction,this.dist),a(t,this.ray.origin,B),!0)}getTransformedNormal(t){return d(R,this.normal),R[3]=0,f(R,R,this.transformation),d(t,R),c(t,t)}init(t){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=j.OBJECT,g(t,this._ray)}set(t,i,a,n,o,h,c){this.intersector=t,this.dist=a,d(this.normal,r(n,m)),s(this.transformation,r(o,e)),this.target=i,this.drapedLayerOrder=h,this.drapedLayerGraphicOrder=c}copy(t){g(t.ray,this._ray),this.intersector=t.intersector,this.dist=t.dist,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.drapedLayerGraphicOrder=t.drapedLayerGraphicOrder,d(this.normal,t.normal),s(this.transformation,t.transformation)}}class M extends N{constructor(){super(...arguments),this.intersector=j.HUD}}function U(t){return new N(t)}const B=l(),R=y();export{A as DEFAULT_TOLERANCE,x as newIntersector,U as newIntersectorResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,isNone as e}from"../../../../core/maybe.js";import{c as s,m as i}from"../../../../chunks/mat4.js";import{c as r,b as o,I as a}from"../../../../chunks/mat4f64.js";import{h as n,m as h,i as m,c,s as l}from"../../../../chunks/vec3.js";import{a as d,f as g,c as _}from"../../../../chunks/vec3f64.js";import{c as u,l as b}from"../../../../chunks/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DState as p}from"./basicInterfaces.js";import{ContentObject as v}from"./ContentObject.js";import{ContentObjectType as y}from"./ContentObjectType.js";import{GeometryRecord as j}from"./GeometryRecord.js";import{Object3DStateID as V}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{addObject3DStateID as A,removeObject3DStateID as T}from"../materials/renderers/utils.js";class x extends v{constructor(t={}){super(),this.type=y.Object,this._geometryRecords=new Array,this._geometries=new Array,this._objectTransformation=r(),this._bvObjectSpace=new L,this._bvWorldSpace=new L,this._bvDirty=!0,this._hasVolatileTransformation=!1,this._visible=!0,this.castShadow=null==t.castShadow||t.castShadow,this.metadata=t.metadata,this.metadata&&this.metadata.isElevationSource&&(this.metadata.lastValidElevationBB=new O);const{geometries:e,materials:s,transformations:i,origins:a}=t;if(Array.isArray(e)){S(s.length===e.length,"Object3D: materials don't match geometries"),S(i.length===e.length,"Object3D: transformations don't match geometries"),this._geometryRecords.length=e.length,this._geometries.length=e.length;for(let t=0;t<e.length;t++)this._geometries[t]=e[t],this._geometryRecords[t]=j.pool.acquire(e[t],s[t],o(i[t]),{highlights:null,occludees:null,visible:this._visible},a&&a[t])}}get geometryRecords(){return this._geometryRecords}get geometries(){return this._geometries}get transformation(){return this._objectTransformation}set transformation(t){s(this._objectTransformation,t),this._invalidateBoundingVolume(),this._emit("objectTransformation",this)}dispose(){this._geometryRecords.length=0,this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(e,s,i,r,o){i=i||a,this._geometries.push(e);const n=j.pool.acquire(e,s,i,{highlights:null,occludees:null,visible:this._visible},r,o);return this._geometryRecords.push(n),this._hasVolatileTransformation=this._hasVolatileTransformation||t(n.shaderTransformation),this._emit("objectGeometryAdded",{object:this,record:n}),this._invalidateBoundingVolume(),n}removeGeometry(e){const s=this._geometryRecords.splice(e,1)[0];return this._hasVolatileTransformation=t(s.shaderTransformation)?this._geometryRecords.some((e=>t(e.shaderTransformation))):this._hasVolatileTransformation,s.dispose(),this._geometries.splice(e,1),this._emit("objectGeometryRemoved",{object:this,record:s}),this._invalidateBoundingVolume(),s}removeAllGeometries(){for(;this.geometryRecords.length>0;)this.removeGeometry(0)}geometryVertexAttrsUpdated(t){this._emit("vertexAttrsUpdated",{object:this,record:t}),this._invalidateBoundingVolume()}get isVisible(){return this._visible}setVisible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometryRecords)t.instanceParameters.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new V(p.MaskOccludee);for(const e of this._geometryRecords)e.instanceParameters.occludees=A(e.instanceParameters.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometryRecords)e.instanceParameters.occludees=T(e.instanceParameters.occludees,t);this._emit("occlusionChanged",this)}highlight(){const t=new V(p.Highlight);for(const e of this._geometryRecords)e.instanceParameters.highlights=A(e.instanceParameters.highlights,t);return this._emit("highlightChanged",this),t}removeHighlight(t){for(const e of this._geometryRecords)e.instanceParameters.highlights=T(e.instanceParameters.highlights,t);this._emit("highlightChanged",this)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.getStaticTransformation())}_getCombinedShaderTransformation(t){return i(r(),this.transformation,t.getShaderTransformation())}hasVolativeTransformation(){return this._hasVolatileTransformation}get boundingVolumeWorldSpace(){return this._validateBoundingVolume(),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._validateBoundingVolume(),this._bvObjectSpace}_validateBoundingVolume(){if(!this._bvDirty&&!this._hasVolatileTransformation)return;this._bvObjectSpace.init(),this._bvWorldSpace.init();for(let e=0;e<this._geometryRecords.length;++e){const s=this._geometries[e],i=this._geometryRecords[e],r=s.boundingInfo;t(r)&&(this._calculateTransformedBoundingVolume(r,this._bvObjectSpace,i.getShaderTransformation()),this._calculateTransformedBoundingVolume(r,this._bvWorldSpace,this._getCombinedShaderTransformation(i)))}n(this._bvObjectSpace.bounds,this._bvObjectSpace.min,this._bvObjectSpace.max,.5),n(this._bvWorldSpace.bounds,this._bvWorldSpace.min,this._bvWorldSpace.max,.5);const s=_(),i=_(),r=f(this.transformation);for(let t=0;t<this._geometryRecords.length;++t){const o=this._geometries[t].boundingInfo;if(e(o))continue;const a=this._geometryRecords[t].getShaderTransformation(),n=f(a);h(s,o.getCenter(),a);const c=m(s,this._bvObjectSpace.bounds),l=o.getBSRadius()*n;this._bvObjectSpace.bounds[3]=Math.max(this._bvObjectSpace.bounds[3],c+l),h(i,s,this.transformation);const d=m(i,this._bvWorldSpace.bounds),g=l*r;this._bvWorldSpace.bounds[3]=Math.max(this._bvWorldSpace.bounds[3],d+g)}this._bvDirty=!1}_calculateTransformedBoundingVolume(t,e,s){const i=t.getBBMin(),r=t.getBBMax(),o=d(i),a=d(r);h(o,o,s),h(a,a,s);for(let n=0;n<3;++n)e.min[n]=Math.min(e.min[n],o[n],a[n]),e.max[n]=Math.max(e.max[n],o[n],a[n]);for(let n=0;n<3;++n){c(o,i),c(a,r),o[n]=r[n],a[n]=i[n],h(o,o,s),h(a,a,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],o[t],a[t]),e.max[t]=Math.max(e.max[t],o[t],a[t])}}_invalidateBoundingVolume(){this._bvDirty=!0,t(this._parentLayer)&&this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace.bounds)}_emit(e,s){t(this._parentLayer)&&this._parentLayer.events.emit(e,s)}get test(){const t=this;return{hasGeometry:e=>t._geometries.includes(e),getGeometryIndex:e=>t._geometries.indexOf(e)}}}class O{constructor(){this.min=g(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=g(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends O{constructor(){super(...arguments),this.bounds=u()}init(){l(this.min,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l(this.max,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),b(this.bounds)}}export{x as Object3D};
5
+ import{isSome as t,isNone as e}from"../../../../core/maybe.js";import{c as s,m as i}from"../../../../chunks/mat4.js";import{c as r,b as o,I as a}from"../../../../chunks/mat4f64.js";import{h as n,v as h,i as m,c,s as l}from"../../../../chunks/vec3.js";import{a as d,f as g,c as _}from"../../../../chunks/vec3f64.js";import{c as u,l as b}from"../../../../chunks/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DState as p}from"./basicInterfaces.js";import{ContentObject as v}from"./ContentObject.js";import{ContentObjectType as y}from"./ContentObjectType.js";import{GeometryRecord as j}from"./GeometryRecord.js";import{Object3DStateID as V}from"./Object3DStateID.js";import{assert as S}from"./Util.js";import{addObject3DStateID as A,removeObject3DStateID as T}from"../materials/renderers/utils.js";class x extends v{constructor(t={}){super(),this.type=y.Object,this._geometryRecords=new Array,this._geometries=new Array,this._objectTransformation=r(),this._bvObjectSpace=new L,this._bvWorldSpace=new L,this._bvDirty=!0,this._hasVolatileTransformation=!1,this._visible=!0,this.castShadow=null==t.castShadow||t.castShadow,this.metadata=t.metadata,this.metadata&&this.metadata.isElevationSource&&(this.metadata.lastValidElevationBB=new O);const{geometries:e,materials:s,transformations:i,origins:a}=t;if(Array.isArray(e)){S(s.length===e.length,"Object3D: materials don't match geometries"),S(i.length===e.length,"Object3D: transformations don't match geometries"),this._geometryRecords.length=e.length,this._geometries.length=e.length;for(let t=0;t<e.length;t++)this._geometries[t]=e[t],this._geometryRecords[t]=j.pool.acquire(e[t],s[t],o(i[t]),{highlights:null,occludees:null,visible:this._visible},a&&a[t])}}get geometryRecords(){return this._geometryRecords}get geometries(){return this._geometries}get transformation(){return this._objectTransformation}set transformation(t){s(this._objectTransformation,t),this._invalidateBoundingVolume(),this._emit("objectTransformation",this)}dispose(){this._geometryRecords.length=0,this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){S(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(e,s,i,r,o){i=i||a,this._geometries.push(e);const n=j.pool.acquire(e,s,i,{highlights:null,occludees:null,visible:this._visible},r,o);return this._geometryRecords.push(n),this._hasVolatileTransformation=this._hasVolatileTransformation||t(n.shaderTransformation),this._emit("objectGeometryAdded",{object:this,record:n}),this._invalidateBoundingVolume(),n}removeGeometry(e){const s=this._geometryRecords.splice(e,1)[0];return this._hasVolatileTransformation=t(s.shaderTransformation)?this._geometryRecords.some((e=>t(e.shaderTransformation))):this._hasVolatileTransformation,s.dispose(),this._geometries.splice(e,1),this._emit("objectGeometryRemoved",{object:this,record:s}),this._invalidateBoundingVolume(),s}removeAllGeometries(){for(;this.geometryRecords.length>0;)this.removeGeometry(0)}geometryVertexAttrsUpdated(t){this._emit("vertexAttrsUpdated",{object:this,record:t}),this._invalidateBoundingVolume()}get isVisible(){return this._visible}setVisible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometryRecords)t.instanceParameters.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new V(p.MaskOccludee);for(const e of this._geometryRecords)e.instanceParameters.occludees=A(e.instanceParameters.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometryRecords)e.instanceParameters.occludees=T(e.instanceParameters.occludees,t);this._emit("occlusionChanged",this)}highlight(){const t=new V(p.Highlight);for(const e of this._geometryRecords)e.instanceParameters.highlights=A(e.instanceParameters.highlights,t);return this._emit("highlightChanged",this),t}removeHighlight(t){for(const e of this._geometryRecords)e.instanceParameters.highlights=T(e.instanceParameters.highlights,t);this._emit("highlightChanged",this)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.getStaticTransformation())}_getCombinedShaderTransformation(t){return i(r(),this.transformation,t.getShaderTransformation())}hasVolativeTransformation(){return this._hasVolatileTransformation}get boundingVolumeWorldSpace(){return this._validateBoundingVolume(),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._validateBoundingVolume(),this._bvObjectSpace}_validateBoundingVolume(){if(!this._bvDirty&&!this._hasVolatileTransformation)return;this._bvObjectSpace.init(),this._bvWorldSpace.init();for(let e=0;e<this._geometryRecords.length;++e){const s=this._geometries[e],i=this._geometryRecords[e],r=s.boundingInfo;t(r)&&(this._calculateTransformedBoundingVolume(r,this._bvObjectSpace,i.getShaderTransformation()),this._calculateTransformedBoundingVolume(r,this._bvWorldSpace,this._getCombinedShaderTransformation(i)))}n(this._bvObjectSpace.bounds,this._bvObjectSpace.min,this._bvObjectSpace.max,.5),n(this._bvWorldSpace.bounds,this._bvWorldSpace.min,this._bvWorldSpace.max,.5);const s=_(),i=_(),r=f(this.transformation);for(let t=0;t<this._geometryRecords.length;++t){const o=this._geometries[t].boundingInfo;if(e(o))continue;const a=this._geometryRecords[t].getShaderTransformation(),n=f(a);h(s,o.getCenter(),a);const c=m(s,this._bvObjectSpace.bounds),l=o.getBSRadius()*n;this._bvObjectSpace.bounds[3]=Math.max(this._bvObjectSpace.bounds[3],c+l),h(i,s,this.transformation);const d=m(i,this._bvWorldSpace.bounds),g=l*r;this._bvWorldSpace.bounds[3]=Math.max(this._bvWorldSpace.bounds[3],d+g)}this._bvDirty=!1}_calculateTransformedBoundingVolume(t,e,s){const i=t.getBBMin(),r=t.getBBMax(),o=d(i),a=d(r);h(o,o,s),h(a,a,s);for(let n=0;n<3;++n)e.min[n]=Math.min(e.min[n],o[n],a[n]),e.max[n]=Math.max(e.max[n],o[n],a[n]);for(let n=0;n<3;++n){c(o,i),c(a,r),o[n]=r[n],a[n]=i[n],h(o,o,s),h(a,a,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],o[t],a[t]),e.max[t]=Math.max(e.max[t],o[t],a[t])}}_invalidateBoundingVolume(){this._bvDirty=!0,t(this._parentLayer)&&this._parentLayer.notifyObjectBBChanged(this,this._bvWorldSpace.bounds)}_emit(e,s){t(this._parentLayer)&&this._parentLayer.events.emit(e,s)}get test(){const t=this;return{hasGeometry:e=>t._geometries.includes(e),getGeometryIndex:e=>t._geometries.indexOf(e)}}}class O{constructor(){this.min=g(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=g(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends O{constructor(){super(...arguments),this.bounds=u()}init(){l(this.min,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l(this.max,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),b(this.bounds)}}export{x as Object3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{f as r}from"../../../../chunks/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map}setUidToObjectAndLayerId(e,r,t,o,i=null,d=null){if(!(e&&r&&t&&o))return;this._layerUidToId.set(o,t);let a=this._layerUidToGraphicsUidToObjectId.get(o);a||(a=new Map,this._layerUidToGraphicsUidToObjectId.set(o,a)),a.set(r,{objectId:e,attributeNodeId:i,attributeIndex:d})}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let o=r.get(e.graphicUid);if(!o){for(;!o;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(o=e)}if(o>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,o),this._colorToUID.set(o,e)}const i=new ArrayBuffer(4);new DataView(i).setUint32(0,o,!1);return new t(i)}getColorToObjectAndLayerIdMapping(){const r=new Map;for(const[t,o]of this._colorToUID.entries()){const i=this._layerUidToGraphicsUidToObjectId.get(o.layerUid);let d=null;i?(d=i.get(o.graphicUid),d||e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for graphicsId "+o.graphicUid)):e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for layerUid "+o.layerUid);const a=this._layerUidToId.get(o.layerUid);a||e.getLogger(this.declaredClass).warn("no layerId found for uid "+o.layerUid),d&&a&&r.set(t,d.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:d.objectId,lid:a,attrId:d.attributeNodeId,attrIdx:d.attributeIndex}:{type:"object-and-layer-id",oid:d.objectId,lid:a})}return r}}export{o as ObjectAndLayerIdRenderHelper};
5
+ import e from"../../../../core/Logger.js";import{f as r}from"../../../../chunks/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map}setUidToObjectAndLayerId(e,r,t,o,d=null,i=null,a=null){if(!(e&&r&&t&&o))return;this._layerUidToId.set(o,t);let s=this._layerUidToGraphicsUidToObjectId.get(o);s||(s=new Map,this._layerUidToGraphicsUidToObjectId.set(o,s)),s.set(r,{objectId:e,attributeNodeId:d,attributeIndex:i,subLayerId:a})}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let o=r.get(e.graphicUid);if(!o){for(;!o;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(o=e)}if(o>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,o),this._colorToUID.set(o,e)}const d=new ArrayBuffer(4);new DataView(d).setUint32(0,o,!1);return new t(d)}getColorToObjectAndLayerIdMapping(){const r=new Map;for(const[t,o]of this._colorToUID.entries()){const d=this._layerUidToGraphicsUidToObjectId.get(o.layerUid);let i=null;d?(i=d.get(o.graphicUid),i||e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for graphicsId "+o.graphicUid)):e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for layerUid "+o.layerUid);const a=this._layerUidToId.get(o.layerUid);a||e.getLogger(this.declaredClass).warn("no layerId found for uid "+o.layerUid),i&&a&&r.set(t,i.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:i.objectId,lid:a,attrId:i.attributeNodeId,attrIdx:i.attributeIndex,subLayerId:i.subLayerId}:{type:"object-and-layer-id",oid:i.objectId,lid:a})}return r}}export{o as ObjectAndLayerIdRenderHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i,CompositingFunction as o}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as s}from"../../../webgl/context-util.js";import{TextureSamplingMode as a,SizedPixelFormat as h,PixelFormat as n,PixelType as l,ClearBufferBit as g}from"../../../webgl/enums.js";class T{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const i=e.type===s.WEBGL2;this._renderTargetHelper=new t(e);const o=this._renderTargetHelper;this._mainColorTargets=[o.registerColorTarget({name:"mainColorTarget0"}),o.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=o.registerColorTarget({name:"frontFaceTarget"});const g=e=>o.registerColorTarget({name:e,dataType:l.FLOAT,internalFormat:i?h.RGBA32F:n.RGBA,samplingMode:a.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=o.registerDepthTarget({name:"mainDepth"}),this.linearDepth=o.registerColorTarget({name:"linearDepth",samplingMode:a.NEAREST}),this.terrainLinearDepth=o.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=o.registerColorTarget({name:"geometryLinearDepth"}),this.normal=o.registerColorTarget({name:"normal"}),this.highlight=o.registerColorTarget({name:"highlight",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=o.registerColorTarget({name:"hudVisibility",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=o.registerColorTarget({name:"tmpColor"}),this.tmpDepth=o.registerDepthTarget({name:"tmpDepth"}),this.hudColor=o.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT|g.STENCIL_BUFFER_BIT)}composite(t){e(this.colorTexture)&&this._compositingHelper.composite(t,this.colorTexture,i.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,p),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,m)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.None,1,o.TransparentToHUDVisibility)),this.hudVisibility,this.tmpDepth)}renderOITPass(e,t,i){let o,s;switch(t){case r.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case r.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case r.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(g.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeTransparent(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=g.COLOR_BUFFER_BIT}r&&(s|=g.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=g.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const p=[0,0,0,0],m=[0,1,0,1];export{T as OffscreenRendering};
5
+ import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as o}from"../../../webgl/context-util.js";import{TextureSamplingMode as s,SizedPixelFormat as a,PixelFormat as h,PixelType as n,ClearBufferBit as l}from"../../../webgl/enums.js";class g{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const i=e.type===o.WEBGL2;this._renderTargetHelper=new t(e);const l=this._renderTargetHelper;this._mainColorTargets=[l.registerColorTarget({name:"mainColorTarget0"}),l.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=l.registerColorTarget({name:"frontFaceTarget"});const g=e=>l.registerColorTarget({name:e,dataType:n.FLOAT,internalFormat:i?a.RGBA32F:h.RGBA,samplingMode:s.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=l.registerDepthTarget({name:"mainDepth"}),this.linearDepth=l.registerColorTarget({name:"linearDepth",samplingMode:s.NEAREST}),this.terrainLinearDepth=l.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=l.registerColorTarget({name:"geometryLinearDepth"}),this.normal=l.registerColorTarget({name:"normal"}),this.highlight=l.registerColorTarget({name:"highlight",internalFormat:i?a.RGBA4:h.RGBA,dataType:n.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=l.registerColorTarget({name:"hudVisibility",internalFormat:i?a.RGBA4:h.RGBA,dataType:n.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=l.registerColorTarget({name:"tmpColor"}),this.tmpDepth=l.registerDepthTarget({name:"tmpDepth"}),this.hudColor=l.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(l.COLOR_BUFFER_BIT|l.DEPTH_BUFFER_BIT|l.STENCIL_BUFFER_BIT)}composite(t){e(this.colorTexture)&&this._compositingHelper.composite(t,this.colorTexture,i.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,T),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,p)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,t,i){let o,s;switch(t){case r.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case r.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case r.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(l.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=l.COLOR_BUFFER_BIT}r&&(s|=l.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=l.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const T=[0,0,0,0],p=[0,1,0,1];export{g as OffscreenRendering};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{unwrapOr as t,isNone as r,isSome as i}from"../../../../core/maybe.js";import{generateUID as s}from"../../../../core/uid.js";import{c as a}from"../../../../chunks/mat4.js";import{c as n,I as e}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec4f64.js";import{maxScale as m}from"../../support/mathUtils.js";import{Object3DState as c}from"./basicInterfaces.js";import{computeAttachmentOriginTriangles as d}from"./geometryDataUtils.js";import{InstanceParameters as f}from"./InstanceParameters.js";import{Object3DStateID as u}from"./Object3DStateID.js";import{VertexAttribute as g}from"./VertexAttribute.js";import{addObject3DStateID as l,removeObject3DStateID as p}from"../materials/renderers/utils.js";class T{constructor(r,i,a={}){this.data=r,this.material=i,this.boundingSphere=h(),this.instanceParameters=new f,this._transformation=n(),this._shaderTransformationDirty=!0,this.layerUid=t(a.layerUid,null),this.graphicUid=t(a.graphicUid,null),this.id=a.id?a.id:s(),this.boundingInfo=t(a.boundingInfo,null),this.calculateShaderTransformation=t(a.calculateShaderTransformation,null),this.castShadow=!!a.castShadow&&a.castShadow}get transformation(){return this._transformation}updateTransformation(t){t(this._transformation),this._shaderTransformationDirty=!0,this.computeBoundingSphere(this._transformation,this.boundingSphere)}shaderTransformationChanged(){this._shaderTransformationDirty=!0}computeBoundingSphere(t,i,s=m(t)){r(this.boundingInfo)||(o(i,this.boundingInfo.getCenter(),t),i[3]=this.boundingInfo.getBSRadius()*s)}get hasShaderTransformation(){return i(this.calculateShaderTransformation)}get primitiveType(){return this.data.primitiveType}getShaderTransformation(){return r(this.calculateShaderTransformation)?t(this.transformation,e):(this._shaderTransformationDirty&&(this._shaderTransformation||(this._shaderTransformation=n()),a(this._shaderTransformation,this.calculateShaderTransformation(t(this.transformation,e))),this._shaderTransformationDirty=!1),this._shaderTransformation)}computeAttachmentOrigin(t){if(this.material.computeAttachmentOrigin)return!!this.material.computeAttachmentOrigin(this,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0);const r=this.indices.get(g.POSITION),s=this.vertexAttributes.get(g.POSITION);return!!d(s,r,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0)}get indices(){return this.data.indices}get vertexAttributes(){return this.data.vertexAttributes}addHighlight(){const t=new u(c.Highlight),r=this.instanceParameters;return r.highlights=l(r.highlights,t),t}removeHighlight(t){const r=this.instanceParameters;r.highlights=p(r.highlights,t)}}class S extends T{}export{T as RenderGeometry,S as ValidatedRenderGeometry};
5
+ import{unwrapOr as t,isNone as r,isSome as i}from"../../../../core/maybe.js";import{generateUID as s}from"../../../../core/uid.js";import{c as a}from"../../../../chunks/mat4.js";import{c as n,I as e}from"../../../../chunks/mat4f64.js";import{v as o}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec4f64.js";import{maxScale as m}from"../../support/mathUtils.js";import{Object3DState as c}from"./basicInterfaces.js";import{computeAttachmentOriginTriangles as d}from"./geometryDataUtils.js";import{InstanceParameters as f}from"./InstanceParameters.js";import{Object3DStateID as u}from"./Object3DStateID.js";import{VertexAttribute as g}from"./VertexAttribute.js";import{addObject3DStateID as l,removeObject3DStateID as p}from"../materials/renderers/utils.js";class T{constructor(r,i,a={}){this.data=r,this.material=i,this.boundingSphere=h(),this.instanceParameters=new f,this._transformation=n(),this._shaderTransformationDirty=!0,this.layerUid=t(a.layerUid,null),this.graphicUid=t(a.graphicUid,null),this.id=a.id?a.id:s(),this.boundingInfo=t(a.boundingInfo,null),this.calculateShaderTransformation=t(a.calculateShaderTransformation,null),this.castShadow=!!a.castShadow&&a.castShadow}get transformation(){return this._transformation}updateTransformation(t){t(this._transformation),this._shaderTransformationDirty=!0,this.computeBoundingSphere(this._transformation,this.boundingSphere)}shaderTransformationChanged(){this._shaderTransformationDirty=!0}computeBoundingSphere(t,i,s=m(t)){r(this.boundingInfo)||(o(i,this.boundingInfo.getCenter(),t),i[3]=this.boundingInfo.getBSRadius()*s)}get hasShaderTransformation(){return i(this.calculateShaderTransformation)}get primitiveType(){return this.data.primitiveType}getShaderTransformation(){return r(this.calculateShaderTransformation)?t(this.transformation,e):(this._shaderTransformationDirty&&(this._shaderTransformation||(this._shaderTransformation=n()),a(this._shaderTransformation,this.calculateShaderTransformation(t(this.transformation,e))),this._shaderTransformationDirty=!1),this._shaderTransformation)}computeAttachmentOrigin(t){if(this.material.computeAttachmentOrigin)return!!this.material.computeAttachmentOrigin(this,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0);const r=this.indices.get(g.POSITION),s=this.vertexAttributes.get(g.POSITION);return!!d(s,r,t)&&(i(this._transformation)&&o(t,t,this._transformation),!0)}get indices(){return this.data.indices}get vertexAttributes(){return this.data.vertexAttributes}addHighlight(){const t=new u(c.Highlight),r=this.instanceParameters;return r.highlights=l(r.highlights,t),t}removeHighlight(t){const r=this.instanceParameters;r.highlights=p(r.highlights,t)}}class S extends T{}export{T as RenderGeometry,S as ValidatedRenderGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as r}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat3f64.js";import{v as c,m as h,w as o,a as n,q as _}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{s as u,j as d,b as p,l,k as f,a as x,h as T,n as g,f as b,c as w}from"../../../../chunks/vec2.js";import{a as S}from"../../../../chunks/vec2f64.js";import{k as M,c as C,o as D,m as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e){this._rctx=t,this._viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.numCascades=1,this._maxNumCascades=4,this._splitSchemeLambda=0,this._warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this._maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this._maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)ut[t]=this._cascades[t];return ut.length=this.numCascades,ut}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:r}=this._clampNearFar(s);this._computeCascadeDistances(r,a),this._setupMatrices(t,e);const i=t.viewMatrix,c=t.projectionMatrix;for(let h=0;h<this.numCascades;++h)this._constructCascade(h,c,i,e);this._lastOrigin=null,this.clear()}finish(t){N(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!M(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||v(),C(this._lastOrigin,t);for(let e=0;e<this.numCascades;++e){c(dt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)pt[16*e+t]=dt[t]}}return pt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this._rctx,r=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(r,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,r=2**Math.round(s+a);return Math.min(this._maxTextureSize,2*r)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this._rctx,t),this._fbo=new Y(this._rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this._rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=r(this._fbo),this._depthTexture=r(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=r(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const r=this._cascades[t],i=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*i+e[14])/Math.abs(e[11]*i+e[15]),_=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<_);for(let c=0;c<8;++c){z(et,c%4==0||c%4==3?-1:1,c%4==0||c%4==1?-1:1,c<4?n:_,1),R(st[c],et,tt);for(let t=0;t<3;++t)st[c][t]/=st[c][3]}D(mt,st[0]),c(Z,_t,mt),r.camera.viewMatrix=Z;for(let c=0;c<8;++c)E(st[c],st[c],r.camera.viewMatrix);C(at,st[0]),C(rt,st[0]);for(let c=1;c<8;++c)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[c][t]),rt[t]=Math.max(rt[t],st[c][t]);at[2]-=200,rt[2]+=200,r.camera.near=-rt[2],r.camera.far=-at[2],this._warp?this._constructTrapezoidalProjection(s,a,r):this._constructOrthogonalProjection(r),h(r.lightMat,r.camera.projectionMatrix,r.camera.viewMatrix);const m=this._textureSize/2;r.camera.viewport[0]=t%2==0?0:m,r.camera.viewport[1]=0===Math.floor(t/2)?0:m,r.camera.viewport[2]=m,r.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],rt[0],at[1],rt[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const r=1/st[0][3],i=1/st[4][3];N(r<i);let c=r+Math.sqrt(r*i);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,Dt(st,c,h,it,ct,ht,ot,nt),Ut(it,ct,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-rt[2]),a.camera.projectionMatrix[14]=-(at[2]+rt[2])/(at[2]-rt[2])}_setupMatrices(t,e){h($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this._viewingMode===F.Global?t.eye:j(mt,0,0,1);_(_t,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this._maxNumCascades);const a=(t-e)/this.numCascades,r=(t/e)**(1/this.numCascades);let i=e,c=e;for(let h=0;h<this.numCascades+1;++h)this._cascadeDistances[h]=s(i,c,this._splitSchemeLambda),i*=r,c+=a}get gpuMemoryUsage(){return this._snapshots.reduce(((t,e)=>t+W(e)),this._fbo?.gpuMemoryUsage??0)}get test(){const t=this;return{maxNumCascades:this._maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t._splitSchemeLambda=e},get splitSchemeLambda(){return t._splitSchemeLambda},set warp(e){t._warp=e},get warp(){return t._warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),rt=v(),it=S(),ct=S(),ht=S(),ot=S(),nt=S(),_t=m(),mt=v(),ut=[],dt=m(),pt=new Float32Array(64),lt=S(),ft=S(),xt=[S(),S(),S(),S()],Tt=S(),gt=S(),bt=S(),wt=S(),St=S(),Mt=S(),Ct=S();function Dt(t,e,s,a,r,i,c,h){u(lt,0,0);for(let u=0;u<4;++u)d(lt,lt,t[u]);p(lt,lt,.25),u(ft,0,0);for(let u=4;u<8;++u)d(ft,ft,t[u]);p(ft,ft,.25),l(xt[0],t[4],t[5],.5),l(xt[1],t[5],t[6],.5),l(xt[2],t[6],t[7],.5),l(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],lt);for(let u=1;u<4;++u){const t=f(xt[u],lt);t<n&&(n=t,o=u)}x(Tt,xt[o],t[o+4]);const _=Tt[0];let m,S;Tt[0]=-Tt[1],Tt[1]=_,x(gt,ft,lt),T(gt,Tt)<0&&g(Tt,Tt),l(Tt,Tt,gt,s),b(Tt,Tt),m=S=T(x(bt,t[0],lt),Tt);for(let u=1;u<8;++u){const e=T(x(bt,t[u],lt),Tt);e<m?m=e:e>S&&(S=e)}w(a,lt),p(bt,Tt,m-e),d(a,a,bt);let M=-1,C=1,D=0,E=0;for(let u=0;u<8;++u){x(wt,t[u],a),b(wt,wt);const e=Tt[0]*wt[1]-Tt[1]*wt[0];e>0?e>M&&(M=e,D=u):e<C&&(C=e,E=u)}A(M>0,"leftArea"),A(C<0,"rightArea"),p(St,Tt,m),d(St,St,lt),p(Mt,Tt,S),d(Mt,Mt,lt),Ct[0]=-Tt[1],Ct[1]=Tt[0];const j=k(a,t[E],Mt,d(bt,Mt,Ct),1,r),v=k(a,t[D],Mt,bt,1,i),z=k(a,t[D],St,d(bt,St,Ct),1,c),R=k(a,t[E],St,bt,1,h);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=S();function vt(t,e){return u(jt,t[e],t[e+3]),jt}const zt=S(),Rt=i();function Ut(t,e,s,a,r){x(zt,s,a),p(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-T(vt(Rt,0),t),Rt[Et(1,2)]=-T(vt(Rt,1),t);let i=T(vt(Rt,0),s)+Rt[Et(0,2)],c=T(vt(Rt,1),s)+Rt[Et(1,2)],h=T(vt(Rt,0),a)+Rt[Et(0,2)],o=T(vt(Rt,1),a)+Rt[Et(1,2)];i=-(i+h)/(c+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*i,Rt[Et(0,1)]+=Rt[Et(1,1)]*i,Rt[Et(0,2)]+=Rt[Et(1,2)]*i,i=1/(T(vt(Rt,0),s)+Rt[Et(0,2)]),c=1/(T(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=i,Rt[Et(0,1)]*=i,Rt[Et(0,2)]*=i,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=T(vt(Rt,1),s)+Rt[Et(1,2)],o=T(vt(Rt,2),s)+Rt[Et(2,2)],i=-.5*(i/c+h/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*i,Rt[Et(1,1)]+=Rt[Et(2,1)]*i,Rt[Et(1,2)]+=Rt[Et(2,2)]*i,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=-c/i,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,r[0]=Rt[0],r[1]=Rt[1],r[2]=0,r[3]=Rt[2],r[4]=Rt[3],r[5]=Rt[4],r[6]=0,r[7]=Rt[5],r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=Rt[6],r[13]=Rt[7],r[14]=0,r[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};
5
+ import has from"../../../../core/has.js";import{clamp as t,acosClamped as e,lerp as s}from"../../../../core/mathUtils.js";import{isSome as a,disposeMaybe as r}from"../../../../core/maybe.js";import{c as i}from"../../../../chunks/mat3f64.js";import{v as c,m as h,w as o,a as n,q as _}from"../../../../chunks/mat4.js";import{c as m}from"../../../../chunks/mat4f64.js";import{s as u,j as d,b as p,l,k as f,a as x,h as T,n as g,f as w,c as b}from"../../../../chunks/vec2.js";import{a as S}from"../../../../chunks/vec2f64.js";import{w as M,c as C,x as D,v as E,s as j}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{s as z,t as R}from"../../../../chunks/vec4.js";import{c as U}from"../../../../chunks/vec4f64.js";import{ViewingMode as F}from"../../../ViewingMode.js";import{Camera as y}from"./Camera.js";import{assert as N,logWithBase as O,verify as A,rayRay2D as k}from"./Util.js";import{TextureType as L,ClearBufferBit as P,PixelFormat as B,PixelType as G,TextureWrapMode as I,TextureSamplingMode as X,TargetType as H,DepthStencilTargetType as q}from"../../../webgl/enums.js";import{FramebufferObject as Y}from"../../../webgl/FramebufferObject.js";import{Texture as V}from"../../../webgl/Texture.js";import{getGpuMemoryUsage as W}from"../../../webgl/Util.js";var J;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(J||(J={}));class K{constructor(){this.camera=new y,this.lightMat=m()}}class Q{constructor(t,e){this._rctx=t,this._viewingMode=e,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this.numCascades=1,this._maxNumCascades=4,this._splitSchemeLambda=0,this._warp=!0,this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=U(),this._cascades=[new K,new K,new K,new K],this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}get depthTexture(){return this._depthTexture}get textureSize(){return this._textureSize}get cascadeDistances(){return z(this._usedCascadeDistances,this._cascadeDistances[0],this.numCascades>1?this._cascadeDistances[1]:1/0,this.numCascades>2?this._cascadeDistances[2]:1/0,this.numCascades>3?this._cascadeDistances[3]:1/0)}dispose(){this._discardDepthTexture(),this._discardAllSnapshots()}set maxCascades(e){this._maxNumCascades=t(Math.floor(e),1,4)}get maxCascades(){return this._maxNumCascades}set enabled(t){this._enabled=t,t||(this._discardDepthTexture(),this._discardAllSnapshots())}get enabled(){return this._enabled}get ready(){return this._enabled&&a(this._depthTexture)}getSnapshot(t){return this.enabled?this._snapshots[t]:null}getCascades(){for(let t=0;t<this.numCascades;++t)ut[t]=this._cascades[t];return ut.length=this.numCascades,ut}start(t,e,s){N(this.enabled),this._textureSize=this._computeTextureSize(t.fullWidth,t.fullHeight),this._ensureDepthTexture();const{near:a,far:r}=this._clampNearFar(s);this._computeCascadeDistances(r,a),this._setupMatrices(t,e);const i=t.viewMatrix,c=t.projectionMatrix;for(let h=0;h<this.numCascades;++h)this._constructCascade(h,c,i,e);this._lastOrigin=null,this.clear()}finish(t){N(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!M(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||v(),C(this._lastOrigin,t);for(let e=0;e<this.numCascades;++e){c(dt,this._cascades[e].lightMat,t);for(let t=0;t<16;++t)pt[16*e+t]=dt[t]}}return pt}takeCascadeSnapshotTo(t,e){N(this.enabled);const s=this._ensureSnapshot(e);this._bindFbo();const a=this._rctx,r=a.bindTexture(s,V.TEXTURE_UNIT_FOR_UPDATES);a.gl.copyTexSubImage2D(L.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),a.bindTexture(r,V.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT)}_computeTextureSize(t,e){const s=.5*Math.log(t*t+e*e)*Math.LOG2E,a=.35,r=2**Math.round(s+a);return Math.min(this._maxTextureSize,2*r)}_ensureDepthTexture(){if(a(this._depthTexture)&&this._depthTexture.descriptor.width===this._textureSize)return;this._discardDepthTexture();const t={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};this._depthTexture=new V(this._rctx,t),this._fbo=new Y(this._rctx,{colorTarget:H.TEXTURE,depthStencilTarget:q.DEPTH_RENDER_BUFFER,width:this._textureSize,height:this._textureSize},this._depthTexture)}_ensureSnapshot(t){let e=this._snapshots[t];if(a(e)&&e.descriptor.width===this._textureSize)return e;this._discardSnapshot(t);const s={target:L.TEXTURE_2D,pixelFormat:B.RGBA,dataType:G.UNSIGNED_BYTE,wrapMode:I.CLAMP_TO_EDGE,samplingMode:X.NEAREST,flipped:!0,width:this._textureSize,height:this._textureSize};return e=new V(this._rctx,s),this._snapshots[t]=e,e}_discardDepthTexture(){this._fbo=r(this._fbo),this._depthTexture=r(this._depthTexture)}_discardSnapshot(t){this._snapshots[t]=r(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this._depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,e,s,a){const r=this._cascades[t],i=-this._cascadeDistances[t],o=-this._cascadeDistances[t+1],n=(e[10]*i+e[14])/Math.abs(e[11]*i+e[15]),_=(e[10]*o+e[14])/Math.abs(e[11]*o+e[15]);N(n<_);for(let c=0;c<8;++c){z(et,c%4==0||c%4==3?-1:1,c%4==0||c%4==1?-1:1,c<4?n:_,1),R(st[c],et,tt);for(let t=0;t<3;++t)st[c][t]/=st[c][3]}D(mt,st[0]),c(Z,_t,mt),r.camera.viewMatrix=Z;for(let c=0;c<8;++c)E(st[c],st[c],r.camera.viewMatrix);C(at,st[0]),C(rt,st[0]);for(let c=1;c<8;++c)for(let t=0;t<3;++t)at[t]=Math.min(at[t],st[c][t]),rt[t]=Math.max(rt[t],st[c][t]);at[2]-=200,rt[2]+=200,r.camera.near=-rt[2],r.camera.far=-at[2],this._warp?this._constructTrapezoidalProjection(s,a,r):this._constructOrthogonalProjection(r),h(r.lightMat,r.camera.projectionMatrix,r.camera.viewMatrix);const m=this._textureSize/2;r.camera.viewport[0]=t%2==0?0:m,r.camera.viewport[1]=0===Math.floor(t/2)?0:m,r.camera.viewport[2]=m,r.camera.viewport[3]=m}_constructOrthogonalProjection(t){o(t.camera.projectionMatrix,at[0],rt[0],at[1],rt[1],t.camera.near,t.camera.far)}_constructTrapezoidalProjection(t,s,a){const r=1/st[0][3],i=1/st[4][3];N(r<i);let c=r+Math.sqrt(r*i);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,Dt(st,c,h,it,ct,ht,ot,nt),Ut(it,ct,ot,nt,a.camera.projectionMatrix),a.camera.projectionMatrix[10]=2/(at[2]-rt[2]),a.camera.projectionMatrix[14]=-(at[2]+rt[2])/(at[2]-rt[2])}_setupMatrices(t,e){h($,t.projectionMatrix,t.viewMatrix),n(tt,$);const s=this._viewingMode===F.Global?t.eye:j(mt,0,0,1);_(_t,[0,0,0],[-e[0],-e[1],-e[2]],s)}_clampNearFar(t){let{near:e,far:s}=t;return e<2&&(e=2),s<2&&(s=2),e>=s&&(e=2,s=4),{near:e,far:s}}_computeCascadeDistances(t,e){this.numCascades=Math.min(1+Math.floor(O(t/e,4)),this._maxNumCascades);const a=(t-e)/this.numCascades,r=(t/e)**(1/this.numCascades);let i=e,c=e;for(let h=0;h<this.numCascades+1;++h)this._cascadeDistances[h]=s(i,c,this._splitSchemeLambda),i*=r,c+=a}get gpuMemoryUsage(){return this._snapshots.reduce(((t,e)=>t+W(e)),this._fbo?.gpuMemoryUsage??0)}get test(){const t=this;return{maxNumCascades:this._maxNumCascades,cascades:this._cascades,textureSize:this._textureSize,set splitSchemeLambda(e){t._splitSchemeLambda=e},get splitSchemeLambda(){return t._splitSchemeLambda},set warp(e){t._warp=e},get warp(){return t._warp}}}}const Z=m(),$=m(),tt=m(),et=U(),st=[];for(let Ft=0;Ft<8;++Ft)st.push(U());const at=v(),rt=v(),it=S(),ct=S(),ht=S(),ot=S(),nt=S(),_t=m(),mt=v(),ut=[],dt=m(),pt=new Float32Array(64),lt=S(),ft=S(),xt=[S(),S(),S(),S()],Tt=S(),gt=S(),wt=S(),bt=S(),St=S(),Mt=S(),Ct=S();function Dt(t,e,s,a,r,i,c,h){u(lt,0,0);for(let u=0;u<4;++u)d(lt,lt,t[u]);p(lt,lt,.25),u(ft,0,0);for(let u=4;u<8;++u)d(ft,ft,t[u]);p(ft,ft,.25),l(xt[0],t[4],t[5],.5),l(xt[1],t[5],t[6],.5),l(xt[2],t[6],t[7],.5),l(xt[3],t[7],t[4],.5);let o=0,n=f(xt[0],lt);for(let u=1;u<4;++u){const t=f(xt[u],lt);t<n&&(n=t,o=u)}x(Tt,xt[o],t[o+4]);const _=Tt[0];let m,S;Tt[0]=-Tt[1],Tt[1]=_,x(gt,ft,lt),T(gt,Tt)<0&&g(Tt,Tt),l(Tt,Tt,gt,s),w(Tt,Tt),m=S=T(x(wt,t[0],lt),Tt);for(let u=1;u<8;++u){const e=T(x(wt,t[u],lt),Tt);e<m?m=e:e>S&&(S=e)}b(a,lt),p(wt,Tt,m-e),d(a,a,wt);let M=-1,C=1,D=0,E=0;for(let u=0;u<8;++u){x(bt,t[u],a),w(bt,bt);const e=Tt[0]*bt[1]-Tt[1]*bt[0];e>0?e>M&&(M=e,D=u):e<C&&(C=e,E=u)}A(M>0,"leftArea"),A(C<0,"rightArea"),p(St,Tt,m),d(St,St,lt),p(Mt,Tt,S),d(Mt,Mt,lt),Ct[0]=-Tt[1],Ct[1]=Tt[0];const j=k(a,t[E],Mt,d(wt,Mt,Ct),1,r),v=k(a,t[D],Mt,wt,1,i),z=k(a,t[D],St,d(wt,St,Ct),1,c),R=k(a,t[E],St,wt,1,h);A(j,"rayRay"),A(v,"rayRay"),A(z,"rayRay"),A(R,"rayRay")}function Et(t,e){return 3*e+t}const jt=S();function vt(t,e){return u(jt,t[e],t[e+3]),jt}const zt=S(),Rt=i();function Ut(t,e,s,a,r){x(zt,s,a),p(zt,zt,.5),Rt[0]=zt[0],Rt[1]=zt[1],Rt[2]=0,Rt[3]=zt[1],Rt[4]=-zt[0],Rt[5]=0,Rt[6]=zt[0]*zt[0]+zt[1]*zt[1],Rt[7]=zt[0]*zt[1]-zt[1]*zt[0],Rt[8]=1,Rt[Et(0,2)]=-T(vt(Rt,0),t),Rt[Et(1,2)]=-T(vt(Rt,1),t);let i=T(vt(Rt,0),s)+Rt[Et(0,2)],c=T(vt(Rt,1),s)+Rt[Et(1,2)],h=T(vt(Rt,0),a)+Rt[Et(0,2)],o=T(vt(Rt,1),a)+Rt[Et(1,2)];i=-(i+h)/(c+o),Rt[Et(0,0)]+=Rt[Et(1,0)]*i,Rt[Et(0,1)]+=Rt[Et(1,1)]*i,Rt[Et(0,2)]+=Rt[Et(1,2)]*i,i=1/(T(vt(Rt,0),s)+Rt[Et(0,2)]),c=1/(T(vt(Rt,1),s)+Rt[Et(1,2)]),Rt[Et(0,0)]*=i,Rt[Et(0,1)]*=i,Rt[Et(0,2)]*=i,Rt[Et(1,0)]*=c,Rt[Et(1,1)]*=c,Rt[Et(1,2)]*=c,Rt[Et(2,0)]=Rt[Et(1,0)],Rt[Et(2,1)]=Rt[Et(1,1)],Rt[Et(2,2)]=Rt[Et(1,2)],Rt[Et(1,2)]+=1,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=T(vt(Rt,1),s)+Rt[Et(1,2)],o=T(vt(Rt,2),s)+Rt[Et(2,2)],i=-.5*(i/c+h/o),Rt[Et(1,0)]+=Rt[Et(2,0)]*i,Rt[Et(1,1)]+=Rt[Et(2,1)]*i,Rt[Et(1,2)]+=Rt[Et(2,2)]*i,i=T(vt(Rt,1),e)+Rt[Et(1,2)],c=T(vt(Rt,2),e)+Rt[Et(2,2)],h=-c/i,Rt[Et(1,0)]*=h,Rt[Et(1,1)]*=h,Rt[Et(1,2)]*=h,r[0]=Rt[0],r[1]=Rt[1],r[2]=0,r[3]=Rt[2],r[4]=Rt[3],r[5]=Rt[4],r[6]=0,r[7]=Rt[5],r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=Rt[6],r[13]=Rt[7],r[14]=0,r[15]=Rt[8]}export{Q as ShadowMap,J as SnapshotSlot};