@vcmap/ui 5.0.0-rc.30 → 5.0.0-rc.31

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 (323) hide show
  1. package/build/buildHelpers.js +4 -3
  2. package/config/base.config.json +5 -4
  3. package/config/dev.config.json +4 -0
  4. package/config/graphFeatureInfo.config.json +1 -1
  5. package/config/projects.config.json +2 -2
  6. package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +1 -1
  7. package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
  8. package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
  9. package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
  10. package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
  11. package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
  12. package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
  13. package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
  14. package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
  15. package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
  16. package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
  17. package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
  18. package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
  19. package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
  20. package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
  21. package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
  22. package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
  23. package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
  24. package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
  25. package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
  26. package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
  27. package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
  28. package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
  29. package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
  30. package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
  31. package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
  32. package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
  33. package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
  34. package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
  35. package/dist/assets/cesium/Workers/{package.js → chunk-MPAZH4BF.js} +13 -2
  36. package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
  37. package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
  38. package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
  39. package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
  40. package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
  41. package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
  42. package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
  43. package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
  44. package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
  45. package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
  46. package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
  47. package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
  48. package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
  49. package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
  50. package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
  51. package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
  52. package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
  53. package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
  54. package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
  55. package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
  56. package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
  57. package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
  58. package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
  59. package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
  60. package/dist/assets/cesium/Workers/combineGeometry.js +65 -15
  61. package/dist/assets/cesium/Workers/createBoxGeometry.js +55 -10
  62. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +231 -310
  63. package/dist/assets/cesium/Workers/createCircleGeometry.js +185 -202
  64. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +141 -155
  65. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +477 -557
  66. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  67. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1162 -1307
  68. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +533 -569
  69. package/dist/assets/cesium/Workers/createCylinderGeometry.js +57 -10
  70. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +224 -258
  71. package/dist/assets/cesium/Workers/createEllipseGeometry.js +68 -12
  72. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +61 -12
  73. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +56 -10
  74. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +58 -13
  75. package/dist/assets/cesium/Workers/createFrustumGeometry.js +55 -10
  76. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +226 -243
  77. package/dist/assets/cesium/Workers/createGeometry.js +143 -48
  78. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1484 -2011
  79. package/dist/assets/cesium/Workers/createPlaneGeometry.js +216 -243
  80. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +121 -113
  81. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1041 -1327
  82. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +516 -657
  83. package/dist/assets/cesium/Workers/createPolylineGeometry.js +471 -547
  84. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +352 -384
  85. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
  86. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1128 -1331
  87. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +445 -500
  88. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +381 -440
  89. package/dist/assets/cesium/Workers/createSphereGeometry.js +112 -118
  90. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +112 -121
  91. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -127
  92. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +462 -505
  93. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +377 -436
  94. package/dist/assets/cesium/Workers/createVectorTilePoints.js +110 -77
  95. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +369 -391
  96. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +252 -244
  97. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  98. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2244 -2677
  99. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -926
  100. package/dist/assets/cesium/Workers/createWallGeometry.js +459 -593
  101. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +324 -419
  102. package/dist/assets/cesium/Workers/decodeDraco.js +327 -347
  103. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  104. package/dist/assets/cesium/Workers/decodeI3S.js +765 -970
  105. package/dist/assets/cesium/Workers/transcodeKTX2.js +3353 -1464
  106. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +3 -4
  107. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  108. package/dist/assets/{cesium.eaf7cc.js → cesium.77d0f7.js} +8915 -13165
  109. package/dist/assets/cesium.js +1 -1
  110. package/dist/assets/{core.b16511.js → core.720589.js} +3421 -3365
  111. package/dist/assets/core.js +1 -1
  112. package/dist/assets/index-dd539204.js +1 -0
  113. package/dist/assets/{ol.4bbf0f.js → ol.e48649.js} +4 -4
  114. package/dist/assets/ol.js +1 -1
  115. package/dist/assets/{ui.ab815e.css → ui.50452a.css} +1 -1
  116. package/dist/assets/{ui.ab815e.js → ui.50452a.js} +4270 -4355
  117. package/dist/assets/ui.js +1 -1
  118. package/dist/assets/vue.js +2 -2
  119. package/dist/assets/{vuetify.ea3fa8.js → vuetify.f0a769.js} +1 -1
  120. package/dist/assets/vuetify.js +2 -2
  121. package/dist/index.html +27 -23
  122. package/index.html +23 -22
  123. package/package.json +5 -5
  124. package/plugins/@vcmap-show-case/plugin-editors/PluginEditors.vue +119 -0
  125. package/plugins/@vcmap-show-case/plugin-editors/index.js +41 -0
  126. package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
  127. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ProjectSelectorComponent.vue +1 -1
  128. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/config.json +2 -2
  129. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/package.json +1 -1
  130. package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/package.json +1 -1
  131. package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +1 -1
  132. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/ThemeChangerComponent.vue +1 -1
  133. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/config.json +2 -2
  134. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/package.json +1 -1
  135. package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +20 -1
  136. package/plugins/package.json +6 -2
  137. package/src/application/VcsAttributions.vue +27 -20
  138. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +22 -14
  139. package/src/components/form-inputs-controls/VcsSlider.vue +1 -0
  140. package/src/components/icons/2DAreaIcon.vue +2 -17
  141. package/src/components/icons/2DDistanceIcon.vue +0 -3
  142. package/src/components/icons/3DAreaIcon.vue +2 -17
  143. package/src/components/icons/3DDistanceIcon.vue +0 -3
  144. package/src/components/icons/3DHeightIcon.vue +0 -3
  145. package/src/components/icons/AngleIcon.vue +0 -1
  146. package/src/components/icons/AssociationsIcon.vue +1 -3
  147. package/src/components/icons/AxisIcon.vue +0 -4
  148. package/src/components/icons/BoundingBoxIcon.vue +1 -4
  149. package/src/components/icons/CheckboxIcon.vue +0 -2
  150. package/src/components/icons/CheckboxIndeterminateIcon.vue +1 -5
  151. package/src/components/icons/CircleIcon.vue +1 -6
  152. package/src/components/icons/ClippingHorizontalIcon.vue +0 -1
  153. package/src/components/icons/ClippingIcon.vue +0 -1
  154. package/src/components/icons/ClippingVerticalIcon.vue +0 -1
  155. package/src/components/icons/ColorPickerIcon.vue +0 -1
  156. package/src/components/icons/ColorSwatchIcon.vue +0 -2
  157. package/src/components/icons/CommentIcon.vue +0 -1
  158. package/src/components/icons/CompassIcon.vue +0 -2
  159. package/src/components/icons/ComponentsIcon.vue +0 -1
  160. package/src/components/icons/ConeIcon.vue +1 -4
  161. package/src/components/icons/DimensionsHouseIcon.vue +0 -2
  162. package/src/components/icons/EditIcon.vue +0 -1
  163. package/src/components/icons/EditVerticesIcon.vue +0 -4
  164. package/src/components/icons/ElevationProfileIcon.vue +1 -13
  165. package/src/components/icons/ExportAreaIcon.vue +0 -1
  166. package/src/components/icons/ExportFlightIcon.vue +0 -1
  167. package/src/components/icons/ExportIcon.vue +12 -8
  168. package/src/components/icons/ExternalLinkIcon.vue +0 -2
  169. package/src/components/icons/FastForwardIcon.vue +0 -1
  170. package/src/components/icons/FilterIcon.vue +0 -1
  171. package/src/components/icons/GlobeNatureIcon.vue +0 -3
  172. package/src/components/icons/GroundIcon.vue +0 -1
  173. package/src/components/icons/HealthCareIndustriesIcon.vue +1 -11
  174. package/src/components/icons/HideIcon.vue +0 -1
  175. package/src/components/icons/HomePointIcon.vue +0 -1
  176. package/src/components/icons/HospitalsIcon.vue +1 -20
  177. package/src/components/icons/HouseIcon.vue +3 -13
  178. package/src/components/icons/ImportIcon.vue +6 -14
  179. package/src/components/icons/InfoIcon.vue +0 -2
  180. package/src/components/icons/KebabIcon.vue +1 -9
  181. package/src/components/icons/LabelIcon.vue +0 -2
  182. package/src/components/icons/LayersIcon.vue +1 -9
  183. package/src/components/icons/LegendIcon.vue +0 -1
  184. package/src/components/icons/LineIcon.vue +0 -2
  185. package/src/components/icons/LinkIcon.vue +0 -1
  186. package/src/components/icons/LogoutIcon.vue +0 -1
  187. package/src/components/icons/MapIcon.vue +0 -2
  188. package/src/components/icons/MenuIcon.vue +1 -5
  189. package/src/components/icons/MinusIcon.vue +0 -2
  190. package/src/components/icons/ObjectSelectIcon.vue +0 -2
  191. package/src/components/icons/ObliqueViewIcon.vue +0 -1
  192. package/src/components/icons/PdfIcon.vue +0 -1
  193. package/src/components/icons/PedestrianIcon.vue +0 -1
  194. package/src/components/icons/PenIcon.vue +0 -1
  195. package/src/components/icons/PlayCircleIcon.vue +1 -8
  196. package/src/components/icons/PlusIcon.vue +0 -2
  197. package/src/components/icons/PoiIcon.vue +0 -1
  198. package/src/components/icons/PointIcon.vue +2 -6
  199. package/src/components/icons/PointSelectIcon.vue +0 -1
  200. package/src/components/icons/PresentationModeIcon.vue +0 -1
  201. package/src/components/icons/ProgressIcon.vue +1 -1
  202. package/src/components/icons/QueryIcon.vue +0 -1
  203. package/src/components/icons/RectangleIcon.vue +1 -6
  204. package/src/components/icons/ReturnIcon.vue +0 -1
  205. package/src/components/icons/RewindIcon.vue +0 -1
  206. package/src/components/icons/RotateLeftIcon.vue +0 -1
  207. package/src/components/icons/RotateRightIcon.vue +0 -1
  208. package/src/components/icons/ScreenshotIcon.vue +1 -6
  209. package/src/components/icons/SearchIcon.vue +0 -1
  210. package/src/components/icons/ShadowIcon.vue +0 -2
  211. package/src/components/icons/ShapesIcon.vue +1 -4
  212. package/src/components/icons/ShareIcon.vue +0 -1
  213. package/src/components/icons/SimpleCircleFilledIcon.vue +0 -1
  214. package/src/components/icons/SimpleCircleHalfFilledIcon.vue +0 -1
  215. package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -7
  216. package/src/components/icons/SkipPreviousIcon.vue +1 -6
  217. package/src/components/icons/SplitViewIcon.vue +0 -1
  218. package/src/components/icons/TextStyleIcon.vue +0 -3
  219. package/src/components/icons/ThreeDimensionsIcon.vue +0 -1
  220. package/src/components/icons/ToolsIcon.vue +0 -1
  221. package/src/components/icons/TouchIcon.vue +0 -1
  222. package/src/components/icons/TriangleIcon.vue +0 -3
  223. package/src/components/icons/TwoDimensionsIcon.vue +0 -2
  224. package/src/components/icons/UploadIcon.vue +0 -1
  225. package/src/components/icons/UserProfileIcon.vue +0 -1
  226. package/src/components/icons/UserShareIcon.vue +0 -1
  227. package/src/components/icons/ViewpointFlightIcon.vue +0 -1
  228. package/src/components/icons/ViewpointIcon.vue +0 -1
  229. package/src/components/icons/Viewshed360Icon.vue +0 -1
  230. package/src/components/icons/ViewshedConeIcon.vue +0 -1
  231. package/src/components/icons/ViewshedIcon.vue +0 -1
  232. package/src/components/icons/WalkingIcon.vue +0 -1
  233. package/src/components/icons/WallIcon.vue +1 -4
  234. package/src/components/icons/WandIcon.vue +22 -70
  235. package/src/components/lists/VcsList.vue +18 -12
  236. package/src/components/plugins/AbstractConfigEditor.vue +2 -2
  237. package/src/components/tables/VcsDataTable.vue +1 -1
  238. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +57 -14
  239. package/src/contentTree/contentTreeCollection.js +30 -9
  240. package/src/i18n/de.js +8 -5
  241. package/src/i18n/en.js +8 -5
  242. package/src/i18n/i18nCollection.js +19 -65
  243. package/src/manager/buttonManager.js +4 -0
  244. package/src/manager/contextMenu/contextMenuManager.js +2 -0
  245. package/src/pluginHelper.js +2 -2
  246. package/src/vcsUiApp.js +9 -4
  247. package/src/vuePlugins/i18n.js +0 -8
  248. package/dist/assets/cesium/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  249. package/dist/assets/cesium/Workers/ArcType-2d9abbbc.js +0 -37
  250. package/dist/assets/cesium/Workers/AttributeCompression-f9f6c717.js +0 -716
  251. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-4140c51f.js +0 -258
  252. package/dist/assets/cesium/Workers/BoundingRectangle-c714b156.js +0 -369
  253. package/dist/assets/cesium/Workers/BoxGeometry-6f3da43d.js +0 -884
  254. package/dist/assets/cesium/Workers/Check-6ede7e26.js +0 -290
  255. package/dist/assets/cesium/Workers/Color-8a565ff2.js +0 -2262
  256. package/dist/assets/cesium/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  257. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4b4d4096.js +0 -132
  258. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-7b94502b.js +0 -498
  259. package/dist/assets/cesium/Workers/CylinderGeometry-ca070b87.js +0 -467
  260. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  261. package/dist/assets/cesium/Workers/EllipseGeometry-122e51fa.js +0 -1304
  262. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-4d326efc.js +0 -366
  263. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-16cc2bd7.js +0 -443
  264. package/dist/assets/cesium/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  265. package/dist/assets/cesium/Workers/EllipsoidGeometry-cb148ca2.js +0 -637
  266. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-0fa10c79.js +0 -454
  267. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  268. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-6dd1b7af.js +0 -373
  269. package/dist/assets/cesium/Workers/EncodedCartesian3-57415c8a.js +0 -171
  270. package/dist/assets/cesium/Workers/FrustumGeometry-ee73037c.js +0 -2540
  271. package/dist/assets/cesium/Workers/GeometryAttribute-ff5b4fb1.js +0 -619
  272. package/dist/assets/cesium/Workers/GeometryAttributes-ad136444.js +0 -91
  273. package/dist/assets/cesium/Workers/GeometryInstance-34d9e21e.js +0 -121
  274. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  275. package/dist/assets/cesium/Workers/GeometryPipeline-1f8fbf05.js +0 -3690
  276. package/dist/assets/cesium/Workers/IndexDatatype-2643aa47.js +0 -200
  277. package/dist/assets/cesium/Workers/IntersectionTests-70d39ba9.js +0 -1836
  278. package/dist/assets/cesium/Workers/Math-0a2ac845.js +0 -1340
  279. package/dist/assets/cesium/Workers/Matrix2-e1298525.js +0 -7086
  280. package/dist/assets/cesium/Workers/Matrix3-41c58dde.js +0 -4283
  281. package/dist/assets/cesium/Workers/OrientedBoundingBox-159cf1d6.js +0 -1259
  282. package/dist/assets/cesium/Workers/Plane-4c3d403b.js +0 -309
  283. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-076a5d25.js +0 -1074
  284. package/dist/assets/cesium/Workers/PolygonPipeline-b9f2810a.js +0 -1344
  285. package/dist/assets/cesium/Workers/PolylinePipeline-639192e0.js +0 -573
  286. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-b73549fb.js +0 -781
  287. package/dist/assets/cesium/Workers/PrimitivePipeline-10ede1b6.js +0 -966
  288. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-c35a7356.js +0 -280
  289. package/dist/assets/cesium/Workers/RuntimeError-ef395448.js +0 -68
  290. package/dist/assets/cesium/Workers/TerrainEncoding-668d242f.js +0 -1227
  291. package/dist/assets/cesium/Workers/Transforms-a2a85221.js +0 -14712
  292. package/dist/assets/cesium/Workers/VertexFormat-030f11ff.js +0 -312
  293. package/dist/assets/cesium/Workers/WallGeometryLibrary-1938bf0d.js +0 -211
  294. package/dist/assets/cesium/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  295. package/dist/assets/cesium/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  296. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  297. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -1363
  298. package/dist/assets/cesium/Workers/combine-d9581036.js +0 -82
  299. package/dist/assets/cesium/Workers/defaultValue-fe22d8c0.js +0 -51
  300. package/dist/assets/index-c115e3a1.js +0 -1
  301. package/plugins/@vcmap/create-link/fallbackCreateLink.vue +0 -76
  302. package/plugins/@vcmap/create-link/index.js +0 -95
  303. package/plugins/@vcmap/create-link/package.json +0 -6
  304. package/plugins/@vcmap/search-nominatim/LICENSE.md +0 -13
  305. package/plugins/@vcmap/search-nominatim/README.md +0 -3
  306. package/plugins/@vcmap/search-nominatim/SearchNominatimEditor.vue +0 -90
  307. package/plugins/@vcmap/search-nominatim/config.json +0 -3
  308. package/plugins/@vcmap/search-nominatim/index.js +0 -66
  309. package/plugins/@vcmap/search-nominatim/nominatim.js +0 -175
  310. package/plugins/@vcmap/search-nominatim/package.json +0 -9
  311. /package/dist/assets/{vue.67e80f.js → vue.5d696e.js} +0 -0
  312. /package/dist/assets/{vuetify.ea3fa8.css → vuetify.f0a769.css} +0 -0
  313. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ModulesListComponent.vue +0 -0
  314. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/README.md +0 -0
  315. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/de.json +0 -0
  316. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/en.json +0 -0
  317. /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/index.js +0 -0
  318. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/README.md +0 -0
  319. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/SimpleGraphComponent.vue +0 -0
  320. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/index.js +0 -0
  321. /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/simpleGraphView.js +0 -0
  322. /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +0 -0
  323. /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/index.js +0 -0
