@vcmap/ui 5.0.0-rc.18 → 5.0.0-rc.21

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 (376) hide show
  1. package/README.md +6 -6
  2. package/build/build.js +2 -2
  3. package/build/buildCesium.js +3 -3
  4. package/build/buildHelpers.js +2 -1
  5. package/config/base.config.json +0 -4
  6. package/config/dev.config.json +35 -14
  7. package/config/www.config.json +4 -0
  8. package/dist/assets/cesium/Workers/ArcType-ce2e50ab.js +37 -0
  9. package/dist/assets/cesium/Workers/AttributeCompression-b646d393.js +716 -0
  10. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-ff186ccc.js +258 -0
  11. package/dist/assets/cesium/Workers/BoundingRectangle-be5924f4.js +369 -0
  12. package/dist/assets/cesium/Workers/BoxGeometry-12eeccaf.js +884 -0
  13. package/dist/assets/cesium/Workers/Check-666ab1a0.js +290 -0
  14. package/dist/assets/cesium/Workers/Color-a84038cb.js +2262 -0
  15. package/dist/assets/cesium/Workers/ComponentDatatype-f7b11d02.js +341 -0
  16. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-3272c1b3.js +132 -0
  17. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-0170e093.js +498 -0
  18. package/dist/assets/cesium/Workers/CylinderGeometry-7c5da648.js +467 -0
  19. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-372c07d8.js +63 -0
  20. package/dist/assets/cesium/Workers/EllipseGeometry-797d580e.js +1304 -0
  21. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-2939e1dc.js +366 -0
  22. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-8b50870f.js +443 -0
  23. package/dist/assets/cesium/Workers/EllipsoidGeodesic-98c62a56.js +520 -0
  24. package/dist/assets/cesium/Workers/EllipsoidGeometry-21c0e3a5.js +637 -0
  25. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-eff247c8.js +454 -0
  26. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-19756602.js +741 -0
  27. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-214683dc.js +373 -0
  28. package/dist/assets/cesium/Workers/EncodedCartesian3-81f70735.js +171 -0
  29. package/dist/assets/cesium/Workers/FrustumGeometry-ac42a6d9.js +2512 -0
  30. package/dist/assets/cesium/Workers/GeometryAttribute-7d6f1732.js +619 -0
  31. package/dist/assets/cesium/Workers/GeometryAttributes-f06a2792.js +91 -0
  32. package/dist/assets/cesium/Workers/GeometryInstance-451dc1cd.js +121 -0
  33. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-04332ce7.js +16 -0
  34. package/dist/assets/cesium/Workers/GeometryPipeline-ce4339ed.js +3690 -0
  35. package/dist/assets/cesium/Workers/IndexDatatype-a55ceaa1.js +200 -0
  36. package/dist/assets/cesium/Workers/IntersectionTests-f6e6bd8a.js +1836 -0
  37. package/dist/assets/cesium/Workers/Math-2dbd6b93.js +1330 -0
  38. package/dist/assets/cesium/Workers/Matrix2-13178034.js +7086 -0
  39. package/dist/assets/cesium/Workers/Matrix3-315394f6.js +4283 -0
  40. package/dist/assets/cesium/Workers/OrientedBoundingBox-04920dc7.js +1257 -0
  41. package/dist/assets/cesium/Workers/Plane-900aa728.js +309 -0
  42. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-a8680d96.js +1074 -0
  43. package/dist/assets/cesium/Workers/PolygonPipeline-844aab0a.js +1345 -0
  44. package/dist/assets/cesium/Workers/PolylinePipeline-32f36d2a.js +573 -0
  45. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-a510d657.js +781 -0
  46. package/dist/assets/cesium/Workers/PrimitivePipeline-ba38434a.js +966 -0
  47. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-bdba697e.js +280 -0
  48. package/dist/assets/cesium/Workers/RuntimeError-06c93819.js +68 -0
  49. package/dist/assets/cesium/Workers/TerrainEncoding-833187da.js +1227 -0
  50. package/dist/assets/cesium/Workers/Transforms-40229881.js +14696 -0
  51. package/dist/assets/cesium/Workers/VertexFormat-6b480673.js +312 -0
  52. package/dist/assets/cesium/Workers/WallGeometryLibrary-919eed92.js +211 -0
  53. package/dist/assets/cesium/Workers/WebGLConstants-a8cc3e8c.js +620 -0
  54. package/dist/assets/cesium/Workers/WebMercatorProjection-13a90d41.js +151 -0
  55. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-c2038105.js +129 -0
  56. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +1336 -4
  57. package/dist/assets/cesium/Workers/combine-ca22a614.js +82 -0
  58. package/dist/assets/cesium/Workers/combineGeometry.js +17 -25
  59. package/dist/assets/cesium/Workers/createBoxGeometry.js +12 -25
  60. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +313 -25
  61. package/dist/assets/cesium/Workers/createCircleGeometry.js +213 -25
  62. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +160 -25
  63. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +586 -25
  64. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +236 -25
  65. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1407 -25
  66. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +603 -25
  67. package/dist/assets/cesium/Workers/createCylinderGeometry.js +12 -25
  68. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +265 -25
  69. package/dist/assets/cesium/Workers/createEllipseGeometry.js +14 -25
  70. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +14 -25
  71. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +12 -25
  72. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +15 -25
  73. package/dist/assets/cesium/Workers/createFrustumGeometry.js +12 -25
  74. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +251 -25
  75. package/dist/assets/cesium/Workers/createGeometry.js +55 -25
  76. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +2134 -25
  77. package/dist/assets/cesium/Workers/createPlaneGeometry.js +250 -25
  78. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +115 -25
  79. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1420 -25
  80. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +683 -25
  81. package/dist/assets/cesium/Workers/createPolylineGeometry.js +571 -25
  82. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +411 -25
  83. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +301 -25
  84. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1476 -25
  85. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +535 -25
  86. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +458 -25
  87. package/dist/assets/cesium/Workers/createSphereGeometry.js +123 -25
  88. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +126 -25
  89. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +127 -25
  90. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +535 -25
  91. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +445 -25
  92. package/dist/assets/cesium/Workers/createVectorTilePoints.js +79 -25
  93. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +406 -25
  94. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +254 -25
  95. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +640 -25
  96. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2711 -27
  97. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +994 -25
  98. package/dist/assets/cesium/Workers/createWallGeometry.js +623 -25
  99. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +432 -25
  100. package/dist/assets/cesium/Workers/decodeDraco.js +381 -25
  101. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +3687 -25
  102. package/dist/assets/cesium/Workers/decodeI3S.js +1040 -0
  103. package/dist/assets/cesium/Workers/defaultValue-0a909f67.js +51 -0
  104. package/dist/assets/cesium/Workers/package.js +2 -2
  105. package/dist/assets/cesium/Workers/transcodeKTX2.js +1516 -25
  106. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +18 -2
  107. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1023 -25
  108. package/dist/assets/{cesium.2f992f.js → cesium.49585c.js} +112161 -108735
  109. package/dist/assets/cesium.js +1 -1
  110. package/dist/assets/{core.cb0408.js → core.59d4d1.js} +1616 -1629
  111. package/dist/assets/core.js +1 -1
  112. package/dist/assets/{index.bccdf969.js → index.a3861d4e.js} +1 -1
  113. package/dist/assets/{ol.5e3fd0.js → ol.c1c512.js} +6992 -6972
  114. package/dist/assets/ol.js +1 -1
  115. package/dist/assets/ui.80175f.css +1 -0
  116. package/dist/assets/{ui.08c48f.js → ui.80175f.js} +6121 -6785
  117. package/dist/assets/ui.js +1 -1
  118. package/dist/assets/{vue.228ead.js → vue.a08ab1.js} +0 -0
  119. package/dist/assets/vue.js +2 -2
  120. package/dist/assets/{vuetify.0b5039.css → vuetify.efc158.css} +0 -0
  121. package/dist/assets/{vuetify.0b5039.js → vuetify.efc158.js} +1 -1
  122. package/dist/assets/vuetify.js +2 -2
  123. package/dist/index.html +1 -1
  124. package/index.js +2 -1
  125. package/lib/cesium.js +1 -1
  126. package/package.json +3 -4
  127. package/plugins/{simple-graph → @vcmap/simple-graph}/README.md +1 -1
  128. package/plugins/{simple-graph → @vcmap/simple-graph}/SimpleGraphComponent.vue +0 -0
  129. package/plugins/{simple-graph → @vcmap/simple-graph}/index.js +0 -0
  130. package/plugins/{simple-graph → @vcmap/simple-graph}/package.json +0 -0
  131. package/plugins/{simple-graph → @vcmap/simple-graph}/simpleGraphView.js +0 -0
  132. package/plugins/@vcmap-show-case/README.md +20 -0
  133. package/plugins/{buttonExamples/ButtonExamples.vue → @vcmap-show-case/buttons-example/ButtonsExample.vue} +1 -1
  134. package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
  135. package/plugins/{buttonExamples → @vcmap-show-case/buttons-example}/index.js +16 -8
  136. package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
  137. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Categories.vue +7 -6
  138. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Category.vue +4 -3
  139. package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
  140. package/plugins/{categoryTest → @vcmap-show-case/category-tester}/index.js +12 -4
  141. package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
  142. package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
  143. package/plugins/{test → @vcmap-show-case/config-editor}/editor.vue +0 -0
  144. package/plugins/@vcmap-show-case/config-editor/index.js +47 -0
  145. package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
  146. package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
  147. package/plugins/@vcmap-show-case/context-menu-tester/index.js +33 -0
  148. package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
  149. package/plugins/{@vcmap/pluginExample/pluginExampleComponent.vue → @vcmap-show-case/form-inputs-example/FormInputsExample.vue} +14 -13
  150. package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
  151. package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
  152. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/exampleActions.js +1 -1
  153. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/index.js +23 -22
  154. package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
  155. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/validation.js +0 -0
  156. package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
  157. package/plugins/@vcmap-show-case/icons-example/allIconsComponent.vue +51 -0
  158. package/plugins/@vcmap-show-case/icons-example/index.js +44 -0
  159. package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
  160. package/plugins/{test/testList.vue → @vcmap-show-case/list-example/ListExample.vue} +1 -1
  161. package/plugins/@vcmap-show-case/list-example/README.md +3 -0
  162. package/plugins/@vcmap-show-case/list-example/index.js +44 -0
  163. package/plugins/@vcmap-show-case/list-example/package.json +5 -0
  164. package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
  165. package/plugins/{notifier → @vcmap-show-case/notifier-tester}/index.js +11 -6
  166. package/plugins/{notifier → @vcmap-show-case/notifier-tester}/notifierTester.vue +0 -0
  167. package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
  168. package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
  169. package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/TextfieldsExample.vue} +1 -7
  170. package/plugins/{example → @vcmap-show-case/textfields-example}/index.js +58 -62
  171. package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
  172. package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
  173. package/plugins/{test/windowManagerExample.vue → @vcmap-show-case/window-tester/WindowExample.vue} +36 -20
  174. package/plugins/{test → @vcmap-show-case/window-tester}/emptyComponent.vue +8 -3
  175. package/plugins/@vcmap-show-case/window-tester/index.js +62 -0
  176. package/plugins/{test → @vcmap-show-case/window-tester}/myCustomHeader.vue +0 -0
  177. package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
  178. package/plugins/{test → @vcmap-show-case/window-tester}/toolbox-data.js +9 -9
  179. package/plugins/{test/vcsContent.vue → @vcmap-show-case/window-tester/windowExampleContent.vue} +1 -5
  180. package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
  181. package/plugins/{wizardExample → @vcmap-show-case/wizard-example}/index.js +12 -6
  182. package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
  183. package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +95 -0
  184. package/plugins/package.json +2 -1
  185. package/src/actions/actionHelper.js +1 -3
  186. package/src/actions/stateRefAction.js +0 -10
  187. package/src/application/VcsApp.vue +42 -23
  188. package/src/application/VcsMap.vue +9 -0
  189. package/src/components/buttons/VcsActionButtonList.vue +1 -0
  190. package/src/components/form-inputs-controls/VcsCheckbox.vue +3 -1
  191. package/src/components/form-inputs-controls/VcsWizard.vue +17 -20
  192. package/src/components/form-inputs-controls/VcsWizardStep.vue +160 -0
  193. package/src/{icons → components/icons}/+all.js +0 -0
  194. package/src/{icons → components/icons}/2DAreaIcon.vue +0 -0
  195. package/src/{icons → components/icons}/2DDistanceIcon.vue +0 -0
  196. package/src/{icons → components/icons}/3DAreaIcon.vue +0 -0
  197. package/src/{icons → components/icons}/3DDistanceIcon.vue +0 -0
  198. package/src/{icons → components/icons}/3DHeightIcon.vue +0 -0
  199. package/src/{icons → components/icons}/AngleIcon.vue +0 -0
  200. package/src/{icons → components/icons}/AssociationsIcon.vue +0 -0
  201. package/src/{icons → components/icons}/AxisIcon.vue +0 -0
  202. package/src/{icons → components/icons}/BoundingBoxIcon.vue +0 -0
  203. package/src/{icons → components/icons}/CheckboxCheckedIcon.vue +0 -0
  204. package/src/{icons → components/icons}/CheckboxIcon.vue +0 -0
  205. package/src/{icons → components/icons}/CheckboxIndeterminateIcon.vue +0 -0
  206. package/src/{icons → components/icons}/CircleIcon.vue +0 -0
  207. package/src/{icons → components/icons}/ClippingHorizontalIcon.vue +0 -0
  208. package/src/{icons → components/icons}/ClippingIcon.vue +0 -0
  209. package/src/{icons → components/icons}/ClippingVerticalIcon.vue +0 -0
  210. package/src/{icons → components/icons}/ColorPickerIcon.vue +0 -0
  211. package/src/{icons → components/icons}/ColorSwatchIcon.vue +0 -0
  212. package/src/{icons → components/icons}/CommentIcon.vue +0 -0
  213. package/src/{icons → components/icons}/CompassIcon.vue +0 -0
  214. package/src/{icons → components/icons}/ComponentsIcon.vue +0 -0
  215. package/src/{icons → components/icons}/ConeIcon.vue +0 -0
  216. package/src/{icons → components/icons}/DimensionsHouseIcon.vue +0 -0
  217. package/src/{icons → components/icons}/EditIcon.vue +0 -0
  218. package/src/{icons → components/icons}/ElevationProfileIcon.vue +0 -0
  219. package/src/{icons → components/icons}/ExportAreaIcon.vue +0 -0
  220. package/src/{icons → components/icons}/ExportFlightIcon.vue +0 -0
  221. package/src/{icons → components/icons}/ExportIcon.vue +0 -0
  222. package/src/{icons → components/icons}/ExternalLinkIcon.vue +0 -0
  223. package/src/{icons → components/icons}/EyeIcon.vue +0 -0
  224. package/src/{icons → components/icons}/FastForwardIcon.vue +0 -0
  225. package/src/{icons → components/icons}/FilterIcon.vue +0 -0
  226. package/src/{icons → components/icons}/GlobalTerrainIcon.vue +0 -0
  227. package/src/{icons → components/icons}/GlobeNatureIcon.vue +0 -0
  228. package/src/{icons → components/icons}/GroundIcon.vue +0 -0
  229. package/src/{icons → components/icons}/HealthCareIndustriesIcon.vue +0 -0
  230. package/src/{icons → components/icons}/HelpIcon.vue +0 -0
  231. package/src/{icons → components/icons}/HideIcon.vue +0 -0
  232. package/src/{icons → components/icons}/HomePointIcon.vue +0 -0
  233. package/src/{icons → components/icons}/HospitalsIcon.vue +0 -0
  234. package/src/{icons → components/icons}/HouseIcon.vue +0 -0
  235. package/src/{icons → components/icons}/ImportIcon.vue +0 -0
  236. package/src/{icons → components/icons}/InfoIcon.vue +0 -0
  237. package/src/{icons → components/icons}/KebabIcon.vue +0 -0
  238. package/src/{icons → components/icons}/LabelIcon.vue +0 -0
  239. package/src/{icons → components/icons}/LayersIcon.vue +0 -0
  240. package/src/{icons → components/icons}/LegendIcon.vue +0 -0
  241. package/src/{icons → components/icons}/LineIcon.vue +0 -0
  242. package/src/{icons → components/icons}/LinkIcon.vue +0 -0
  243. package/src/{icons → components/icons}/LogoutIcon.vue +0 -0
  244. package/src/{icons → components/icons}/MapIcon.vue +0 -0
  245. package/src/{icons → components/icons}/MenuIcon.vue +0 -0
  246. package/src/{icons → components/icons}/MinusIcon.vue +0 -0
  247. package/src/{icons → components/icons}/ObjectAttributeIcon.vue +0 -0
  248. package/src/{icons → components/icons}/ObjectSelectIcon.vue +0 -0
  249. package/src/{icons → components/icons}/ObliqueViewIcon.vue +0 -0
  250. package/src/{icons → components/icons}/PdfIcon.vue +0 -0
  251. package/src/{icons → components/icons}/PedestrianIcon.vue +0 -0
  252. package/src/{icons → components/icons}/PenIcon.vue +0 -0
  253. package/src/{icons → components/icons}/PlayCircleIcon.vue +0 -0
  254. package/src/{icons → components/icons}/PlusIcon.vue +0 -0
  255. package/src/{icons → components/icons}/PoiIcon.vue +0 -0
  256. package/src/{icons → components/icons}/PointSelectIcon.vue +0 -0
  257. package/src/{icons → components/icons}/PolygonIcon.vue +0 -0
  258. package/src/{icons → components/icons}/PresentationModeIcon.vue +0 -0
  259. package/src/{icons → components/icons}/ProgressIcon.vue +0 -0
  260. package/src/{icons → components/icons}/QueryIcon.vue +0 -0
  261. package/src/{icons → components/icons}/RectangleIcon.vue +0 -0
  262. package/src/{icons → components/icons}/ReturnIcon.vue +0 -0
  263. package/src/{icons → components/icons}/RewindIcon.vue +0 -0
  264. package/src/{icons → components/icons}/RotateLeftIcon.vue +0 -0
  265. package/src/{icons → components/icons}/RotateRightIcon.vue +0 -0
  266. package/src/{icons → components/icons}/ScreenshotIcon.vue +0 -0
  267. package/src/{icons → components/icons}/SearchIcon.vue +0 -0
  268. package/src/{icons → components/icons}/ShadowIcon.vue +0 -0
  269. package/src/{icons → components/icons}/ShapesIcon.vue +0 -0
  270. package/src/{icons → components/icons}/ShareIcon.vue +0 -0
  271. package/src/{icons → components/icons}/SimpleCircleFilledIcon.vue +0 -0
  272. package/src/{icons → components/icons}/SimpleCircleHalfFilledIcon.vue +0 -0
  273. package/src/{icons → components/icons}/SimpleCircleOutlinedIcon.vue +0 -0
  274. package/src/{icons → components/icons}/SkipNextIcon.vue +0 -0
  275. package/src/{icons → components/icons}/SkipPreviousIcon.vue +0 -0
  276. package/src/{icons → components/icons}/SplitViewIcon.vue +0 -0
  277. package/src/{icons → components/icons}/TerrainBoxIcon.vue +0 -0
  278. package/src/{icons → components/icons}/TextStyleIcon.vue +0 -0
  279. package/src/{icons → components/icons}/ThreeDimensionsIcon.vue +0 -0
  280. package/src/{icons → components/icons}/ToolsIcon.vue +0 -0
  281. package/src/{icons → components/icons}/TouchIcon.vue +0 -0
  282. package/src/{icons → components/icons}/TrashCanIcon.vue +0 -0
  283. package/src/{icons → components/icons}/TriangleIcon.vue +0 -0
  284. package/src/{icons → components/icons}/TwoDimensionsIcon.vue +0 -0
  285. package/src/{icons → components/icons}/UploadIcon.vue +0 -0
  286. package/src/{icons → components/icons}/UserProfileIcon.vue +0 -0
  287. package/src/{icons → components/icons}/UserShareIcon.vue +0 -0
  288. package/src/{icons → components/icons}/VideoRecorderIcon.vue +0 -0
  289. package/src/{icons → components/icons}/ViewpointFlightIcon.vue +0 -0
  290. package/src/{icons → components/icons}/ViewpointIcon.vue +0 -0
  291. package/src/{icons → components/icons}/Viewshed360Icon.vue +0 -0
  292. package/src/{icons → components/icons}/ViewshedConeIcon.vue +0 -0
  293. package/src/{icons → components/icons}/ViewshedIcon.vue +0 -0
  294. package/src/{icons → components/icons}/WalkingIcon.vue +0 -0
  295. package/src/{icons → components/icons}/WallIcon.vue +0 -0
  296. package/src/{icons → components/icons}/WandIcon.vue +0 -0
  297. package/src/components/lists/VcsList.vue +21 -12
  298. package/src/components/lists/VcsTreeviewLeaf.vue +14 -2
  299. package/src/components/notification/VcsTooltip.vue +1 -1
  300. package/src/featureInfo/abstractFeatureInfoView.js +1 -1
  301. package/src/featureInfo/addressBalloonFeatureInfoView.js +1 -1
  302. package/src/featureInfo/balloonFeatureInfoView.js +1 -1
  303. package/src/featureInfo/balloonHelper.js +6 -6
  304. package/src/featureInfo/featureInfo.js +2 -2
  305. package/src/i18n/de.js +2 -6
  306. package/src/i18n/en.js +2 -6
  307. package/src/legend/legendHelper.js +4 -3
  308. package/src/legend/vcsLegend.vue +21 -2
  309. package/src/manager/window/WindowComponent.vue +42 -4
  310. package/src/manager/window/WindowComponentHeader.vue +1 -1
  311. package/src/manager/window/windowHelper.js +7 -11
  312. package/src/manager/window/windowManager.js +15 -11
  313. package/src/navigation/mapNavCompass.vue +13 -7
  314. package/src/navigation/mapNavigation.vue +66 -4
  315. package/src/navigation/orientationToolsButton.vue +1 -1
  316. package/src/navigation/overviewMap.js +26 -10
  317. package/src/navigation/vcsCompass.vue +4 -73
  318. package/src/setup.js +1 -1
  319. package/src/vuePlugins/vuetify.js +1 -1
  320. package/dist/assets/cesium/Workers/ArcType-c9b2b290.js +0 -25
  321. package/dist/assets/cesium/Workers/AttributeCompression-7b0f288d.js +0 -25
  322. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-d0c22774.js +0 -25
  323. package/dist/assets/cesium/Workers/BoundingRectangle-201b1a81.js +0 -25
  324. package/dist/assets/cesium/Workers/BoxGeometry-4985457c.js +0 -25
  325. package/dist/assets/cesium/Workers/Color-cc8c18b3.js +0 -25
  326. package/dist/assets/cesium/Workers/ComponentDatatype-0200bf8c.js +0 -25
  327. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4345acdf.js +0 -25
  328. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-850a6c35.js +0 -25
  329. package/dist/assets/cesium/Workers/CylinderGeometry-57a1051a.js +0 -25
  330. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-62ce5a1f.js +0 -25
  331. package/dist/assets/cesium/Workers/EllipseGeometry-8627398f.js +0 -25
  332. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-e5919563.js +0 -25
  333. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-96fd4ae1.js +0 -25
  334. package/dist/assets/cesium/Workers/EllipsoidGeodesic-8bfefbff.js +0 -25
  335. package/dist/assets/cesium/Workers/EllipsoidGeometry-377329b9.js +0 -25
  336. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-e6e16e49.js +0 -25
  337. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-03528f73.js +0 -25
  338. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-c080fd1b.js +0 -25
  339. package/dist/assets/cesium/Workers/EncodedCartesian3-ea0e408f.js +0 -25
  340. package/dist/assets/cesium/Workers/FrustumGeometry-a8b5d817.js +0 -25
  341. package/dist/assets/cesium/Workers/GeometryAttribute-8458a8fd.js +0 -25
  342. package/dist/assets/cesium/Workers/GeometryAttributes-ac0f8485.js +0 -25
  343. package/dist/assets/cesium/Workers/GeometryInstance-ee3aa3ba.js +0 -25
  344. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-08ae0c50.js +0 -25
  345. package/dist/assets/cesium/Workers/GeometryPipeline-33ca229c.js +0 -25
  346. package/dist/assets/cesium/Workers/IndexDatatype-e713bfd2.js +0 -25
  347. package/dist/assets/cesium/Workers/IntersectionTests-eb4db8e0.js +0 -25
  348. package/dist/assets/cesium/Workers/Matrix2-eefef8eb.js +0 -25
  349. package/dist/assets/cesium/Workers/OrientedBoundingBox-5193f9a2.js +0 -25
  350. package/dist/assets/cesium/Workers/Plane-b0299683.js +0 -25
  351. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-b61295f3.js +0 -25
  352. package/dist/assets/cesium/Workers/PolygonPipeline-eb527514.js +0 -25
  353. package/dist/assets/cesium/Workers/PolylinePipeline-0f23dd84.js +0 -25
  354. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-2d903430.js +0 -25
  355. package/dist/assets/cesium/Workers/PrimitivePipeline-e2640413.js +0 -25
  356. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-ae8bf8a5.js +0 -25
  357. package/dist/assets/cesium/Workers/RuntimeError-5baf5c66.js +0 -25
  358. package/dist/assets/cesium/Workers/TerrainEncoding-bc10ab54.js +0 -25
  359. package/dist/assets/cesium/Workers/Transforms-d2e5867e.js +0 -63
  360. package/dist/assets/cesium/Workers/VertexFormat-5ec0d9ff.js +0 -25
  361. package/dist/assets/cesium/Workers/WallGeometryLibrary-1a33e416.js +0 -25
  362. package/dist/assets/cesium/Workers/WebGLConstants-5b50ced1.js +0 -25
  363. package/dist/assets/cesium/Workers/WebMercatorProjection-cd2f30c2.js +0 -25
  364. package/dist/assets/cesium/Workers/_commonjsHelpers-bc29abbc.js +0 -25
  365. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-f13aceb1.js +0 -25
  366. package/dist/assets/cesium/Workers/combine-7533016d.js +0 -25
  367. package/dist/assets/cesium/Workers/defaultValue-0c475b81.js +0 -25
  368. package/dist/assets/cesium/Workers/package.json +0 -1
  369. package/dist/assets/ui.08c48f.css +0 -1
  370. package/plugins/@vcmap/pluginExample/config.json +0 -6
  371. package/plugins/@vcmap/pluginExample/package.json +0 -7
  372. package/plugins/categoryTest/ItemEditor.vue +0 -13
  373. package/plugins/test/allIconsComponent.vue +0 -50
  374. package/plugins/test/index.js +0 -209
  375. package/plugins/wizardExample/wizardExample.vue +0 -77
  376. package/src/components/form-inputs-controls/VcsColorPicker.vue +0 -85
