@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.
- package/build/buildHelpers.js +4 -3
- package/config/base.config.json +5 -4
- package/config/dev.config.json +4 -0
- package/config/graphFeatureInfo.config.json +1 -1
- package/config/projects.config.json +2 -2
- package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +1 -1
- package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
- package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
- package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
- package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
- package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
- package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
- package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
- package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
- package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
- package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
- package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
- package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
- package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
- package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
- package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
- package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
- package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
- package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
- package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
- package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
- package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
- package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
- package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
- package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
- package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
- package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
- package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
- package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
- package/dist/assets/cesium/Workers/{package.js → chunk-MPAZH4BF.js} +13 -2
- package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
- package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
- package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
- package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
- package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
- package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
- package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
- package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
- package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
- package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
- package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
- package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
- package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
- package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
- package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
- package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
- package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
- package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
- package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
- package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
- package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
- package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
- package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
- package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
- package/dist/assets/cesium/Workers/combineGeometry.js +65 -15
- package/dist/assets/cesium/Workers/createBoxGeometry.js +55 -10
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +231 -310
- package/dist/assets/cesium/Workers/createCircleGeometry.js +185 -202
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +141 -155
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +477 -557
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1162 -1307
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +533 -569
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +57 -10
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +224 -258
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +68 -12
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +61 -12
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +56 -10
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +58 -13
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +55 -10
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +226 -243
- package/dist/assets/cesium/Workers/createGeometry.js +143 -48
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1484 -2011
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +216 -243
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +121 -113
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1041 -1327
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +516 -657
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +471 -547
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +352 -384
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1128 -1331
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +445 -500
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +381 -440
- package/dist/assets/cesium/Workers/createSphereGeometry.js +112 -118
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +112 -121
- package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -127
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +462 -505
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +377 -436
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +110 -77
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +369 -391
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +252 -244
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2244 -2677
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -926
- package/dist/assets/cesium/Workers/createWallGeometry.js +459 -593
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +324 -419
- package/dist/assets/cesium/Workers/decodeDraco.js +327 -347
- package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
- package/dist/assets/cesium/Workers/decodeI3S.js +765 -970
- package/dist/assets/cesium/Workers/transcodeKTX2.js +3353 -1464
- package/dist/assets/cesium/Workers/transferTypedArrayTest.js +3 -4
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +748 -953
- package/dist/assets/{cesium.eaf7cc.js → cesium.77d0f7.js} +8915 -13165
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.b16511.js → core.720589.js} +3421 -3365
- package/dist/assets/core.js +1 -1
- package/dist/assets/index-dd539204.js +1 -0
- package/dist/assets/{ol.4bbf0f.js → ol.e48649.js} +4 -4
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.ab815e.css → ui.50452a.css} +1 -1
- package/dist/assets/{ui.ab815e.js → ui.50452a.js} +4270 -4355
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.ea3fa8.js → vuetify.f0a769.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +27 -23
- package/index.html +23 -22
- package/package.json +5 -5
- package/plugins/@vcmap-show-case/plugin-editors/PluginEditors.vue +119 -0
- package/plugins/@vcmap-show-case/plugin-editors/index.js +41 -0
- package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
- package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ProjectSelectorComponent.vue +1 -1
- package/plugins/{@vcmap → @vcmap-show-case}/project-selector/config.json +2 -2
- package/plugins/{@vcmap → @vcmap-show-case}/project-selector/package.json +1 -1
- package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/package.json +1 -1
- package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +1 -1
- package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/ThemeChangerComponent.vue +1 -1
- package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/config.json +2 -2
- package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/package.json +1 -1
- package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +20 -1
- package/plugins/package.json +6 -2
- package/src/application/VcsAttributions.vue +27 -20
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +22 -14
- package/src/components/form-inputs-controls/VcsSlider.vue +1 -0
- package/src/components/icons/2DAreaIcon.vue +2 -17
- package/src/components/icons/2DDistanceIcon.vue +0 -3
- package/src/components/icons/3DAreaIcon.vue +2 -17
- package/src/components/icons/3DDistanceIcon.vue +0 -3
- package/src/components/icons/3DHeightIcon.vue +0 -3
- package/src/components/icons/AngleIcon.vue +0 -1
- package/src/components/icons/AssociationsIcon.vue +1 -3
- package/src/components/icons/AxisIcon.vue +0 -4
- package/src/components/icons/BoundingBoxIcon.vue +1 -4
- package/src/components/icons/CheckboxIcon.vue +0 -2
- package/src/components/icons/CheckboxIndeterminateIcon.vue +1 -5
- package/src/components/icons/CircleIcon.vue +1 -6
- package/src/components/icons/ClippingHorizontalIcon.vue +0 -1
- package/src/components/icons/ClippingIcon.vue +0 -1
- package/src/components/icons/ClippingVerticalIcon.vue +0 -1
- package/src/components/icons/ColorPickerIcon.vue +0 -1
- package/src/components/icons/ColorSwatchIcon.vue +0 -2
- package/src/components/icons/CommentIcon.vue +0 -1
- package/src/components/icons/CompassIcon.vue +0 -2
- package/src/components/icons/ComponentsIcon.vue +0 -1
- package/src/components/icons/ConeIcon.vue +1 -4
- package/src/components/icons/DimensionsHouseIcon.vue +0 -2
- package/src/components/icons/EditIcon.vue +0 -1
- package/src/components/icons/EditVerticesIcon.vue +0 -4
- package/src/components/icons/ElevationProfileIcon.vue +1 -13
- package/src/components/icons/ExportAreaIcon.vue +0 -1
- package/src/components/icons/ExportFlightIcon.vue +0 -1
- package/src/components/icons/ExportIcon.vue +12 -8
- package/src/components/icons/ExternalLinkIcon.vue +0 -2
- package/src/components/icons/FastForwardIcon.vue +0 -1
- package/src/components/icons/FilterIcon.vue +0 -1
- package/src/components/icons/GlobeNatureIcon.vue +0 -3
- package/src/components/icons/GroundIcon.vue +0 -1
- package/src/components/icons/HealthCareIndustriesIcon.vue +1 -11
- package/src/components/icons/HideIcon.vue +0 -1
- package/src/components/icons/HomePointIcon.vue +0 -1
- package/src/components/icons/HospitalsIcon.vue +1 -20
- package/src/components/icons/HouseIcon.vue +3 -13
- package/src/components/icons/ImportIcon.vue +6 -14
- package/src/components/icons/InfoIcon.vue +0 -2
- package/src/components/icons/KebabIcon.vue +1 -9
- package/src/components/icons/LabelIcon.vue +0 -2
- package/src/components/icons/LayersIcon.vue +1 -9
- package/src/components/icons/LegendIcon.vue +0 -1
- package/src/components/icons/LineIcon.vue +0 -2
- package/src/components/icons/LinkIcon.vue +0 -1
- package/src/components/icons/LogoutIcon.vue +0 -1
- package/src/components/icons/MapIcon.vue +0 -2
- package/src/components/icons/MenuIcon.vue +1 -5
- package/src/components/icons/MinusIcon.vue +0 -2
- package/src/components/icons/ObjectSelectIcon.vue +0 -2
- package/src/components/icons/ObliqueViewIcon.vue +0 -1
- package/src/components/icons/PdfIcon.vue +0 -1
- package/src/components/icons/PedestrianIcon.vue +0 -1
- package/src/components/icons/PenIcon.vue +0 -1
- package/src/components/icons/PlayCircleIcon.vue +1 -8
- package/src/components/icons/PlusIcon.vue +0 -2
- package/src/components/icons/PoiIcon.vue +0 -1
- package/src/components/icons/PointIcon.vue +2 -6
- package/src/components/icons/PointSelectIcon.vue +0 -1
- package/src/components/icons/PresentationModeIcon.vue +0 -1
- package/src/components/icons/ProgressIcon.vue +1 -1
- package/src/components/icons/QueryIcon.vue +0 -1
- package/src/components/icons/RectangleIcon.vue +1 -6
- package/src/components/icons/ReturnIcon.vue +0 -1
- package/src/components/icons/RewindIcon.vue +0 -1
- package/src/components/icons/RotateLeftIcon.vue +0 -1
- package/src/components/icons/RotateRightIcon.vue +0 -1
- package/src/components/icons/ScreenshotIcon.vue +1 -6
- package/src/components/icons/SearchIcon.vue +0 -1
- package/src/components/icons/ShadowIcon.vue +0 -2
- package/src/components/icons/ShapesIcon.vue +1 -4
- package/src/components/icons/ShareIcon.vue +0 -1
- package/src/components/icons/SimpleCircleFilledIcon.vue +0 -1
- package/src/components/icons/SimpleCircleHalfFilledIcon.vue +0 -1
- package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -7
- package/src/components/icons/SkipPreviousIcon.vue +1 -6
- package/src/components/icons/SplitViewIcon.vue +0 -1
- package/src/components/icons/TextStyleIcon.vue +0 -3
- package/src/components/icons/ThreeDimensionsIcon.vue +0 -1
- package/src/components/icons/ToolsIcon.vue +0 -1
- package/src/components/icons/TouchIcon.vue +0 -1
- package/src/components/icons/TriangleIcon.vue +0 -3
- package/src/components/icons/TwoDimensionsIcon.vue +0 -2
- package/src/components/icons/UploadIcon.vue +0 -1
- package/src/components/icons/UserProfileIcon.vue +0 -1
- package/src/components/icons/UserShareIcon.vue +0 -1
- package/src/components/icons/ViewpointFlightIcon.vue +0 -1
- package/src/components/icons/ViewpointIcon.vue +0 -1
- package/src/components/icons/Viewshed360Icon.vue +0 -1
- package/src/components/icons/ViewshedConeIcon.vue +0 -1
- package/src/components/icons/ViewshedIcon.vue +0 -1
- package/src/components/icons/WalkingIcon.vue +0 -1
- package/src/components/icons/WallIcon.vue +1 -4
- package/src/components/icons/WandIcon.vue +22 -70
- package/src/components/lists/VcsList.vue +18 -12
- package/src/components/plugins/AbstractConfigEditor.vue +2 -2
- package/src/components/tables/VcsDataTable.vue +1 -1
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +57 -14
- package/src/contentTree/contentTreeCollection.js +30 -9
- package/src/i18n/de.js +8 -5
- package/src/i18n/en.js +8 -5
- package/src/i18n/i18nCollection.js +19 -65
- package/src/manager/buttonManager.js +4 -0
- package/src/manager/contextMenu/contextMenuManager.js +2 -0
- package/src/pluginHelper.js +2 -2
- package/src/vcsUiApp.js +9 -4
- package/src/vuePlugins/i18n.js +0 -8
- package/dist/assets/cesium/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
- package/dist/assets/cesium/Workers/ArcType-2d9abbbc.js +0 -37
- package/dist/assets/cesium/Workers/AttributeCompression-f9f6c717.js +0 -716
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-4140c51f.js +0 -258
- package/dist/assets/cesium/Workers/BoundingRectangle-c714b156.js +0 -369
- package/dist/assets/cesium/Workers/BoxGeometry-6f3da43d.js +0 -884
- package/dist/assets/cesium/Workers/Check-6ede7e26.js +0 -290
- package/dist/assets/cesium/Workers/Color-8a565ff2.js +0 -2262
- package/dist/assets/cesium/Workers/ComponentDatatype-cf1fa08e.js +0 -341
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4b4d4096.js +0 -132
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-7b94502b.js +0 -498
- package/dist/assets/cesium/Workers/CylinderGeometry-ca070b87.js +0 -467
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
- package/dist/assets/cesium/Workers/EllipseGeometry-122e51fa.js +0 -1304
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-4d326efc.js +0 -366
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-16cc2bd7.js +0 -443
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
- package/dist/assets/cesium/Workers/EllipsoidGeometry-cb148ca2.js +0 -637
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-0fa10c79.js +0 -454
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-6dd1b7af.js +0 -373
- package/dist/assets/cesium/Workers/EncodedCartesian3-57415c8a.js +0 -171
- package/dist/assets/cesium/Workers/FrustumGeometry-ee73037c.js +0 -2540
- package/dist/assets/cesium/Workers/GeometryAttribute-ff5b4fb1.js +0 -619
- package/dist/assets/cesium/Workers/GeometryAttributes-ad136444.js +0 -91
- package/dist/assets/cesium/Workers/GeometryInstance-34d9e21e.js +0 -121
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
- package/dist/assets/cesium/Workers/GeometryPipeline-1f8fbf05.js +0 -3690
- package/dist/assets/cesium/Workers/IndexDatatype-2643aa47.js +0 -200
- package/dist/assets/cesium/Workers/IntersectionTests-70d39ba9.js +0 -1836
- package/dist/assets/cesium/Workers/Math-0a2ac845.js +0 -1340
- package/dist/assets/cesium/Workers/Matrix2-e1298525.js +0 -7086
- package/dist/assets/cesium/Workers/Matrix3-41c58dde.js +0 -4283
- package/dist/assets/cesium/Workers/OrientedBoundingBox-159cf1d6.js +0 -1259
- package/dist/assets/cesium/Workers/Plane-4c3d403b.js +0 -309
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-076a5d25.js +0 -1074
- package/dist/assets/cesium/Workers/PolygonPipeline-b9f2810a.js +0 -1344
- package/dist/assets/cesium/Workers/PolylinePipeline-639192e0.js +0 -573
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-b73549fb.js +0 -781
- package/dist/assets/cesium/Workers/PrimitivePipeline-10ede1b6.js +0 -966
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-c35a7356.js +0 -280
- package/dist/assets/cesium/Workers/RuntimeError-ef395448.js +0 -68
- package/dist/assets/cesium/Workers/TerrainEncoding-668d242f.js +0 -1227
- package/dist/assets/cesium/Workers/Transforms-a2a85221.js +0 -14712
- package/dist/assets/cesium/Workers/VertexFormat-030f11ff.js +0 -312
- package/dist/assets/cesium/Workers/WallGeometryLibrary-1938bf0d.js +0 -211
- package/dist/assets/cesium/Workers/WebGLConstants-0b1ce7ba.js +0 -620
- package/dist/assets/cesium/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
- package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -1363
- package/dist/assets/cesium/Workers/combine-d9581036.js +0 -82
- package/dist/assets/cesium/Workers/defaultValue-fe22d8c0.js +0 -51
- package/dist/assets/index-c115e3a1.js +0 -1
- package/plugins/@vcmap/create-link/fallbackCreateLink.vue +0 -76
- package/plugins/@vcmap/create-link/index.js +0 -95
- package/plugins/@vcmap/create-link/package.json +0 -6
- package/plugins/@vcmap/search-nominatim/LICENSE.md +0 -13
- package/plugins/@vcmap/search-nominatim/README.md +0 -3
- package/plugins/@vcmap/search-nominatim/SearchNominatimEditor.vue +0 -90
- package/plugins/@vcmap/search-nominatim/config.json +0 -3
- package/plugins/@vcmap/search-nominatim/index.js +0 -66
- package/plugins/@vcmap/search-nominatim/nominatim.js +0 -175
- package/plugins/@vcmap/search-nominatim/package.json +0 -9
- /package/dist/assets/{vue.67e80f.js → vue.5d696e.js} +0 -0
- /package/dist/assets/{vuetify.ea3fa8.css → vuetify.f0a769.css} +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/ModulesListComponent.vue +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/README.md +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/de.json +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/en.json +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/project-selector/index.js +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/README.md +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/SimpleGraphComponent.vue +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/index.js +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/simple-graph/simpleGraphView.js +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +0 -0
- /package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/index.js +0 -0
@@ -1,1836 +0,0 @@
|
|
1
|
-
define(['exports', './Matrix3-41c58dde', './defaultValue-fe22d8c0', './Check-6ede7e26', './Transforms-a2a85221', './Math-0a2ac845'], (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
|
-
}));
|