@@ -1,1127 +1,838 @@
1
- define(['./Transforms-a2a85221', './Matrix2-e1298525', './Matrix3-41c58dde', './Check-6ede7e26', './defaultValue-fe22d8c0', './Math-0a2ac845', './ArcType-2d9abbbc', './arrayRemoveDuplicates-d2061e85', './ComponentDatatype-cf1fa08e', './EllipsoidGeodesic-5b3623dc', './EllipsoidRhumbLine-ef872433', './EncodedCartesian3-57415c8a', './GeometryAttribute-ff5b4fb1', './IntersectionTests-70d39ba9', './Plane-4c3d403b', './WebMercatorProjection-13ed1a6e', './combine-d9581036', './RuntimeError-ef395448', './WebGLConstants-0b1ce7ba'], (function (Transforms, Matrix2, Matrix3, Check, defaultValue, Math$1, ArcType, arrayRemoveDuplicates, ComponentDatatype, EllipsoidGeodesic, EllipsoidRhumbLine, EncodedCartesian3, GeometryAttribute, IntersectionTests, Plane, WebMercatorProjection, combine, RuntimeError, WebGLConstants) { 'use strict';
2
-
3
- /**
4
- * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
5
- * longitude and latitude are directly mapped to X and Y. This projection is commonly
6
- * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
7
- *
8
- * @alias GeographicTilingScheme
9
- * @constructor
10
- *
11
- * @param {object} [options] Object with the following properties:
12
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to
13
- * the WGS84 ellipsoid.
14
- * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.
15
- * @param {number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of
16
- * the tile tree.
17
- * @param {number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of
18
- * the tile tree.
19
- */
20
- function GeographicTilingScheme(options) {
21
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
22
-
23
- this._ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
24
- this._rectangle = defaultValue.defaultValue(options.rectangle, Matrix2.Rectangle.MAX_VALUE);
25
- this._projection = new Transforms.GeographicProjection(this._ellipsoid);
26
- this._numberOfLevelZeroTilesX = defaultValue.defaultValue(
27
- options.numberOfLevelZeroTilesX,
28
- 2
29
- );
30
- this._numberOfLevelZeroTilesY = defaultValue.defaultValue(
31
- options.numberOfLevelZeroTilesY,
32
- 1
33
- );
34
- }
35
-
36
- Object.defineProperties(GeographicTilingScheme.prototype, {
37
- /**
38
- * Gets the ellipsoid that is tiled by this tiling scheme.
39
- * @memberof GeographicTilingScheme.prototype
40
- * @type {Ellipsoid}
41
- */
42
- ellipsoid: {
43
- get: function () {
44
- return this._ellipsoid;
45
- },
46
- },
47
-
48
- /**
49
- * Gets the rectangle, in radians, covered by this tiling scheme.
50
- * @memberof GeographicTilingScheme.prototype
51
- * @type {Rectangle}
52
- */
53
- rectangle: {
54
- get: function () {
55
- return this._rectangle;
56
- },
57
- },
58
-
59
- /**
60
- * Gets the map projection used by this tiling scheme.
61
- * @memberof GeographicTilingScheme.prototype
62
- * @type {MapProjection}
63
- */
64
- projection: {
65
- get: function () {
66
- return this._projection;
67
- },
68
- },
69
- });
70
-
71
- /**
72
- * Gets the total number of tiles in the X direction at a specified level-of-detail.
73
- *
74
- * @param {number} level The level-of-detail.
75
- * @returns {number} The number of tiles in the X direction at the given level.
76
- */
77
- GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {
78
- return this._numberOfLevelZeroTilesX << level;
79
- };
80
-
81
- /**
82
- * Gets the total number of tiles in the Y direction at a specified level-of-detail.
83
- *
84
- * @param {number} level The level-of-detail.
85
- * @returns {number} The number of tiles in the Y direction at the given level.
86
- */
87
- GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {
88
- return this._numberOfLevelZeroTilesY << level;
89
- };
90
-
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.109.3
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ WebMercatorProjection_default
28
+ } from "./chunk-HQF437NJ.js";
29
+ import {
30
+ ArcType_default
31
+ } from "./chunk-CCFQRR6D.js";
32
+ import {
33
+ EncodedCartesian3_default
34
+ } from "./chunk-QT3MPEMI.js";
35
+ import {
36
+ EllipsoidGeodesic_default
37
+ } from "./chunk-AFFLIKOH.js";
38
+ import {
39
+ arrayRemoveDuplicates_default
40
+ } from "./chunk-3W63OHNJ.js";
41
+ import {
42
+ EllipsoidRhumbLine_default
43
+ } from "./chunk-K36FEYS7.js";
44
+ import {
45
+ IntersectionTests_default
46
+ } from "./chunk-MYZB7C4T.js";
47
+ import {
48
+ Plane_default
49
+ } from "./chunk-OYFCF4PL.js";
50
+ import {
51
+ GeometryAttribute_default,
52
+ Geometry_default
53
+ } from "./chunk-X4SU25DT.js";
54
+ import {
55
+ BoundingSphere_default,
56
+ GeographicProjection_default,
57
+ Quaternion_default,
58
+ Resource_default,
59
+ buildModuleUrl_default
60
+ } from "./chunk-PFQBCKBM.js";
61
+ import "./chunk-QJ3DFBH3.js";
62
+ import {
63
+ Cartesian2_default,
64
+ Rectangle_default
65
+ } from "./chunk-DUHWWBQQ.js";
66
+ import {
67
+ ComponentDatatype_default
68
+ } from "./chunk-LLUNNUJV.js";
69
+ import {
70
+ Cartesian3_default,
71
+ Cartographic_default,
72
+ Ellipsoid_default,
73
+ Matrix3_default
74
+ } from "./chunk-PCJWUS4M.js";
75
+ import {
76
+ Math_default
77
+ } from "./chunk-N3JIFFX2.js";
78
+ import "./chunk-AHKEZ2OE.js";
79
+ import "./chunk-ABADGKYE.js";
80
+ import {
81
+ defaultValue_default
82
+ } from "./chunk-WXTV4ATB.js";
83
+ import {
84
+ Check_default,
85
+ DeveloperError_default
86
+ } from "./chunk-4MFFIWUA.js";
87
+ import {
88
+ defined_default
89
+ } from "./chunk-6BTKZDRG.js";
90
+
91
+ // packages/engine/Source/Core/GeographicTilingScheme.js
92
+ function GeographicTilingScheme(options) {
93
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
94
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
95
+ this._rectangle = defaultValue_default(options.rectangle, Rectangle_default.MAX_VALUE);
96
+ this._projection = new GeographicProjection_default(this._ellipsoid);
97
+ this._numberOfLevelZeroTilesX = defaultValue_default(
98
+ options.numberOfLevelZeroTilesX,
99
+ 2
100
+ );
101
+ this._numberOfLevelZeroTilesY = defaultValue_default(
102
+ options.numberOfLevelZeroTilesY,
103
+ 1
104
+ );
105
+ }
106
+ Object.defineProperties(GeographicTilingScheme.prototype, {
91
107
  /**
92
- * Transforms a rectangle specified in geodetic radians to the native coordinate system
93
- * of this tiling scheme.
94
- *
95
- * @param {Rectangle} rectangle The rectangle to transform.
96
- * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance
97
- * should be created.
98
- * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'
99
- * is undefined.
108
+ * Gets the ellipsoid that is tiled by this tiling scheme.
109
+ * @memberof GeographicTilingScheme.prototype
110
+ * @type {Ellipsoid}
100
111
  */
101
- GeographicTilingScheme.prototype.rectangleToNativeRectangle = function (
102
- rectangle,
103
- result
104
- ) {
105
- //>>includeStart('debug', pragmas.debug);
106
- Check.Check.defined("rectangle", rectangle);
107
- //>>includeEnd('debug');
108
-
109
- const west = Math$1.CesiumMath.toDegrees(rectangle.west);
110
- const south = Math$1.CesiumMath.toDegrees(rectangle.south);
111
- const east = Math$1.CesiumMath.toDegrees(rectangle.east);
112
- const north = Math$1.CesiumMath.toDegrees(rectangle.north);
113
-
114
- if (!defaultValue.defined(result)) {
115
- return new Matrix2.Rectangle(west, south, east, north);
112
+ ellipsoid: {
113
+ get: function() {
114
+ return this._ellipsoid;
116
115
  }
117
-
118
- result.west = west;
119
- result.south = south;
120
- result.east = east;
121
- result.north = north;
122
- return result;
123
- };
124
-
125
- /**
126
- * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
127
- * of the tiling scheme.
128
- *
129
- * @param {number} x The integer x coordinate of the tile.
130
- * @param {number} y The integer y coordinate of the tile.
131
- * @param {number} level The tile level-of-detail. Zero is the least detailed.
132
- * @param {object} [result] The instance to which to copy the result, or undefined if a new instance
133
- * should be created.
134
- * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
135
- * if 'result' is undefined.
136
- */
137
- GeographicTilingScheme.prototype.tileXYToNativeRectangle = function (
138
- x,
139
- y,
140
- level,
141
- result
142
- ) {
143
- const rectangleRadians = this.tileXYToRectangle(x, y, level, result);
144
- rectangleRadians.west = Math$1.CesiumMath.toDegrees(rectangleRadians.west);
145
- rectangleRadians.south = Math$1.CesiumMath.toDegrees(rectangleRadians.south);
146
- rectangleRadians.east = Math$1.CesiumMath.toDegrees(rectangleRadians.east);
147
- rectangleRadians.north = Math$1.CesiumMath.toDegrees(rectangleRadians.north);
148
- return rectangleRadians;
149
- };
150
-
116
+ },
151
117
  /**
152
- * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
153
- *
154
- * @param {number} x The integer x coordinate of the tile.
155
- * @param {number} y The integer y coordinate of the tile.
156
- * @param {number} level The tile level-of-detail. Zero is the least detailed.
157
- * @param {object} [result] The instance to which to copy the result, or undefined if a new instance
158
- * should be created.
159
- * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
160
- * if 'result' is undefined.
118
+ * Gets the rectangle, in radians, covered by this tiling scheme.
119
+ * @memberof GeographicTilingScheme.prototype
120
+ * @type {Rectangle}
161
121
  */
162
- GeographicTilingScheme.prototype.tileXYToRectangle = function (
163
- x,
164
- y,
165
- level,
166
- result
167
- ) {
168
- const rectangle = this._rectangle;
169
-
170
- const xTiles = this.getNumberOfXTilesAtLevel(level);
171
- const yTiles = this.getNumberOfYTilesAtLevel(level);
172
-
173
- const xTileWidth = rectangle.width / xTiles;
174
- const west = x * xTileWidth + rectangle.west;
175
- const east = (x + 1) * xTileWidth + rectangle.west;
176
-
177
- const yTileHeight = rectangle.height / yTiles;
178
- const north = rectangle.north - y * yTileHeight;
179
- const south = rectangle.north - (y + 1) * yTileHeight;
180
-
181
- if (!defaultValue.defined(result)) {
182
- result = new Matrix2.Rectangle(west, south, east, north);
122
+ rectangle: {
123
+ get: function() {
124
+ return this._rectangle;
183
125
  }
184
-
185
- result.west = west;
186
- result.south = south;
187
- result.east = east;
188
- result.north = north;
189
- return result;
190
- };
191
-
126
+ },
192
127
  /**
193
- * Calculates the tile x, y coordinates of the tile containing
194
- * a given cartographic position.
195
- *
196
- * @param {Cartographic} position The position.
197
- * @param {number} level The tile level-of-detail. Zero is the least detailed.
198
- * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance
199
- * should be created.
200
- * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates
201
- * if 'result' is undefined.
128
+ * Gets the map projection used by this tiling scheme.
129
+ * @memberof GeographicTilingScheme.prototype
130
+ * @type {MapProjection}
202
131
  */
203
- GeographicTilingScheme.prototype.positionToTileXY = function (
204
- position,
205
- level,
206
- result
207
- ) {
208
- const rectangle = this._rectangle;
209
- if (!Matrix2.Rectangle.contains(rectangle, position)) {
210
- // outside the bounds of the tiling scheme
211
- return undefined;
132
+ projection: {
133
+ get: function() {
134
+ return this._projection;
212
135
  }
213
-
214
- const xTiles = this.getNumberOfXTilesAtLevel(level);
215
- const yTiles = this.getNumberOfYTilesAtLevel(level);
216
-
217
- const xTileWidth = rectangle.width / xTiles;
218
- const yTileHeight = rectangle.height / yTiles;
219
-
220
- let longitude = position.longitude;
221
- if (rectangle.east < rectangle.west) {
222
- longitude += Math$1.CesiumMath.TWO_PI;
223
- }
224
-
225
- let xTileCoordinate = ((longitude - rectangle.west) / xTileWidth) | 0;
226
- if (xTileCoordinate >= xTiles) {
227
- xTileCoordinate = xTiles - 1;
228
- }
229
-
230
- let yTileCoordinate =
231
- ((rectangle.north - position.latitude) / yTileHeight) | 0;
232
- if (yTileCoordinate >= yTiles) {
233
- yTileCoordinate = yTiles - 1;
234
- }
235
-
236
- if (!defaultValue.defined(result)) {
237
- return new Matrix2.Cartesian2(xTileCoordinate, yTileCoordinate);
238
- }
239
-
240
- result.x = xTileCoordinate;
241
- result.y = yTileCoordinate;
242
- return result;
243
- };
244
-
245
- const scratchDiagonalCartesianNE = new Matrix3.Cartesian3();
246
- const scratchDiagonalCartesianSW = new Matrix3.Cartesian3();
247
- const scratchDiagonalCartographic = new Matrix3.Cartographic();
248
- const scratchCenterCartesian = new Matrix3.Cartesian3();
249
- const scratchSurfaceCartesian = new Matrix3.Cartesian3();
250
-
251
- const scratchBoundingSphere = new Transforms.BoundingSphere();
252
- const tilingScheme = new GeographicTilingScheme();
253
- const scratchCorners = [
254
- new Matrix3.Cartographic(),
255
- new Matrix3.Cartographic(),
256
- new Matrix3.Cartographic(),
257
- new Matrix3.Cartographic(),
258
- ];
259
- const scratchTileXY = new Matrix2.Cartesian2();
260
-
261
- /**
262
- * A collection of functions for approximating terrain height
263
- * @private
264
- */
265
- const ApproximateTerrainHeights = {};
266
-
267
- /**
268
- * Initializes the minimum and maximum terrain heights
269
- * @return {Promise<void>}
270
- */
271
- ApproximateTerrainHeights.initialize = function () {
272
- let initPromise = ApproximateTerrainHeights._initPromise;
273
- if (defaultValue.defined(initPromise)) {
274
- return initPromise;
275
- }
276
- initPromise = Transforms.Resource.fetchJson(
277
- Transforms.buildModuleUrl("Assets/approximateTerrainHeights.json")
278
- ).then(function (json) {
279
- ApproximateTerrainHeights._terrainHeights = json;
280
- });
281
- ApproximateTerrainHeights._initPromise = initPromise;
282
-
136
+ }
137
+ });
138
+ GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function(level) {
139
+ return this._numberOfLevelZeroTilesX << level;
140
+ };
141
+ GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function(level) {
142
+ return this._numberOfLevelZeroTilesY << level;
143
+ };
144
+ GeographicTilingScheme.prototype.rectangleToNativeRectangle = function(rectangle, result) {
145
+ Check_default.defined("rectangle", rectangle);
146
+ const west = Math_default.toDegrees(rectangle.west);
147
+ const south = Math_default.toDegrees(rectangle.south);
148
+ const east = Math_default.toDegrees(rectangle.east);
149
+ const north = Math_default.toDegrees(rectangle.north);
150
+ if (!defined_default(result)) {
151
+ return new Rectangle_default(west, south, east, north);
152
+ }
153
+ result.west = west;
154
+ result.south = south;
155
+ result.east = east;
156
+ result.north = north;
157
+ return result;
158
+ };
159
+ GeographicTilingScheme.prototype.tileXYToNativeRectangle = function(x, y, level, result) {
160
+ const rectangleRadians = this.tileXYToRectangle(x, y, level, result);
161
+ rectangleRadians.west = Math_default.toDegrees(rectangleRadians.west);
162
+ rectangleRadians.south = Math_default.toDegrees(rectangleRadians.south);
163
+ rectangleRadians.east = Math_default.toDegrees(rectangleRadians.east);
164
+ rectangleRadians.north = Math_default.toDegrees(rectangleRadians.north);
165
+ return rectangleRadians;
166
+ };
167
+ GeographicTilingScheme.prototype.tileXYToRectangle = function(x, y, level, result) {
168
+ const rectangle = this._rectangle;
169
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
170
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
171
+ const xTileWidth = rectangle.width / xTiles;
172
+ const west = x * xTileWidth + rectangle.west;
173
+ const east = (x + 1) * xTileWidth + rectangle.west;
174
+ const yTileHeight = rectangle.height / yTiles;
175
+ const north = rectangle.north - y * yTileHeight;
176
+ const south = rectangle.north - (y + 1) * yTileHeight;
177
+ if (!defined_default(result)) {
178
+ result = new Rectangle_default(west, south, east, north);
179
+ }
180
+ result.west = west;
181
+ result.south = south;
182
+ result.east = east;
183
+ result.north = north;
184
+ return result;
185
+ };
186
+ GeographicTilingScheme.prototype.positionToTileXY = function(position, level, result) {
187
+ const rectangle = this._rectangle;
188
+ if (!Rectangle_default.contains(rectangle, position)) {
189
+ return void 0;
190
+ }
191
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
192
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
193
+ const xTileWidth = rectangle.width / xTiles;
194
+ const yTileHeight = rectangle.height / yTiles;
195
+ let longitude = position.longitude;
196
+ if (rectangle.east < rectangle.west) {
197
+ longitude += Math_default.TWO_PI;
198
+ }
199
+ let xTileCoordinate = (longitude - rectangle.west) / xTileWidth | 0;
200
+ if (xTileCoordinate >= xTiles) {
201
+ xTileCoordinate = xTiles - 1;
202
+ }
203
+ let yTileCoordinate = (rectangle.north - position.latitude) / yTileHeight | 0;
204
+ if (yTileCoordinate >= yTiles) {
205
+ yTileCoordinate = yTiles - 1;
206
+ }
207
+ if (!defined_default(result)) {
208
+ return new Cartesian2_default(xTileCoordinate, yTileCoordinate);
209
+ }
210
+ result.x = xTileCoordinate;
211
+ result.y = yTileCoordinate;
212
+ return result;
213
+ };
214
+ var GeographicTilingScheme_default = GeographicTilingScheme;
215
+
216
+ // packages/engine/Source/Core/ApproximateTerrainHeights.js
217
+ var scratchDiagonalCartesianNE = new Cartesian3_default();
218
+ var scratchDiagonalCartesianSW = new Cartesian3_default();
219
+ var scratchDiagonalCartographic = new Cartographic_default();
220
+ var scratchCenterCartesian = new Cartesian3_default();
221
+ var scratchSurfaceCartesian = new Cartesian3_default();
222
+ var scratchBoundingSphere = new BoundingSphere_default();
223
+ var tilingScheme = new GeographicTilingScheme_default();
224
+ var scratchCorners = [
225
+ new Cartographic_default(),
226
+ new Cartographic_default(),
227
+ new Cartographic_default(),
228
+ new Cartographic_default()
229
+ ];
230
+ var scratchTileXY = new Cartesian2_default();
231
+ var ApproximateTerrainHeights = {};
232
+ ApproximateTerrainHeights.initialize = function() {
233
+ let initPromise = ApproximateTerrainHeights._initPromise;
234
+ if (defined_default(initPromise)) {
283
235
  return initPromise;
284
- };
285
-
286
- /**
287
- * Computes the minimum and maximum terrain heights for a given rectangle
288
- * @param {Rectangle} rectangle The bounding rectangle
289
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
290
- * @return {{minimumTerrainHeight: number, maximumTerrainHeight: number}}
291
- */
292
- ApproximateTerrainHeights.getMinimumMaximumHeights = function (
293
- rectangle,
294
- ellipsoid
295
- ) {
296
- //>>includeStart('debug', pragmas.debug);
297
- Check.Check.defined("rectangle", rectangle);
298
- if (!defaultValue.defined(ApproximateTerrainHeights._terrainHeights)) {
299
- throw new Check.DeveloperError(
300
- "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
301
- );
302
- }
303
- //>>includeEnd('debug');
304
- ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
305
-
306
- const xyLevel = getTileXYLevel(rectangle);
307
-
308
- // Get the terrain min/max for that tile
309
- let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
310
- let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
311
- if (defaultValue.defined(xyLevel)) {
312
- const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
313
- const heights = ApproximateTerrainHeights._terrainHeights[key];
314
- if (defaultValue.defined(heights)) {
315
- minTerrainHeight = heights[0];
316
- maxTerrainHeight = heights[1];
317
- }
318
-
319
- // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface
320
- ellipsoid.cartographicToCartesian(
321
- Matrix2.Rectangle.northeast(rectangle, scratchDiagonalCartographic),
322
- scratchDiagonalCartesianNE
323
- );
324
- ellipsoid.cartographicToCartesian(
325
- Matrix2.Rectangle.southwest(rectangle, scratchDiagonalCartographic),
326
- scratchDiagonalCartesianSW
327
- );
328
-
329
- Matrix3.Cartesian3.midpoint(
330
- scratchDiagonalCartesianSW,
331
- scratchDiagonalCartesianNE,
332
- scratchCenterCartesian
333
- );
334
- const surfacePosition = ellipsoid.scaleToGeodeticSurface(
335
- scratchCenterCartesian,
336
- scratchSurfaceCartesian
337
- );
338
- if (defaultValue.defined(surfacePosition)) {
339
- const distance = Matrix3.Cartesian3.distance(
340
- scratchCenterCartesian,
341
- surfacePosition
342
- );
343
- minTerrainHeight = Math.min(minTerrainHeight, -distance);
344
- } else {
345
- minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
346
- }
347
- }
348
-
349
- minTerrainHeight = Math.max(
350
- ApproximateTerrainHeights._defaultMinTerrainHeight,
351
- minTerrainHeight
236
+ }
237
+ initPromise = Resource_default.fetchJson(
238
+ buildModuleUrl_default("Assets/approximateTerrainHeights.json")
239
+ ).then(function(json) {
240
+ ApproximateTerrainHeights._terrainHeights = json;
241
+ });
242
+ ApproximateTerrainHeights._initPromise = initPromise;
243
+ return initPromise;
244
+ };
245
+ ApproximateTerrainHeights.getMinimumMaximumHeights = function(rectangle, ellipsoid) {
246
+ Check_default.defined("rectangle", rectangle);
247
+ if (!defined_default(ApproximateTerrainHeights._terrainHeights)) {
248
+ throw new DeveloperError_default(
249
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
352
250
  );
353
-
354
- return {
355
- minimumTerrainHeight: minTerrainHeight,
356
- maximumTerrainHeight: maxTerrainHeight,
357
- };
358
- };
359
-
360
- /**
361
- * Computes the bounding sphere based on the tile heights in the rectangle
362
- * @param {Rectangle} rectangle The bounding rectangle
363
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
364
- * @return {BoundingSphere} The result bounding sphere
365
- */
366
- ApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {
367
- //>>includeStart('debug', pragmas.debug);
368
- Check.Check.defined("rectangle", rectangle);
369
- if (!defaultValue.defined(ApproximateTerrainHeights._terrainHeights)) {
370
- throw new Check.DeveloperError(
371
- "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
372
- );
373
- }
374
- //>>includeEnd('debug');
375
- ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
376
-
377
- const xyLevel = getTileXYLevel(rectangle);
378
-
379
- // Get the terrain max for that tile
380
- let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
381
- if (defaultValue.defined(xyLevel)) {
382
- const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
383
- const heights = ApproximateTerrainHeights._terrainHeights[key];
384
- if (defaultValue.defined(heights)) {
385
- maxTerrainHeight = heights[1];
386
- }
251
+ }
252
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
253
+ const xyLevel = getTileXYLevel(rectangle);
254
+ let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
255
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
256
+ if (defined_default(xyLevel)) {
257
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
258
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
259
+ if (defined_default(heights)) {
260
+ minTerrainHeight = heights[0];
261
+ maxTerrainHeight = heights[1];
387
262
  }
388
-
389
- const result = Transforms.BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);
390
- Transforms.BoundingSphere.fromRectangle3D(
391
- rectangle,
392
- ellipsoid,
393
- maxTerrainHeight,
394
- scratchBoundingSphere
263
+ ellipsoid.cartographicToCartesian(
264
+ Rectangle_default.northeast(rectangle, scratchDiagonalCartographic),
265
+ scratchDiagonalCartesianNE
395
266
  );
396
-
397
- return Transforms.BoundingSphere.union(result, scratchBoundingSphere, result);
398
- };
399
-
400
- function getTileXYLevel(rectangle) {
401
- Matrix3.Cartographic.fromRadians(
402
- rectangle.east,
403
- rectangle.north,
404
- 0.0,
405
- scratchCorners[0]
267
+ ellipsoid.cartographicToCartesian(
268
+ Rectangle_default.southwest(rectangle, scratchDiagonalCartographic),
269
+ scratchDiagonalCartesianSW
406
270
  );
407
- Matrix3.Cartographic.fromRadians(
408
- rectangle.west,
409
- rectangle.north,
410
- 0.0,
411
- scratchCorners[1]
271
+ Cartesian3_default.midpoint(
272
+ scratchDiagonalCartesianSW,
273
+ scratchDiagonalCartesianNE,
274
+ scratchCenterCartesian
412
275
  );
413
- Matrix3.Cartographic.fromRadians(
414
- rectangle.east,
415
- rectangle.south,
416
- 0.0,
417
- scratchCorners[2]
276
+ const surfacePosition = ellipsoid.scaleToGeodeticSurface(
277
+ scratchCenterCartesian,
278
+ scratchSurfaceCartesian
418
279
  );
419
- Matrix3.Cartographic.fromRadians(
420
- rectangle.west,
421
- rectangle.south,
422
- 0.0,
423
- scratchCorners[3]
280
+ if (defined_default(surfacePosition)) {
281
+ const distance = Cartesian3_default.distance(
282
+ scratchCenterCartesian,
283
+ surfacePosition
284
+ );
285
+ minTerrainHeight = Math.min(minTerrainHeight, -distance);
286
+ } else {
287
+ minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
288
+ }
289
+ }
290
+ minTerrainHeight = Math.max(
291
+ ApproximateTerrainHeights._defaultMinTerrainHeight,
292
+ minTerrainHeight
293
+ );
294
+ return {
295
+ minimumTerrainHeight: minTerrainHeight,
296
+ maximumTerrainHeight: maxTerrainHeight
297
+ };
298
+ };
299
+ ApproximateTerrainHeights.getBoundingSphere = function(rectangle, ellipsoid) {
300
+ Check_default.defined("rectangle", rectangle);
301
+ if (!defined_default(ApproximateTerrainHeights._terrainHeights)) {
302
+ throw new DeveloperError_default(
303
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
424
304
  );
425
-
426
- // Determine which tile the bounding rectangle is in
427
- let lastLevelX = 0,
428
- lastLevelY = 0;
429
- let currentX = 0,
430
- currentY = 0;
431
- const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;
432
- let i;
433
- for (i = 0; i <= maxLevel; ++i) {
434
- let failed = false;
435
- for (let j = 0; j < 4; ++j) {
436
- const corner = scratchCorners[j];
437
- tilingScheme.positionToTileXY(corner, i, scratchTileXY);
438
- if (j === 0) {
439
- currentX = scratchTileXY.x;
440
- currentY = scratchTileXY.y;
441
- } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {
442
- failed = true;
443
- break;
444
- }
445
- }
446
-
447
- if (failed) {
305
+ }
306
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
307
+ const xyLevel = getTileXYLevel(rectangle);
308
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
309
+ if (defined_default(xyLevel)) {
310
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
311
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
312
+ if (defined_default(heights)) {
313
+ maxTerrainHeight = heights[1];
314
+ }
315
+ }
316
+ const result = BoundingSphere_default.fromRectangle3D(rectangle, ellipsoid, 0);
317
+ BoundingSphere_default.fromRectangle3D(
318
+ rectangle,
319
+ ellipsoid,
320
+ maxTerrainHeight,
321
+ scratchBoundingSphere
322
+ );
323
+ return BoundingSphere_default.union(result, scratchBoundingSphere, result);
324
+ };
325
+ function getTileXYLevel(rectangle) {
326
+ Cartographic_default.fromRadians(
327
+ rectangle.east,
328
+ rectangle.north,
329
+ 0,
330
+ scratchCorners[0]
331
+ );
332
+ Cartographic_default.fromRadians(
333
+ rectangle.west,
334
+ rectangle.north,
335
+ 0,
336
+ scratchCorners[1]
337
+ );
338
+ Cartographic_default.fromRadians(
339
+ rectangle.east,
340
+ rectangle.south,
341
+ 0,
342
+ scratchCorners[2]
343
+ );
344
+ Cartographic_default.fromRadians(
345
+ rectangle.west,
346
+ rectangle.south,
347
+ 0,
348
+ scratchCorners[3]
349
+ );
350
+ let lastLevelX = 0, lastLevelY = 0;
351
+ let currentX = 0, currentY = 0;
352
+ const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;
353
+ let i;
354
+ for (i = 0; i <= maxLevel; ++i) {
355
+ let failed = false;
356
+ for (let j = 0; j < 4; ++j) {
357
+ const corner = scratchCorners[j];
358
+ tilingScheme.positionToTileXY(corner, i, scratchTileXY);
359
+ if (j === 0) {
360
+ currentX = scratchTileXY.x;
361
+ currentY = scratchTileXY.y;
362
+ } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {
363
+ failed = true;
448
364
  break;
449
365
  }
450
-
451
- lastLevelX = currentX;
452
- lastLevelY = currentY;
453
366
  }
454
-
455
- if (i === 0) {
456
- return undefined;
367
+ if (failed) {
368
+ break;
457
369
  }
458
-
459
- return {
460
- x: lastLevelX,
461
- y: lastLevelY,
462
- level: i > maxLevel ? maxLevel : i - 1,
463
- };
370
+ lastLevelX = currentX;
371
+ lastLevelY = currentY;
464
372
  }
465
-
466
- ApproximateTerrainHeights._terrainHeightsMaxLevel = 6;
467
- ApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;
468
- ApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;
469
- ApproximateTerrainHeights._terrainHeights = undefined;
470
- ApproximateTerrainHeights._initPromise = undefined;
471
-
472
- Object.defineProperties(ApproximateTerrainHeights, {
473
- /**
474
- * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,
475
- * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.
476
- * @type {boolean}
477
- * @readonly
478
- * @memberof ApproximateTerrainHeights
479
- */
480
- initialized: {
481
- get: function () {
482
- return defaultValue.defined(ApproximateTerrainHeights._terrainHeights);
483
- },
484
- },
485
- });
486
- var ApproximateTerrainHeights$1 = ApproximateTerrainHeights;
487
-
488
- const PROJECTIONS = [Transforms.GeographicProjection, WebMercatorProjection.WebMercatorProjection];
489
- const PROJECTION_COUNT = PROJECTIONS.length;
490
-
491
- const MITER_BREAK_SMALL = Math.cos(Math$1.CesiumMath.toRadians(30.0));
492
- const MITER_BREAK_LARGE = Math.cos(Math$1.CesiumMath.toRadians(150.0));
493
-
494
- // Initial heights for constructing the wall.
495
- // Keeping WALL_INITIAL_MIN_HEIGHT near the ellipsoid surface helps
496
- // prevent precision problems with planes in the shader.
497
- // Putting the start point of a plane at ApproximateTerrainHeights._defaultMinTerrainHeight,
498
- // which is a highly conservative bound, usually puts the plane origin several thousands
499
- // of meters away from the actual terrain, causing floating point problems when checking
500
- // fragments on terrain against the plane.
501
- // Ellipsoid height is generally much closer.
502
- // The initial max height is arbitrary.
503
- // Both heights are corrected using ApproximateTerrainHeights for computing the actual volume geometry.
504
- const WALL_INITIAL_MIN_HEIGHT = 0.0;
505
- const WALL_INITIAL_MAX_HEIGHT = 1000.0;
506
-
373
+ if (i === 0) {
374
+ return void 0;
375
+ }
376
+ return {
377
+ x: lastLevelX,
378
+ y: lastLevelY,
379
+ level: i > maxLevel ? maxLevel : i - 1
380
+ };
381
+ }
382
+ ApproximateTerrainHeights._terrainHeightsMaxLevel = 6;
383
+ ApproximateTerrainHeights._defaultMaxTerrainHeight = 9e3;
384
+ ApproximateTerrainHeights._defaultMinTerrainHeight = -1e5;
385
+ ApproximateTerrainHeights._terrainHeights = void 0;
386
+ ApproximateTerrainHeights._initPromise = void 0;
387
+ Object.defineProperties(ApproximateTerrainHeights, {
507
388
  /**
508
- * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
509
- *
510
- * @alias GroundPolylineGeometry
511
- * @constructor
512
- *
513
- * @param {object} options Options with the following properties:
514
- * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
515
- * @param {number} [options.width=1.0] The screen space width in pixels.
516
- * @param {number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
517
- * @param {boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
518
- * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
519
- *
520
- * @exception {DeveloperError} At least two positions are required.
521
- *
522
- * @see GroundPolylinePrimitive
523
- *
524
- * @example
525
- * const positions = Cesium.Cartesian3.fromDegreesArray([
526
- * -112.1340164450331, 36.05494287836128,
527
- * -112.08821010582645, 36.097804071380715,
528
- * -112.13296079730024, 36.168769146801104
529
- * ]);
530
- *
531
- * const geometry = new Cesium.GroundPolylineGeometry({
532
- * positions : positions
533
- * });
389
+ * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,
390
+ * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.
391
+ * @type {boolean}
392
+ * @readonly
393
+ * @memberof ApproximateTerrainHeights
534
394
  */
535
- function GroundPolylineGeometry(options) {
536
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
537
- const positions = options.positions;
538
-
539
- //>>includeStart('debug', pragmas.debug);
540
- if (!defaultValue.defined(positions) || positions.length < 2) {
541
- throw new Check.DeveloperError("At least two positions are required.");
395
+ initialized: {
396
+ get: function() {
397
+ return defined_default(ApproximateTerrainHeights._terrainHeights);
542
398
  }
543
- if (
544
- defaultValue.defined(options.arcType) &&
545
- options.arcType !== ArcType.ArcType.GEODESIC &&
546
- options.arcType !== ArcType.ArcType.RHUMB
547
- ) {
548
- throw new Check.DeveloperError(
549
- "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB."
550
- );
551
- }
552
- //>>includeEnd('debug');
553
-
554
- /**
555
- * The screen space width in pixels.
556
- * @type {number}
557
- */
558
- this.width = defaultValue.defaultValue(options.width, 1.0); // Doesn't get packed, not necessary for computing geometry.
559
-
560
- this._positions = positions;
561
-
562
- /**
563
- * The distance interval used for interpolating options.points. Zero indicates no interpolation.
564
- * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
565
- * @type {boolean}
566
- * @default 9999.0
567
- */
568
- this.granularity = defaultValue.defaultValue(options.granularity, 9999.0);
569
-
570
- /**
571
- * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
572
- * If the geometry has two positions this parameter will be ignored.
573
- * @type {boolean}
574
- * @default false
575
- */
576
- this.loop = defaultValue.defaultValue(options.loop, false);
577
-
578
- /**
579
- * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
580
- * @type {ArcType}
581
- * @default ArcType.GEODESIC
582
- */
583
- this.arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
584
-
585
- this._ellipsoid = Matrix3.Ellipsoid.WGS84;
586
-
587
- // MapProjections can't be packed, so store the index to a known MapProjection.
588
- this._projectionIndex = 0;
589
- this._workerName = "createGroundPolylineGeometry";
590
-
591
- // Used by GroundPolylinePrimitive to signal worker that scenemode is 3D only.
592
- this._scene3DOnly = false;
593
399
  }
594
-
595
- Object.defineProperties(GroundPolylineGeometry.prototype, {
596
- /**
597
- * The number of elements used to pack the object into an array.
598
- * @memberof GroundPolylineGeometry.prototype
599
- * @type {number}
600
- * @readonly
601
- * @private
602
- */
603
- packedLength: {
604
- get: function () {
605
- return (
606
- 1.0 +
607
- this._positions.length * 3 +
608
- 1.0 +
609
- 1.0 +
610
- 1.0 +
611
- Matrix3.Ellipsoid.packedLength +
612
- 1.0 +
613
- 1.0
614
- );
615
- },
616
- },
617
- });
618
-
400
+ });
401
+ var ApproximateTerrainHeights_default = ApproximateTerrainHeights;
402
+
403
+ // packages/engine/Source/Core/GroundPolylineGeometry.js
404
+ var PROJECTIONS = [GeographicProjection_default, WebMercatorProjection_default];
405
+ var PROJECTION_COUNT = PROJECTIONS.length;
406
+ var MITER_BREAK_SMALL = Math.cos(Math_default.toRadians(30));
407
+ var MITER_BREAK_LARGE = Math.cos(Math_default.toRadians(150));
408
+ var WALL_INITIAL_MIN_HEIGHT = 0;
409
+ var WALL_INITIAL_MAX_HEIGHT = 1e3;
410
+ function GroundPolylineGeometry(options) {
411
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
412
+ const positions = options.positions;
413
+ if (!defined_default(positions) || positions.length < 2) {
414
+ throw new DeveloperError_default("At least two positions are required.");
415
+ }
416
+ if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
417
+ throw new DeveloperError_default(
418
+ "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB."
419
+ );
420
+ }
421
+ this.width = defaultValue_default(options.width, 1);
422
+ this._positions = positions;
423
+ this.granularity = defaultValue_default(options.granularity, 9999);
424
+ this.loop = defaultValue_default(options.loop, false);
425
+ this.arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
426
+ this._ellipsoid = Ellipsoid_default.WGS84;
427
+ this._projectionIndex = 0;
428
+ this._workerName = "createGroundPolylineGeometry";
429
+ this._scene3DOnly = false;
430
+ }
431
+ Object.defineProperties(GroundPolylineGeometry.prototype, {
619
432
  /**
620
- * Set the GroundPolylineGeometry's projection and ellipsoid.
621
- * Used by GroundPolylinePrimitive to signal scene information to the geometry for generating 2D attributes.
622
- *
623
- * @param {GroundPolylineGeometry} groundPolylineGeometry GroundPolylinGeometry describing a polyline on terrain or 3D Tiles.
624
- * @param {Projection} mapProjection A MapProjection used for projecting cartographic coordinates to 2D.
433
+ * The number of elements used to pack the object into an array.
434
+ * @memberof GroundPolylineGeometry.prototype
435
+ * @type {number}
436
+ * @readonly
625
437
  * @private
626
438
  */
627
- GroundPolylineGeometry.setProjectionAndEllipsoid = function (
628
- groundPolylineGeometry,
629
- mapProjection
630
- ) {
631
- let projectionIndex = 0;
632
- for (let i = 0; i < PROJECTION_COUNT; i++) {
633
- if (mapProjection instanceof PROJECTIONS[i]) {
634
- projectionIndex = i;
635
- break;
636
- }
439
+ packedLength: {
440
+ get: function() {
441
+ return 1 + this._positions.length * 3 + 1 + 1 + 1 + Ellipsoid_default.packedLength + 1 + 1;
637
442
  }
638
-
639
- groundPolylineGeometry._projectionIndex = projectionIndex;
640
- groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;
641
- };
642
-
643
- const cart3Scratch1 = new Matrix3.Cartesian3();
644
- const cart3Scratch2 = new Matrix3.Cartesian3();
645
- const cart3Scratch3 = new Matrix3.Cartesian3();
646
- function computeRightNormal(start, end, maxHeight, ellipsoid, result) {
647
- const startBottom = getPosition(ellipsoid, start, 0.0, cart3Scratch1);
648
- const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);
649
- const endBottom = getPosition(ellipsoid, end, 0.0, cart3Scratch3);
650
-
651
- const up = direction(startTop, startBottom, cart3Scratch2);
652
- const forward = direction(endBottom, startBottom, cart3Scratch3);
653
-
654
- Matrix3.Cartesian3.cross(forward, up, result);
655
- return Matrix3.Cartesian3.normalize(result, result);
656
443
  }
657
-
658
- const interpolatedCartographicScratch = new Matrix3.Cartographic();
659
- const interpolatedBottomScratch = new Matrix3.Cartesian3();
660
- const interpolatedTopScratch = new Matrix3.Cartesian3();
661
- const interpolatedNormalScratch = new Matrix3.Cartesian3();
662
- function interpolateSegment(
444
+ });
445
+ GroundPolylineGeometry.setProjectionAndEllipsoid = function(groundPolylineGeometry, mapProjection) {
446
+ let projectionIndex = 0;
447
+ for (let i = 0; i < PROJECTION_COUNT; i++) {
448
+ if (mapProjection instanceof PROJECTIONS[i]) {
449
+ projectionIndex = i;
450
+ break;
451
+ }
452
+ }
453
+ groundPolylineGeometry._projectionIndex = projectionIndex;
454
+ groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;
455
+ };
456
+ var cart3Scratch1 = new Cartesian3_default();
457
+ var cart3Scratch2 = new Cartesian3_default();
458
+ var cart3Scratch3 = new Cartesian3_default();
459
+ function computeRightNormal(start, end, maxHeight, ellipsoid, result) {
460
+ const startBottom = getPosition(ellipsoid, start, 0, cart3Scratch1);
461
+ const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);
462
+ const endBottom = getPosition(ellipsoid, end, 0, cart3Scratch3);
463
+ const up = direction(startTop, startBottom, cart3Scratch2);
464
+ const forward = direction(endBottom, startBottom, cart3Scratch3);
465
+ Cartesian3_default.cross(forward, up, result);
466
+ return Cartesian3_default.normalize(result, result);
467
+ }
468
+ var interpolatedCartographicScratch = new Cartographic_default();
469
+ var interpolatedBottomScratch = new Cartesian3_default();
470
+ var interpolatedTopScratch = new Cartesian3_default();
471
+ var interpolatedNormalScratch = new Cartesian3_default();
472
+ function interpolateSegment(start, end, minHeight, maxHeight, granularity, arcType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray) {
473
+ if (granularity === 0) {
474
+ return;
475
+ }
476
+ let ellipsoidLine;
477
+ if (arcType === ArcType_default.GEODESIC) {
478
+ ellipsoidLine = new EllipsoidGeodesic_default(start, end, ellipsoid);
479
+ } else if (arcType === ArcType_default.RHUMB) {
480
+ ellipsoidLine = new EllipsoidRhumbLine_default(start, end, ellipsoid);
481
+ }
482
+ const surfaceDistance = ellipsoidLine.surfaceDistance;
483
+ if (surfaceDistance < granularity) {
484
+ return;
485
+ }
486
+ const interpolatedNormal = computeRightNormal(
663
487
  start,
664
488
  end,
665
- minHeight,
666
489
  maxHeight,
667
- granularity,
668
- arcType,
669
490
  ellipsoid,
670
- normalsArray,
671
- bottomPositionsArray,
672
- topPositionsArray,
673
- cartographicsArray
674
- ) {
675
- if (granularity === 0.0) {
676
- return;
677
- }
678
-
679
- let ellipsoidLine;
680
- if (arcType === ArcType.ArcType.GEODESIC) {
681
- ellipsoidLine = new EllipsoidGeodesic.EllipsoidGeodesic(start, end, ellipsoid);
682
- } else if (arcType === ArcType.ArcType.RHUMB) {
683
- ellipsoidLine = new EllipsoidRhumbLine.EllipsoidRhumbLine(start, end, ellipsoid);
684
- }
685
-
686
- const surfaceDistance = ellipsoidLine.surfaceDistance;
687
- if (surfaceDistance < granularity) {
688
- return;
689
- }
690
-
691
- // Compute rightwards normal applicable at all interpolated points
692
- const interpolatedNormal = computeRightNormal(
693
- start,
694
- end,
695
- maxHeight,
491
+ interpolatedNormalScratch
492
+ );
493
+ const segments = Math.ceil(surfaceDistance / granularity);
494
+ const interpointDistance = surfaceDistance / segments;
495
+ let distanceFromStart = interpointDistance;
496
+ const pointsToAdd = segments - 1;
497
+ let packIndex = normalsArray.length;
498
+ for (let i = 0; i < pointsToAdd; i++) {
499
+ const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(
500
+ distanceFromStart,
501
+ interpolatedCartographicScratch
502
+ );
503
+ const interpolatedBottom = getPosition(
696
504
  ellipsoid,
697
- interpolatedNormalScratch
505
+ interpolatedCartographic,
506
+ minHeight,
507
+ interpolatedBottomScratch
698
508
  );
699
-
700
- const segments = Math.ceil(surfaceDistance / granularity);
701
- const interpointDistance = surfaceDistance / segments;
702
- let distanceFromStart = interpointDistance;
703
- const pointsToAdd = segments - 1;
704
- let packIndex = normalsArray.length;
705
- for (let i = 0; i < pointsToAdd; i++) {
706
- const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(
707
- distanceFromStart,
708
- interpolatedCartographicScratch
709
- );
710
- const interpolatedBottom = getPosition(
711
- ellipsoid,
712
- interpolatedCartographic,
713
- minHeight,
714
- interpolatedBottomScratch
715
- );
716
- const interpolatedTop = getPosition(
717
- ellipsoid,
718
- interpolatedCartographic,
719
- maxHeight,
720
- interpolatedTopScratch
721
- );
722
-
723
- Matrix3.Cartesian3.pack(interpolatedNormal, normalsArray, packIndex);
724
- Matrix3.Cartesian3.pack(interpolatedBottom, bottomPositionsArray, packIndex);
725
- Matrix3.Cartesian3.pack(interpolatedTop, topPositionsArray, packIndex);
726
- cartographicsArray.push(interpolatedCartographic.latitude);
727
- cartographicsArray.push(interpolatedCartographic.longitude);
728
-
729
- packIndex += 3;
730
- distanceFromStart += interpointDistance;
731
- }
732
- }
733
-
734
- const heightlessCartographicScratch = new Matrix3.Cartographic();
735
- function getPosition(ellipsoid, cartographic, height, result) {
736
- Matrix3.Cartographic.clone(cartographic, heightlessCartographicScratch);
737
- heightlessCartographicScratch.height = height;
738
- return Matrix3.Cartographic.toCartesian(
739
- heightlessCartographicScratch,
509
+ const interpolatedTop = getPosition(
740
510
  ellipsoid,
741
- result
511
+ interpolatedCartographic,
512
+ maxHeight,
513
+ interpolatedTopScratch
742
514
  );
515
+ Cartesian3_default.pack(interpolatedNormal, normalsArray, packIndex);
516
+ Cartesian3_default.pack(interpolatedBottom, bottomPositionsArray, packIndex);
517
+ Cartesian3_default.pack(interpolatedTop, topPositionsArray, packIndex);
518
+ cartographicsArray.push(interpolatedCartographic.latitude);
519
+ cartographicsArray.push(interpolatedCartographic.longitude);
520
+ packIndex += 3;
521
+ distanceFromStart += interpointDistance;
743
522
  }
744
-
745
- /**
746
- * Stores the provided instance into the provided array.
747
- *
748
- * @param {PolygonGeometry} value The value to pack.
749
- * @param {number[]} array The array to pack into.
750
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
751
- *
752
- * @returns {number[]} The array that was packed into
753
- */
754
- GroundPolylineGeometry.pack = function (value, array, startingIndex) {
755
- //>>includeStart('debug', pragmas.debug);
756
- Check.Check.typeOf.object("value", value);
757
- Check.Check.defined("array", array);
758
- //>>includeEnd('debug');
759
-
760
- let index = defaultValue.defaultValue(startingIndex, 0);
761
-
762
- const positions = value._positions;
763
- const positionsLength = positions.length;
764
-
765
- array[index++] = positionsLength;
766
-
767
- for (let i = 0; i < positionsLength; ++i) {
768
- const cartesian = positions[i];
769
- Matrix3.Cartesian3.pack(cartesian, array, index);
770
- index += 3;
771
- }
772
-
773
- array[index++] = value.granularity;
774
- array[index++] = value.loop ? 1.0 : 0.0;
775
- array[index++] = value.arcType;
776
-
777
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, index);
778
- index += Matrix3.Ellipsoid.packedLength;
779
-
780
- array[index++] = value._projectionIndex;
781
- array[index++] = value._scene3DOnly ? 1.0 : 0.0;
782
-
783
- return array;
784
- };
785
-
786
- /**
787
- * Retrieves an instance from a packed array.
788
- *
789
- * @param {number[]} array The packed array.
790
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
791
- * @param {PolygonGeometry} [result] The object into which to store the result.
792
- */
793
- GroundPolylineGeometry.unpack = function (array, startingIndex, result) {
794
- //>>includeStart('debug', pragmas.debug);
795
- Check.Check.defined("array", array);
796
- //>>includeEnd('debug');
797
-
798
- let index = defaultValue.defaultValue(startingIndex, 0);
799
- const positionsLength = array[index++];
800
- const positions = new Array(positionsLength);
801
-
802
- for (let i = 0; i < positionsLength; i++) {
803
- positions[i] = Matrix3.Cartesian3.unpack(array, index);
804
- index += 3;
805
- }
806
-
807
- const granularity = array[index++];
808
- const loop = array[index++] === 1.0;
809
- const arcType = array[index++];
810
-
811
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, index);
812
- index += Matrix3.Ellipsoid.packedLength;
813
-
814
- const projectionIndex = array[index++];
815
- const scene3DOnly = array[index++] === 1.0;
816
-
817
- if (!defaultValue.defined(result)) {
818
- result = new GroundPolylineGeometry({
819
- positions: positions,
820
- });
821
- }
822
-
823
- result._positions = positions;
824
- result.granularity = granularity;
825
- result.loop = loop;
826
- result.arcType = arcType;
827
- result._ellipsoid = ellipsoid;
828
- result._projectionIndex = projectionIndex;
829
- result._scene3DOnly = scene3DOnly;
830
-
831
- return result;
832
- };
833
-
834
- function direction(target, origin, result) {
835
- Matrix3.Cartesian3.subtract(target, origin, result);
836
- Matrix3.Cartesian3.normalize(result, result);
837
- return result;
523
+ }
524
+ var heightlessCartographicScratch = new Cartographic_default();
525
+ function getPosition(ellipsoid, cartographic, height, result) {
526
+ Cartographic_default.clone(cartographic, heightlessCartographicScratch);
527
+ heightlessCartographicScratch.height = height;
528
+ return Cartographic_default.toCartesian(
529
+ heightlessCartographicScratch,
530
+ ellipsoid,
531
+ result
532
+ );
533
+ }
534
+ GroundPolylineGeometry.pack = function(value, array, startingIndex) {
535
+ Check_default.typeOf.object("value", value);
536
+ Check_default.defined("array", array);
537
+ let index = defaultValue_default(startingIndex, 0);
538
+ const positions = value._positions;
539
+ const positionsLength = positions.length;
540
+ array[index++] = positionsLength;
541
+ for (let i = 0; i < positionsLength; ++i) {
542
+ const cartesian = positions[i];
543
+ Cartesian3_default.pack(cartesian, array, index);
544
+ index += 3;
838
545
  }
839
-
840
- function tangentDirection(target, origin, up, result) {
841
- result = direction(target, origin, result);
842
-
843
- // orthogonalize
844
- result = Matrix3.Cartesian3.cross(result, up, result);
845
- result = Matrix3.Cartesian3.normalize(result, result);
846
- result = Matrix3.Cartesian3.cross(up, result, result);
847
- return result;
546
+ array[index++] = value.granularity;
547
+ array[index++] = value.loop ? 1 : 0;
548
+ array[index++] = value.arcType;
549
+ Ellipsoid_default.pack(value._ellipsoid, array, index);
550
+ index += Ellipsoid_default.packedLength;
551
+ array[index++] = value._projectionIndex;
552
+ array[index++] = value._scene3DOnly ? 1 : 0;
553
+ return array;
554
+ };
555
+ GroundPolylineGeometry.unpack = function(array, startingIndex, result) {
556
+ Check_default.defined("array", array);
557
+ let index = defaultValue_default(startingIndex, 0);
558
+ const positionsLength = array[index++];
559
+ const positions = new Array(positionsLength);
560
+ for (let i = 0; i < positionsLength; i++) {
561
+ positions[i] = Cartesian3_default.unpack(array, index);
562
+ index += 3;
848
563
  }
849
-
850
- const toPreviousScratch = new Matrix3.Cartesian3();
851
- const toNextScratch = new Matrix3.Cartesian3();
852
- const forwardScratch = new Matrix3.Cartesian3();
853
- const vertexUpScratch = new Matrix3.Cartesian3();
854
- const cosine90 = 0.0;
855
- const cosine180 = -1.0;
856
- function computeVertexMiterNormal(
564
+ const granularity = array[index++];
565
+ const loop = array[index++] === 1;
566
+ const arcType = array[index++];
567
+ const ellipsoid = Ellipsoid_default.unpack(array, index);
568
+ index += Ellipsoid_default.packedLength;
569
+ const projectionIndex = array[index++];
570
+ const scene3DOnly = array[index++] === 1;
571
+ if (!defined_default(result)) {
572
+ result = new GroundPolylineGeometry({
573
+ positions
574
+ });
575
+ }
576
+ result._positions = positions;
577
+ result.granularity = granularity;
578
+ result.loop = loop;
579
+ result.arcType = arcType;
580
+ result._ellipsoid = ellipsoid;
581
+ result._projectionIndex = projectionIndex;
582
+ result._scene3DOnly = scene3DOnly;
583
+ return result;
584
+ };
585
+ function direction(target, origin, result) {
586
+ Cartesian3_default.subtract(target, origin, result);
587
+ Cartesian3_default.normalize(result, result);
588
+ return result;
589
+ }
590
+ function tangentDirection(target, origin, up, result) {
591
+ result = direction(target, origin, result);
592
+ result = Cartesian3_default.cross(result, up, result);
593
+ result = Cartesian3_default.normalize(result, result);
594
+ result = Cartesian3_default.cross(up, result, result);
595
+ return result;
596
+ }
597
+ var toPreviousScratch = new Cartesian3_default();
598
+ var toNextScratch = new Cartesian3_default();
599
+ var forwardScratch = new Cartesian3_default();
600
+ var vertexUpScratch = new Cartesian3_default();
601
+ var cosine90 = 0;
602
+ var cosine180 = -1;
603
+ function computeVertexMiterNormal(previousBottom, vertexBottom, vertexTop, nextBottom, result) {
604
+ const up = direction(vertexTop, vertexBottom, vertexUpScratch);
605
+ const toPrevious = tangentDirection(
857
606
  previousBottom,
858
607
  vertexBottom,
859
- vertexTop,
860
- nextBottom,
861
- result
862
- ) {
863
- const up = direction(vertexTop, vertexBottom, vertexUpScratch);
864
-
865
- // Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid
866
- const toPrevious = tangentDirection(
867
- previousBottom,
868
- vertexBottom,
869
- up,
870
- toPreviousScratch
871
- );
872
- const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);
873
-
874
- // Check if tangents are almost opposite - if so, no need to miter.
875
- if (
876
- Math$1.CesiumMath.equalsEpsilon(
877
- Matrix3.Cartesian3.dot(toPrevious, toNext),
878
- cosine180,
879
- Math$1.CesiumMath.EPSILON5
880
- )
881
- ) {
882
- result = Matrix3.Cartesian3.cross(up, toPrevious, result);
883
- result = Matrix3.Cartesian3.normalize(result, result);
884
- return result;
885
- }
886
-
887
- // Average directions to previous and to next in the plane of Up
888
- result = Matrix3.Cartesian3.add(toNext, toPrevious, result);
889
- result = Matrix3.Cartesian3.normalize(result, result);
890
-
891
- // Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more "backwards")
892
- const forward = Matrix3.Cartesian3.cross(up, result, forwardScratch);
893
- if (Matrix3.Cartesian3.dot(toNext, forward) < cosine90) {
894
- result = Matrix3.Cartesian3.negate(result, result);
895
- }
896
-
608
+ up,
609
+ toPreviousScratch
610
+ );
611
+ const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);
612
+ if (Math_default.equalsEpsilon(
613
+ Cartesian3_default.dot(toPrevious, toNext),
614
+ cosine180,
615
+ Math_default.EPSILON5
616
+ )) {
617
+ result = Cartesian3_default.cross(up, toPrevious, result);
618
+ result = Cartesian3_default.normalize(result, result);
897
619
  return result;
898
620
  }
899
-
900
- const XZ_PLANE = Plane.Plane.fromPointNormal(Matrix3.Cartesian3.ZERO, Matrix3.Cartesian3.UNIT_Y);
901
-
902
- const previousBottomScratch = new Matrix3.Cartesian3();
903
- const vertexBottomScratch = new Matrix3.Cartesian3();
904
- const vertexTopScratch = new Matrix3.Cartesian3();
905
- const nextBottomScratch = new Matrix3.Cartesian3();
906
- const vertexNormalScratch = new Matrix3.Cartesian3();
907
- const intersectionScratch = new Matrix3.Cartesian3();
908
- const cartographicScratch0 = new Matrix3.Cartographic();
909
- const cartographicScratch1 = new Matrix3.Cartographic();
910
- const cartographicIntersectionScratch = new Matrix3.Cartographic();
911
- /**
912
- * Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.
913
- * Vertices are "fat," packing all the data needed in each volume to describe a line on terrain or 3D Tiles.
914
- * Should not be called independent of {@link GroundPolylinePrimitive}.
915
- *
916
- * @param {GroundPolylineGeometry} groundPolylineGeometry
917
- * @private
918
- */
919
- GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) {
920
- const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;
921
- let loop = groundPolylineGeometry.loop;
922
- const ellipsoid = groundPolylineGeometry._ellipsoid;
923
- const granularity = groundPolylineGeometry.granularity;
924
- const arcType = groundPolylineGeometry.arcType;
925
- const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](
926
- ellipsoid
621
+ result = Cartesian3_default.add(toNext, toPrevious, result);
622
+ result = Cartesian3_default.normalize(result, result);
623
+ const forward = Cartesian3_default.cross(up, result, forwardScratch);
624
+ if (Cartesian3_default.dot(toNext, forward) < cosine90) {
625
+ result = Cartesian3_default.negate(result, result);
626
+ }
627
+ return result;
628
+ }
629
+ var XZ_PLANE = Plane_default.fromPointNormal(Cartesian3_default.ZERO, Cartesian3_default.UNIT_Y);
630
+ var previousBottomScratch = new Cartesian3_default();
631
+ var vertexBottomScratch = new Cartesian3_default();
632
+ var vertexTopScratch = new Cartesian3_default();
633
+ var nextBottomScratch = new Cartesian3_default();
634
+ var vertexNormalScratch = new Cartesian3_default();
635
+ var intersectionScratch = new Cartesian3_default();
636
+ var cartographicScratch0 = new Cartographic_default();
637
+ var cartographicScratch1 = new Cartographic_default();
638
+ var cartographicIntersectionScratch = new Cartographic_default();
639
+ GroundPolylineGeometry.createGeometry = function(groundPolylineGeometry) {
640
+ const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;
641
+ let loop = groundPolylineGeometry.loop;
642
+ const ellipsoid = groundPolylineGeometry._ellipsoid;
643
+ const granularity = groundPolylineGeometry.granularity;
644
+ const arcType = groundPolylineGeometry.arcType;
645
+ const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](
646
+ ellipsoid
647
+ );
648
+ const minHeight = WALL_INITIAL_MIN_HEIGHT;
649
+ const maxHeight = WALL_INITIAL_MAX_HEIGHT;
650
+ let index;
651
+ let i;
652
+ const positions = groundPolylineGeometry._positions;
653
+ const positionsLength = positions.length;
654
+ if (positionsLength === 2) {
655
+ loop = false;
656
+ }
657
+ let p0;
658
+ let p1;
659
+ let c0;
660
+ let c1;
661
+ const rhumbLine = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
662
+ let intersection;
663
+ let intersectionCartographic;
664
+ let intersectionLongitude;
665
+ const splitPositions = [positions[0]];
666
+ for (i = 0; i < positionsLength - 1; i++) {
667
+ p0 = positions[i];
668
+ p1 = positions[i + 1];
669
+ intersection = IntersectionTests_default.lineSegmentPlane(
670
+ p0,
671
+ p1,
672
+ XZ_PLANE,
673
+ intersectionScratch
927
674
  );
928
-
929
- const minHeight = WALL_INITIAL_MIN_HEIGHT;
930
- const maxHeight = WALL_INITIAL_MAX_HEIGHT;
931
-
932
- let index;
933
- let i;
934
-
935
- const positions = groundPolylineGeometry._positions;
936
- const positionsLength = positions.length;
937
-
938
- if (positionsLength === 2) {
939
- loop = false;
940
- }
941
-
942
- // Split positions across the IDL and the Prime Meridian as well.
943
- // Split across prime meridian because very large geometries crossing the Prime Meridian but not the IDL
944
- // may get split by the plane of IDL + Prime Meridian.
945
- let p0;
946
- let p1;
947
- let c0;
948
- let c1;
949
- const rhumbLine = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
950
- let intersection;
951
- let intersectionCartographic;
952
- let intersectionLongitude;
953
- const splitPositions = [positions[0]];
954
- for (i = 0; i < positionsLength - 1; i++) {
955
- p0 = positions[i];
956
- p1 = positions[i + 1];
957
- intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
958
- p0,
959
- p1,
960
- XZ_PLANE,
961
- intersectionScratch
962
- );
963
- if (
964
- defaultValue.defined(intersection) &&
965
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
966
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
967
- ) {
968
- if (groundPolylineGeometry.arcType === ArcType.ArcType.GEODESIC) {
969
- splitPositions.push(Matrix3.Cartesian3.clone(intersection));
970
- } else if (groundPolylineGeometry.arcType === ArcType.ArcType.RHUMB) {
971
- intersectionLongitude = ellipsoid.cartesianToCartographic(
972
- intersection,
973
- cartographicScratch0
974
- ).longitude;
975
- c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
976
- c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
977
- rhumbLine.setEndPoints(c0, c1);
978
- intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
979
- intersectionLongitude,
980
- cartographicIntersectionScratch
981
- );
982
- intersection = ellipsoid.cartographicToCartesian(
983
- intersectionCartographic,
984
- intersectionScratch
985
- );
986
- if (
987
- defaultValue.defined(intersection) &&
988
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
989
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
990
- ) {
991
- splitPositions.push(Matrix3.Cartesian3.clone(intersection));
992
- }
675
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
676
+ if (groundPolylineGeometry.arcType === ArcType_default.GEODESIC) {
677
+ splitPositions.push(Cartesian3_default.clone(intersection));
678
+ } else if (groundPolylineGeometry.arcType === ArcType_default.RHUMB) {
679
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
680
+ intersection,
681
+ cartographicScratch0
682
+ ).longitude;
683
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
684
+ c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
685
+ rhumbLine.setEndPoints(c0, c1);
686
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
687
+ intersectionLongitude,
688
+ cartographicIntersectionScratch
689
+ );
690
+ intersection = ellipsoid.cartographicToCartesian(
691
+ intersectionCartographic,
692
+ intersectionScratch
693
+ );
694
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
695
+ splitPositions.push(Cartesian3_default.clone(intersection));
993
696
  }
994
697
  }
995
- splitPositions.push(p1);
996
698
  }
997
-
998
- if (loop) {
999
- p0 = positions[positionsLength - 1];
1000
- p1 = positions[0];
1001
- intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
1002
- p0,
1003
- p1,
1004
- XZ_PLANE,
1005
- intersectionScratch
1006
- );
1007
- if (
1008
- defaultValue.defined(intersection) &&
1009
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
1010
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
1011
- ) {
1012
- if (groundPolylineGeometry.arcType === ArcType.ArcType.GEODESIC) {
1013
- splitPositions.push(Matrix3.Cartesian3.clone(intersection));
1014
- } else if (groundPolylineGeometry.arcType === ArcType.ArcType.RHUMB) {
1015
- intersectionLongitude = ellipsoid.cartesianToCartographic(
1016
- intersection,
1017
- cartographicScratch0
1018
- ).longitude;
1019
- c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
1020
- c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
1021
- rhumbLine.setEndPoints(c0, c1);
1022
- intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
1023
- intersectionLongitude,
1024
- cartographicIntersectionScratch
1025
- );
1026
- intersection = ellipsoid.cartographicToCartesian(
1027
- intersectionCartographic,
1028
- intersectionScratch
1029
- );
1030
- if (
1031
- defaultValue.defined(intersection) &&
1032
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
1033
- !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
1034
- ) {
1035
- splitPositions.push(Matrix3.Cartesian3.clone(intersection));
1036
- }
699
+ splitPositions.push(p1);
700
+ }
701
+ if (loop) {
702
+ p0 = positions[positionsLength - 1];
703
+ p1 = positions[0];
704
+ intersection = IntersectionTests_default.lineSegmentPlane(
705
+ p0,
706
+ p1,
707
+ XZ_PLANE,
708
+ intersectionScratch
709
+ );
710
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
711
+ if (groundPolylineGeometry.arcType === ArcType_default.GEODESIC) {
712
+ splitPositions.push(Cartesian3_default.clone(intersection));
713
+ } else if (groundPolylineGeometry.arcType === ArcType_default.RHUMB) {
714
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
715
+ intersection,
716
+ cartographicScratch0
717
+ ).longitude;
718
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
719
+ c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
720
+ rhumbLine.setEndPoints(c0, c1);
721
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
722
+ intersectionLongitude,
723
+ cartographicIntersectionScratch
724
+ );
725
+ intersection = ellipsoid.cartographicToCartesian(
726
+ intersectionCartographic,
727
+ intersectionScratch
728
+ );
729
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
730
+ splitPositions.push(Cartesian3_default.clone(intersection));
1037
731
  }
1038
732
  }
1039
733
  }
1040
- let cartographicsLength = splitPositions.length;
1041
-
1042
- let cartographics = new Array(cartographicsLength);
1043
- for (i = 0; i < cartographicsLength; i++) {
1044
- const cartographic = Matrix3.Cartographic.fromCartesian(
1045
- splitPositions[i],
1046
- ellipsoid
1047
- );
1048
- cartographic.height = 0.0;
1049
- cartographics[i] = cartographic;
1050
- }
1051
-
1052
- cartographics = arrayRemoveDuplicates.arrayRemoveDuplicates(
1053
- cartographics,
1054
- Matrix3.Cartographic.equalsEpsilon
734
+ }
735
+ let cartographicsLength = splitPositions.length;
736
+ let cartographics = new Array(cartographicsLength);
737
+ for (i = 0; i < cartographicsLength; i++) {
738
+ const cartographic = Cartographic_default.fromCartesian(
739
+ splitPositions[i],
740
+ ellipsoid
1055
741
  );
1056
- cartographicsLength = cartographics.length;
1057
-
1058
- if (cartographicsLength < 2) {
1059
- return undefined;
1060
- }
1061
-
1062
- /**** Build heap-side arrays for positions, interpolated cartographics, and normals from which to compute vertices ****/
1063
- // We build a "wall" and then decompose it into separately connected component "volumes" because we need a lot
1064
- // of information about the wall. Also, this simplifies interpolation.
1065
- // Convention: "next" and "end" are locally forward to each segment of the wall,
1066
- // and we are computing normals pointing towards the local right side of the vertices in each segment.
1067
- const cartographicsArray = [];
1068
- const normalsArray = [];
1069
- const bottomPositionsArray = [];
1070
- const topPositionsArray = [];
1071
-
1072
- let previousBottom = previousBottomScratch;
1073
- let vertexBottom = vertexBottomScratch;
1074
- let vertexTop = vertexTopScratch;
1075
- let nextBottom = nextBottomScratch;
1076
- let vertexNormal = vertexNormalScratch;
1077
-
1078
- // First point - either loop or attach a "perpendicular" normal
1079
- const startCartographic = cartographics[0];
1080
- const nextCartographic = cartographics[1];
1081
-
1082
- const prestartCartographic = cartographics[cartographicsLength - 1];
1083
- previousBottom = getPosition(
1084
- ellipsoid,
1085
- prestartCartographic,
1086
- minHeight,
1087
- previousBottom
742
+ cartographic.height = 0;
743
+ cartographics[i] = cartographic;
744
+ }
745
+ cartographics = arrayRemoveDuplicates_default(
746
+ cartographics,
747
+ Cartographic_default.equalsEpsilon
748
+ );
749
+ cartographicsLength = cartographics.length;
750
+ if (cartographicsLength < 2) {
751
+ return void 0;
752
+ }
753
+ const cartographicsArray = [];
754
+ const normalsArray = [];
755
+ const bottomPositionsArray = [];
756
+ const topPositionsArray = [];
757
+ let previousBottom = previousBottomScratch;
758
+ let vertexBottom = vertexBottomScratch;
759
+ let vertexTop = vertexTopScratch;
760
+ let nextBottom = nextBottomScratch;
761
+ let vertexNormal = vertexNormalScratch;
762
+ const startCartographic = cartographics[0];
763
+ const nextCartographic = cartographics[1];
764
+ const prestartCartographic = cartographics[cartographicsLength - 1];
765
+ previousBottom = getPosition(
766
+ ellipsoid,
767
+ prestartCartographic,
768
+ minHeight,
769
+ previousBottom
770
+ );
771
+ nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);
772
+ vertexBottom = getPosition(
773
+ ellipsoid,
774
+ startCartographic,
775
+ minHeight,
776
+ vertexBottom
777
+ );
778
+ vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);
779
+ if (loop) {
780
+ vertexNormal = computeVertexMiterNormal(
781
+ previousBottom,
782
+ vertexBottom,
783
+ vertexTop,
784
+ nextBottom,
785
+ vertexNormal
1088
786
  );
1089
- nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);
1090
- vertexBottom = getPosition(
1091
- ellipsoid,
787
+ } else {
788
+ vertexNormal = computeRightNormal(
1092
789
  startCartographic,
1093
- minHeight,
1094
- vertexBottom
790
+ nextCartographic,
791
+ maxHeight,
792
+ ellipsoid,
793
+ vertexNormal
1095
794
  );
1096
- vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);
1097
-
1098
- if (loop) {
1099
- vertexNormal = computeVertexMiterNormal(
1100
- previousBottom,
1101
- vertexBottom,
1102
- vertexTop,
1103
- nextBottom,
1104
- vertexNormal
1105
- );
1106
- } else {
1107
- vertexNormal = computeRightNormal(
1108
- startCartographic,
1109
- nextCartographic,
1110
- maxHeight,
1111
- ellipsoid,
1112
- vertexNormal
1113
- );
1114
- }
1115
-
1116
- Matrix3.Cartesian3.pack(vertexNormal, normalsArray, 0);
1117
- Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, 0);
1118
- Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, 0);
1119
- cartographicsArray.push(startCartographic.latitude);
1120
- cartographicsArray.push(startCartographic.longitude);
1121
-
795
+ }
796
+ Cartesian3_default.pack(vertexNormal, normalsArray, 0);
797
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, 0);
798
+ Cartesian3_default.pack(vertexTop, topPositionsArray, 0);
799
+ cartographicsArray.push(startCartographic.latitude);
800
+ cartographicsArray.push(startCartographic.longitude);
801
+ interpolateSegment(
802
+ startCartographic,
803
+ nextCartographic,
804
+ minHeight,
805
+ maxHeight,
806
+ granularity,
807
+ arcType,
808
+ ellipsoid,
809
+ normalsArray,
810
+ bottomPositionsArray,
811
+ topPositionsArray,
812
+ cartographicsArray
813
+ );
814
+ for (i = 1; i < cartographicsLength - 1; ++i) {
815
+ previousBottom = Cartesian3_default.clone(vertexBottom, previousBottom);
816
+ vertexBottom = Cartesian3_default.clone(nextBottom, vertexBottom);
817
+ const vertexCartographic = cartographics[i];
818
+ getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);
819
+ getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);
820
+ computeVertexMiterNormal(
821
+ previousBottom,
822
+ vertexBottom,
823
+ vertexTop,
824
+ nextBottom,
825
+ vertexNormal
826
+ );
827
+ index = normalsArray.length;
828
+ Cartesian3_default.pack(vertexNormal, normalsArray, index);
829
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, index);
830
+ Cartesian3_default.pack(vertexTop, topPositionsArray, index);
831
+ cartographicsArray.push(vertexCartographic.latitude);
832
+ cartographicsArray.push(vertexCartographic.longitude);
1122
833
  interpolateSegment(
1123
- startCartographic,
1124
- nextCartographic,
834
+ cartographics[i],
835
+ cartographics[i + 1],
1125
836
  minHeight,
1126
837
  maxHeight,
1127
838
  granularity,
@@ -1132,388 +843,76 @@ define(['./Transforms-a2a85221', './Matrix2-e1298525', './Matrix3-41c58dde', './
1132
843
  topPositionsArray,
1133
844
  cartographicsArray
1134
845
  );
1135
-
1136
- // All inbetween points
1137
- for (i = 1; i < cartographicsLength - 1; ++i) {
1138
- previousBottom = Matrix3.Cartesian3.clone(vertexBottom, previousBottom);
1139
- vertexBottom = Matrix3.Cartesian3.clone(nextBottom, vertexBottom);
1140
- const vertexCartographic = cartographics[i];
1141
- getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);
1142
- getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);
1143
-
1144
- computeVertexMiterNormal(
1145
- previousBottom,
1146
- vertexBottom,
1147
- vertexTop,
1148
- nextBottom,
1149
- vertexNormal
1150
- );
1151
-
1152
- index = normalsArray.length;
1153
- Matrix3.Cartesian3.pack(vertexNormal, normalsArray, index);
1154
- Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, index);
1155
- Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, index);
1156
- cartographicsArray.push(vertexCartographic.latitude);
1157
- cartographicsArray.push(vertexCartographic.longitude);
1158
-
1159
- interpolateSegment(
1160
- cartographics[i],
1161
- cartographics[i + 1],
1162
- minHeight,
1163
- maxHeight,
1164
- granularity,
1165
- arcType,
1166
- ellipsoid,
1167
- normalsArray,
1168
- bottomPositionsArray,
1169
- topPositionsArray,
1170
- cartographicsArray
1171
- );
1172
- }
1173
-
1174
- // Last point - either loop or attach a normal "perpendicular" to the wall.
1175
- const endCartographic = cartographics[cartographicsLength - 1];
1176
- const preEndCartographic = cartographics[cartographicsLength - 2];
1177
-
1178
- vertexBottom = getPosition(
846
+ }
847
+ const endCartographic = cartographics[cartographicsLength - 1];
848
+ const preEndCartographic = cartographics[cartographicsLength - 2];
849
+ vertexBottom = getPosition(
850
+ ellipsoid,
851
+ endCartographic,
852
+ minHeight,
853
+ vertexBottom
854
+ );
855
+ vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);
856
+ if (loop) {
857
+ const postEndCartographic = cartographics[0];
858
+ previousBottom = getPosition(
1179
859
  ellipsoid,
1180
- endCartographic,
860
+ preEndCartographic,
1181
861
  minHeight,
1182
- vertexBottom
1183
- );
1184
- vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);
1185
-
1186
- if (loop) {
1187
- const postEndCartographic = cartographics[0];
1188
- previousBottom = getPosition(
1189
- ellipsoid,
1190
- preEndCartographic,
1191
- minHeight,
1192
- previousBottom
1193
- );
1194
- nextBottom = getPosition(
1195
- ellipsoid,
1196
- postEndCartographic,
1197
- minHeight,
1198
- nextBottom
1199
- );
1200
-
1201
- vertexNormal = computeVertexMiterNormal(
1202
- previousBottom,
1203
- vertexBottom,
1204
- vertexTop,
1205
- nextBottom,
1206
- vertexNormal
1207
- );
1208
- } else {
1209
- vertexNormal = computeRightNormal(
1210
- preEndCartographic,
1211
- endCartographic,
1212
- maxHeight,
1213
- ellipsoid,
1214
- vertexNormal
1215
- );
1216
- }
1217
-
1218
- index = normalsArray.length;
1219
- Matrix3.Cartesian3.pack(vertexNormal, normalsArray, index);
1220
- Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, index);
1221
- Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, index);
1222
- cartographicsArray.push(endCartographic.latitude);
1223
- cartographicsArray.push(endCartographic.longitude);
1224
-
1225
- if (loop) {
1226
- interpolateSegment(
1227
- endCartographic,
1228
- startCartographic,
1229
- minHeight,
1230
- maxHeight,
1231
- granularity,
1232
- arcType,
1233
- ellipsoid,
1234
- normalsArray,
1235
- bottomPositionsArray,
1236
- topPositionsArray,
1237
- cartographicsArray
1238
- );
1239
- index = normalsArray.length;
1240
- for (i = 0; i < 3; ++i) {
1241
- normalsArray[index + i] = normalsArray[i];
1242
- bottomPositionsArray[index + i] = bottomPositionsArray[i];
1243
- topPositionsArray[index + i] = topPositionsArray[i];
1244
- }
1245
- cartographicsArray.push(startCartographic.latitude);
1246
- cartographicsArray.push(startCartographic.longitude);
1247
- }
1248
-
1249
- return generateGeometryAttributes(
1250
- loop,
1251
- projection,
1252
- bottomPositionsArray,
1253
- topPositionsArray,
1254
- normalsArray,
1255
- cartographicsArray,
1256
- compute2dAttributes
1257
- );
1258
- };
1259
-
1260
- // If the end normal angle is too steep compared to the direction of the line segment,
1261
- // "break" the miter by rotating the normal 90 degrees around the "up" direction at the point
1262
- // For ultra precision we would want to project into a plane, but in practice this is sufficient.
1263
- const lineDirectionScratch = new Matrix3.Cartesian3();
1264
- const matrix3Scratch = new Matrix3.Matrix3();
1265
- const quaternionScratch = new Transforms.Quaternion();
1266
- function breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {
1267
- const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);
1268
-
1269
- const dot = Matrix3.Cartesian3.dot(lineDirection, endGeometryNormal);
1270
- if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {
1271
- const vertexUp = direction(endTop, endBottom, vertexUpScratch);
1272
- const angle =
1273
- dot < MITER_BREAK_LARGE
1274
- ? Math$1.CesiumMath.PI_OVER_TWO
1275
- : -Math$1.CesiumMath.PI_OVER_TWO;
1276
- const quaternion = Transforms.Quaternion.fromAxisAngle(
1277
- vertexUp,
1278
- angle,
1279
- quaternionScratch
1280
- );
1281
- const rotationMatrix = Matrix3.Matrix3.fromQuaternion(quaternion, matrix3Scratch);
1282
- Matrix3.Matrix3.multiplyByVector(
1283
- rotationMatrix,
1284
- endGeometryNormal,
1285
- endGeometryNormal
1286
- );
1287
- return true;
1288
- }
1289
- return false;
1290
- }
1291
-
1292
- const endPosCartographicScratch = new Matrix3.Cartographic();
1293
- const normalStartpointScratch = new Matrix3.Cartesian3();
1294
- const normalEndpointScratch = new Matrix3.Cartesian3();
1295
- function projectNormal(
1296
- projection,
1297
- cartographic,
1298
- normal,
1299
- projectedPosition,
1300
- result
1301
- ) {
1302
- const position = Matrix3.Cartographic.toCartesian(
1303
- cartographic,
1304
- projection._ellipsoid,
1305
- normalStartpointScratch
1306
- );
1307
- let normalEndpoint = Matrix3.Cartesian3.add(position, normal, normalEndpointScratch);
1308
- let flipNormal = false;
1309
-
1310
- const ellipsoid = projection._ellipsoid;
1311
- let normalEndpointCartographic = ellipsoid.cartesianToCartographic(
1312
- normalEndpoint,
1313
- endPosCartographicScratch
1314
- );
1315
- // If normal crosses the IDL, go the other way and flip the result.
1316
- // In practice this almost never happens because the cartographic start
1317
- // and end points of each segment are "nudged" to be on the same side
1318
- // of the IDL and slightly away from the IDL.
1319
- if (
1320
- Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) >
1321
- Math$1.CesiumMath.PI_OVER_TWO
1322
- ) {
1323
- flipNormal = true;
1324
- normalEndpoint = Matrix3.Cartesian3.subtract(
1325
- position,
1326
- normal,
1327
- normalEndpointScratch
1328
- );
1329
- normalEndpointCartographic = ellipsoid.cartesianToCartographic(
1330
- normalEndpoint,
1331
- endPosCartographicScratch
1332
- );
1333
- }
1334
-
1335
- normalEndpointCartographic.height = 0.0;
1336
- const normalEndpointProjected = projection.project(
1337
- normalEndpointCartographic,
1338
- result
1339
- );
1340
- result = Matrix3.Cartesian3.subtract(
1341
- normalEndpointProjected,
1342
- projectedPosition,
1343
- result
862
+ previousBottom
1344
863
  );