@@ -0,0 +1,1836 @@
1
+ define(['exports', './Matrix3-315394f6', './defaultValue-0a909f67', './Check-666ab1a0', './Transforms-40229881', './Math-2dbd6b93'], (function (exports, Matrix3, defaultValue, Check, Transforms, Math$1) { 'use strict';
2
+
3
+ /**
4
+ * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
5
+ *
6
+ * @namespace QuadraticRealPolynomial
7
+ */
8
+ const QuadraticRealPolynomial = {};
9
+
10
+ /**
11
+ * Provides the discriminant of the quadratic equation from the supplied coefficients.
12
+ *
13
+ * @param {Number} a The coefficient of the 2nd order monomial.
14
+ * @param {Number} b The coefficient of the 1st order monomial.
15
+ * @param {Number} c The coefficient of the 0th order monomial.
16
+ * @returns {Number} The value of the discriminant.
17
+ */
18
+ QuadraticRealPolynomial.computeDiscriminant = function (a, b, c) {
19
+ //>>includeStart('debug', pragmas.debug);
20
+ if (typeof a !== "number") {
21
+ throw new Check.DeveloperError("a is a required number.");
22
+ }
23
+ if (typeof b !== "number") {
24
+ throw new Check.DeveloperError("b is a required number.");
25
+ }
26
+ if (typeof c !== "number") {
27
+ throw new Check.DeveloperError("c is a required number.");
28
+ }
29
+ //>>includeEnd('debug');
30
+
31
+ const discriminant = b * b - 4.0 * a * c;
32
+ return discriminant;
33
+ };
34
+
35
+ function addWithCancellationCheck$1(left, right, tolerance) {
36
+ const difference = left + right;
37
+ if (
38
+ Math$1.CesiumMath.sign(left) !== Math$1.CesiumMath.sign(right) &&
39
+ Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance
40
+ ) {
41
+ return 0.0;
42
+ }
43
+
44
+ return difference;
45
+ }
46
+
47
+ /**
48
+ * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
49
+ *
50
+ * @param {Number} a The coefficient of the 2nd order monomial.
51
+ * @param {Number} b The coefficient of the 1st order monomial.
52
+ * @param {Number} c The coefficient of the 0th order monomial.
53
+ * @returns {Number[]} The real valued roots.
54
+ */
55
+ QuadraticRealPolynomial.computeRealRoots = function (a, b, c) {
56
+ //>>includeStart('debug', pragmas.debug);
57
+ if (typeof a !== "number") {
58
+ throw new Check.DeveloperError("a is a required number.");
59
+ }
60
+ if (typeof b !== "number") {
61
+ throw new Check.DeveloperError("b is a required number.");
62
+ }
63
+ if (typeof c !== "number") {
64
+ throw new Check.DeveloperError("c is a required number.");
65
+ }
66
+ //>>includeEnd('debug');
67
+
68
+ let ratio;
69
+ if (a === 0.0) {
70
+ if (b === 0.0) {
71
+ // Constant function: c = 0.
72
+ return [];
73
+ }
74
+
75
+ // Linear function: b * x + c = 0.
76
+ return [-c / b];
77
+ } else if (b === 0.0) {
78
+ if (c === 0.0) {
79
+ // 2nd order monomial: a * x^2 = 0.
80
+ return [0.0, 0.0];
81
+ }
82
+
83
+ const cMagnitude = Math.abs(c);
84
+ const aMagnitude = Math.abs(a);
85
+
86
+ if (
87
+ cMagnitude < aMagnitude &&
88
+ cMagnitude / aMagnitude < Math$1.CesiumMath.EPSILON14
89
+ ) {
90
+ // c ~= 0.0.
91
+ // 2nd order monomial: a * x^2 = 0.
92
+ return [0.0, 0.0];
93
+ } else if (
94
+ cMagnitude > aMagnitude &&
95
+ aMagnitude / cMagnitude < Math$1.CesiumMath.EPSILON14
96
+ ) {
97
+ // a ~= 0.0.
98
+ // Constant function: c = 0.
99
+ return [];
100
+ }
101
+
102
+ // a * x^2 + c = 0
103
+ ratio = -c / a;
104
+
105
+ if (ratio < 0.0) {
106
+ // Both roots are complex.
107
+ return [];
108
+ }
109
+
110
+ // Both roots are real.
111
+ const root = Math.sqrt(ratio);
112
+ return [-root, root];
113
+ } else if (c === 0.0) {
114
+ // a * x^2 + b * x = 0
115
+ ratio = -b / a;
116
+ if (ratio < 0.0) {
117
+ return [ratio, 0.0];
118
+ }
119
+
120
+ return [0.0, ratio];
121
+ }
122
+
123
+ // a * x^2 + b * x + c = 0
124
+ const b2 = b * b;
125
+ const four_ac = 4.0 * a * c;
126
+ const radicand = addWithCancellationCheck$1(b2, -four_ac, Math$1.CesiumMath.EPSILON14);
127
+
128
+ if (radicand < 0.0) {
129
+ // Both roots are complex.
130
+ return [];
131
+ }
132
+
133
+ const q =
134
+ -0.5 *
135
+ addWithCancellationCheck$1(
136
+ b,
137
+ Math$1.CesiumMath.sign(b) * Math.sqrt(radicand),
138
+ Math$1.CesiumMath.EPSILON14
139
+ );
140
+ if (b > 0.0) {
141
+ return [q / a, c / q];
142
+ }
143
+
144
+ return [c / q, q / a];
145
+ };
146
+ var QuadraticRealPolynomial$1 = QuadraticRealPolynomial;
147
+
148
+ /**
149
+ * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
150
+ *
151
+ * @namespace CubicRealPolynomial
152
+ */
153
+ const CubicRealPolynomial = {};
154
+
155
+ /**
156
+ * Provides the discriminant of the cubic equation from the supplied coefficients.
157
+ *
158
+ * @param {Number} a The coefficient of the 3rd order monomial.
159
+ * @param {Number} b The coefficient of the 2nd order monomial.
160
+ * @param {Number} c The coefficient of the 1st order monomial.
161
+ * @param {Number} d The coefficient of the 0th order monomial.
162
+ * @returns {Number} The value of the discriminant.
163
+ */
164
+ CubicRealPolynomial.computeDiscriminant = function (a, b, c, d) {
165
+ //>>includeStart('debug', pragmas.debug);
166
+ if (typeof a !== "number") {
167
+ throw new Check.DeveloperError("a is a required number.");
168
+ }
169
+ if (typeof b !== "number") {
170
+ throw new Check.DeveloperError("b is a required number.");
171
+ }
172
+ if (typeof c !== "number") {
173
+ throw new Check.DeveloperError("c is a required number.");
174
+ }
175
+ if (typeof d !== "number") {
176
+ throw new Check.DeveloperError("d is a required number.");
177
+ }
178
+ //>>includeEnd('debug');
179
+
180
+ const a2 = a * a;
181
+ const b2 = b * b;
182
+ const c2 = c * c;
183
+ const d2 = d * d;
184
+
185
+ const discriminant =
186
+ 18.0 * a * b * c * d +
187
+ b2 * c2 -
188
+ 27.0 * a2 * d2 -
189
+ 4.0 * (a * c2 * c + b2 * b * d);
190
+ return discriminant;
191
+ };
192
+
193
+ function computeRealRoots(a, b, c, d) {
194
+ const A = a;
195
+ const B = b / 3.0;
196
+ const C = c / 3.0;
197
+ const D = d;
198
+
199
+ const AC = A * C;
200
+ const BD = B * D;
201
+ const B2 = B * B;
202
+ const C2 = C * C;
203
+ const delta1 = A * C - B2;
204
+ const delta2 = A * D - B * C;
205
+ const delta3 = B * D - C2;
206
+
207
+ const discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;
208
+ let temp;
209
+ let temp1;
210
+
211
+ if (discriminant < 0.0) {
212
+ let ABar;
213
+ let CBar;
214
+ let DBar;
215
+
216
+ if (B2 * BD >= AC * C2) {
217
+ ABar = A;
218
+ CBar = delta1;
219
+ DBar = -2.0 * B * delta1 + A * delta2;
220
+ } else {
221
+ ABar = D;
222
+ CBar = delta3;
223
+ DBar = -D * delta2 + 2.0 * C * delta3;
224
+ }
225
+
226
+ const s = DBar < 0.0 ? -1.0 : 1.0; // This is not Math.Sign()!
227
+ const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);
228
+ temp1 = -DBar + temp0;
229
+
230
+ const x = temp1 / 2.0;
231
+ const p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);
232
+ const q = temp1 === temp0 ? -p : -CBar / p;
233
+
234
+ temp = CBar <= 0.0 ? p + q : -DBar / (p * p + q * q + CBar);
235
+
236
+ if (B2 * BD >= AC * C2) {
237
+ return [(temp - B) / A];
238
+ }
239
+
240
+ return [-D / (temp + C)];
241
+ }
242
+
243
+ const CBarA = delta1;
244
+ const DBarA = -2.0 * B * delta1 + A * delta2;
245
+
246
+ const CBarD = delta3;
247
+ const DBarD = -D * delta2 + 2.0 * C * delta3;
248
+
249
+ const squareRootOfDiscriminant = Math.sqrt(discriminant);
250
+ const halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;
251
+
252
+ let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);
253
+ temp = 2.0 * Math.sqrt(-CBarA);
254
+ let cosine = Math.cos(theta);
255
+ temp1 = temp * cosine;
256
+ let temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
257
+
258
+ const numeratorLarge = temp1 + temp3 > 2.0 * B ? temp1 - B : temp3 - B;
259
+ const denominatorLarge = A;
260
+
261
+ const root1 = numeratorLarge / denominatorLarge;
262
+
263
+ theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);
264
+ temp = 2.0 * Math.sqrt(-CBarD);
265
+ cosine = Math.cos(theta);
266
+ temp1 = temp * cosine;
267
+ temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
268
+
269
+ const numeratorSmall = -D;
270
+ const denominatorSmall = temp1 + temp3 < 2.0 * C ? temp1 + C : temp3 + C;
271
+
272
+ const root3 = numeratorSmall / denominatorSmall;
273
+
274
+ const E = denominatorLarge * denominatorSmall;
275
+ const F =
276
+ -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;
277
+ const G = numeratorLarge * numeratorSmall;
278
+
279
+ const root2 = (C * F - B * G) / (-B * F + C * E);
280
+
281
+ if (root1 <= root2) {
282
+ if (root1 <= root3) {
283
+ if (root2 <= root3) {
284
+ return [root1, root2, root3];
285
+ }
286
+ return [root1, root3, root2];
287
+ }
288
+ return [root3, root1, root2];
289
+ }
290
+ if (root1 <= root3) {
291
+ return [root2, root1, root3];
292
+ }
293
+ if (root2 <= root3) {
294
+ return [root2, root3, root1];
295
+ }
296
+ return [root3, root2, root1];
297
+ }
298
+
299
+ /**
300
+ * Provides the real valued roots of the cubic polynomial with the provided coefficients.
301
+ *
302
+ * @param {Number} a The coefficient of the 3rd order monomial.
303
+ * @param {Number} b The coefficient of the 2nd order monomial.
304
+ * @param {Number} c The coefficient of the 1st order monomial.
305
+ * @param {Number} d The coefficient of the 0th order monomial.
306
+ * @returns {Number[]} The real valued roots.
307
+ */
308
+ CubicRealPolynomial.computeRealRoots = function (a, b, c, d) {
309
+ //>>includeStart('debug', pragmas.debug);
310
+ if (typeof a !== "number") {
311
+ throw new Check.DeveloperError("a is a required number.");
312
+ }
313
+ if (typeof b !== "number") {
314
+ throw new Check.DeveloperError("b is a required number.");
315
+ }
316
+ if (typeof c !== "number") {
317
+ throw new Check.DeveloperError("c is a required number.");
318
+ }
319
+ if (typeof d !== "number") {
320
+ throw new Check.DeveloperError("d is a required number.");
321
+ }
322
+ //>>includeEnd('debug');
323
+
324
+ let roots;
325
+ let ratio;
326
+ if (a === 0.0) {
327
+ // Quadratic function: b * x^2 + c * x + d = 0.
328
+ return QuadraticRealPolynomial$1.computeRealRoots(b, c, d);
329
+ } else if (b === 0.0) {
330
+ if (c === 0.0) {
331
+ if (d === 0.0) {
332
+ // 3rd order monomial: a * x^3 = 0.
333
+ return [0.0, 0.0, 0.0];
334
+ }
335
+
336
+ // a * x^3 + d = 0
337
+ ratio = -d / a;
338
+ const root =
339
+ ratio < 0.0 ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);
340
+ return [root, root, root];
341
+ } else if (d === 0.0) {
342
+ // x * (a * x^2 + c) = 0.
343
+ roots = QuadraticRealPolynomial$1.computeRealRoots(a, 0, c);
344
+
345
+ // Return the roots in ascending order.
346
+ if (roots.Length === 0) {
347
+ return [0.0];
348
+ }
349
+ return [roots[0], 0.0, roots[1]];
350
+ }
351
+
352
+ // Deflated cubic polynomial: a * x^3 + c * x + d= 0.
353
+ return computeRealRoots(a, 0, c, d);
354
+ } else if (c === 0.0) {
355
+ if (d === 0.0) {
356
+ // x^2 * (a * x + b) = 0.
357
+ ratio = -b / a;
358
+ if (ratio < 0.0) {
359
+ return [ratio, 0.0, 0.0];
360
+ }
361
+ return [0.0, 0.0, ratio];
362
+ }
363
+ // a * x^3 + b * x^2 + d = 0.
364
+ return computeRealRoots(a, b, 0, d);
365
+ } else if (d === 0.0) {
366
+ // x * (a * x^2 + b * x + c) = 0
367
+ roots = QuadraticRealPolynomial$1.computeRealRoots(a, b, c);
368
+
369
+ // Return the roots in ascending order.
370
+ if (roots.length === 0) {
371
+ return [0.0];
372
+ } else if (roots[1] <= 0.0) {
373
+ return [roots[0], roots[1], 0.0];
374
+ } else if (roots[0] >= 0.0) {
375
+ return [0.0, roots[0], roots[1]];
376
+ }
377
+ return [roots[0], 0.0, roots[1]];
378
+ }
379
+
380
+ return computeRealRoots(a, b, c, d);
381
+ };
382
+ var CubicRealPolynomial$1 = CubicRealPolynomial;
383
+
384
+ /**
385
+ * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
386
+ *
387
+ * @namespace QuarticRealPolynomial
388
+ */
389
+ const QuarticRealPolynomial = {};
390
+
391
+ /**
392
+ * Provides the discriminant of the quartic equation from the supplied coefficients.
393
+ *
394
+ * @param {Number} a The coefficient of the 4th order monomial.
395
+ * @param {Number} b The coefficient of the 3rd order monomial.
396
+ * @param {Number} c The coefficient of the 2nd order monomial.
397
+ * @param {Number} d The coefficient of the 1st order monomial.
398
+ * @param {Number} e The coefficient of the 0th order monomial.
399
+ * @returns {Number} The value of the discriminant.
400
+ */
401
+ QuarticRealPolynomial.computeDiscriminant = function (a, b, c, d, e) {
402
+ //>>includeStart('debug', pragmas.debug);
403
+ if (typeof a !== "number") {
404
+ throw new Check.DeveloperError("a is a required number.");
405
+ }
406
+ if (typeof b !== "number") {
407
+ throw new Check.DeveloperError("b is a required number.");
408
+ }
409
+ if (typeof c !== "number") {
410
+ throw new Check.DeveloperError("c is a required number.");
411
+ }
412
+ if (typeof d !== "number") {
413
+ throw new Check.DeveloperError("d is a required number.");
414
+ }
415
+ if (typeof e !== "number") {
416
+ throw new Check.DeveloperError("e is a required number.");
417
+ }
418
+ //>>includeEnd('debug');
419
+
420
+ const a2 = a * a;
421
+ const a3 = a2 * a;
422
+ const b2 = b * b;
423
+ const b3 = b2 * b;
424
+ const c2 = c * c;
425
+ const c3 = c2 * c;
426
+ const d2 = d * d;
427
+ const d3 = d2 * d;
428
+ const e2 = e * e;
429
+ const e3 = e2 * e;
430
+
431
+ const discriminant =
432
+ b2 * c2 * d2 -
433
+ 4.0 * b3 * d3 -
434
+ 4.0 * a * c3 * d2 +
435
+ 18 * a * b * c * d3 -
436
+ 27.0 * a2 * d2 * d2 +
437
+ 256.0 * a3 * e3 +
438
+ e *
439
+ (18.0 * b3 * c * d -
440
+ 4.0 * b2 * c3 +
441
+ 16.0 * a * c2 * c2 -
442
+ 80.0 * a * b * c2 * d -
443
+ 6.0 * a * b2 * d2 +
444
+ 144.0 * a2 * c * d2) +
445
+ e2 *
446
+ (144.0 * a * b2 * c -
447
+ 27.0 * b2 * b2 -
448
+ 128.0 * a2 * c2 -
449
+ 192.0 * a2 * b * d);
450
+ return discriminant;
451
+ };
452
+
453
+ function original(a3, a2, a1, a0) {
454
+ const a3Squared = a3 * a3;
455
+
456
+ const p = a2 - (3.0 * a3Squared) / 8.0;
457
+ const q = a1 - (a2 * a3) / 2.0 + (a3Squared * a3) / 8.0;
458
+ const r =
459
+ a0 -
460
+ (a1 * a3) / 4.0 +
461
+ (a2 * a3Squared) / 16.0 -
462
+ (3.0 * a3Squared * a3Squared) / 256.0;
463
+
464
+ // Find the roots of the cubic equations: h^6 + 2 p h^4 + (p^2 - 4 r) h^2 - q^2 = 0.
465
+ const cubicRoots = CubicRealPolynomial$1.computeRealRoots(
466
+ 1.0,
467
+ 2.0 * p,
468
+ p * p - 4.0 * r,
469
+ -q * q
470
+ );
471
+
472
+ if (cubicRoots.length > 0) {
473
+ const temp = -a3 / 4.0;
474
+
475
+ // Use the largest positive root.
476
+ const hSquared = cubicRoots[cubicRoots.length - 1];
477
+
478
+ if (Math.abs(hSquared) < Math$1.CesiumMath.EPSILON14) {
479
+ // y^4 + p y^2 + r = 0.
480
+ const roots = QuadraticRealPolynomial$1.computeRealRoots(1.0, p, r);
481
+
482
+ if (roots.length === 2) {
483
+ const root0 = roots[0];
484
+ const root1 = roots[1];
485
+
486
+ let y;
487
+ if (root0 >= 0.0 && root1 >= 0.0) {
488
+ const y0 = Math.sqrt(root0);
489
+ const y1 = Math.sqrt(root1);
490
+
491
+ return [temp - y1, temp - y0, temp + y0, temp + y1];
492
+ } else if (root0 >= 0.0 && root1 < 0.0) {
493
+ y = Math.sqrt(root0);
494
+ return [temp - y, temp + y];
495
+ } else if (root0 < 0.0 && root1 >= 0.0) {
496
+ y = Math.sqrt(root1);
497
+ return [temp - y, temp + y];
498
+ }
499
+ }
500
+ return [];
501
+ } else if (hSquared > 0.0) {
502
+ const h = Math.sqrt(hSquared);
503
+
504
+ const m = (p + hSquared - q / h) / 2.0;
505
+ const n = (p + hSquared + q / h) / 2.0;
506
+
507
+ // Now solve the two quadratic factors: (y^2 + h y + m)(y^2 - h y + n);
508
+ const roots1 = QuadraticRealPolynomial$1.computeRealRoots(1.0, h, m);
509
+ const roots2 = QuadraticRealPolynomial$1.computeRealRoots(1.0, -h, n);
510
+
511
+ if (roots1.length !== 0) {
512
+ roots1[0] += temp;
513
+ roots1[1] += temp;
514
+
515
+ if (roots2.length !== 0) {
516
+ roots2[0] += temp;
517
+ roots2[1] += temp;
518
+
519
+ if (roots1[1] <= roots2[0]) {
520
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
521
+ } else if (roots2[1] <= roots1[0]) {
522
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
523
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
524
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
525
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
526
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
527
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
528
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
529
+ }
530
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
531
+ }
532
+ return roots1;
533
+ }
534
+
535
+ if (roots2.length !== 0) {
536
+ roots2[0] += temp;
537
+ roots2[1] += temp;
538
+
539
+ return roots2;
540
+ }
541
+ return [];
542
+ }
543
+ }
544
+ return [];
545
+ }
546
+
547
+ function neumark(a3, a2, a1, a0) {
548
+ const a1Squared = a1 * a1;
549
+ const a2Squared = a2 * a2;
550
+ const a3Squared = a3 * a3;
551
+
552
+ const p = -2.0 * a2;
553
+ const q = a1 * a3 + a2Squared - 4.0 * a0;
554
+ const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;
555
+
556
+ const cubicRoots = CubicRealPolynomial$1.computeRealRoots(1.0, p, q, r);
557
+
558
+ if (cubicRoots.length > 0) {
559
+ // Use the most positive root
560
+ const y = cubicRoots[0];
561
+
562
+ const temp = a2 - y;
563
+ const tempSquared = temp * temp;
564
+
565
+ const g1 = a3 / 2.0;
566
+ const h1 = temp / 2.0;
567
+
568
+ const m = tempSquared - 4.0 * a0;
569
+ const mError = tempSquared + 4.0 * Math.abs(a0);
570
+
571
+ const n = a3Squared - 4.0 * y;
572
+ const nError = a3Squared + 4.0 * Math.abs(y);
573
+
574
+ let g2;
575
+ let h2;
576
+
577
+ if (y < 0.0 || m * nError < n * mError) {
578
+ const squareRootOfN = Math.sqrt(n);
579
+ g2 = squareRootOfN / 2.0;
580
+ h2 = squareRootOfN === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfN;
581
+ } else {
582
+ const squareRootOfM = Math.sqrt(m);
583
+ g2 = squareRootOfM === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfM;
584
+ h2 = squareRootOfM / 2.0;
585
+ }
586
+
587
+ let G;
588
+ let g;
589
+ if (g1 === 0.0 && g2 === 0.0) {
590
+ G = 0.0;
591
+ g = 0.0;
592
+ } else if (Math$1.CesiumMath.sign(g1) === Math$1.CesiumMath.sign(g2)) {
593
+ G = g1 + g2;
594
+ g = y / G;
595
+ } else {
596
+ g = g1 - g2;
597
+ G = y / g;
598
+ }
599
+
600
+ let H;
601
+ let h;
602
+ if (h1 === 0.0 && h2 === 0.0) {
603
+ H = 0.0;
604
+ h = 0.0;
605
+ } else if (Math$1.CesiumMath.sign(h1) === Math$1.CesiumMath.sign(h2)) {
606
+ H = h1 + h2;
607
+ h = a0 / H;
608
+ } else {
609
+ h = h1 - h2;
610
+ H = a0 / h;
611
+ }
612
+
613
+ // Now solve the two quadratic factors: (y^2 + G y + H)(y^2 + g y + h);
614
+ const roots1 = QuadraticRealPolynomial$1.computeRealRoots(1.0, G, H);
615
+ const roots2 = QuadraticRealPolynomial$1.computeRealRoots(1.0, g, h);
616
+
617
+ if (roots1.length !== 0) {
618
+ if (roots2.length !== 0) {
619
+ if (roots1[1] <= roots2[0]) {
620
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
621
+ } else if (roots2[1] <= roots1[0]) {
622
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
623
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
624
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
625
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
626
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
627
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
628
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
629
+ }
630
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
631
+ }
632
+ return roots1;
633
+ }
634
+ if (roots2.length !== 0) {
635
+ return roots2;
636
+ }
637
+ }
638
+ return [];
639
+ }
640
+
641
+ /**
642
+ * Provides the real valued roots of the quartic polynomial with the provided coefficients.
643
+ *
644
+ * @param {Number} a The coefficient of the 4th order monomial.
645
+ * @param {Number} b The coefficient of the 3rd order monomial.
646
+ * @param {Number} c The coefficient of the 2nd order monomial.
647
+ * @param {Number} d The coefficient of the 1st order monomial.
648
+ * @param {Number} e The coefficient of the 0th order monomial.
649
+ * @returns {Number[]} The real valued roots.
650
+ */
651
+ QuarticRealPolynomial.computeRealRoots = function (a, b, c, d, e) {
652
+ //>>includeStart('debug', pragmas.debug);
653
+ if (typeof a !== "number") {
654
+ throw new Check.DeveloperError("a is a required number.");
655
+ }
656
+ if (typeof b !== "number") {
657
+ throw new Check.DeveloperError("b is a required number.");
658
+ }
659
+ if (typeof c !== "number") {
660
+ throw new Check.DeveloperError("c is a required number.");
661
+ }
662
+ if (typeof d !== "number") {
663
+ throw new Check.DeveloperError("d is a required number.");
664
+ }
665
+ if (typeof e !== "number") {
666
+ throw new Check.DeveloperError("e is a required number.");
667
+ }
668
+ //>>includeEnd('debug');
669
+
670
+ if (Math.abs(a) < Math$1.CesiumMath.EPSILON15) {
671
+ return CubicRealPolynomial$1.computeRealRoots(b, c, d, e);
672
+ }
673
+ const a3 = b / a;
674
+ const a2 = c / a;
675
+ const a1 = d / a;
676
+ const a0 = e / a;
677
+
678
+ let k = a3 < 0.0 ? 1 : 0;
679
+ k += a2 < 0.0 ? k + 1 : k;
680
+ k += a1 < 0.0 ? k + 1 : k;
681
+ k += a0 < 0.0 ? k + 1 : k;
682
+
683
+ switch (k) {
684
+ case 0:
685
+ return original(a3, a2, a1, a0);
686
+ case 1:
687
+ return neumark(a3, a2, a1, a0);
688
+ case 2:
689
+ return neumark(a3, a2, a1, a0);
690
+ case 3:
691
+ return original(a3, a2, a1, a0);
692
+ case 4:
693
+ return original(a3, a2, a1, a0);
694
+ case 5:
695
+ return neumark(a3, a2, a1, a0);
696
+ case 6:
697
+ return original(a3, a2, a1, a0);
698
+ case 7:
699
+ return original(a3, a2, a1, a0);
700
+ case 8:
701
+ return neumark(a3, a2, a1, a0);
702
+ case 9:
703
+ return original(a3, a2, a1, a0);
704
+ case 10:
705
+ return original(a3, a2, a1, a0);
706
+ case 11:
707
+ return neumark(a3, a2, a1, a0);
708
+ case 12:
709
+ return original(a3, a2, a1, a0);
710
+ case 13:
711
+ return original(a3, a2, a1, a0);
712
+ case 14:
713
+ return original(a3, a2, a1, a0);
714
+ case 15:
715
+ return original(a3, a2, a1, a0);
716
+ default:
717
+ return undefined;
718
+ }
719
+ };
720
+ var QuarticRealPolynomial$1 = QuarticRealPolynomial;
721
+
722
+ /**
723
+ * Represents a ray that extends infinitely from the provided origin in the provided direction.
724
+ * @alias Ray
725
+ * @constructor
726
+ *
727
+ * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.
728
+ * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.
729
+ */
730
+ function Ray(origin, direction) {
731
+ direction = Matrix3.Cartesian3.clone(defaultValue.defaultValue(direction, Matrix3.Cartesian3.ZERO));
732
+ if (!Matrix3.Cartesian3.equals(direction, Matrix3.Cartesian3.ZERO)) {
733
+ Matrix3.Cartesian3.normalize(direction, direction);
734
+ }
735
+
736
+ /**
737
+ * The origin of the ray.
738
+ * @type {Cartesian3}
739
+ * @default {@link Cartesian3.ZERO}
740
+ */
741
+ this.origin = Matrix3.Cartesian3.clone(defaultValue.defaultValue(origin, Matrix3.Cartesian3.ZERO));
742
+
743
+ /**
744
+ * The direction of the ray.
745
+ * @type {Cartesian3}
746
+ */
747
+ this.direction = direction;
748
+ }
749
+
750
+ /**
751
+ * Duplicates a Ray instance.
752
+ *
753
+ * @param {Ray} ray The ray to duplicate.
754
+ * @param {Ray} [result] The object onto which to store the result.
755
+ * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
756
+ */
757
+ Ray.clone = function (ray, result) {
758
+ if (!defaultValue.defined(ray)) {
759
+ return undefined;
760
+ }
761
+ if (!defaultValue.defined(result)) {
762
+ return new Ray(ray.origin, ray.direction);
763
+ }
764
+ result.origin = Matrix3.Cartesian3.clone(ray.origin);
765
+ result.direction = Matrix3.Cartesian3.clone(ray.direction);
766
+ return result;
767
+ };
768
+
769
+ /**
770
+ * Computes the point along the ray given by r(t) = o + t*d,
771
+ * where o is the origin of the ray and d is the direction.
772
+ *
773
+ * @param {Ray} ray The ray.
774
+ * @param {Number} t A scalar value.
775
+ * @param {Cartesian3} [result] The object in which the result will be stored.
776
+ * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.
777
+ *
778
+ * @example
779
+ * //Get the first intersection point of a ray and an ellipsoid.
780
+ * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
781
+ * const point = Cesium.Ray.getPoint(ray, intersection.start);
782
+ */
783
+ Ray.getPoint = function (ray, t, result) {
784
+ //>>includeStart('debug', pragmas.debug);
785
+ Check.Check.typeOf.object("ray", ray);
786
+ Check.Check.typeOf.number("t", t);
787
+ //>>includeEnd('debug');
788
+
789
+ if (!defaultValue.defined(result)) {
790
+ result = new Matrix3.Cartesian3();
791
+ }
792
+
793
+ result = Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
794
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
795
+ };
796
+
797
+ /**
798
+ * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
799
+ *
800
+ * @namespace IntersectionTests
801
+ */
802
+ const IntersectionTests = {};
803
+
804
+ /**
805
+ * Computes the intersection of a ray and a plane.
806
+ *
807
+ * @param {Ray} ray The ray.
808
+ * @param {Plane} plane The plane.
809
+ * @param {Cartesian3} [result] The object onto which to store the result.
810
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
811
+ */
812
+ IntersectionTests.rayPlane = function (ray, plane, result) {
813
+ //>>includeStart('debug', pragmas.debug);
814
+ if (!defaultValue.defined(ray)) {
815
+ throw new Check.DeveloperError("ray is required.");
816
+ }
817
+ if (!defaultValue.defined(plane)) {
818
+ throw new Check.DeveloperError("plane is required.");
819
+ }
820
+ //>>includeEnd('debug');
821
+
822
+ if (!defaultValue.defined(result)) {
823
+ result = new Matrix3.Cartesian3();
824
+ }
825
+
826
+ const origin = ray.origin;
827
+ const direction = ray.direction;
828
+ const normal = plane.normal;
829
+ const denominator = Matrix3.Cartesian3.dot(normal, direction);
830
+
831
+ if (Math.abs(denominator) < Math$1.CesiumMath.EPSILON15) {
832
+ // Ray is parallel to plane. The ray may be in the polygon's plane.
833
+ return undefined;
834
+ }
835
+
836
+ const t = (-plane.distance - Matrix3.Cartesian3.dot(normal, origin)) / denominator;
837
+
838
+ if (t < 0) {
839
+ return undefined;
840
+ }
841
+
842
+ result = Matrix3.Cartesian3.multiplyByScalar(direction, t, result);
843
+ return Matrix3.Cartesian3.add(origin, result, result);
844
+ };
845
+
846
+ const scratchEdge0 = new Matrix3.Cartesian3();
847
+ const scratchEdge1 = new Matrix3.Cartesian3();
848
+ const scratchPVec = new Matrix3.Cartesian3();
849
+ const scratchTVec = new Matrix3.Cartesian3();
850
+ const scratchQVec = new Matrix3.Cartesian3();
851
+
852
+ /**
853
+ * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.
854
+ *
855
+ * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
856
+ * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
857
+ *
858
+ * @memberof IntersectionTests
859
+ *
860
+ * @param {Ray} ray The ray.
861
+ * @param {Cartesian3} p0 The first vertex of the triangle.
862
+ * @param {Cartesian3} p1 The second vertex of the triangle.
863
+ * @param {Cartesian3} p2 The third vertex of the triangle.
864
+ * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle
865
+ * and return undefined for intersections with the back face.
866
+ * @returns {Number} The intersection as a parametric distance along the ray, or undefined if there is no intersection.
867
+ */
868
+ IntersectionTests.rayTriangleParametric = function (
869
+ ray,
870
+ p0,
871
+ p1,
872
+ p2,
873
+ cullBackFaces
874
+ ) {
875
+ //>>includeStart('debug', pragmas.debug);
876
+ if (!defaultValue.defined(ray)) {
877
+ throw new Check.DeveloperError("ray is required.");
878
+ }
879
+ if (!defaultValue.defined(p0)) {
880
+ throw new Check.DeveloperError("p0 is required.");
881
+ }
882
+ if (!defaultValue.defined(p1)) {
883
+ throw new Check.DeveloperError("p1 is required.");
884
+ }
885
+ if (!defaultValue.defined(p2)) {
886
+ throw new Check.DeveloperError("p2 is required.");
887
+ }
888
+ //>>includeEnd('debug');
889
+
890
+ cullBackFaces = defaultValue.defaultValue(cullBackFaces, false);
891
+
892
+ const origin = ray.origin;
893
+ const direction = ray.direction;
894
+
895
+ const edge0 = Matrix3.Cartesian3.subtract(p1, p0, scratchEdge0);
896
+ const edge1 = Matrix3.Cartesian3.subtract(p2, p0, scratchEdge1);
897
+
898
+ const p = Matrix3.Cartesian3.cross(direction, edge1, scratchPVec);
899
+ const det = Matrix3.Cartesian3.dot(edge0, p);
900
+
901
+ let tvec;
902
+ let q;
903
+
904
+ let u;
905
+ let v;
906
+ let t;
907
+
908
+ if (cullBackFaces) {
909
+ if (det < Math$1.CesiumMath.EPSILON6) {
910
+ return undefined;
911
+ }
912
+
913
+ tvec = Matrix3.Cartesian3.subtract(origin, p0, scratchTVec);
914
+ u = Matrix3.Cartesian3.dot(tvec, p);
915
+ if (u < 0.0 || u > det) {
916
+ return undefined;
917
+ }
918
+
919
+ q = Matrix3.Cartesian3.cross(tvec, edge0, scratchQVec);
920
+
921
+ v = Matrix3.Cartesian3.dot(direction, q);
922
+ if (v < 0.0 || u + v > det) {
923
+ return undefined;
924
+ }
925
+
926
+ t = Matrix3.Cartesian3.dot(edge1, q) / det;
927
+ } else {
928
+ if (Math.abs(det) < Math$1.CesiumMath.EPSILON6) {
929
+ return undefined;
930
+ }
931
+ const invDet = 1.0 / det;
932
+
933
+ tvec = Matrix3.Cartesian3.subtract(origin, p0, scratchTVec);
934
+ u = Matrix3.Cartesian3.dot(tvec, p) * invDet;
935
+ if (u < 0.0 || u > 1.0) {
936
+ return undefined;
937
+ }
938
+
939
+ q = Matrix3.Cartesian3.cross(tvec, edge0, scratchQVec);
940
+
941
+ v = Matrix3.Cartesian3.dot(direction, q) * invDet;
942
+ if (v < 0.0 || u + v > 1.0) {
943
+ return undefined;
944
+ }
945
+
946
+ t = Matrix3.Cartesian3.dot(edge1, q) * invDet;
947
+ }
948
+
949
+ return t;
950
+ };
951
+
952
+ /**
953
+ * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
954
+ *
955
+ * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
956
+ * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
957
+ *
958
+ * @memberof IntersectionTests
959
+ *
960
+ * @param {Ray} ray The ray.
961
+ * @param {Cartesian3} p0 The first vertex of the triangle.
962
+ * @param {Cartesian3} p1 The second vertex of the triangle.
963
+ * @param {Cartesian3} p2 The third vertex of the triangle.
964
+ * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle
965
+ * and return undefined for intersections with the back face.
966
+ * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.
967
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
968
+ */
969
+ IntersectionTests.rayTriangle = function (
970
+ ray,
971
+ p0,
972
+ p1,
973
+ p2,
974
+ cullBackFaces,
975
+ result
976
+ ) {
977
+ const t = IntersectionTests.rayTriangleParametric(
978
+ ray,
979
+ p0,
980
+ p1,
981
+ p2,
982
+ cullBackFaces
983
+ );
984
+ if (!defaultValue.defined(t) || t < 0.0) {
985
+ return undefined;
986
+ }
987
+
988
+ if (!defaultValue.defined(result)) {
989
+ result = new Matrix3.Cartesian3();
990
+ }
991
+
992
+ Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
993
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
994
+ };
995
+
996
+ const scratchLineSegmentTriangleRay = new Ray();
997
+
998
+ /**
999
+ * Computes the intersection of a line segment and a triangle.
1000
+ * @memberof IntersectionTests
1001
+ *
1002
+ * @param {Cartesian3} v0 The an end point of the line segment.
1003
+ * @param {Cartesian3} v1 The other end point of the line segment.
1004
+ * @param {Cartesian3} p0 The first vertex of the triangle.
1005
+ * @param {Cartesian3} p1 The second vertex of the triangle.
1006
+ * @param {Cartesian3} p2 The third vertex of the triangle.
1007
+ * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle
1008
+ * and return undefined for intersections with the back face.
1009
+ * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.
1010
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
1011
+ */
1012
+ IntersectionTests.lineSegmentTriangle = function (
1013
+ v0,
1014
+ v1,
1015
+ p0,
1016
+ p1,
1017
+ p2,
1018
+ cullBackFaces,
1019
+ result
1020
+ ) {
1021
+ //>>includeStart('debug', pragmas.debug);
1022
+ if (!defaultValue.defined(v0)) {
1023
+ throw new Check.DeveloperError("v0 is required.");
1024
+ }
1025
+ if (!defaultValue.defined(v1)) {
1026
+ throw new Check.DeveloperError("v1 is required.");
1027
+ }
1028
+ if (!defaultValue.defined(p0)) {
1029
+ throw new Check.DeveloperError("p0 is required.");
1030
+ }
1031
+ if (!defaultValue.defined(p1)) {
1032
+ throw new Check.DeveloperError("p1 is required.");
1033
+ }
1034
+ if (!defaultValue.defined(p2)) {
1035
+ throw new Check.DeveloperError("p2 is required.");
1036
+ }
1037
+ //>>includeEnd('debug');
1038
+
1039
+ const ray = scratchLineSegmentTriangleRay;
1040
+ Matrix3.Cartesian3.clone(v0, ray.origin);
1041
+ Matrix3.Cartesian3.subtract(v1, v0, ray.direction);
1042
+ Matrix3.Cartesian3.normalize(ray.direction, ray.direction);
1043
+
1044
+ const t = IntersectionTests.rayTriangleParametric(
1045
+ ray,
1046
+ p0,
1047
+ p1,
1048
+ p2,
1049
+ cullBackFaces
1050
+ );
1051
+ if (!defaultValue.defined(t) || t < 0.0 || t > Matrix3.Cartesian3.distance(v0, v1)) {
1052
+ return undefined;
1053
+ }
1054
+
1055
+ if (!defaultValue.defined(result)) {
1056
+ result = new Matrix3.Cartesian3();
1057
+ }
1058
+
1059
+ Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
1060
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
1061
+ };
1062
+
1063
+ function solveQuadratic(a, b, c, result) {
1064
+ const det = b * b - 4.0 * a * c;
1065
+ if (det < 0.0) {
1066
+ return undefined;
1067
+ } else if (det > 0.0) {
1068
+ const denom = 1.0 / (2.0 * a);
1069
+ const disc = Math.sqrt(det);
1070
+ const root0 = (-b + disc) * denom;
1071
+ const root1 = (-b - disc) * denom;
1072
+
1073
+ if (root0 < root1) {
1074
+ result.root0 = root0;
1075
+ result.root1 = root1;
1076
+ } else {
1077
+ result.root0 = root1;
1078
+ result.root1 = root0;
1079
+ }
1080
+
1081
+ return result;
1082
+ }
1083
+
1084
+ const root = -b / (2.0 * a);
1085
+ if (root === 0.0) {
1086
+ return undefined;
1087
+ }
1088
+
1089
+ result.root0 = result.root1 = root;
1090
+ return result;
1091
+ }
1092
+
1093
+ const raySphereRoots = {
1094
+ root0: 0.0,
1095
+ root1: 0.0,
1096
+ };
1097
+
1098
+ function raySphere(ray, sphere, result) {
1099
+ if (!defaultValue.defined(result)) {
1100
+ result = new Transforms.Interval();
1101
+ }
1102
+
1103
+ const origin = ray.origin;
1104
+ const direction = ray.direction;
1105
+
1106
+ const center = sphere.center;
1107
+ const radiusSquared = sphere.radius * sphere.radius;
1108
+
1109
+ const diff = Matrix3.Cartesian3.subtract(origin, center, scratchPVec);
1110
+
1111
+ const a = Matrix3.Cartesian3.dot(direction, direction);
1112
+ const b = 2.0 * Matrix3.Cartesian3.dot(direction, diff);
1113
+ const c = Matrix3.Cartesian3.magnitudeSquared(diff) - radiusSquared;
1114
+
1115
+ const roots = solveQuadratic(a, b, c, raySphereRoots);
1116
+ if (!defaultValue.defined(roots)) {
1117
+ return undefined;
1118
+ }
1119
+
1120
+ result.start = roots.root0;
1121
+ result.stop = roots.root1;
1122
+ return result;
1123
+ }
1124
+
1125
+ /**
1126
+ * Computes the intersection points of a ray with a sphere.
1127
+ * @memberof IntersectionTests
1128
+ *
1129
+ * @param {Ray} ray The ray.
1130
+ * @param {BoundingSphere} sphere The sphere.
1131
+ * @param {Interval} [result] The result onto which to store the result.
1132
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
1133
+ */
1134
+ IntersectionTests.raySphere = function (ray, sphere, result) {
1135
+ //>>includeStart('debug', pragmas.debug);
1136
+ if (!defaultValue.defined(ray)) {
1137
+ throw new Check.DeveloperError("ray is required.");
1138
+ }
1139
+ if (!defaultValue.defined(sphere)) {
1140
+ throw new Check.DeveloperError("sphere is required.");
1141
+ }
1142
+ //>>includeEnd('debug');
1143
+
1144
+ result = raySphere(ray, sphere, result);
1145
+ if (!defaultValue.defined(result) || result.stop < 0.0) {
1146
+ return undefined;
1147
+ }
1148
+
1149
+ result.start = Math.max(result.start, 0.0);
1150
+ return result;
1151
+ };
1152
+
1153
+ const scratchLineSegmentRay = new Ray();
1154
+
1155
+ /**
1156
+ * Computes the intersection points of a line segment with a sphere.
1157
+ * @memberof IntersectionTests
1158
+ *
1159
+ * @param {Cartesian3} p0 An end point of the line segment.
1160
+ * @param {Cartesian3} p1 The other end point of the line segment.
1161
+ * @param {BoundingSphere} sphere The sphere.
1162
+ * @param {Interval} [result] The result onto which to store the result.
1163
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
1164
+ */
1165
+ IntersectionTests.lineSegmentSphere = function (p0, p1, sphere, result) {
1166
+ //>>includeStart('debug', pragmas.debug);
1167
+ if (!defaultValue.defined(p0)) {
1168
+ throw new Check.DeveloperError("p0 is required.");
1169
+ }
1170
+ if (!defaultValue.defined(p1)) {
1171
+ throw new Check.DeveloperError("p1 is required.");
1172
+ }
1173
+ if (!defaultValue.defined(sphere)) {
1174
+ throw new Check.DeveloperError("sphere is required.");
1175
+ }
1176
+ //>>includeEnd('debug');
1177
+
1178
+ const ray = scratchLineSegmentRay;
1179
+ Matrix3.Cartesian3.clone(p0, ray.origin);
1180
+ const direction = Matrix3.Cartesian3.subtract(p1, p0, ray.direction);
1181
+
1182
+ const maxT = Matrix3.Cartesian3.magnitude(direction);
1183
+ Matrix3.Cartesian3.normalize(direction, direction);
1184
+
1185
+ result = raySphere(ray, sphere, result);
1186
+ if (!defaultValue.defined(result) || result.stop < 0.0 || result.start > maxT) {
1187
+ return undefined;
1188
+ }
1189
+
1190
+ result.start = Math.max(result.start, 0.0);
1191
+ result.stop = Math.min(result.stop, maxT);
1192
+ return result;
1193
+ };
1194
+
1195
+ const scratchQ = new Matrix3.Cartesian3();
1196
+ const scratchW = new Matrix3.Cartesian3();
1197
+
1198
+ /**
1199
+ * Computes the intersection points of a ray with an ellipsoid.
1200
+ *
1201
+ * @param {Ray} ray The ray.
1202
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
1203
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
1204
+ */
1205
+ IntersectionTests.rayEllipsoid = function (ray, ellipsoid) {
1206
+ //>>includeStart('debug', pragmas.debug);
1207
+ if (!defaultValue.defined(ray)) {
1208
+ throw new Check.DeveloperError("ray is required.");
1209
+ }
1210
+ if (!defaultValue.defined(ellipsoid)) {
1211
+ throw new Check.DeveloperError("ellipsoid is required.");
1212
+ }
1213
+ //>>includeEnd('debug');
1214
+
1215
+ const inverseRadii = ellipsoid.oneOverRadii;
1216
+ const q = Matrix3.Cartesian3.multiplyComponents(inverseRadii, ray.origin, scratchQ);
1217
+ const w = Matrix3.Cartesian3.multiplyComponents(
1218
+ inverseRadii,
1219
+ ray.direction,
1220
+ scratchW
1221
+ );
1222
+
1223
+ const q2 = Matrix3.Cartesian3.magnitudeSquared(q);
1224
+ const qw = Matrix3.Cartesian3.dot(q, w);
1225
+
1226
+ let difference, w2, product, discriminant, temp;
1227
+
1228
+ if (q2 > 1.0) {
1229
+ // Outside ellipsoid.
1230
+ if (qw >= 0.0) {
1231
+ // Looking outward or tangent (0 intersections).
1232
+ return undefined;
1233
+ }
1234
+
1235
+ // qw < 0.0.
1236
+ const qw2 = qw * qw;
1237
+ difference = q2 - 1.0; // Positively valued.
1238
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
1239
+ product = w2 * difference;
1240
+
1241
+ if (qw2 < product) {
1242
+ // Imaginary roots (0 intersections).
1243
+ return undefined;
1244
+ } else if (qw2 > product) {
1245
+ // Distinct roots (2 intersections).
1246
+ discriminant = qw * qw - product;
1247
+ temp = -qw + Math.sqrt(discriminant); // Avoid cancellation.
1248
+ const root0 = temp / w2;
1249
+ const root1 = difference / temp;
1250
+ if (root0 < root1) {
1251
+ return new Transforms.Interval(root0, root1);
1252
+ }
1253
+
1254
+ return {
1255
+ start: root1,
1256
+ stop: root0,
1257
+ };
1258
+ }
1259
+ // qw2 == product. Repeated roots (2 intersections).
1260
+ const root = Math.sqrt(difference / w2);
1261
+ return new Transforms.Interval(root, root);
1262
+ } else if (q2 < 1.0) {
1263
+ // Inside ellipsoid (2 intersections).
1264
+ difference = q2 - 1.0; // Negatively valued.
1265
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
1266
+ product = w2 * difference; // Negatively valued.
1267
+
1268
+ discriminant = qw * qw - product;
1269
+ temp = -qw + Math.sqrt(discriminant); // Positively valued.
1270
+ return new Transforms.Interval(0.0, temp / w2);
1271
+ }
1272
+ // q2 == 1.0. On ellipsoid.
1273
+ if (qw < 0.0) {
1274
+ // Looking inward.
1275
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
1276
+ return new Transforms.Interval(0.0, -qw / w2);
1277
+ }
1278
+
1279
+ // qw >= 0.0. Looking outward or tangent.
1280
+ return undefined;
1281
+ };
1282
+
1283
+ function addWithCancellationCheck(left, right, tolerance) {
1284
+ const difference = left + right;
1285
+ if (
1286
+ Math$1.CesiumMath.sign(left) !== Math$1.CesiumMath.sign(right) &&
1287
+ Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance
1288
+ ) {
1289
+ return 0.0;
1290
+ }
1291
+
1292
+ return difference;
1293
+ }
1294
+
1295
+ function quadraticVectorExpression(A, b, c, x, w) {
1296
+ const xSquared = x * x;
1297
+ const wSquared = w * w;
1298
+
1299
+ const l2 = (A[Matrix3.Matrix3.COLUMN1ROW1] - A[Matrix3.Matrix3.COLUMN2ROW2]) * wSquared;
1300
+ const l1 =
1301
+ w *
1302
+ (x *
1303
+ addWithCancellationCheck(
1304
+ A[Matrix3.Matrix3.COLUMN1ROW0],
1305
+ A[Matrix3.Matrix3.COLUMN0ROW1],
1306
+ Math$1.CesiumMath.EPSILON15
1307
+ ) +
1308
+ b.y);
1309
+ const l0 =
1310
+ A[Matrix3.Matrix3.COLUMN0ROW0] * xSquared +
1311
+ A[Matrix3.Matrix3.COLUMN2ROW2] * wSquared +
1312
+ x * b.x +
1313
+ c;
1314
+
1315
+ const r1 =
1316
+ wSquared *
1317
+ addWithCancellationCheck(
1318
+ A[Matrix3.Matrix3.COLUMN2ROW1],
1319
+ A[Matrix3.Matrix3.COLUMN1ROW2],
1320
+ Math$1.CesiumMath.EPSILON15
1321
+ );
1322
+ const r0 =
1323
+ w *
1324
+ (x *
1325
+ addWithCancellationCheck(A[Matrix3.Matrix3.COLUMN2ROW0], A[Matrix3.Matrix3.COLUMN0ROW2]) +
1326
+ b.z);
1327
+
1328
+ let cosines;
1329
+ const solutions = [];
1330
+ if (r0 === 0.0 && r1 === 0.0) {
1331
+ cosines = QuadraticRealPolynomial$1.computeRealRoots(l2, l1, l0);
1332
+ if (cosines.length === 0) {
1333
+ return solutions;
1334
+ }
1335
+
1336
+ const cosine0 = cosines[0];
1337
+ const sine0 = Math.sqrt(Math.max(1.0 - cosine0 * cosine0, 0.0));
1338
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine0, w * -sine0));
1339
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine0, w * sine0));
1340
+
1341
+ if (cosines.length === 2) {
1342
+ const cosine1 = cosines[1];
1343
+ const sine1 = Math.sqrt(Math.max(1.0 - cosine1 * cosine1, 0.0));
1344
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine1, w * -sine1));
1345
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine1, w * sine1));
1346
+ }
1347
+
1348
+ return solutions;
1349
+ }
1350
+
1351
+ const r0Squared = r0 * r0;
1352
+ const r1Squared = r1 * r1;
1353
+ const l2Squared = l2 * l2;
1354
+ const r0r1 = r0 * r1;
1355
+
1356
+ const c4 = l2Squared + r1Squared;
1357
+ const c3 = 2.0 * (l1 * l2 + r0r1);
1358
+ const c2 = 2.0 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;
1359
+ const c1 = 2.0 * (l0 * l1 - r0r1);
1360
+ const c0 = l0 * l0 - r0Squared;
1361
+
1362
+ if (c4 === 0.0 && c3 === 0.0 && c2 === 0.0 && c1 === 0.0) {
1363
+ return solutions;
1364
+ }
1365
+
1366
+ cosines = QuarticRealPolynomial$1.computeRealRoots(c4, c3, c2, c1, c0);
1367
+ const length = cosines.length;
1368
+ if (length === 0) {
1369
+ return solutions;
1370
+ }
1371
+
1372
+ for (let i = 0; i < length; ++i) {
1373
+ const cosine = cosines[i];
1374
+ const cosineSquared = cosine * cosine;
1375
+ const sineSquared = Math.max(1.0 - cosineSquared, 0.0);
1376
+ const sine = Math.sqrt(sineSquared);
1377
+
1378
+ //const left = l2 * cosineSquared + l1 * cosine + l0;
1379
+ let left;
1380
+ if (Math$1.CesiumMath.sign(l2) === Math$1.CesiumMath.sign(l0)) {
1381
+ left = addWithCancellationCheck(
1382
+ l2 * cosineSquared + l0,
1383
+ l1 * cosine,
1384
+ Math$1.CesiumMath.EPSILON12
1385
+ );
1386
+ } else if (Math$1.CesiumMath.sign(l0) === Math$1.CesiumMath.sign(l1 * cosine)) {
1387
+ left = addWithCancellationCheck(
1388
+ l2 * cosineSquared,
1389
+ l1 * cosine + l0,
1390
+ Math$1.CesiumMath.EPSILON12
1391
+ );
1392
+ } else {
1393
+ left = addWithCancellationCheck(
1394
+ l2 * cosineSquared + l1 * cosine,
1395
+ l0,
1396
+ Math$1.CesiumMath.EPSILON12
1397
+ );
1398
+ }
1399
+
1400
+ const right = addWithCancellationCheck(
1401
+ r1 * cosine,
1402
+ r0,
1403
+ Math$1.CesiumMath.EPSILON15
1404
+ );
1405
+ const product = left * right;
1406
+
1407
+ if (product < 0.0) {
1408
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
1409
+ } else if (product > 0.0) {
1410
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * -sine));
1411
+ } else if (sine !== 0.0) {
1412
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * -sine));
1413
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
1414
+ ++i;
1415
+ } else {
1416
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
1417
+ }
1418
+ }
1419
+
1420
+ return solutions;
1421
+ }
1422
+
1423
+ const firstAxisScratch = new Matrix3.Cartesian3();
1424
+ const secondAxisScratch = new Matrix3.Cartesian3();
1425
+ const thirdAxisScratch = new Matrix3.Cartesian3();
1426
+ const referenceScratch = new Matrix3.Cartesian3();
1427
+ const bCart = new Matrix3.Cartesian3();
1428
+ const bScratch = new Matrix3.Matrix3();
1429
+ const btScratch = new Matrix3.Matrix3();
1430
+ const diScratch = new Matrix3.Matrix3();
1431
+ const dScratch = new Matrix3.Matrix3();
1432
+ const cScratch = new Matrix3.Matrix3();
1433
+ const tempMatrix = new Matrix3.Matrix3();
1434
+ const aScratch = new Matrix3.Matrix3();
1435
+ const sScratch = new Matrix3.Cartesian3();
1436
+ const closestScratch = new Matrix3.Cartesian3();
1437
+ const surfPointScratch = new Matrix3.Cartographic();
1438
+
1439
+ /**
1440
+ * Provides the point along the ray which is nearest to the ellipsoid.
1441
+ *
1442
+ * @param {Ray} ray The ray.
1443
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
1444
+ * @returns {Cartesian3} The nearest planetodetic point on the ray.
1445
+ */
1446
+ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {
1447
+ //>>includeStart('debug', pragmas.debug);
1448
+ if (!defaultValue.defined(ray)) {
1449
+ throw new Check.DeveloperError("ray is required.");
1450
+ }
1451
+ if (!defaultValue.defined(ellipsoid)) {
1452
+ throw new Check.DeveloperError("ellipsoid is required.");
1453
+ }
1454
+ //>>includeEnd('debug');
1455
+
1456
+ const position = ray.origin;
1457
+ const direction = ray.direction;
1458
+
1459
+ if (!Matrix3.Cartesian3.equals(position, Matrix3.Cartesian3.ZERO)) {
1460
+ const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);
1461
+ if (Matrix3.Cartesian3.dot(direction, normal) >= 0.0) {
1462
+ // The location provided is the closest point in altitude
1463
+ return position;
1464
+ }
1465
+ }
1466
+
1467
+ const intersects = defaultValue.defined(this.rayEllipsoid(ray, ellipsoid));
1468
+
1469
+ // Compute the scaled direction vector.
1470
+ const f = ellipsoid.transformPositionToScaledSpace(
1471
+ direction,
1472
+ firstAxisScratch
1473
+ );
1474
+
1475
+ // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose.
1476
+ const firstAxis = Matrix3.Cartesian3.normalize(f, f);
1477
+ const reference = Matrix3.Cartesian3.mostOrthogonalAxis(f, referenceScratch);
1478
+ const secondAxis = Matrix3.Cartesian3.normalize(
1479
+ Matrix3.Cartesian3.cross(reference, firstAxis, secondAxisScratch),
1480
+ secondAxisScratch
1481
+ );
1482
+ const thirdAxis = Matrix3.Cartesian3.normalize(
1483
+ Matrix3.Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch),
1484
+ thirdAxisScratch
1485
+ );
1486
+ const B = bScratch;
1487
+ B[0] = firstAxis.x;
1488
+ B[1] = firstAxis.y;
1489
+ B[2] = firstAxis.z;
1490
+ B[3] = secondAxis.x;
1491
+ B[4] = secondAxis.y;
1492
+ B[5] = secondAxis.z;
1493
+ B[6] = thirdAxis.x;
1494
+ B[7] = thirdAxis.y;
1495
+ B[8] = thirdAxis.z;
1496
+
1497
+ const B_T = Matrix3.Matrix3.transpose(B, btScratch);
1498
+
1499
+ // Get the scaling matrix and its inverse.
1500
+ const D_I = Matrix3.Matrix3.fromScale(ellipsoid.radii, diScratch);
1501
+ const D = Matrix3.Matrix3.fromScale(ellipsoid.oneOverRadii, dScratch);
1502
+
1503
+ const C = cScratch;
1504
+ C[0] = 0.0;
1505
+ C[1] = -direction.z;
1506
+ C[2] = direction.y;
1507
+ C[3] = direction.z;
1508
+ C[4] = 0.0;
1509
+ C[5] = -direction.x;
1510
+ C[6] = -direction.y;
1511
+ C[7] = direction.x;
1512
+ C[8] = 0.0;
1513
+
1514
+ const temp = Matrix3.Matrix3.multiply(
1515
+ Matrix3.Matrix3.multiply(B_T, D, tempMatrix),
1516
+ C,
1517
+ tempMatrix
1518
+ );
1519
+ const A = Matrix3.Matrix3.multiply(
1520
+ Matrix3.Matrix3.multiply(temp, D_I, aScratch),
1521
+ B,
1522
+ aScratch
1523
+ );
1524
+ const b = Matrix3.Matrix3.multiplyByVector(temp, position, bCart);
1525
+
1526
+ // Solve for the solutions to the expression in standard form:
1527
+ const solutions = quadraticVectorExpression(
1528
+ A,
1529
+ Matrix3.Cartesian3.negate(b, firstAxisScratch),
1530
+ 0.0,
1531
+ 0.0,
1532
+ 1.0
1533
+ );
1534
+
1535
+ let s;
1536
+ let altitude;
1537
+ const length = solutions.length;
1538
+ if (length > 0) {
1539
+ let closest = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, closestScratch);
1540
+ let maximumValue = Number.NEGATIVE_INFINITY;
1541
+
1542
+ for (let i = 0; i < length; ++i) {
1543
+ s = Matrix3.Matrix3.multiplyByVector(
1544
+ D_I,
1545
+ Matrix3.Matrix3.multiplyByVector(B, solutions[i], sScratch),
1546
+ sScratch
1547
+ );
1548
+ const v = Matrix3.Cartesian3.normalize(
1549
+ Matrix3.Cartesian3.subtract(s, position, referenceScratch),
1550
+ referenceScratch
1551
+ );
1552
+ const dotProduct = Matrix3.Cartesian3.dot(v, direction);
1553
+
1554
+ if (dotProduct > maximumValue) {
1555
+ maximumValue = dotProduct;
1556
+ closest = Matrix3.Cartesian3.clone(s, closest);
1557
+ }
1558
+ }
1559
+
1560
+ const surfacePoint = ellipsoid.cartesianToCartographic(
1561
+ closest,
1562
+ surfPointScratch
1563
+ );
1564
+ maximumValue = Math$1.CesiumMath.clamp(maximumValue, 0.0, 1.0);
1565
+ altitude =
1566
+ Matrix3.Cartesian3.magnitude(
1567
+ Matrix3.Cartesian3.subtract(closest, position, referenceScratch)
1568
+ ) * Math.sqrt(1.0 - maximumValue * maximumValue);
1569
+ altitude = intersects ? -altitude : altitude;
1570
+ surfacePoint.height = altitude;
1571
+ return ellipsoid.cartographicToCartesian(surfacePoint, new Matrix3.Cartesian3());
1572
+ }
1573
+
1574
+ return undefined;
1575
+ };
1576
+
1577
+ const lineSegmentPlaneDifference = new Matrix3.Cartesian3();
1578
+
1579
+ /**
1580
+ * Computes the intersection of a line segment and a plane.
1581
+ *
1582
+ * @param {Cartesian3} endPoint0 An end point of the line segment.
1583
+ * @param {Cartesian3} endPoint1 The other end point of the line segment.
1584
+ * @param {Plane} plane The plane.
1585
+ * @param {Cartesian3} [result] The object onto which to store the result.
1586
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersection.
1587
+ *
1588
+ * @example
1589
+ * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
1590
+ * const normal = ellipsoid.geodeticSurfaceNormal(origin);
1591
+ * const plane = Cesium.Plane.fromPointNormal(origin, normal);
1592
+ *
1593
+ * const p0 = new Cesium.Cartesian3(...);
1594
+ * const p1 = new Cesium.Cartesian3(...);
1595
+ *
1596
+ * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
1597
+ * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
1598
+ */
1599
+ IntersectionTests.lineSegmentPlane = function (
1600
+ endPoint0,
1601
+ endPoint1,
1602
+ plane,
1603
+ result
1604
+ ) {
1605
+ //>>includeStart('debug', pragmas.debug);
1606
+ if (!defaultValue.defined(endPoint0)) {
1607
+ throw new Check.DeveloperError("endPoint0 is required.");
1608
+ }
1609
+ if (!defaultValue.defined(endPoint1)) {
1610
+ throw new Check.DeveloperError("endPoint1 is required.");
1611
+ }
1612
+ if (!defaultValue.defined(plane)) {
1613
+ throw new Check.DeveloperError("plane is required.");
1614
+ }
1615
+ //>>includeEnd('debug');
1616
+
1617
+ if (!defaultValue.defined(result)) {
1618
+ result = new Matrix3.Cartesian3();
1619
+ }
1620
+
1621
+ const difference = Matrix3.Cartesian3.subtract(
1622
+ endPoint1,
1623
+ endPoint0,
1624
+ lineSegmentPlaneDifference
1625
+ );
1626
+ const normal = plane.normal;
1627
+ const nDotDiff = Matrix3.Cartesian3.dot(normal, difference);
1628
+
1629
+ // check if the segment and plane are parallel
1630
+ if (Math.abs(nDotDiff) < Math$1.CesiumMath.EPSILON6) {
1631
+ return undefined;
1632
+ }
1633
+
1634
+ const nDotP0 = Matrix3.Cartesian3.dot(normal, endPoint0);
1635
+ const t = -(plane.distance + nDotP0) / nDotDiff;
1636
+
1637
+ // intersection only if t is in [0, 1]
1638
+ if (t < 0.0 || t > 1.0) {
1639
+ return undefined;
1640
+ }
1641
+
1642
+ // intersection is endPoint0 + t * (endPoint1 - endPoint0)
1643
+ Matrix3.Cartesian3.multiplyByScalar(difference, t, result);
1644
+ Matrix3.Cartesian3.add(endPoint0, result, result);
1645
+ return result;
1646
+ };
1647
+
1648
+ /**
1649
+ * Computes the intersection of a triangle and a plane
1650
+ *
1651
+ * @param {Cartesian3} p0 First point of the triangle
1652
+ * @param {Cartesian3} p1 Second point of the triangle
1653
+ * @param {Cartesian3} p2 Third point of the triangle
1654
+ * @param {Plane} plane Intersection plane
1655
+ * @returns {Object} An object with properties <code>positions</code> and <code>indices</code>, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)
1656
+ *
1657
+ * @example
1658
+ * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
1659
+ * const normal = ellipsoid.geodeticSurfaceNormal(origin);
1660
+ * const plane = Cesium.Plane.fromPointNormal(origin, normal);
1661
+ *
1662
+ * const p0 = new Cesium.Cartesian3(...);
1663
+ * const p1 = new Cesium.Cartesian3(...);
1664
+ * const p2 = new Cesium.Cartesian3(...);
1665
+ *
1666
+ * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
1667
+ * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
1668
+ */
1669
+ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) {
1670
+ //>>includeStart('debug', pragmas.debug);
1671
+ if (!defaultValue.defined(p0) || !defaultValue.defined(p1) || !defaultValue.defined(p2) || !defaultValue.defined(plane)) {
1672
+ throw new Check.DeveloperError("p0, p1, p2, and plane are required.");
1673
+ }
1674
+ //>>includeEnd('debug');
1675
+
1676
+ const planeNormal = plane.normal;
1677
+ const planeD = plane.distance;
1678
+ const p0Behind = Matrix3.Cartesian3.dot(planeNormal, p0) + planeD < 0.0;
1679
+ const p1Behind = Matrix3.Cartesian3.dot(planeNormal, p1) + planeD < 0.0;
1680
+ const p2Behind = Matrix3.Cartesian3.dot(planeNormal, p2) + planeD < 0.0;
1681
+ // Given these dots products, the calls to lineSegmentPlaneIntersection
1682
+ // always have defined results.
1683
+
1684
+ let numBehind = 0;
1685
+ numBehind += p0Behind ? 1 : 0;
1686
+ numBehind += p1Behind ? 1 : 0;
1687
+ numBehind += p2Behind ? 1 : 0;
1688
+
1689
+ let u1, u2;
1690
+ if (numBehind === 1 || numBehind === 2) {
1691
+ u1 = new Matrix3.Cartesian3();
1692
+ u2 = new Matrix3.Cartesian3();
1693
+ }
1694
+
1695
+ if (numBehind === 1) {
1696
+ if (p0Behind) {
1697
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);
1698
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);
1699
+
1700
+ return {
1701
+ positions: [p0, p1, p2, u1, u2],
1702
+ indices: [
1703
+ // Behind
1704
+ 0,
1705
+ 3,
1706
+ 4,
1707
+
1708
+ // In front
1709
+ 1,
1710
+ 2,
1711
+ 4,
1712
+ 1,
1713
+ 4,
1714
+ 3,
1715
+ ],
1716
+ };
1717
+ } else if (p1Behind) {
1718
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);
1719
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);
1720
+
1721
+ return {
1722
+ positions: [p0, p1, p2, u1, u2],
1723
+ indices: [
1724
+ // Behind
1725
+ 1,
1726
+ 3,
1727
+ 4,
1728
+
1729
+ // In front
1730
+ 2,
1731
+ 0,
1732
+ 4,
1733
+ 2,
1734
+ 4,
1735
+ 3,
1736
+ ],
1737
+ };
1738
+ } else if (p2Behind) {
1739
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);
1740
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);
1741
+
1742
+ return {
1743
+ positions: [p0, p1, p2, u1, u2],
1744
+ indices: [
1745
+ // Behind
1746
+ 2,
1747
+ 3,
1748
+ 4,
1749
+
1750
+ // In front
1751
+ 0,
1752
+ 1,
1753
+ 4,
1754
+ 0,
1755
+ 4,
1756
+ 3,
1757
+ ],
1758
+ };
1759
+ }
1760
+ } else if (numBehind === 2) {
1761
+ if (!p0Behind) {
1762
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);
1763
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);
1764
+
1765
+ return {
1766
+ positions: [p0, p1, p2, u1, u2],
1767
+ indices: [
1768
+ // Behind
1769
+ 1,
1770
+ 2,
1771
+ 4,
1772
+ 1,
1773
+ 4,
1774
+ 3,
1775
+
1776
+ // In front
1777
+ 0,
1778
+ 3,
1779
+ 4,
1780
+ ],
1781
+ };
1782
+ } else if (!p1Behind) {
1783
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);
1784
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);
1785
+
1786
+ return {
1787
+ positions: [p0, p1, p2, u1, u2],
1788
+ indices: [
1789
+ // Behind
1790
+ 2,
1791
+ 0,
1792
+ 4,
1793
+ 2,
1794
+ 4,
1795
+ 3,
1796
+
1797
+ // In front
1798
+ 1,
1799
+ 3,
1800
+ 4,
1801
+ ],
1802
+ };
1803
+ } else if (!p2Behind) {
1804
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);
1805
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);
1806
+
1807
+ return {
1808
+ positions: [p0, p1, p2, u1, u2],
1809
+ indices: [
1810
+ // Behind
1811
+ 0,
1812
+ 1,
1813
+ 4,
1814
+ 0,
1815
+ 4,
1816
+ 3,
1817
+
1818
+ // In front
1819
+ 2,
1820
+ 3,
1821
+ 4,
1822
+ ],
1823
+ };
1824
+ }
1825
+ }
1826
+
1827
+ // if numBehind is 3, the triangle is completely behind the plane;
1828
+ // otherwise, it is completely in front (numBehind is 0).
1829
+ return undefined;
1830
+ };
1831
+ var IntersectionTests$1 = IntersectionTests;
1832
+
1833
+ exports.IntersectionTests = IntersectionTests$1;
1834
+ exports.Ray = Ray;
1835
+
1836
+ }));