1345
- result.z = 0.0;
1346
- result = Matrix3.Cartesian3.normalize(result, result);
1347
- if (flipNormal) {
1348
- Matrix3.Cartesian3.negate(result, result);
1349
- }
1350
- return result;
1351
- }
1352
-
1353
- const adjustHeightNormalScratch = new Matrix3.Cartesian3();
1354
- const adjustHeightOffsetScratch = new Matrix3.Cartesian3();
1355
- function adjustHeights(
1356
- bottom,
1357
- top,
1358
- minHeight,
1359
- maxHeight,
1360
- adjustHeightBottom,
1361
- adjustHeightTop
1362
- ) {
1363
- // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively
1364
- const adjustHeightNormal = Matrix3.Cartesian3.subtract(
1365
- top,
1366
- bottom,
1367
- adjustHeightNormalScratch
864
+ nextBottom = getPosition(
865
+ ellipsoid,
866
+ postEndCartographic,
867
+ minHeight,
868
+ nextBottom
1368
869
  );
1369
- Matrix3.Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal);
1370
-
1371
- const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;
1372
- let adjustHeightOffset = Matrix3.Cartesian3.multiplyByScalar(
1373
- adjustHeightNormal,
1374
- distanceForBottom,
1375
- adjustHeightOffsetScratch
870
+ vertexNormal = computeVertexMiterNormal(
871
+ previousBottom,
872
+ vertexBottom,
873
+ vertexTop,
874
+ nextBottom,
875
+ vertexNormal
1376
876
  );
1377
- Matrix3.Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom);
1378
-
1379
- const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;
1380
- adjustHeightOffset = Matrix3.Cartesian3.multiplyByScalar(
1381
- adjustHeightNormal,
1382
- distanceForTop,
1383
- adjustHeightOffsetScratch
877
+ } else {
878
+ vertexNormal = computeRightNormal(
879
+ preEndCartographic,
880
+ endCartographic,
881
+ maxHeight,
882
+ ellipsoid,
883
+ vertexNormal
1384
884
  );
1385
- Matrix3.Cartesian3.add(top, adjustHeightOffset, adjustHeightTop);
1386
885
  }
1387
-
1388
- const nudgeDirectionScratch = new Matrix3.Cartesian3();
1389
- function nudgeXZ(start, end) {
1390
- const startToXZdistance = Plane.Plane.getPointDistance(XZ_PLANE, start);
1391
- const endToXZdistance = Plane.Plane.getPointDistance(XZ_PLANE, end);
1392
- let offset = nudgeDirectionScratch;
1393
- // Larger epsilon than what's used in GeometryPipeline, a centimeter in world space
1394
- if (Math$1.CesiumMath.equalsEpsilon(startToXZdistance, 0.0, Math$1.CesiumMath.EPSILON2)) {
1395
- offset = direction(end, start, offset);
1396
- Matrix3.Cartesian3.multiplyByScalar(offset, Math$1.CesiumMath.EPSILON2, offset);
1397
- Matrix3.Cartesian3.add(start, offset, start);
1398
- } else if (
1399
- Math$1.CesiumMath.equalsEpsilon(endToXZdistance, 0.0, Math$1.CesiumMath.EPSILON2)
1400
- ) {
1401
- offset = direction(start, end, offset);
1402
- Matrix3.Cartesian3.multiplyByScalar(offset, Math$1.CesiumMath.EPSILON2, offset);
1403
- Matrix3.Cartesian3.add(end, offset, end);
1404
- }
1405
- }
1406
-
1407
- // "Nudge" cartographic coordinates so start and end are on the same side of the IDL.
1408
- // Nudge amounts are tiny, basically just an IDL flip.
1409
- // Only used for 2D/CV.
1410
- function nudgeCartographic(start, end) {
1411
- const absStartLon = Math.abs(start.longitude);
1412
- const absEndLon = Math.abs(end.longitude);
1413
- if (
1414
- Math$1.CesiumMath.equalsEpsilon(absStartLon, Math$1.CesiumMath.PI, Math$1.CesiumMath.EPSILON11)
1415
- ) {
1416
- const endSign = Math$1.CesiumMath.sign(end.longitude);
1417
- start.longitude = endSign * (absStartLon - Math$1.CesiumMath.EPSILON11);
1418
- return 1;
1419
- } else if (
1420
- Math$1.CesiumMath.equalsEpsilon(absEndLon, Math$1.CesiumMath.PI, Math$1.CesiumMath.EPSILON11)
1421
- ) {
1422
- const startSign = Math$1.CesiumMath.sign(start.longitude);
1423
- end.longitude = startSign * (absEndLon - Math$1.CesiumMath.EPSILON11);
1424
- return 2;
886
+ index = normalsArray.length;
887
+ Cartesian3_default.pack(vertexNormal, normalsArray, index);
888
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, index);
889
+ Cartesian3_default.pack(vertexTop, topPositionsArray, index);
890
+ cartographicsArray.push(endCartographic.latitude);
891
+ cartographicsArray.push(endCartographic.longitude);
892
+ if (loop) {
893
+ interpolateSegment(
894
+ endCartographic,
895
+ startCartographic,
896
+ minHeight,
897
+ maxHeight,
898
+ granularity,
899
+ arcType,
900
+ ellipsoid,
901
+ normalsArray,
902
+ bottomPositionsArray,
903
+ topPositionsArray,
904
+ cartographicsArray
905
+ );
906
+ index = normalsArray.length;
907
+ for (i = 0; i < 3; ++i) {
908
+ normalsArray[index + i] = normalsArray[i];
909
+ bottomPositionsArray[index + i] = bottomPositionsArray[i];
910
+ topPositionsArray[index + i] = topPositionsArray[i];
1425
911
  }
1426
- return 0;
912
+ cartographicsArray.push(startCartographic.latitude);
913
+ cartographicsArray.push(startCartographic.longitude);
1427
914
  }
1428
-
1429
- const startCartographicScratch = new Matrix3.Cartographic();
1430
- const endCartographicScratch = new Matrix3.Cartographic();
1431
-
1432
- const segmentStartTopScratch = new Matrix3.Cartesian3();
1433
- const segmentEndTopScratch = new Matrix3.Cartesian3();
1434
- const segmentStartBottomScratch = new Matrix3.Cartesian3();
1435
- const segmentEndBottomScratch = new Matrix3.Cartesian3();
1436
- const segmentStartNormalScratch = new Matrix3.Cartesian3();
1437
- const segmentEndNormalScratch = new Matrix3.Cartesian3();
1438
-
1439
- const getHeightCartographics = [
1440
- startCartographicScratch,
1441
- endCartographicScratch,
1442
- ];
1443
- const getHeightRectangleScratch = new Matrix2.Rectangle();
1444
-
1445
- const adjustHeightStartTopScratch = new Matrix3.Cartesian3();
1446
- const adjustHeightEndTopScratch = new Matrix3.Cartesian3();
1447
- const adjustHeightStartBottomScratch = new Matrix3.Cartesian3();
1448
- const adjustHeightEndBottomScratch = new Matrix3.Cartesian3();
1449
-
1450
- const segmentStart2DScratch = new Matrix3.Cartesian3();
1451
- const segmentEnd2DScratch = new Matrix3.Cartesian3();
1452
- const segmentStartNormal2DScratch = new Matrix3.Cartesian3();
1453
- const segmentEndNormal2DScratch = new Matrix3.Cartesian3();
1454
-
1455
- const offsetScratch = new Matrix3.Cartesian3();
1456
- const startUpScratch = new Matrix3.Cartesian3();
1457
- const endUpScratch = new Matrix3.Cartesian3();
1458
- const rightScratch = new Matrix3.Cartesian3();
1459
- const startPlaneNormalScratch = new Matrix3.Cartesian3();
1460
- const endPlaneNormalScratch = new Matrix3.Cartesian3();
1461
- const encodeScratch = new EncodedCartesian3.EncodedCartesian3();
1462
-
1463
- const encodeScratch2D = new EncodedCartesian3.EncodedCartesian3();
1464
- const forwardOffset2DScratch = new Matrix3.Cartesian3();
1465
- const right2DScratch = new Matrix3.Cartesian3();
1466
-
1467
- const normalNudgeScratch = new Matrix3.Cartesian3();
1468
-
1469
- const scratchBoundingSpheres = [new Transforms.BoundingSphere(), new Transforms.BoundingSphere()];
1470
-
1471
- // Winding order is reversed so each segment's volume is inside-out
1472
- const REFERENCE_INDICES = [
1473
- 0,
1474
- 2,
1475
- 1,
1476
- 0,
1477
- 3,
1478
- 2, // right
1479
- 0,
1480
- 7,
1481
- 3,
1482
- 0,
1483
- 4,
1484
- 7, // start
1485
- 0,
1486
- 5,
1487
- 4,
1488
- 0,
1489
- 1,
1490
- 5, // bottom
1491
- 5,
1492
- 7,
1493
- 4,
1494
- 5,
1495
- 6,
1496
- 7, // left
1497
- 5,
1498
- 2,
1499
- 6,
1500
- 5,
1501
- 1,
1502
- 2, // end
1503
- 3,
1504
- 6,
1505
- 2,
1506
- 3,
1507
- 7,
1508
- 6, // top
1509
- ];
1510
- const REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;
1511
-
1512
- // Decompose the "wall" into a series of shadow volumes.
1513
- // Each shadow volume's vertices encode a description of the line it contains,
1514
- // including mitering planes at the end points, a plane along the line itself,
1515
- // and attributes for computing length-wise texture coordinates.
1516
- function generateGeometryAttributes(
915
+ return generateGeometryAttributes(
1517
916
  loop,
1518
917
  projection,
1519
918
  bottomPositionsArray,
@@ -1521,614 +920,688 @@ define(['./Transforms-a2a85221', './Matrix2-e1298525', './Matrix3-41c58dde', './
1521
920
  normalsArray,
1522
921
  cartographicsArray,
1523
922
  compute2dAttributes
1524
- ) {
1525
- let i;
1526
- let index;
1527
- const ellipsoid = projection._ellipsoid;
1528
-
1529
- // Each segment will have 8 vertices
1530
- const segmentCount = bottomPositionsArray.length / 3 - 1;
1531
- const vertexCount = segmentCount * 8;
1532
- const arraySizeVec4 = vertexCount * 4;
1533
- const indexCount = segmentCount * 36;
1534
-
1535
- const indices =
1536
- vertexCount > 65535
1537
- ? new Uint32Array(indexCount)
1538
- : new Uint16Array(indexCount);
1539
- const positionsArray = new Float64Array(vertexCount * 3);
1540
-
1541
- const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);
1542
- const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);
1543
- const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);
1544
- const endNormalAndTextureCoordinateNormalizationX = new Float32Array(
1545
- arraySizeVec4
923
+ );
924
+ };
925
+ var lineDirectionScratch = new Cartesian3_default();
926
+ var matrix3Scratch = new Matrix3_default();
927
+ var quaternionScratch = new Quaternion_default();
928
+ function breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {
929
+ const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);
930
+ const dot = Cartesian3_default.dot(lineDirection, endGeometryNormal);
931
+ if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {
932
+ const vertexUp = direction(endTop, endBottom, vertexUpScratch);
933
+ const angle = dot < MITER_BREAK_LARGE ? Math_default.PI_OVER_TWO : -Math_default.PI_OVER_TWO;
934
+ const quaternion = Quaternion_default.fromAxisAngle(
935
+ vertexUp,
936
+ angle,
937
+ quaternionScratch
1546
938
  );
1547
- const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(
1548
- arraySizeVec4
939
+ const rotationMatrix = Matrix3_default.fromQuaternion(quaternion, matrix3Scratch);
940
+ Matrix3_default.multiplyByVector(
941
+ rotationMatrix,
942
+ endGeometryNormal,
943
+ endGeometryNormal
1549
944
  );
1550
-
1551
- let startHiLo2D;
1552
- let offsetAndRight2D;
1553
- let startEndNormals2D;
1554
- let texcoordNormalization2D;
1555
-
1556
- if (compute2dAttributes) {
1557
- startHiLo2D = new Float32Array(arraySizeVec4);
1558
- offsetAndRight2D = new Float32Array(arraySizeVec4);
1559
- startEndNormals2D = new Float32Array(arraySizeVec4);
1560
- texcoordNormalization2D = new Float32Array(vertexCount * 2);
1561
- }
1562
-
1563
- /*** Compute total lengths for texture coordinate normalization ***/
1564
- // 2D
1565
- const cartographicsLength = cartographicsArray.length / 2;
1566
- let length2D = 0.0;
1567
-
1568
- const startCartographic = startCartographicScratch;
1569
- startCartographic.height = 0.0;
1570
- const endCartographic = endCartographicScratch;
1571
- endCartographic.height = 0.0;
1572
-
1573
- let segmentStartCartesian = segmentStartTopScratch;
1574
- let segmentEndCartesian = segmentEndTopScratch;
1575
-
1576
- if (compute2dAttributes) {
1577
- index = 0;
1578
- for (i = 1; i < cartographicsLength; i++) {
1579
- // Don't clone anything from previous segment b/c possible IDL touch
1580
- startCartographic.latitude = cartographicsArray[index];
1581
- startCartographic.longitude = cartographicsArray[index + 1];
1582
- endCartographic.latitude = cartographicsArray[index + 2];
1583
- endCartographic.longitude = cartographicsArray[index + 3];
1584
-
1585
- segmentStartCartesian = projection.project(
1586
- startCartographic,
1587
- segmentStartCartesian
1588
- );
1589
- segmentEndCartesian = projection.project(
1590
- endCartographic,
1591
- segmentEndCartesian
1592
- );
1593
- length2D += Matrix3.Cartesian3.distance(
1594
- segmentStartCartesian,
1595
- segmentEndCartesian
1596
- );
1597
- index += 2;
1598
- }
945
+ return true;
946
+ }
947
+ return false;
948
+ }
949
+ var endPosCartographicScratch = new Cartographic_default();
950
+ var normalStartpointScratch = new Cartesian3_default();
951
+ var normalEndpointScratch = new Cartesian3_default();
952
+ function projectNormal(projection, cartographic, normal, projectedPosition, result) {
953
+ const position = Cartographic_default.toCartesian(
954
+ cartographic,
955
+ projection._ellipsoid,
956
+ normalStartpointScratch
957
+ );
958
+ let normalEndpoint = Cartesian3_default.add(position, normal, normalEndpointScratch);
959
+ let flipNormal = false;
960
+ const ellipsoid = projection._ellipsoid;
961
+ let normalEndpointCartographic = ellipsoid.cartesianToCartographic(
962
+ normalEndpoint,
963
+ endPosCartographicScratch
964
+ );
965
+ if (Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) > Math_default.PI_OVER_TWO) {
966
+ flipNormal = true;
967
+ normalEndpoint = Cartesian3_default.subtract(
968
+ position,
969
+ normal,
970
+ normalEndpointScratch
971
+ );
972
+ normalEndpointCartographic = ellipsoid.cartesianToCartographic(
973
+ normalEndpoint,
974
+ endPosCartographicScratch
975
+ );
976
+ }
977
+ normalEndpointCartographic.height = 0;
978
+ const normalEndpointProjected = projection.project(
979
+ normalEndpointCartographic,
980
+ result
981
+ );
982
+ result = Cartesian3_default.subtract(
983
+ normalEndpointProjected,
984
+ projectedPosition,
985
+ result
986
+ );
987
+ result.z = 0;
988
+ result = Cartesian3_default.normalize(result, result);
989
+ if (flipNormal) {
990
+ Cartesian3_default.negate(result, result);
991
+ }
992
+ return result;
993
+ }
994
+ var adjustHeightNormalScratch = new Cartesian3_default();
995
+ var adjustHeightOffsetScratch = new Cartesian3_default();
996
+ function adjustHeights(bottom, top, minHeight, maxHeight, adjustHeightBottom, adjustHeightTop) {
997
+ const adjustHeightNormal = Cartesian3_default.subtract(
998
+ top,
999
+ bottom,
1000
+ adjustHeightNormalScratch
1001
+ );
1002
+ Cartesian3_default.normalize(adjustHeightNormal, adjustHeightNormal);
1003
+ const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;
1004
+ let adjustHeightOffset = Cartesian3_default.multiplyByScalar(
1005
+ adjustHeightNormal,
1006
+ distanceForBottom,
1007
+ adjustHeightOffsetScratch
1008
+ );
1009
+ Cartesian3_default.add(bottom, adjustHeightOffset, adjustHeightBottom);
1010
+ const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;
1011
+ adjustHeightOffset = Cartesian3_default.multiplyByScalar(
1012
+ adjustHeightNormal,
1013
+ distanceForTop,
1014
+ adjustHeightOffsetScratch
1015
+ );
1016
+ Cartesian3_default.add(top, adjustHeightOffset, adjustHeightTop);
1017
+ }
1018
+ var nudgeDirectionScratch = new Cartesian3_default();
1019
+ function nudgeXZ(start, end) {
1020
+ const startToXZdistance = Plane_default.getPointDistance(XZ_PLANE, start);
1021
+ const endToXZdistance = Plane_default.getPointDistance(XZ_PLANE, end);
1022
+ let offset = nudgeDirectionScratch;
1023
+ if (Math_default.equalsEpsilon(startToXZdistance, 0, Math_default.EPSILON2)) {
1024
+ offset = direction(end, start, offset);
1025
+ Cartesian3_default.multiplyByScalar(offset, Math_default.EPSILON2, offset);
1026
+ Cartesian3_default.add(start, offset, start);
1027
+ } else if (Math_default.equalsEpsilon(endToXZdistance, 0, Math_default.EPSILON2)) {
1028
+ offset = direction(start, end, offset);
1029
+ Cartesian3_default.multiplyByScalar(offset, Math_default.EPSILON2, offset);
1030
+ Cartesian3_default.add(end, offset, end);
1031
+ }
1032
+ }
1033
+ function nudgeCartographic(start, end) {
1034
+ const absStartLon = Math.abs(start.longitude);
1035
+ const absEndLon = Math.abs(end.longitude);
1036
+ if (Math_default.equalsEpsilon(absStartLon, Math_default.PI, Math_default.EPSILON11)) {
1037
+ const endSign = Math_default.sign(end.longitude);
1038
+ start.longitude = endSign * (absStartLon - Math_default.EPSILON11);
1039
+ return 1;
1040
+ } else if (Math_default.equalsEpsilon(absEndLon, Math_default.PI, Math_default.EPSILON11)) {
1041
+ const startSign = Math_default.sign(start.longitude);
1042
+ end.longitude = startSign * (absEndLon - Math_default.EPSILON11);
1043
+ return 2;
1044
+ }
1045
+ return 0;
1046
+ }
1047
+ var startCartographicScratch = new Cartographic_default();
1048
+ var endCartographicScratch = new Cartographic_default();
1049
+ var segmentStartTopScratch = new Cartesian3_default();
1050
+ var segmentEndTopScratch = new Cartesian3_default();
1051
+ var segmentStartBottomScratch = new Cartesian3_default();
1052
+ var segmentEndBottomScratch = new Cartesian3_default();
1053
+ var segmentStartNormalScratch = new Cartesian3_default();
1054
+ var segmentEndNormalScratch = new Cartesian3_default();
1055
+ var getHeightCartographics = [
1056
+ startCartographicScratch,
1057
+ endCartographicScratch
1058
+ ];
1059
+ var getHeightRectangleScratch = new Rectangle_default();
1060
+ var adjustHeightStartTopScratch = new Cartesian3_default();
1061
+ var adjustHeightEndTopScratch = new Cartesian3_default();
1062
+ var adjustHeightStartBottomScratch = new Cartesian3_default();
1063
+ var adjustHeightEndBottomScratch = new Cartesian3_default();
1064
+ var segmentStart2DScratch = new Cartesian3_default();
1065
+ var segmentEnd2DScratch = new Cartesian3_default();
1066
+ var segmentStartNormal2DScratch = new Cartesian3_default();
1067
+ var segmentEndNormal2DScratch = new Cartesian3_default();
1068
+ var offsetScratch = new Cartesian3_default();
1069
+ var startUpScratch = new Cartesian3_default();
1070
+ var endUpScratch = new Cartesian3_default();
1071
+ var rightScratch = new Cartesian3_default();
1072
+ var startPlaneNormalScratch = new Cartesian3_default();
1073
+ var endPlaneNormalScratch = new Cartesian3_default();
1074
+ var encodeScratch = new EncodedCartesian3_default();
1075
+ var encodeScratch2D = new EncodedCartesian3_default();
1076
+ var forwardOffset2DScratch = new Cartesian3_default();
1077
+ var right2DScratch = new Cartesian3_default();
1078
+ var normalNudgeScratch = new Cartesian3_default();
1079
+ var scratchBoundingSpheres = [new BoundingSphere_default(), new BoundingSphere_default()];
1080
+ var REFERENCE_INDICES = [
1081
+ 0,
1082
+ 2,
1083
+ 1,
1084
+ 0,
1085
+ 3,
1086
+ 2,
1087
+ // right
1088
+ 0,
1089
+ 7,
1090
+ 3,
1091
+ 0,
1092
+ 4,
1093
+ 7,
1094
+ // start
1095
+ 0,
1096
+ 5,
1097
+ 4,
1098
+ 0,
1099
+ 1,
1100
+ 5,
1101
+ // bottom
1102
+ 5,
1103
+ 7,
1104
+ 4,
1105
+ 5,
1106
+ 6,
1107
+ 7,
1108
+ // left
1109
+ 5,
1110
+ 2,
1111
+ 6,
1112
+ 5,
1113
+ 1,
1114
+ 2,
1115
+ // end
1116
+ 3,
1117
+ 6,
1118
+ 2,
1119
+ 3,
1120
+ 7,
1121
+ 6
1122
+ // top
1123
+ ];
1124
+ var REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;
1125
+ function generateGeometryAttributes(loop, projection, bottomPositionsArray, topPositionsArray, normalsArray, cartographicsArray, compute2dAttributes) {
1126
+ let i;
1127
+ let index;
1128
+ const ellipsoid = projection._ellipsoid;
1129
+ const segmentCount = bottomPositionsArray.length / 3 - 1;
1130
+ const vertexCount = segmentCount * 8;
1131
+ const arraySizeVec4 = vertexCount * 4;
1132
+ const indexCount = segmentCount * 36;
1133
+ const indices = vertexCount > 65535 ? new Uint32Array(indexCount) : new Uint16Array(indexCount);
1134
+ const positionsArray = new Float64Array(vertexCount * 3);
1135
+ const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);
1136
+ const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);
1137
+ const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);
1138
+ const endNormalAndTextureCoordinateNormalizationX = new Float32Array(
1139
+ arraySizeVec4
1140
+ );
1141
+ const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(
1142
+ arraySizeVec4
1143
+ );
1144
+ let startHiLo2D;
1145
+ let offsetAndRight2D;
1146
+ let startEndNormals2D;
1147
+ let texcoordNormalization2D;
1148
+ if (compute2dAttributes) {
1149
+ startHiLo2D = new Float32Array(arraySizeVec4);
1150
+ offsetAndRight2D = new Float32Array(arraySizeVec4);
1151
+ startEndNormals2D = new Float32Array(arraySizeVec4);
1152
+ texcoordNormalization2D = new Float32Array(vertexCount * 2);
1153
+ }
1154
+ const cartographicsLength = cartographicsArray.length / 2;
1155
+ let length2D = 0;
1156
+ const startCartographic = startCartographicScratch;
1157
+ startCartographic.height = 0;
1158
+ const endCartographic = endCartographicScratch;
1159
+ endCartographic.height = 0;
1160
+ let segmentStartCartesian = segmentStartTopScratch;
1161
+ let segmentEndCartesian = segmentEndTopScratch;
1162
+ if (compute2dAttributes) {
1163
+ index = 0;
1164
+ for (i = 1; i < cartographicsLength; i++) {
1165
+ startCartographic.latitude = cartographicsArray[index];
1166
+ startCartographic.longitude = cartographicsArray[index + 1];
1167
+ endCartographic.latitude = cartographicsArray[index + 2];
1168
+ endCartographic.longitude = cartographicsArray[index + 3];
1169
+ segmentStartCartesian = projection.project(
1170
+ startCartographic,
1171
+ segmentStartCartesian
1172
+ );
1173
+ segmentEndCartesian = projection.project(
1174
+ endCartographic,
1175
+ segmentEndCartesian
1176
+ );
1177
+ length2D += Cartesian3_default.distance(
1178
+ segmentStartCartesian,
1179
+ segmentEndCartesian
1180
+ );
1181
+ index += 2;
1599
1182
  }
1600
-
1601
- // 3D
1602
- const positionsLength = topPositionsArray.length / 3;
1603
- segmentEndCartesian = Matrix3.Cartesian3.unpack(
1183
+ }
1184
+ const positionsLength = topPositionsArray.length / 3;
1185
+ segmentEndCartesian = Cartesian3_default.unpack(
1186
+ topPositionsArray,
1187
+ 0,
1188
+ segmentEndCartesian
1189
+ );
1190
+ let length3D = 0;
1191
+ index = 3;
1192
+ for (i = 1; i < positionsLength; i++) {
1193
+ segmentStartCartesian = Cartesian3_default.clone(
1194
+ segmentEndCartesian,
1195
+ segmentStartCartesian
1196
+ );
1197
+ segmentEndCartesian = Cartesian3_default.unpack(
1604
1198
  topPositionsArray,
1605
- 0,
1199
+ index,
1606
1200
  segmentEndCartesian
1607
1201
  );
1608
- let length3D = 0.0;
1609
-
1610
- index = 3;
1611
- for (i = 1; i < positionsLength; i++) {
1612
- segmentStartCartesian = Matrix3.Cartesian3.clone(
1613
- segmentEndCartesian,
1614
- segmentStartCartesian
1202
+ length3D += Cartesian3_default.distance(segmentStartCartesian, segmentEndCartesian);
1203
+ index += 3;
1204
+ }
1205
+ let j;
1206
+ index = 3;
1207
+ let cartographicsIndex = 0;
1208
+ let vec2sWriteIndex = 0;
1209
+ let vec3sWriteIndex = 0;
1210
+ let vec4sWriteIndex = 0;
1211
+ let miterBroken = false;
1212
+ let endBottom = Cartesian3_default.unpack(
1213
+ bottomPositionsArray,
1214
+ 0,
1215
+ segmentEndBottomScratch
1216
+ );
1217
+ let endTop = Cartesian3_default.unpack(topPositionsArray, 0, segmentEndTopScratch);
1218
+ let endGeometryNormal = Cartesian3_default.unpack(
1219
+ normalsArray,
1220
+ 0,
1221
+ segmentEndNormalScratch
1222
+ );
1223
+ if (loop) {
1224
+ const preEndBottom = Cartesian3_default.unpack(
1225
+ bottomPositionsArray,
1226
+ bottomPositionsArray.length - 6,
1227
+ segmentStartBottomScratch
1228
+ );
1229
+ if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {
1230
+ endGeometryNormal = Cartesian3_default.negate(
1231
+ endGeometryNormal,
1232
+ endGeometryNormal
1615
1233
  );
1616
- segmentEndCartesian = Matrix3.Cartesian3.unpack(
1617
- topPositionsArray,
1618
- index,
1619
- segmentEndCartesian
1234
+ }
1235
+ }
1236
+ let lengthSoFar3D = 0;
1237
+ let lengthSoFar2D = 0;
1238
+ let sumHeights = 0;
1239
+ for (i = 0; i < segmentCount; i++) {
1240
+ const startBottom = Cartesian3_default.clone(endBottom, segmentStartBottomScratch);
1241
+ const startTop = Cartesian3_default.clone(endTop, segmentStartTopScratch);
1242
+ let startGeometryNormal = Cartesian3_default.clone(
1243
+ endGeometryNormal,
1244
+ segmentStartNormalScratch
1245
+ );
1246
+ if (miterBroken) {
1247
+ startGeometryNormal = Cartesian3_default.negate(
1248
+ startGeometryNormal,
1249
+ startGeometryNormal
1620
1250
  );
1621
- length3D += Matrix3.Cartesian3.distance(segmentStartCartesian, segmentEndCartesian);
1622
- index += 3;
1623
1251
  }
1624
-
1625
- /*** Generate segments ***/
1626
- let j;
1627
- index = 3;
1628
- let cartographicsIndex = 0;
1629
- let vec2sWriteIndex = 0;
1630
- let vec3sWriteIndex = 0;
1631
- let vec4sWriteIndex = 0;
1632
- let miterBroken = false;
1633
-
1634
- let endBottom = Matrix3.Cartesian3.unpack(
1252
+ endBottom = Cartesian3_default.unpack(
1635
1253
  bottomPositionsArray,
1636
- 0,
1254
+ index,
1637
1255
  segmentEndBottomScratch
1638
1256
  );
1639
- let endTop = Matrix3.Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch);
1640
- let endGeometryNormal = Matrix3.Cartesian3.unpack(
1257
+ endTop = Cartesian3_default.unpack(topPositionsArray, index, segmentEndTopScratch);
1258
+ endGeometryNormal = Cartesian3_default.unpack(
1641
1259
  normalsArray,
1642
- 0,
1260
+ index,
1643
1261
  segmentEndNormalScratch
1644
1262
  );
1645
-
1646
- if (loop) {
1647
- const preEndBottom = Matrix3.Cartesian3.unpack(
1648
- bottomPositionsArray,
1649
- bottomPositionsArray.length - 6,
1650
- segmentStartBottomScratch
1651
- );
1652
- if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {
1653
- // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom)
1654
- endGeometryNormal = Matrix3.Cartesian3.negate(
1655
- endGeometryNormal,
1656
- endGeometryNormal
1657
- );
1658
- }
1659
- }
1660
-
1661
- let lengthSoFar3D = 0.0;
1662
- let lengthSoFar2D = 0.0;
1663
-
1664
- // For translating bounding volume
1665
- let sumHeights = 0.0;
1666
-
1667
- for (i = 0; i < segmentCount; i++) {
1668
- const startBottom = Matrix3.Cartesian3.clone(endBottom, segmentStartBottomScratch);
1669
- const startTop = Matrix3.Cartesian3.clone(endTop, segmentStartTopScratch);
1670
- let startGeometryNormal = Matrix3.Cartesian3.clone(
1671
- endGeometryNormal,
1672
- segmentStartNormalScratch
1673
- );
1674
-
1675
- if (miterBroken) {
1676
- startGeometryNormal = Matrix3.Cartesian3.negate(
1263
+ miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);
1264
+ startCartographic.latitude = cartographicsArray[cartographicsIndex];
1265
+ startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];
1266
+ endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];
1267
+ endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];
1268
+ let start2D;
1269
+ let end2D;
1270
+ let startGeometryNormal2D;
1271
+ let endGeometryNormal2D;
1272
+ if (compute2dAttributes) {
1273
+ const nudgeResult = nudgeCartographic(startCartographic, endCartographic);
1274
+ start2D = projection.project(startCartographic, segmentStart2DScratch);
1275
+ end2D = projection.project(endCartographic, segmentEnd2DScratch);
1276
+ const direction2D = direction(end2D, start2D, forwardOffset2DScratch);
1277
+ direction2D.y = Math.abs(direction2D.y);
1278
+ startGeometryNormal2D = segmentStartNormal2DScratch;
1279
+ endGeometryNormal2D = segmentEndNormal2DScratch;
1280
+ if (nudgeResult === 0 || Cartesian3_default.dot(direction2D, Cartesian3_default.UNIT_Y) > MITER_BREAK_SMALL) {
1281
+ startGeometryNormal2D = projectNormal(
1282
+ projection,
1283
+ startCartographic,
1677
1284
  startGeometryNormal,
1678
- startGeometryNormal
1679
- );
1680
- }
1681
-
1682
- endBottom = Matrix3.Cartesian3.unpack(
1683
- bottomPositionsArray,
1684
- index,
1685
- segmentEndBottomScratch
1686
- );
1687
- endTop = Matrix3.Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch);
1688
- endGeometryNormal = Matrix3.Cartesian3.unpack(
1689
- normalsArray,
1690
- index,
1691
- segmentEndNormalScratch
1692
- );
1693
-
1694
- miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);
1695
-
1696
- // 2D - don't clone anything from previous segment b/c possible IDL touch
1697
- startCartographic.latitude = cartographicsArray[cartographicsIndex];
1698
- startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];
1699
- endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];
1700
- endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];
1701
- let start2D;
1702
- let end2D;
1703
- let startGeometryNormal2D;
1704
- let endGeometryNormal2D;
1705
-
1706
- if (compute2dAttributes) {
1707
- const nudgeResult = nudgeCartographic(startCartographic, endCartographic);
1708
- start2D = projection.project(startCartographic, segmentStart2DScratch);
1709
- end2D = projection.project(endCartographic, segmentEnd2DScratch);
1710
- const direction2D = direction(end2D, start2D, forwardOffset2DScratch);
1711
- direction2D.y = Math.abs(direction2D.y);
1712
-
1713
- startGeometryNormal2D = segmentStartNormal2DScratch;
1714
- endGeometryNormal2D = segmentEndNormal2DScratch;
1715
- if (
1716
- nudgeResult === 0 ||
1717
- Matrix3.Cartesian3.dot(direction2D, Matrix3.Cartesian3.UNIT_Y) > MITER_BREAK_SMALL
1718
- ) {
1719
- // No nudge - project the original normal
1720
- // Or, if the line's angle relative to the IDL is very acute,
1721
- // in which case snapping will produce oddly shaped volumes.
1722
- startGeometryNormal2D = projectNormal(
1723
- projection,
1724
- startCartographic,
1725
- startGeometryNormal,
1726
- start2D,
1727
- segmentStartNormal2DScratch
1728
- );
1729
- endGeometryNormal2D = projectNormal(
1730
- projection,
1731
- endCartographic,
1732
- endGeometryNormal,
1733
- end2D,
1734
- segmentEndNormal2DScratch
1735
- );
1736
- } else if (nudgeResult === 1) {
1737
- // Start is close to IDL - snap start normal to align with IDL
1738
- endGeometryNormal2D = projectNormal(
1739
- projection,
1740
- endCartographic,
1741
- endGeometryNormal,
1742
- end2D,
1743
- segmentEndNormal2DScratch
1744
- );
1745
- startGeometryNormal2D.x = 0.0;
1746
- // If start longitude is negative and end longitude is less negative, relative right is unit -Y
1747
- // If start longitude is positive and end longitude is less positive, relative right is unit +Y
1748
- startGeometryNormal2D.y = Math$1.CesiumMath.sign(
1749
- startCartographic.longitude - Math.abs(endCartographic.longitude)
1750
- );
1751
- startGeometryNormal2D.z = 0.0;
1752
- } else {
1753
- // End is close to IDL - snap end normal to align with IDL
1754
- startGeometryNormal2D = projectNormal(
1755
- projection,
1756
- startCartographic,
1757
- startGeometryNormal,
1758
- start2D,
1759
- segmentStartNormal2DScratch
1760
- );
1761
- endGeometryNormal2D.x = 0.0;
1762
- // If end longitude is negative and start longitude is less negative, relative right is unit Y
1763
- // If end longitude is positive and start longitude is less positive, relative right is unit -Y
1764
- endGeometryNormal2D.y = Math$1.CesiumMath.sign(
1765
- startCartographic.longitude - endCartographic.longitude
1766
- );
1767
- endGeometryNormal2D.z = 0.0;
1768
- }
1769
- }
1770
-
1771
- /****************************************
1772
- * Geometry descriptors of a "line on terrain,"
1773
- * as opposed to the "shadow volume used to draw
1774
- * the line on terrain":
1775
- * - position of start + offset to end
1776
- * - start, end, and right-facing planes
1777
- * - encoded texture coordinate offsets
1778
- ****************************************/
1779
-
1780
- /* 3D */
1781
- const segmentLength3D = Matrix3.Cartesian3.distance(startTop, endTop);
1782
-
1783
- const encodedStart = EncodedCartesian3.EncodedCartesian3.fromCartesian(
1784
- startBottom,
1785
- encodeScratch
1786
- );
1787
- const forwardOffset = Matrix3.Cartesian3.subtract(
1788
- endBottom,
1789
- startBottom,
1790
- offsetScratch
1791
- );
1792
- const forward = Matrix3.Cartesian3.normalize(forwardOffset, rightScratch);
1793
-
1794
- let startUp = Matrix3.Cartesian3.subtract(startTop, startBottom, startUpScratch);
1795
- startUp = Matrix3.Cartesian3.normalize(startUp, startUp);
1796
- let rightNormal = Matrix3.Cartesian3.cross(forward, startUp, rightScratch);
1797
- rightNormal = Matrix3.Cartesian3.normalize(rightNormal, rightNormal);
1798
-
1799
- let startPlaneNormal = Matrix3.Cartesian3.cross(
1800
- startUp,
1801
- startGeometryNormal,
1802
- startPlaneNormalScratch
1803
- );
1804
- startPlaneNormal = Matrix3.Cartesian3.normalize(startPlaneNormal, startPlaneNormal);
1805
-
1806
- let endUp = Matrix3.Cartesian3.subtract(endTop, endBottom, endUpScratch);
1807
- endUp = Matrix3.Cartesian3.normalize(endUp, endUp);
1808
- let endPlaneNormal = Matrix3.Cartesian3.cross(
1809
- endGeometryNormal,
1810
- endUp,
1811
- endPlaneNormalScratch
1812
- );
1813
- endPlaneNormal = Matrix3.Cartesian3.normalize(endPlaneNormal, endPlaneNormal);
1814
-
1815
- const texcoordNormalization3DX = segmentLength3D / length3D;
1816
- const texcoordNormalization3DY = lengthSoFar3D / length3D;
1817
-
1818
- /* 2D */
1819
- let segmentLength2D = 0.0;
1820
- let encodedStart2D;
1821
- let forwardOffset2D;
1822
- let right2D;
1823
- let texcoordNormalization2DX = 0.0;
1824
- let texcoordNormalization2DY = 0.0;
1825
- if (compute2dAttributes) {
1826
- segmentLength2D = Matrix3.Cartesian3.distance(start2D, end2D);
1827
-
1828
- encodedStart2D = EncodedCartesian3.EncodedCartesian3.fromCartesian(
1829
1285
  start2D,
1830
- encodeScratch2D
1286
+ segmentStartNormal2DScratch
1831
1287
  );
1832
- forwardOffset2D = Matrix3.Cartesian3.subtract(
1288
+ endGeometryNormal2D = projectNormal(
1289
+ projection,
1290
+ endCartographic,
1291
+ endGeometryNormal,
1833
1292
  end2D,
1834
- start2D,
1835
- forwardOffset2DScratch
1293
+ segmentEndNormal2DScratch
1836
1294
  );
1837
-
1838
- // Right direction is just forward direction rotated by -90 degrees around Z
1839
- // Similarly with plane normals
1840
- right2D = Matrix3.Cartesian3.normalize(forwardOffset2D, right2DScratch);
1841
- const swap = right2D.x;
1842
- right2D.x = right2D.y;
1843
- right2D.y = -swap;
1844
-
1845
- texcoordNormalization2DX = segmentLength2D / length2D;
1846
- texcoordNormalization2DY = lengthSoFar2D / length2D;
1847
- }
1848
- /** Pack **/
1849
- for (j = 0; j < 8; j++) {
1850
- const vec4Index = vec4sWriteIndex + j * 4;
1851
- const vec2Index = vec2sWriteIndex + j * 2;
1852
- const wIndex = vec4Index + 3;
1853
-
1854
- // Encode sidedness of vertex relative to right plane in texture coordinate normalization X,
1855
- // whether vertex is top or bottom of volume in sign/magnitude of normalization Y.
1856
- const rightPlaneSide = j < 4 ? 1.0 : -1.0;
1857
- const topBottomSide =
1858
- j === 2 || j === 3 || j === 6 || j === 7 ? 1.0 : -1.0;
1859
-
1860
- // 3D
1861
- Matrix3.Cartesian3.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);
1862
- startHiAndForwardOffsetX[wIndex] = forwardOffset.x;
1863
-
1864
- Matrix3.Cartesian3.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);
1865
- startLoAndForwardOffsetY[wIndex] = forwardOffset.y;
1866
-
1867
- Matrix3.Cartesian3.pack(
1868
- startPlaneNormal,
1869
- startNormalAndForwardOffsetZ,
1870
- vec4Index
1295
+ } else if (nudgeResult === 1) {
1296
+ endGeometryNormal2D = projectNormal(
1297
+ projection,
1298
+ endCartographic,
1299
+ endGeometryNormal,
1300
+ end2D,
1301
+ segmentEndNormal2DScratch
1871
1302
  );
1872
- startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;
1873
-
1874
- Matrix3.Cartesian3.pack(
1875
- endPlaneNormal,
1876
- endNormalAndTextureCoordinateNormalizationX,
1877
- vec4Index
1303
+ startGeometryNormal2D.x = 0;
1304
+ startGeometryNormal2D.y = Math_default.sign(
1305
+ startCartographic.longitude - Math.abs(endCartographic.longitude)
1878
1306
  );
1879
- endNormalAndTextureCoordinateNormalizationX[wIndex] =
1880
- texcoordNormalization3DX * rightPlaneSide;
1881
-
1882
- Matrix3.Cartesian3.pack(
1883
- rightNormal,
1884
- rightNormalAndTextureCoordinateNormalizationY,
1885
- vec4Index
1307
+ startGeometryNormal2D.z = 0;
1308
+ } else {
1309
+ startGeometryNormal2D = projectNormal(
1310
+ projection,
1311
+ startCartographic,
1312
+ startGeometryNormal,
1313
+ start2D,
1314
+ segmentStartNormal2DScratch
1886
1315
  );
1887
-
1888
- let texcoordNormalization = texcoordNormalization3DY * topBottomSide;
1889
- if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {
1890
- texcoordNormalization = 9.0; // some value greater than 1.0
1891
- }
1892
- rightNormalAndTextureCoordinateNormalizationY[
1893
- wIndex
1894
- ] = texcoordNormalization;
1895
-
1896
- // 2D
1897
- if (compute2dAttributes) {
1898
- startHiLo2D[vec4Index] = encodedStart2D.high.x;
1899
- startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;
1900
- startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;
1901
- startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;
1902
-
1903
- startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;
1904
- startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;
1905
- startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;
1906
- startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;
1907
-
1908
- offsetAndRight2D[vec4Index] = forwardOffset2D.x;
1909
- offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;
1910
- offsetAndRight2D[vec4Index + 2] = right2D.x;
1911
- offsetAndRight2D[vec4Index + 3] = right2D.y;
1912
-
1913
- texcoordNormalization2D[vec2Index] =
1914
- texcoordNormalization2DX * rightPlaneSide;
1915
-
1916
- texcoordNormalization = texcoordNormalization2DY * topBottomSide;
1917
- if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {
1918
- texcoordNormalization = 9.0; // some value greater than 1.0
1919
- }
1920
- texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;
1921
- }
1316
+ endGeometryNormal2D.x = 0;
1317
+ endGeometryNormal2D.y = Math_default.sign(
1318
+ startCartographic.longitude - endCartographic.longitude
1319
+ );
1320
+ endGeometryNormal2D.z = 0;
1922
1321
  }
1923
-
1924
- // Adjust height of volume in 3D
1925
- const adjustHeightStartBottom = adjustHeightStartBottomScratch;
1926
- const adjustHeightEndBottom = adjustHeightEndBottomScratch;
1927
- const adjustHeightStartTop = adjustHeightStartTopScratch;
1928
- const adjustHeightEndTop = adjustHeightEndTopScratch;
1929
-
1930
- const getHeightsRectangle = Matrix2.Rectangle.fromCartographicArray(
1931
- getHeightCartographics,
1932
- getHeightRectangleScratch
1933
- );
1934
- const minMaxHeights = ApproximateTerrainHeights$1.getMinimumMaximumHeights(
1935
- getHeightsRectangle,
1936
- ellipsoid
1937
- );
1938
- const minHeight = minMaxHeights.minimumTerrainHeight;
1939
- const maxHeight = minMaxHeights.maximumTerrainHeight;
1940
-
1941
- sumHeights += minHeight;
1942
- sumHeights += maxHeight;
1943
-
1944
- adjustHeights(
1945
- startBottom,
1946
- startTop,
1947
- minHeight,
1948
- maxHeight,
1949
- adjustHeightStartBottom,
1950
- adjustHeightStartTop
1322
+ }
1323
+ const segmentLength3D = Cartesian3_default.distance(startTop, endTop);
1324
+ const encodedStart = EncodedCartesian3_default.fromCartesian(
1325
+ startBottom,
1326
+ encodeScratch
1327
+ );
1328
+ const forwardOffset = Cartesian3_default.subtract(
1329
+ endBottom,
1330
+ startBottom,
1331
+ offsetScratch
1332
+ );
1333
+ const forward = Cartesian3_default.normalize(forwardOffset, rightScratch);
1334
+ let startUp = Cartesian3_default.subtract(startTop, startBottom, startUpScratch);
1335
+ startUp = Cartesian3_default.normalize(startUp, startUp);
1336
+ let rightNormal = Cartesian3_default.cross(forward, startUp, rightScratch);
1337
+ rightNormal = Cartesian3_default.normalize(rightNormal, rightNormal);
1338
+ let startPlaneNormal = Cartesian3_default.cross(
1339
+ startUp,
1340
+ startGeometryNormal,
1341
+ startPlaneNormalScratch
1342
+ );
1343
+ startPlaneNormal = Cartesian3_default.normalize(startPlaneNormal, startPlaneNormal);
1344
+ let endUp = Cartesian3_default.subtract(endTop, endBottom, endUpScratch);
1345
+ endUp = Cartesian3_default.normalize(endUp, endUp);
1346
+ let endPlaneNormal = Cartesian3_default.cross(
1347
+ endGeometryNormal,
1348
+ endUp,
1349
+ endPlaneNormalScratch
1350
+ );
1351
+ endPlaneNormal = Cartesian3_default.normalize(endPlaneNormal, endPlaneNormal);
1352
+ const texcoordNormalization3DX = segmentLength3D / length3D;
1353
+ const texcoordNormalization3DY = lengthSoFar3D / length3D;
1354
+ let segmentLength2D = 0;
1355
+ let encodedStart2D;
1356
+ let forwardOffset2D;
1357
+ let right2D;
1358
+ let texcoordNormalization2DX = 0;
1359
+ let texcoordNormalization2DY = 0;
1360
+ if (compute2dAttributes) {
1361
+ segmentLength2D = Cartesian3_default.distance(start2D, end2D);
1362
+ encodedStart2D = EncodedCartesian3_default.fromCartesian(
1363
+ start2D,
1364
+ encodeScratch2D
1951
1365
  );
1952
- adjustHeights(
1953
- endBottom,
1954
- endTop,
1955
- minHeight,
1956
- maxHeight,
1957
- adjustHeightEndBottom,
1958
- adjustHeightEndTop
1366
+ forwardOffset2D = Cartesian3_default.subtract(
1367
+ end2D,
1368
+ start2D,
1369
+ forwardOffset2DScratch
1959
1370
  );
1960
-
1961
- // Nudge the positions away from the "polyline" a little bit to prevent errors in GeometryPipeline
1962
- let normalNudge = Matrix3.Cartesian3.multiplyByScalar(
1963
- rightNormal,
1964
- Math$1.CesiumMath.EPSILON5,
1965
- normalNudgeScratch
1371
+ right2D = Cartesian3_default.normalize(forwardOffset2D, right2DScratch);
1372
+ const swap = right2D.x;
1373
+ right2D.x = right2D.y;
1374
+ right2D.y = -swap;
1375
+ texcoordNormalization2DX = segmentLength2D / length2D;
1376
+ texcoordNormalization2DY = lengthSoFar2D / length2D;
1377
+ }
1378
+ for (j = 0; j < 8; j++) {
1379
+ const vec4Index = vec4sWriteIndex + j * 4;
1380
+ const vec2Index = vec2sWriteIndex + j * 2;
1381
+ const wIndex = vec4Index + 3;
1382
+ const rightPlaneSide = j < 4 ? 1 : -1;
1383
+ const topBottomSide = j === 2 || j === 3 || j === 6 || j === 7 ? 1 : -1;
1384
+ Cartesian3_default.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);
1385
+ startHiAndForwardOffsetX[wIndex] = forwardOffset.x;
1386
+ Cartesian3_default.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);
1387
+ startLoAndForwardOffsetY[wIndex] = forwardOffset.y;
1388
+ Cartesian3_default.pack(
1389
+ startPlaneNormal,
1390
+ startNormalAndForwardOffsetZ,
1391
+ vec4Index
1966
1392
  );
1967
- Matrix3.Cartesian3.add(
1968
- adjustHeightStartBottom,
1969
- normalNudge,
1970
- adjustHeightStartBottom
1393
+ startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;
1394
+ Cartesian3_default.pack(
1395
+ endPlaneNormal,
1396
+ endNormalAndTextureCoordinateNormalizationX,
1397
+ vec4Index
1971
1398
  );
1972
- Matrix3.Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
1973
- Matrix3.Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
1974
- Matrix3.Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
1975
-
1976
- // If the segment is very close to the XZ plane, nudge the vertices slightly to avoid touching it.
1977
- nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
1978
- nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
1979
-
1980
- Matrix3.Cartesian3.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);
1981
- Matrix3.Cartesian3.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);
1982
- Matrix3.Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);
1983
- Matrix3.Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);
1984
-
1985
- normalNudge = Matrix3.Cartesian3.multiplyByScalar(
1399
+ endNormalAndTextureCoordinateNormalizationX[wIndex] = texcoordNormalization3DX * rightPlaneSide;
1400
+ Cartesian3_default.pack(
1986
1401
  rightNormal,
1987
- -2.0 * Math$1.CesiumMath.EPSILON5,
1988
- normalNudgeScratch
1989
- );
1990
- Matrix3.Cartesian3.add(
1991
- adjustHeightStartBottom,
1992
- normalNudge,
1993
- adjustHeightStartBottom
1994
- );
1995
- Matrix3.Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
1996
- Matrix3.Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
1997
- Matrix3.Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
1998
-
1999
- nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
2000
- nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
2001
-
2002
- Matrix3.Cartesian3.pack(
2003
- adjustHeightStartBottom,
2004
- positionsArray,
2005
- vec3sWriteIndex + 12
1402
+ rightNormalAndTextureCoordinateNormalizationY,
1403
+ vec4Index
2006
1404
  );
2007
- Matrix3.Cartesian3.pack(
2008
- adjustHeightEndBottom,
2009
- positionsArray,
2010
- vec3sWriteIndex + 15
2011
- );
2012
- Matrix3.Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);
2013
- Matrix3.Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);
2014
-
2015
- cartographicsIndex += 2;
2016
- index += 3;
2017
-
2018
- vec2sWriteIndex += 16;
2019
- vec3sWriteIndex += 24;
2020
- vec4sWriteIndex += 32;
2021
-
2022
- lengthSoFar3D += segmentLength3D;
2023
- lengthSoFar2D += segmentLength2D;
2024
- }
2025
-
2026
- index = 0;
2027
- let indexOffset = 0;
2028
- for (i = 0; i < segmentCount; i++) {
2029
- for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {
2030
- indices[index + j] = REFERENCE_INDICES[j] + indexOffset;
1405
+ let texcoordNormalization = texcoordNormalization3DY * topBottomSide;
1406
+ if (texcoordNormalization === 0 && topBottomSide < 0) {
1407
+ texcoordNormalization = 9;
1408
+ }
1409
+ rightNormalAndTextureCoordinateNormalizationY[wIndex] = texcoordNormalization;
1410
+ if (compute2dAttributes) {
1411
+ startHiLo2D[vec4Index] = encodedStart2D.high.x;
1412
+ startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;
1413
+ startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;
1414
+ startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;
1415
+ startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;
1416
+ startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;
1417
+ startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;
1418
+ startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;
1419
+ offsetAndRight2D[vec4Index] = forwardOffset2D.x;
1420
+ offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;
1421
+ offsetAndRight2D[vec4Index + 2] = right2D.x;
1422
+ offsetAndRight2D[vec4Index + 3] = right2D.y;
1423
+ texcoordNormalization2D[vec2Index] = texcoordNormalization2DX * rightPlaneSide;
1424
+ texcoordNormalization = texcoordNormalization2DY * topBottomSide;
1425
+ if (texcoordNormalization === 0 && topBottomSide < 0) {
1426
+ texcoordNormalization = 9;
1427
+ }
1428
+ texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;
2031
1429
  }
2032
- indexOffset += 8;
2033
- index += REFERENCE_INDICES_LENGTH;
2034
1430
  }
2035
-
2036
- const boundingSpheres = scratchBoundingSpheres;
2037
- Transforms.BoundingSphere.fromVertices(
2038
- bottomPositionsArray,
2039
- Matrix3.Cartesian3.ZERO,
2040
- 3,
2041
- boundingSpheres[0]
1431
+ const adjustHeightStartBottom = adjustHeightStartBottomScratch;
1432
+ const adjustHeightEndBottom = adjustHeightEndBottomScratch;
1433
+ const adjustHeightStartTop = adjustHeightStartTopScratch;
1434
+ const adjustHeightEndTop = adjustHeightEndTopScratch;
1435
+ const getHeightsRectangle = Rectangle_default.fromCartographicArray(
1436
+ getHeightCartographics,
1437
+ getHeightRectangleScratch
2042
1438
  );
2043
- Transforms.BoundingSphere.fromVertices(
2044
- topPositionsArray,
2045
- Matrix3.Cartesian3.ZERO,
2046
- 3,
2047
- boundingSpheres[1]
1439
+ const minMaxHeights = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
1440
+ getHeightsRectangle,
1441
+ ellipsoid
2048
1442
  );
2049
- const boundingSphere = Transforms.BoundingSphere.fromBoundingSpheres(boundingSpheres);
2050
-
2051
- // Adjust bounding sphere height and radius to cover more of the volume
2052
- boundingSphere.radius += sumHeights / (segmentCount * 2.0);
2053
-
2054
- const attributes = {
2055
- position: new GeometryAttribute.GeometryAttribute({
2056
- componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
2057
- componentsPerAttribute: 3,
2058
- normalize: false,
2059
- values: positionsArray,
2060
- }),
2061
- startHiAndForwardOffsetX: getVec4GeometryAttribute(
2062
- startHiAndForwardOffsetX
2063
- ),
2064
- startLoAndForwardOffsetY: getVec4GeometryAttribute(
2065
- startLoAndForwardOffsetY
2066
- ),
2067
- startNormalAndForwardOffsetZ: getVec4GeometryAttribute(
2068
- startNormalAndForwardOffsetZ
2069
- ),
2070
- endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(
2071
- endNormalAndTextureCoordinateNormalizationX
2072
- ),
2073
- rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(
2074
- rightNormalAndTextureCoordinateNormalizationY
2075
- ),
2076
- };
2077
-
2078
- if (compute2dAttributes) {
2079
- attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);
2080
- attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);
2081
- attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);
2082
- attributes.texcoordNormalization2D = new GeometryAttribute.GeometryAttribute({
2083
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
2084
- componentsPerAttribute: 2,
2085
- normalize: false,
2086
- values: texcoordNormalization2D,
2087
- });
1443
+ const minHeight = minMaxHeights.minimumTerrainHeight;
1444
+ const maxHeight = minMaxHeights.maximumTerrainHeight;
1445
+ sumHeights += Math.abs(minHeight);
1446
+ sumHeights += Math.abs(maxHeight);
1447
+ adjustHeights(
1448
+ startBottom,
1449
+ startTop,
1450
+ minHeight,
1451
+ maxHeight,
1452
+ adjustHeightStartBottom,
1453
+ adjustHeightStartTop
1454
+ );
1455
+ adjustHeights(
1456
+ endBottom,
1457
+ endTop,
1458
+ minHeight,
1459
+ maxHeight,
1460
+ adjustHeightEndBottom,
1461
+ adjustHeightEndTop
1462
+ );
1463
+ let normalNudge = Cartesian3_default.multiplyByScalar(
1464
+ rightNormal,
1465
+ Math_default.EPSILON5,
1466
+ normalNudgeScratch
1467
+ );
1468
+ Cartesian3_default.add(
1469
+ adjustHeightStartBottom,
1470
+ normalNudge,
1471
+ adjustHeightStartBottom
1472
+ );
1473
+ Cartesian3_default.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
1474
+ Cartesian3_default.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
1475
+ Cartesian3_default.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
1476
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
1477
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
1478
+ Cartesian3_default.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);
1479
+ Cartesian3_default.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);
1480
+ Cartesian3_default.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);
1481
+ Cartesian3_default.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);
1482
+ normalNudge = Cartesian3_default.multiplyByScalar(
1483
+ rightNormal,
1484
+ -2 * Math_default.EPSILON5,
1485
+ normalNudgeScratch
1486
+ );
1487
+ Cartesian3_default.add(
1488
+ adjustHeightStartBottom,
1489
+ normalNudge,
1490
+ adjustHeightStartBottom
1491
+ );
1492
+ Cartesian3_default.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
1493
+ Cartesian3_default.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
1494
+ Cartesian3_default.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
1495
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
1496
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
1497
+ Cartesian3_default.pack(
1498
+ adjustHeightStartBottom,
1499
+ positionsArray,
1500
+ vec3sWriteIndex + 12
1501
+ );
1502
+ Cartesian3_default.pack(
1503
+ adjustHeightEndBottom,
1504
+ positionsArray,
1505
+ vec3sWriteIndex + 15
1506
+ );
1507
+ Cartesian3_default.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);
1508
+ Cartesian3_default.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);
1509
+ cartographicsIndex += 2;
1510
+ index += 3;
1511
+ vec2sWriteIndex += 16;
1512
+ vec3sWriteIndex += 24;
1513
+ vec4sWriteIndex += 32;
1514
+ lengthSoFar3D += segmentLength3D;
1515
+ lengthSoFar2D += segmentLength2D;
1516
+ }
1517
+ index = 0;
1518
+ let indexOffset = 0;
1519
+ for (i = 0; i < segmentCount; i++) {
1520
+ for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {
1521
+ indices[index + j] = REFERENCE_INDICES[j] + indexOffset;
2088
1522
  }
2089
-
2090
- return new GeometryAttribute.Geometry({
2091
- attributes: attributes,
2092
- indices: indices,
2093
- boundingSphere: boundingSphere,
2094
- });
1523
+ indexOffset += 8;
1524
+ index += REFERENCE_INDICES_LENGTH;
2095
1525
  }
2096
-
2097
- function getVec4GeometryAttribute(typedArray) {
2098
- return new GeometryAttribute.GeometryAttribute({
2099
- componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
2100
- componentsPerAttribute: 4,
1526
+ const boundingSpheres = scratchBoundingSpheres;
1527
+ BoundingSphere_default.fromVertices(
1528
+ bottomPositionsArray,
1529
+ Cartesian3_default.ZERO,
1530
+ 3,
1531
+ boundingSpheres[0]
1532
+ );
1533
+ BoundingSphere_default.fromVertices(
1534
+ topPositionsArray,
1535
+ Cartesian3_default.ZERO,
1536
+ 3,
1537
+ boundingSpheres[1]
1538
+ );
1539
+ const boundingSphere = BoundingSphere_default.fromBoundingSpheres(boundingSpheres);
1540
+ boundingSphere.radius += sumHeights / (segmentCount * 2);
1541
+ const attributes = {
1542
+ position: new GeometryAttribute_default({
1543
+ componentDatatype: ComponentDatatype_default.DOUBLE,
1544
+ componentsPerAttribute: 3,
2101
1545
  normalize: false,
2102
- values: typedArray,
2103
- });
2104
- }
2105
-
2106
- /**
2107
- * Approximates an ellipsoid-tangent vector in 2D by projecting the end point into 2D.
2108
- * Exposed for testing.
2109
- *
2110
- * @param {MapProjection} projection Map Projection for projecting coordinates to 2D.
2111
- * @param {Cartographic} cartographic The cartographic origin point of the normal.
2112
- * Used to check if the normal crosses the IDL during projection.
2113
- * @param {Cartesian3} normal The normal in 3D.
2114
- * @param {Cartesian3} projectedPosition The projected origin point of the normal in 2D.
2115
- * @param {Cartesian3} result Result parameter on which to store the projected normal.
2116
- * @private
2117
- */
2118
- GroundPolylineGeometry._projectNormal = projectNormal;
2119
-
2120
- function createGroundPolylineGeometry(groundPolylineGeometry, offset) {
2121
- return ApproximateTerrainHeights$1.initialize().then(function () {
2122
- if (defaultValue.defined(offset)) {
2123
- groundPolylineGeometry = GroundPolylineGeometry.unpack(
2124
- groundPolylineGeometry,
2125
- offset
2126
- );
2127
- }
2128
- return GroundPolylineGeometry.createGeometry(groundPolylineGeometry);
1546
+ values: positionsArray
1547
+ }),
1548
+ startHiAndForwardOffsetX: getVec4GeometryAttribute(
1549
+ startHiAndForwardOffsetX
1550
+ ),
1551
+ startLoAndForwardOffsetY: getVec4GeometryAttribute(
1552
+ startLoAndForwardOffsetY
1553
+ ),
1554
+ startNormalAndForwardOffsetZ: getVec4GeometryAttribute(
1555
+ startNormalAndForwardOffsetZ
1556
+ ),
1557
+ endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(
1558
+ endNormalAndTextureCoordinateNormalizationX
1559
+ ),
1560
+ rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(
1561
+ rightNormalAndTextureCoordinateNormalizationY
1562
+ )
1563
+ };
1564
+ if (compute2dAttributes) {
1565
+ attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);
1566
+ attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);
1567
+ attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);
1568
+ attributes.texcoordNormalization2D = new GeometryAttribute_default({
1569
+ componentDatatype: ComponentDatatype_default.FLOAT,
1570
+ componentsPerAttribute: 2,
1571
+ normalize: false,
1572
+ values: texcoordNormalization2D
2129
1573
  });
2130
1574
  }
2131
-
2132
- return createGroundPolylineGeometry;
2133
-
2134
- }));
1575
+ return new Geometry_default({
1576
+ attributes,
1577
+ indices,
1578
+ boundingSphere
1579
+ });
1580
+ }
1581
+ function getVec4GeometryAttribute(typedArray) {
1582
+ return new GeometryAttribute_default({
1583
+ componentDatatype: ComponentDatatype_default.FLOAT,
1584
+ componentsPerAttribute: 4,
1585
+ normalize: false,
1586
+ values: typedArray
1587
+ });
1588
+ }
1589
+ GroundPolylineGeometry._projectNormal = projectNormal;
1590
+ var GroundPolylineGeometry_default = GroundPolylineGeometry;
1591
+
1592
+ // packages/engine/Source/Workers/createGroundPolylineGeometry.js
1593
+ function createGroundPolylineGeometry(groundPolylineGeometry, offset) {
1594
+ return ApproximateTerrainHeights_default.initialize().then(function() {
1595
+ if (defined_default(offset)) {
1596
+ groundPolylineGeometry = GroundPolylineGeometry_default.unpack(
1597
+ groundPolylineGeometry,
1598
+ offset
1599
+ );
1600
+ }
1601
+ return GroundPolylineGeometry_default.createGeometry(groundPolylineGeometry);
1602
+ });
1603
+ }
1604
+ var createGroundPolylineGeometry_default = createGroundPolylineGeometry;
1605
+ export {
1606
+ createGroundPolylineGeometry_default as default
1607
+ };