@vcmap/ui 5.0.0-rc.29 → 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 +8 -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.16590b.js → cesium.77d0f7.js} +8915 -13165
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.74da2a.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.50a512.js → ol.e48649.js} +4 -4
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui.d3054c.css → ui.50452a.css} +2 -2
- package/dist/assets/{ui.d3054c.js → ui.50452a.js} +5312 -4776
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.946bd8.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/index.js +6 -0
- package/package.json +5 -5
- package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +37 -1
- package/plugins/@vcmap-show-case/form-inputs-example/index.js +3 -0
- package/plugins/@vcmap-show-case/form-inputs-example/validation.js +11 -0
- 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/style-input-example/styleExample.vue +0 -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/index.js +40 -0
- package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
- package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +128 -0
- package/plugins/package.json +6 -2
- package/src/application/VcsAttributions.vue +27 -20
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
- package/src/components/form-inputs-controls/VcsSlider.vue +1 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +9 -3
- 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 +84 -0
- package/src/components/style/VcsImageSelector.vue +6 -5
- package/src/components/style/VcsTextSelector.vue +1 -1
- package/src/components/tables/VcsDataTable.vue +1 -1
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +780 -0
- package/src/components/vector-properties/composables.js +93 -0
- package/src/contentTree/contentTreeCollection.js +30 -9
- package/src/i18n/de.js +41 -7
- package/src/i18n/en.js +39 -5
- package/src/i18n/i18nCollection.js +19 -65
- package/src/manager/buttonManager.js +4 -0
- package/src/manager/collectionManager/collectionComponent.js +1 -1
- package/src/manager/contextMenu/contextMenuManager.js +2 -0
- package/src/pluginHelper.js +57 -17
- package/src/vcsUiApp.js +25 -30
- 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-cb070eff.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/config.json +0 -3
- package/plugins/@vcmap/search-nominatim/index.js +0 -29
- package/plugins/@vcmap/search-nominatim/nominatim.js +0 -175
- package/plugins/@vcmap/search-nominatim/package.json +0 -9
- /package/dist/assets/{vue.30740e.js → vue.5d696e.js} +0 -0
- /package/dist/assets/{vuetify.946bd8.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
@@ -0,0 +1,2041 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
4
|
+
* Version 1.109.3
|
5
|
+
*
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
7
|
+
*
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
* you may not use this file except in compliance with the License.
|
10
|
+
* You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
* See the License for the specific language governing permissions and
|
18
|
+
* limitations under the License.
|
19
|
+
*
|
20
|
+
* Columbus View (Pat. Pend.)
|
21
|
+
*
|
22
|
+
* Portions licensed separately.
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
24
|
+
*/
|
25
|
+
|
26
|
+
import {
|
27
|
+
Math_default
|
28
|
+
} from "./chunk-N3JIFFX2.js";
|
29
|
+
import {
|
30
|
+
defaultValue_default
|
31
|
+
} from "./chunk-WXTV4ATB.js";
|
32
|
+
import {
|
33
|
+
Check_default,
|
34
|
+
DeveloperError_default
|
35
|
+
} from "./chunk-4MFFIWUA.js";
|
36
|
+
import {
|
37
|
+
defined_default
|
38
|
+
} from "./chunk-6BTKZDRG.js";
|
39
|
+
|
40
|
+
// packages/engine/Source/Core/Cartesian3.js
|
41
|
+
function Cartesian3(x, y, z) {
|
42
|
+
this.x = defaultValue_default(x, 0);
|
43
|
+
this.y = defaultValue_default(y, 0);
|
44
|
+
this.z = defaultValue_default(z, 0);
|
45
|
+
}
|
46
|
+
Cartesian3.fromSpherical = function(spherical, result) {
|
47
|
+
Check_default.typeOf.object("spherical", spherical);
|
48
|
+
if (!defined_default(result)) {
|
49
|
+
result = new Cartesian3();
|
50
|
+
}
|
51
|
+
const clock = spherical.clock;
|
52
|
+
const cone = spherical.cone;
|
53
|
+
const magnitude = defaultValue_default(spherical.magnitude, 1);
|
54
|
+
const radial = magnitude * Math.sin(cone);
|
55
|
+
result.x = radial * Math.cos(clock);
|
56
|
+
result.y = radial * Math.sin(clock);
|
57
|
+
result.z = magnitude * Math.cos(cone);
|
58
|
+
return result;
|
59
|
+
};
|
60
|
+
Cartesian3.fromElements = function(x, y, z, result) {
|
61
|
+
if (!defined_default(result)) {
|
62
|
+
return new Cartesian3(x, y, z);
|
63
|
+
}
|
64
|
+
result.x = x;
|
65
|
+
result.y = y;
|
66
|
+
result.z = z;
|
67
|
+
return result;
|
68
|
+
};
|
69
|
+
Cartesian3.clone = function(cartesian, result) {
|
70
|
+
if (!defined_default(cartesian)) {
|
71
|
+
return void 0;
|
72
|
+
}
|
73
|
+
if (!defined_default(result)) {
|
74
|
+
return new Cartesian3(cartesian.x, cartesian.y, cartesian.z);
|
75
|
+
}
|
76
|
+
result.x = cartesian.x;
|
77
|
+
result.y = cartesian.y;
|
78
|
+
result.z = cartesian.z;
|
79
|
+
return result;
|
80
|
+
};
|
81
|
+
Cartesian3.fromCartesian4 = Cartesian3.clone;
|
82
|
+
Cartesian3.packedLength = 3;
|
83
|
+
Cartesian3.pack = function(value, array, startingIndex) {
|
84
|
+
Check_default.typeOf.object("value", value);
|
85
|
+
Check_default.defined("array", array);
|
86
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
87
|
+
array[startingIndex++] = value.x;
|
88
|
+
array[startingIndex++] = value.y;
|
89
|
+
array[startingIndex] = value.z;
|
90
|
+
return array;
|
91
|
+
};
|
92
|
+
Cartesian3.unpack = function(array, startingIndex, result) {
|
93
|
+
Check_default.defined("array", array);
|
94
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
95
|
+
if (!defined_default(result)) {
|
96
|
+
result = new Cartesian3();
|
97
|
+
}
|
98
|
+
result.x = array[startingIndex++];
|
99
|
+
result.y = array[startingIndex++];
|
100
|
+
result.z = array[startingIndex];
|
101
|
+
return result;
|
102
|
+
};
|
103
|
+
Cartesian3.packArray = function(array, result) {
|
104
|
+
Check_default.defined("array", array);
|
105
|
+
const length = array.length;
|
106
|
+
const resultLength = length * 3;
|
107
|
+
if (!defined_default(result)) {
|
108
|
+
result = new Array(resultLength);
|
109
|
+
} else if (!Array.isArray(result) && result.length !== resultLength) {
|
110
|
+
throw new DeveloperError_default(
|
111
|
+
"If result is a typed array, it must have exactly array.length * 3 elements"
|
112
|
+
);
|
113
|
+
} else if (result.length !== resultLength) {
|
114
|
+
result.length = resultLength;
|
115
|
+
}
|
116
|
+
for (let i = 0; i < length; ++i) {
|
117
|
+
Cartesian3.pack(array[i], result, i * 3);
|
118
|
+
}
|
119
|
+
return result;
|
120
|
+
};
|
121
|
+
Cartesian3.unpackArray = function(array, result) {
|
122
|
+
Check_default.defined("array", array);
|
123
|
+
Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 3);
|
124
|
+
if (array.length % 3 !== 0) {
|
125
|
+
throw new DeveloperError_default("array length must be a multiple of 3.");
|
126
|
+
}
|
127
|
+
const length = array.length;
|
128
|
+
if (!defined_default(result)) {
|
129
|
+
result = new Array(length / 3);
|
130
|
+
} else {
|
131
|
+
result.length = length / 3;
|
132
|
+
}
|
133
|
+
for (let i = 0; i < length; i += 3) {
|
134
|
+
const index = i / 3;
|
135
|
+
result[index] = Cartesian3.unpack(array, i, result[index]);
|
136
|
+
}
|
137
|
+
return result;
|
138
|
+
};
|
139
|
+
Cartesian3.fromArray = Cartesian3.unpack;
|
140
|
+
Cartesian3.maximumComponent = function(cartesian) {
|
141
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
142
|
+
return Math.max(cartesian.x, cartesian.y, cartesian.z);
|
143
|
+
};
|
144
|
+
Cartesian3.minimumComponent = function(cartesian) {
|
145
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
146
|
+
return Math.min(cartesian.x, cartesian.y, cartesian.z);
|
147
|
+
};
|
148
|
+
Cartesian3.minimumByComponent = function(first, second, result) {
|
149
|
+
Check_default.typeOf.object("first", first);
|
150
|
+
Check_default.typeOf.object("second", second);
|
151
|
+
Check_default.typeOf.object("result", result);
|
152
|
+
result.x = Math.min(first.x, second.x);
|
153
|
+
result.y = Math.min(first.y, second.y);
|
154
|
+
result.z = Math.min(first.z, second.z);
|
155
|
+
return result;
|
156
|
+
};
|
157
|
+
Cartesian3.maximumByComponent = function(first, second, result) {
|
158
|
+
Check_default.typeOf.object("first", first);
|
159
|
+
Check_default.typeOf.object("second", second);
|
160
|
+
Check_default.typeOf.object("result", result);
|
161
|
+
result.x = Math.max(first.x, second.x);
|
162
|
+
result.y = Math.max(first.y, second.y);
|
163
|
+
result.z = Math.max(first.z, second.z);
|
164
|
+
return result;
|
165
|
+
};
|
166
|
+
Cartesian3.clamp = function(value, min, max, result) {
|
167
|
+
Check_default.typeOf.object("value", value);
|
168
|
+
Check_default.typeOf.object("min", min);
|
169
|
+
Check_default.typeOf.object("max", max);
|
170
|
+
Check_default.typeOf.object("result", result);
|
171
|
+
const x = Math_default.clamp(value.x, min.x, max.x);
|
172
|
+
const y = Math_default.clamp(value.y, min.y, max.y);
|
173
|
+
const z = Math_default.clamp(value.z, min.z, max.z);
|
174
|
+
result.x = x;
|
175
|
+
result.y = y;
|
176
|
+
result.z = z;
|
177
|
+
return result;
|
178
|
+
};
|
179
|
+
Cartesian3.magnitudeSquared = function(cartesian) {
|
180
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
181
|
+
return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z;
|
182
|
+
};
|
183
|
+
Cartesian3.magnitude = function(cartesian) {
|
184
|
+
return Math.sqrt(Cartesian3.magnitudeSquared(cartesian));
|
185
|
+
};
|
186
|
+
var distanceScratch = new Cartesian3();
|
187
|
+
Cartesian3.distance = function(left, right) {
|
188
|
+
Check_default.typeOf.object("left", left);
|
189
|
+
Check_default.typeOf.object("right", right);
|
190
|
+
Cartesian3.subtract(left, right, distanceScratch);
|
191
|
+
return Cartesian3.magnitude(distanceScratch);
|
192
|
+
};
|
193
|
+
Cartesian3.distanceSquared = function(left, right) {
|
194
|
+
Check_default.typeOf.object("left", left);
|
195
|
+
Check_default.typeOf.object("right", right);
|
196
|
+
Cartesian3.subtract(left, right, distanceScratch);
|
197
|
+
return Cartesian3.magnitudeSquared(distanceScratch);
|
198
|
+
};
|
199
|
+
Cartesian3.normalize = function(cartesian, result) {
|
200
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
201
|
+
Check_default.typeOf.object("result", result);
|
202
|
+
const magnitude = Cartesian3.magnitude(cartesian);
|
203
|
+
result.x = cartesian.x / magnitude;
|
204
|
+
result.y = cartesian.y / magnitude;
|
205
|
+
result.z = cartesian.z / magnitude;
|
206
|
+
if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z)) {
|
207
|
+
throw new DeveloperError_default("normalized result is not a number");
|
208
|
+
}
|
209
|
+
return result;
|
210
|
+
};
|
211
|
+
Cartesian3.dot = function(left, right) {
|
212
|
+
Check_default.typeOf.object("left", left);
|
213
|
+
Check_default.typeOf.object("right", right);
|
214
|
+
return left.x * right.x + left.y * right.y + left.z * right.z;
|
215
|
+
};
|
216
|
+
Cartesian3.multiplyComponents = function(left, right, result) {
|
217
|
+
Check_default.typeOf.object("left", left);
|
218
|
+
Check_default.typeOf.object("right", right);
|
219
|
+
Check_default.typeOf.object("result", result);
|
220
|
+
result.x = left.x * right.x;
|
221
|
+
result.y = left.y * right.y;
|
222
|
+
result.z = left.z * right.z;
|
223
|
+
return result;
|
224
|
+
};
|
225
|
+
Cartesian3.divideComponents = function(left, right, result) {
|
226
|
+
Check_default.typeOf.object("left", left);
|
227
|
+
Check_default.typeOf.object("right", right);
|
228
|
+
Check_default.typeOf.object("result", result);
|
229
|
+
result.x = left.x / right.x;
|
230
|
+
result.y = left.y / right.y;
|
231
|
+
result.z = left.z / right.z;
|
232
|
+
return result;
|
233
|
+
};
|
234
|
+
Cartesian3.add = function(left, right, result) {
|
235
|
+
Check_default.typeOf.object("left", left);
|
236
|
+
Check_default.typeOf.object("right", right);
|
237
|
+
Check_default.typeOf.object("result", result);
|
238
|
+
result.x = left.x + right.x;
|
239
|
+
result.y = left.y + right.y;
|
240
|
+
result.z = left.z + right.z;
|
241
|
+
return result;
|
242
|
+
};
|
243
|
+
Cartesian3.subtract = function(left, right, result) {
|
244
|
+
Check_default.typeOf.object("left", left);
|
245
|
+
Check_default.typeOf.object("right", right);
|
246
|
+
Check_default.typeOf.object("result", result);
|
247
|
+
result.x = left.x - right.x;
|
248
|
+
result.y = left.y - right.y;
|
249
|
+
result.z = left.z - right.z;
|
250
|
+
return result;
|
251
|
+
};
|
252
|
+
Cartesian3.multiplyByScalar = function(cartesian, scalar, result) {
|
253
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
254
|
+
Check_default.typeOf.number("scalar", scalar);
|
255
|
+
Check_default.typeOf.object("result", result);
|
256
|
+
result.x = cartesian.x * scalar;
|
257
|
+
result.y = cartesian.y * scalar;
|
258
|
+
result.z = cartesian.z * scalar;
|
259
|
+
return result;
|
260
|
+
};
|
261
|
+
Cartesian3.divideByScalar = function(cartesian, scalar, result) {
|
262
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
263
|
+
Check_default.typeOf.number("scalar", scalar);
|
264
|
+
Check_default.typeOf.object("result", result);
|
265
|
+
result.x = cartesian.x / scalar;
|
266
|
+
result.y = cartesian.y / scalar;
|
267
|
+
result.z = cartesian.z / scalar;
|
268
|
+
return result;
|
269
|
+
};
|
270
|
+
Cartesian3.negate = function(cartesian, result) {
|
271
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
272
|
+
Check_default.typeOf.object("result", result);
|
273
|
+
result.x = -cartesian.x;
|
274
|
+
result.y = -cartesian.y;
|
275
|
+
result.z = -cartesian.z;
|
276
|
+
return result;
|
277
|
+
};
|
278
|
+
Cartesian3.abs = function(cartesian, result) {
|
279
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
280
|
+
Check_default.typeOf.object("result", result);
|
281
|
+
result.x = Math.abs(cartesian.x);
|
282
|
+
result.y = Math.abs(cartesian.y);
|
283
|
+
result.z = Math.abs(cartesian.z);
|
284
|
+
return result;
|
285
|
+
};
|
286
|
+
var lerpScratch = new Cartesian3();
|
287
|
+
Cartesian3.lerp = function(start, end, t, result) {
|
288
|
+
Check_default.typeOf.object("start", start);
|
289
|
+
Check_default.typeOf.object("end", end);
|
290
|
+
Check_default.typeOf.number("t", t);
|
291
|
+
Check_default.typeOf.object("result", result);
|
292
|
+
Cartesian3.multiplyByScalar(end, t, lerpScratch);
|
293
|
+
result = Cartesian3.multiplyByScalar(start, 1 - t, result);
|
294
|
+
return Cartesian3.add(lerpScratch, result, result);
|
295
|
+
};
|
296
|
+
var angleBetweenScratch = new Cartesian3();
|
297
|
+
var angleBetweenScratch2 = new Cartesian3();
|
298
|
+
Cartesian3.angleBetween = function(left, right) {
|
299
|
+
Check_default.typeOf.object("left", left);
|
300
|
+
Check_default.typeOf.object("right", right);
|
301
|
+
Cartesian3.normalize(left, angleBetweenScratch);
|
302
|
+
Cartesian3.normalize(right, angleBetweenScratch2);
|
303
|
+
const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);
|
304
|
+
const sine = Cartesian3.magnitude(
|
305
|
+
Cartesian3.cross(
|
306
|
+
angleBetweenScratch,
|
307
|
+
angleBetweenScratch2,
|
308
|
+
angleBetweenScratch
|
309
|
+
)
|
310
|
+
);
|
311
|
+
return Math.atan2(sine, cosine);
|
312
|
+
};
|
313
|
+
var mostOrthogonalAxisScratch = new Cartesian3();
|
314
|
+
Cartesian3.mostOrthogonalAxis = function(cartesian, result) {
|
315
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
316
|
+
Check_default.typeOf.object("result", result);
|
317
|
+
const f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch);
|
318
|
+
Cartesian3.abs(f, f);
|
319
|
+
if (f.x <= f.y) {
|
320
|
+
if (f.x <= f.z) {
|
321
|
+
result = Cartesian3.clone(Cartesian3.UNIT_X, result);
|
322
|
+
} else {
|
323
|
+
result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
|
324
|
+
}
|
325
|
+
} else if (f.y <= f.z) {
|
326
|
+
result = Cartesian3.clone(Cartesian3.UNIT_Y, result);
|
327
|
+
} else {
|
328
|
+
result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
|
329
|
+
}
|
330
|
+
return result;
|
331
|
+
};
|
332
|
+
Cartesian3.projectVector = function(a, b, result) {
|
333
|
+
Check_default.defined("a", a);
|
334
|
+
Check_default.defined("b", b);
|
335
|
+
Check_default.defined("result", result);
|
336
|
+
const scalar = Cartesian3.dot(a, b) / Cartesian3.dot(b, b);
|
337
|
+
return Cartesian3.multiplyByScalar(b, scalar, result);
|
338
|
+
};
|
339
|
+
Cartesian3.equals = function(left, right) {
|
340
|
+
return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.z === right.z;
|
341
|
+
};
|
342
|
+
Cartesian3.equalsArray = function(cartesian, array, offset) {
|
343
|
+
return cartesian.x === array[offset] && cartesian.y === array[offset + 1] && cartesian.z === array[offset + 2];
|
344
|
+
};
|
345
|
+
Cartesian3.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
|
346
|
+
return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
|
347
|
+
left.x,
|
348
|
+
right.x,
|
349
|
+
relativeEpsilon,
|
350
|
+
absoluteEpsilon
|
351
|
+
) && Math_default.equalsEpsilon(
|
352
|
+
left.y,
|
353
|
+
right.y,
|
354
|
+
relativeEpsilon,
|
355
|
+
absoluteEpsilon
|
356
|
+
) && Math_default.equalsEpsilon(
|
357
|
+
left.z,
|
358
|
+
right.z,
|
359
|
+
relativeEpsilon,
|
360
|
+
absoluteEpsilon
|
361
|
+
);
|
362
|
+
};
|
363
|
+
Cartesian3.cross = function(left, right, result) {
|
364
|
+
Check_default.typeOf.object("left", left);
|
365
|
+
Check_default.typeOf.object("right", right);
|
366
|
+
Check_default.typeOf.object("result", result);
|
367
|
+
const leftX = left.x;
|
368
|
+
const leftY = left.y;
|
369
|
+
const leftZ = left.z;
|
370
|
+
const rightX = right.x;
|
371
|
+
const rightY = right.y;
|
372
|
+
const rightZ = right.z;
|
373
|
+
const x = leftY * rightZ - leftZ * rightY;
|
374
|
+
const y = leftZ * rightX - leftX * rightZ;
|
375
|
+
const z = leftX * rightY - leftY * rightX;
|
376
|
+
result.x = x;
|
377
|
+
result.y = y;
|
378
|
+
result.z = z;
|
379
|
+
return result;
|
380
|
+
};
|
381
|
+
Cartesian3.midpoint = function(left, right, result) {
|
382
|
+
Check_default.typeOf.object("left", left);
|
383
|
+
Check_default.typeOf.object("right", right);
|
384
|
+
Check_default.typeOf.object("result", result);
|
385
|
+
result.x = (left.x + right.x) * 0.5;
|
386
|
+
result.y = (left.y + right.y) * 0.5;
|
387
|
+
result.z = (left.z + right.z) * 0.5;
|
388
|
+
return result;
|
389
|
+
};
|
390
|
+
Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) {
|
391
|
+
Check_default.typeOf.number("longitude", longitude);
|
392
|
+
Check_default.typeOf.number("latitude", latitude);
|
393
|
+
longitude = Math_default.toRadians(longitude);
|
394
|
+
latitude = Math_default.toRadians(latitude);
|
395
|
+
return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);
|
396
|
+
};
|
397
|
+
var scratchN = new Cartesian3();
|
398
|
+
var scratchK = new Cartesian3();
|
399
|
+
var wgs84RadiiSquared = new Cartesian3(
|
400
|
+
6378137 * 6378137,
|
401
|
+
6378137 * 6378137,
|
402
|
+
6356752314245179e-9 * 6356752314245179e-9
|
403
|
+
);
|
404
|
+
Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) {
|
405
|
+
Check_default.typeOf.number("longitude", longitude);
|
406
|
+
Check_default.typeOf.number("latitude", latitude);
|
407
|
+
height = defaultValue_default(height, 0);
|
408
|
+
const radiiSquared = defined_default(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared;
|
409
|
+
const cosLatitude = Math.cos(latitude);
|
410
|
+
scratchN.x = cosLatitude * Math.cos(longitude);
|
411
|
+
scratchN.y = cosLatitude * Math.sin(longitude);
|
412
|
+
scratchN.z = Math.sin(latitude);
|
413
|
+
scratchN = Cartesian3.normalize(scratchN, scratchN);
|
414
|
+
Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);
|
415
|
+
const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));
|
416
|
+
scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);
|
417
|
+
scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);
|
418
|
+
if (!defined_default(result)) {
|
419
|
+
result = new Cartesian3();
|
420
|
+
}
|
421
|
+
return Cartesian3.add(scratchK, scratchN, result);
|
422
|
+
};
|
423
|
+
Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) {
|
424
|
+
Check_default.defined("coordinates", coordinates);
|
425
|
+
if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
|
426
|
+
throw new DeveloperError_default(
|
427
|
+
"the number of coordinates must be a multiple of 2 and at least 2"
|
428
|
+
);
|
429
|
+
}
|
430
|
+
const length = coordinates.length;
|
431
|
+
if (!defined_default(result)) {
|
432
|
+
result = new Array(length / 2);
|
433
|
+
} else {
|
434
|
+
result.length = length / 2;
|
435
|
+
}
|
436
|
+
for (let i = 0; i < length; i += 2) {
|
437
|
+
const longitude = coordinates[i];
|
438
|
+
const latitude = coordinates[i + 1];
|
439
|
+
const index = i / 2;
|
440
|
+
result[index] = Cartesian3.fromDegrees(
|
441
|
+
longitude,
|
442
|
+
latitude,
|
443
|
+
0,
|
444
|
+
ellipsoid,
|
445
|
+
result[index]
|
446
|
+
);
|
447
|
+
}
|
448
|
+
return result;
|
449
|
+
};
|
450
|
+
Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) {
|
451
|
+
Check_default.defined("coordinates", coordinates);
|
452
|
+
if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
|
453
|
+
throw new DeveloperError_default(
|
454
|
+
"the number of coordinates must be a multiple of 2 and at least 2"
|
455
|
+
);
|
456
|
+
}
|
457
|
+
const length = coordinates.length;
|
458
|
+
if (!defined_default(result)) {
|
459
|
+
result = new Array(length / 2);
|
460
|
+
} else {
|
461
|
+
result.length = length / 2;
|
462
|
+
}
|
463
|
+
for (let i = 0; i < length; i += 2) {
|
464
|
+
const longitude = coordinates[i];
|
465
|
+
const latitude = coordinates[i + 1];
|
466
|
+
const index = i / 2;
|
467
|
+
result[index] = Cartesian3.fromRadians(
|
468
|
+
longitude,
|
469
|
+
latitude,
|
470
|
+
0,
|
471
|
+
ellipsoid,
|
472
|
+
result[index]
|
473
|
+
);
|
474
|
+
}
|
475
|
+
return result;
|
476
|
+
};
|
477
|
+
Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) {
|
478
|
+
Check_default.defined("coordinates", coordinates);
|
479
|
+
if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
|
480
|
+
throw new DeveloperError_default(
|
481
|
+
"the number of coordinates must be a multiple of 3 and at least 3"
|
482
|
+
);
|
483
|
+
}
|
484
|
+
const length = coordinates.length;
|
485
|
+
if (!defined_default(result)) {
|
486
|
+
result = new Array(length / 3);
|
487
|
+
} else {
|
488
|
+
result.length = length / 3;
|
489
|
+
}
|
490
|
+
for (let i = 0; i < length; i += 3) {
|
491
|
+
const longitude = coordinates[i];
|
492
|
+
const latitude = coordinates[i + 1];
|
493
|
+
const height = coordinates[i + 2];
|
494
|
+
const index = i / 3;
|
495
|
+
result[index] = Cartesian3.fromDegrees(
|
496
|
+
longitude,
|
497
|
+
latitude,
|
498
|
+
height,
|
499
|
+
ellipsoid,
|
500
|
+
result[index]
|
501
|
+
);
|
502
|
+
}
|
503
|
+
return result;
|
504
|
+
};
|
505
|
+
Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) {
|
506
|
+
Check_default.defined("coordinates", coordinates);
|
507
|
+
if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
|
508
|
+
throw new DeveloperError_default(
|
509
|
+
"the number of coordinates must be a multiple of 3 and at least 3"
|
510
|
+
);
|
511
|
+
}
|
512
|
+
const length = coordinates.length;
|
513
|
+
if (!defined_default(result)) {
|
514
|
+
result = new Array(length / 3);
|
515
|
+
} else {
|
516
|
+
result.length = length / 3;
|
517
|
+
}
|
518
|
+
for (let i = 0; i < length; i += 3) {
|
519
|
+
const longitude = coordinates[i];
|
520
|
+
const latitude = coordinates[i + 1];
|
521
|
+
const height = coordinates[i + 2];
|
522
|
+
const index = i / 3;
|
523
|
+
result[index] = Cartesian3.fromRadians(
|
524
|
+
longitude,
|
525
|
+
latitude,
|
526
|
+
height,
|
527
|
+
ellipsoid,
|
528
|
+
result[index]
|
529
|
+
);
|
530
|
+
}
|
531
|
+
return result;
|
532
|
+
};
|
533
|
+
Cartesian3.ZERO = Object.freeze(new Cartesian3(0, 0, 0));
|
534
|
+
Cartesian3.ONE = Object.freeze(new Cartesian3(1, 1, 1));
|
535
|
+
Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1, 0, 0));
|
536
|
+
Cartesian3.UNIT_Y = Object.freeze(new Cartesian3(0, 1, 0));
|
537
|
+
Cartesian3.UNIT_Z = Object.freeze(new Cartesian3(0, 0, 1));
|
538
|
+
Cartesian3.prototype.clone = function(result) {
|
539
|
+
return Cartesian3.clone(this, result);
|
540
|
+
};
|
541
|
+
Cartesian3.prototype.equals = function(right) {
|
542
|
+
return Cartesian3.equals(this, right);
|
543
|
+
};
|
544
|
+
Cartesian3.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
|
545
|
+
return Cartesian3.equalsEpsilon(
|
546
|
+
this,
|
547
|
+
right,
|
548
|
+
relativeEpsilon,
|
549
|
+
absoluteEpsilon
|
550
|
+
);
|
551
|
+
};
|
552
|
+
Cartesian3.prototype.toString = function() {
|
553
|
+
return `(${this.x}, ${this.y}, ${this.z})`;
|
554
|
+
};
|
555
|
+
var Cartesian3_default = Cartesian3;
|
556
|
+
|
557
|
+
// packages/engine/Source/Core/scaleToGeodeticSurface.js
|
558
|
+
var scaleToGeodeticSurfaceIntersection = new Cartesian3_default();
|
559
|
+
var scaleToGeodeticSurfaceGradient = new Cartesian3_default();
|
560
|
+
function scaleToGeodeticSurface(cartesian, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, result) {
|
561
|
+
if (!defined_default(cartesian)) {
|
562
|
+
throw new DeveloperError_default("cartesian is required.");
|
563
|
+
}
|
564
|
+
if (!defined_default(oneOverRadii)) {
|
565
|
+
throw new DeveloperError_default("oneOverRadii is required.");
|
566
|
+
}
|
567
|
+
if (!defined_default(oneOverRadiiSquared)) {
|
568
|
+
throw new DeveloperError_default("oneOverRadiiSquared is required.");
|
569
|
+
}
|
570
|
+
if (!defined_default(centerToleranceSquared)) {
|
571
|
+
throw new DeveloperError_default("centerToleranceSquared is required.");
|
572
|
+
}
|
573
|
+
const positionX = cartesian.x;
|
574
|
+
const positionY = cartesian.y;
|
575
|
+
const positionZ = cartesian.z;
|
576
|
+
const oneOverRadiiX = oneOverRadii.x;
|
577
|
+
const oneOverRadiiY = oneOverRadii.y;
|
578
|
+
const oneOverRadiiZ = oneOverRadii.z;
|
579
|
+
const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
|
580
|
+
const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
|
581
|
+
const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
|
582
|
+
const squaredNorm = x2 + y2 + z2;
|
583
|
+
const ratio = Math.sqrt(1 / squaredNorm);
|
584
|
+
const intersection = Cartesian3_default.multiplyByScalar(
|
585
|
+
cartesian,
|
586
|
+
ratio,
|
587
|
+
scaleToGeodeticSurfaceIntersection
|
588
|
+
);
|
589
|
+
if (squaredNorm < centerToleranceSquared) {
|
590
|
+
return !isFinite(ratio) ? void 0 : Cartesian3_default.clone(intersection, result);
|
591
|
+
}
|
592
|
+
const oneOverRadiiSquaredX = oneOverRadiiSquared.x;
|
593
|
+
const oneOverRadiiSquaredY = oneOverRadiiSquared.y;
|
594
|
+
const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
|
595
|
+
const gradient = scaleToGeodeticSurfaceGradient;
|
596
|
+
gradient.x = intersection.x * oneOverRadiiSquaredX * 2;
|
597
|
+
gradient.y = intersection.y * oneOverRadiiSquaredY * 2;
|
598
|
+
gradient.z = intersection.z * oneOverRadiiSquaredZ * 2;
|
599
|
+
let lambda = (1 - ratio) * Cartesian3_default.magnitude(cartesian) / (0.5 * Cartesian3_default.magnitude(gradient));
|
600
|
+
let correction = 0;
|
601
|
+
let func;
|
602
|
+
let denominator;
|
603
|
+
let xMultiplier;
|
604
|
+
let yMultiplier;
|
605
|
+
let zMultiplier;
|
606
|
+
let xMultiplier2;
|
607
|
+
let yMultiplier2;
|
608
|
+
let zMultiplier2;
|
609
|
+
let xMultiplier3;
|
610
|
+
let yMultiplier3;
|
611
|
+
let zMultiplier3;
|
612
|
+
do {
|
613
|
+
lambda -= correction;
|
614
|
+
xMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredX);
|
615
|
+
yMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredY);
|
616
|
+
zMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredZ);
|
617
|
+
xMultiplier2 = xMultiplier * xMultiplier;
|
618
|
+
yMultiplier2 = yMultiplier * yMultiplier;
|
619
|
+
zMultiplier2 = zMultiplier * zMultiplier;
|
620
|
+
xMultiplier3 = xMultiplier2 * xMultiplier;
|
621
|
+
yMultiplier3 = yMultiplier2 * yMultiplier;
|
622
|
+
zMultiplier3 = zMultiplier2 * zMultiplier;
|
623
|
+
func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1;
|
624
|
+
denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;
|
625
|
+
const derivative = -2 * denominator;
|
626
|
+
correction = func / derivative;
|
627
|
+
} while (Math.abs(func) > Math_default.EPSILON12);
|
628
|
+
if (!defined_default(result)) {
|
629
|
+
return new Cartesian3_default(
|
630
|
+
positionX * xMultiplier,
|
631
|
+
positionY * yMultiplier,
|
632
|
+
positionZ * zMultiplier
|
633
|
+
);
|
634
|
+
}
|
635
|
+
result.x = positionX * xMultiplier;
|
636
|
+
result.y = positionY * yMultiplier;
|
637
|
+
result.z = positionZ * zMultiplier;
|
638
|
+
return result;
|
639
|
+
}
|
640
|
+
var scaleToGeodeticSurface_default = scaleToGeodeticSurface;
|
641
|
+
|
642
|
+
// packages/engine/Source/Core/Cartographic.js
|
643
|
+
function Cartographic(longitude, latitude, height) {
|
644
|
+
this.longitude = defaultValue_default(longitude, 0);
|
645
|
+
this.latitude = defaultValue_default(latitude, 0);
|
646
|
+
this.height = defaultValue_default(height, 0);
|
647
|
+
}
|
648
|
+
Cartographic.fromRadians = function(longitude, latitude, height, result) {
|
649
|
+
Check_default.typeOf.number("longitude", longitude);
|
650
|
+
Check_default.typeOf.number("latitude", latitude);
|
651
|
+
height = defaultValue_default(height, 0);
|
652
|
+
if (!defined_default(result)) {
|
653
|
+
return new Cartographic(longitude, latitude, height);
|
654
|
+
}
|
655
|
+
result.longitude = longitude;
|
656
|
+
result.latitude = latitude;
|
657
|
+
result.height = height;
|
658
|
+
return result;
|
659
|
+
};
|
660
|
+
Cartographic.fromDegrees = function(longitude, latitude, height, result) {
|
661
|
+
Check_default.typeOf.number("longitude", longitude);
|
662
|
+
Check_default.typeOf.number("latitude", latitude);
|
663
|
+
longitude = Math_default.toRadians(longitude);
|
664
|
+
latitude = Math_default.toRadians(latitude);
|
665
|
+
return Cartographic.fromRadians(longitude, latitude, height, result);
|
666
|
+
};
|
667
|
+
var cartesianToCartographicN = new Cartesian3_default();
|
668
|
+
var cartesianToCartographicP = new Cartesian3_default();
|
669
|
+
var cartesianToCartographicH = new Cartesian3_default();
|
670
|
+
var wgs84OneOverRadii = new Cartesian3_default(
|
671
|
+
1 / 6378137,
|
672
|
+
1 / 6378137,
|
673
|
+
1 / 6356752314245179e-9
|
674
|
+
);
|
675
|
+
var wgs84OneOverRadiiSquared = new Cartesian3_default(
|
676
|
+
1 / (6378137 * 6378137),
|
677
|
+
1 / (6378137 * 6378137),
|
678
|
+
1 / (6356752314245179e-9 * 6356752314245179e-9)
|
679
|
+
);
|
680
|
+
var wgs84CenterToleranceSquared = Math_default.EPSILON1;
|
681
|
+
Cartographic.fromCartesian = function(cartesian, ellipsoid, result) {
|
682
|
+
const oneOverRadii = defined_default(ellipsoid) ? ellipsoid.oneOverRadii : wgs84OneOverRadii;
|
683
|
+
const oneOverRadiiSquared = defined_default(ellipsoid) ? ellipsoid.oneOverRadiiSquared : wgs84OneOverRadiiSquared;
|
684
|
+
const centerToleranceSquared = defined_default(ellipsoid) ? ellipsoid._centerToleranceSquared : wgs84CenterToleranceSquared;
|
685
|
+
const p = scaleToGeodeticSurface_default(
|
686
|
+
cartesian,
|
687
|
+
oneOverRadii,
|
688
|
+
oneOverRadiiSquared,
|
689
|
+
centerToleranceSquared,
|
690
|
+
cartesianToCartographicP
|
691
|
+
);
|
692
|
+
if (!defined_default(p)) {
|
693
|
+
return void 0;
|
694
|
+
}
|
695
|
+
let n = Cartesian3_default.multiplyComponents(
|
696
|
+
p,
|
697
|
+
oneOverRadiiSquared,
|
698
|
+
cartesianToCartographicN
|
699
|
+
);
|
700
|
+
n = Cartesian3_default.normalize(n, n);
|
701
|
+
const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH);
|
702
|
+
const longitude = Math.atan2(n.y, n.x);
|
703
|
+
const latitude = Math.asin(n.z);
|
704
|
+
const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
|
705
|
+
if (!defined_default(result)) {
|
706
|
+
return new Cartographic(longitude, latitude, height);
|
707
|
+
}
|
708
|
+
result.longitude = longitude;
|
709
|
+
result.latitude = latitude;
|
710
|
+
result.height = height;
|
711
|
+
return result;
|
712
|
+
};
|
713
|
+
Cartographic.toCartesian = function(cartographic, ellipsoid, result) {
|
714
|
+
Check_default.defined("cartographic", cartographic);
|
715
|
+
return Cartesian3_default.fromRadians(
|
716
|
+
cartographic.longitude,
|
717
|
+
cartographic.latitude,
|
718
|
+
cartographic.height,
|
719
|
+
ellipsoid,
|
720
|
+
result
|
721
|
+
);
|
722
|
+
};
|
723
|
+
Cartographic.clone = function(cartographic, result) {
|
724
|
+
if (!defined_default(cartographic)) {
|
725
|
+
return void 0;
|
726
|
+
}
|
727
|
+
if (!defined_default(result)) {
|
728
|
+
return new Cartographic(
|
729
|
+
cartographic.longitude,
|
730
|
+
cartographic.latitude,
|
731
|
+
cartographic.height
|
732
|
+
);
|
733
|
+
}
|
734
|
+
result.longitude = cartographic.longitude;
|
735
|
+
result.latitude = cartographic.latitude;
|
736
|
+
result.height = cartographic.height;
|
737
|
+
return result;
|
738
|
+
};
|
739
|
+
Cartographic.equals = function(left, right) {
|
740
|
+
return left === right || defined_default(left) && defined_default(right) && left.longitude === right.longitude && left.latitude === right.latitude && left.height === right.height;
|
741
|
+
};
|
742
|
+
Cartographic.equalsEpsilon = function(left, right, epsilon) {
|
743
|
+
epsilon = defaultValue_default(epsilon, 0);
|
744
|
+
return left === right || defined_default(left) && defined_default(right) && Math.abs(left.longitude - right.longitude) <= epsilon && Math.abs(left.latitude - right.latitude) <= epsilon && Math.abs(left.height - right.height) <= epsilon;
|
745
|
+
};
|
746
|
+
Cartographic.ZERO = Object.freeze(new Cartographic(0, 0, 0));
|
747
|
+
Cartographic.prototype.clone = function(result) {
|
748
|
+
return Cartographic.clone(this, result);
|
749
|
+
};
|
750
|
+
Cartographic.prototype.equals = function(right) {
|
751
|
+
return Cartographic.equals(this, right);
|
752
|
+
};
|
753
|
+
Cartographic.prototype.equalsEpsilon = function(right, epsilon) {
|
754
|
+
return Cartographic.equalsEpsilon(this, right, epsilon);
|
755
|
+
};
|
756
|
+
Cartographic.prototype.toString = function() {
|
757
|
+
return `(${this.longitude}, ${this.latitude}, ${this.height})`;
|
758
|
+
};
|
759
|
+
var Cartographic_default = Cartographic;
|
760
|
+
|
761
|
+
// packages/engine/Source/Core/Ellipsoid.js
|
762
|
+
function initialize(ellipsoid, x, y, z) {
|
763
|
+
x = defaultValue_default(x, 0);
|
764
|
+
y = defaultValue_default(y, 0);
|
765
|
+
z = defaultValue_default(z, 0);
|
766
|
+
Check_default.typeOf.number.greaterThanOrEquals("x", x, 0);
|
767
|
+
Check_default.typeOf.number.greaterThanOrEquals("y", y, 0);
|
768
|
+
Check_default.typeOf.number.greaterThanOrEquals("z", z, 0);
|
769
|
+
ellipsoid._radii = new Cartesian3_default(x, y, z);
|
770
|
+
ellipsoid._radiiSquared = new Cartesian3_default(x * x, y * y, z * z);
|
771
|
+
ellipsoid._radiiToTheFourth = new Cartesian3_default(
|
772
|
+
x * x * x * x,
|
773
|
+
y * y * y * y,
|
774
|
+
z * z * z * z
|
775
|
+
);
|
776
|
+
ellipsoid._oneOverRadii = new Cartesian3_default(
|
777
|
+
x === 0 ? 0 : 1 / x,
|
778
|
+
y === 0 ? 0 : 1 / y,
|
779
|
+
z === 0 ? 0 : 1 / z
|
780
|
+
);
|
781
|
+
ellipsoid._oneOverRadiiSquared = new Cartesian3_default(
|
782
|
+
x === 0 ? 0 : 1 / (x * x),
|
783
|
+
y === 0 ? 0 : 1 / (y * y),
|
784
|
+
z === 0 ? 0 : 1 / (z * z)
|
785
|
+
);
|
786
|
+
ellipsoid._minimumRadius = Math.min(x, y, z);
|
787
|
+
ellipsoid._maximumRadius = Math.max(x, y, z);
|
788
|
+
ellipsoid._centerToleranceSquared = Math_default.EPSILON1;
|
789
|
+
if (ellipsoid._radiiSquared.z !== 0) {
|
790
|
+
ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
|
791
|
+
}
|
792
|
+
}
|
793
|
+
function Ellipsoid(x, y, z) {
|
794
|
+
this._radii = void 0;
|
795
|
+
this._radiiSquared = void 0;
|
796
|
+
this._radiiToTheFourth = void 0;
|
797
|
+
this._oneOverRadii = void 0;
|
798
|
+
this._oneOverRadiiSquared = void 0;
|
799
|
+
this._minimumRadius = void 0;
|
800
|
+
this._maximumRadius = void 0;
|
801
|
+
this._centerToleranceSquared = void 0;
|
802
|
+
this._squaredXOverSquaredZ = void 0;
|
803
|
+
initialize(this, x, y, z);
|
804
|
+
}
|
805
|
+
Object.defineProperties(Ellipsoid.prototype, {
|
806
|
+
/**
|
807
|
+
* Gets the radii of the ellipsoid.
|
808
|
+
* @memberof Ellipsoid.prototype
|
809
|
+
* @type {Cartesian3}
|
810
|
+
* @readonly
|
811
|
+
*/
|
812
|
+
radii: {
|
813
|
+
get: function() {
|
814
|
+
return this._radii;
|
815
|
+
}
|
816
|
+
},
|
817
|
+
/**
|
818
|
+
* Gets the squared radii of the ellipsoid.
|
819
|
+
* @memberof Ellipsoid.prototype
|
820
|
+
* @type {Cartesian3}
|
821
|
+
* @readonly
|
822
|
+
*/
|
823
|
+
radiiSquared: {
|
824
|
+
get: function() {
|
825
|
+
return this._radiiSquared;
|
826
|
+
}
|
827
|
+
},
|
828
|
+
/**
|
829
|
+
* Gets the radii of the ellipsoid raise to the fourth power.
|
830
|
+
* @memberof Ellipsoid.prototype
|
831
|
+
* @type {Cartesian3}
|
832
|
+
* @readonly
|
833
|
+
*/
|
834
|
+
radiiToTheFourth: {
|
835
|
+
get: function() {
|
836
|
+
return this._radiiToTheFourth;
|
837
|
+
}
|
838
|
+
},
|
839
|
+
/**
|
840
|
+
* Gets one over the radii of the ellipsoid.
|
841
|
+
* @memberof Ellipsoid.prototype
|
842
|
+
* @type {Cartesian3}
|
843
|
+
* @readonly
|
844
|
+
*/
|
845
|
+
oneOverRadii: {
|
846
|
+
get: function() {
|
847
|
+
return this._oneOverRadii;
|
848
|
+
}
|
849
|
+
},
|
850
|
+
/**
|
851
|
+
* Gets one over the squared radii of the ellipsoid.
|
852
|
+
* @memberof Ellipsoid.prototype
|
853
|
+
* @type {Cartesian3}
|
854
|
+
* @readonly
|
855
|
+
*/
|
856
|
+
oneOverRadiiSquared: {
|
857
|
+
get: function() {
|
858
|
+
return this._oneOverRadiiSquared;
|
859
|
+
}
|
860
|
+
},
|
861
|
+
/**
|
862
|
+
* Gets the minimum radius of the ellipsoid.
|
863
|
+
* @memberof Ellipsoid.prototype
|
864
|
+
* @type {number}
|
865
|
+
* @readonly
|
866
|
+
*/
|
867
|
+
minimumRadius: {
|
868
|
+
get: function() {
|
869
|
+
return this._minimumRadius;
|
870
|
+
}
|
871
|
+
},
|
872
|
+
/**
|
873
|
+
* Gets the maximum radius of the ellipsoid.
|
874
|
+
* @memberof Ellipsoid.prototype
|
875
|
+
* @type {number}
|
876
|
+
* @readonly
|
877
|
+
*/
|
878
|
+
maximumRadius: {
|
879
|
+
get: function() {
|
880
|
+
return this._maximumRadius;
|
881
|
+
}
|
882
|
+
}
|
883
|
+
});
|
884
|
+
Ellipsoid.clone = function(ellipsoid, result) {
|
885
|
+
if (!defined_default(ellipsoid)) {
|
886
|
+
return void 0;
|
887
|
+
}
|
888
|
+
const radii = ellipsoid._radii;
|
889
|
+
if (!defined_default(result)) {
|
890
|
+
return new Ellipsoid(radii.x, radii.y, radii.z);
|
891
|
+
}
|
892
|
+
Cartesian3_default.clone(radii, result._radii);
|
893
|
+
Cartesian3_default.clone(ellipsoid._radiiSquared, result._radiiSquared);
|
894
|
+
Cartesian3_default.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
|
895
|
+
Cartesian3_default.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
|
896
|
+
Cartesian3_default.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
|
897
|
+
result._minimumRadius = ellipsoid._minimumRadius;
|
898
|
+
result._maximumRadius = ellipsoid._maximumRadius;
|
899
|
+
result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
|
900
|
+
return result;
|
901
|
+
};
|
902
|
+
Ellipsoid.fromCartesian3 = function(cartesian, result) {
|
903
|
+
if (!defined_default(result)) {
|
904
|
+
result = new Ellipsoid();
|
905
|
+
}
|
906
|
+
if (!defined_default(cartesian)) {
|
907
|
+
return result;
|
908
|
+
}
|
909
|
+
initialize(result, cartesian.x, cartesian.y, cartesian.z);
|
910
|
+
return result;
|
911
|
+
};
|
912
|
+
Ellipsoid.WGS84 = Object.freeze(
|
913
|
+
new Ellipsoid(6378137, 6378137, 6356752314245179e-9)
|
914
|
+
);
|
915
|
+
Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1, 1, 1));
|
916
|
+
Ellipsoid.MOON = Object.freeze(
|
917
|
+
new Ellipsoid(
|
918
|
+
Math_default.LUNAR_RADIUS,
|
919
|
+
Math_default.LUNAR_RADIUS,
|
920
|
+
Math_default.LUNAR_RADIUS
|
921
|
+
)
|
922
|
+
);
|
923
|
+
Ellipsoid.prototype.clone = function(result) {
|
924
|
+
return Ellipsoid.clone(this, result);
|
925
|
+
};
|
926
|
+
Ellipsoid.packedLength = Cartesian3_default.packedLength;
|
927
|
+
Ellipsoid.pack = function(value, array, startingIndex) {
|
928
|
+
Check_default.typeOf.object("value", value);
|
929
|
+
Check_default.defined("array", array);
|
930
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
931
|
+
Cartesian3_default.pack(value._radii, array, startingIndex);
|
932
|
+
return array;
|
933
|
+
};
|
934
|
+
Ellipsoid.unpack = function(array, startingIndex, result) {
|
935
|
+
Check_default.defined("array", array);
|
936
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
937
|
+
const radii = Cartesian3_default.unpack(array, startingIndex);
|
938
|
+
return Ellipsoid.fromCartesian3(radii, result);
|
939
|
+
};
|
940
|
+
Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3_default.normalize;
|
941
|
+
Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function(cartographic, result) {
|
942
|
+
Check_default.typeOf.object("cartographic", cartographic);
|
943
|
+
const longitude = cartographic.longitude;
|
944
|
+
const latitude = cartographic.latitude;
|
945
|
+
const cosLatitude = Math.cos(latitude);
|
946
|
+
const x = cosLatitude * Math.cos(longitude);
|
947
|
+
const y = cosLatitude * Math.sin(longitude);
|
948
|
+
const z = Math.sin(latitude);
|
949
|
+
if (!defined_default(result)) {
|
950
|
+
result = new Cartesian3_default();
|
951
|
+
}
|
952
|
+
result.x = x;
|
953
|
+
result.y = y;
|
954
|
+
result.z = z;
|
955
|
+
return Cartesian3_default.normalize(result, result);
|
956
|
+
};
|
957
|
+
Ellipsoid.prototype.geodeticSurfaceNormal = function(cartesian, result) {
|
958
|
+
if (Cartesian3_default.equalsEpsilon(cartesian, Cartesian3_default.ZERO, Math_default.EPSILON14)) {
|
959
|
+
return void 0;
|
960
|
+
}
|
961
|
+
if (!defined_default(result)) {
|
962
|
+
result = new Cartesian3_default();
|
963
|
+
}
|
964
|
+
result = Cartesian3_default.multiplyComponents(
|
965
|
+
cartesian,
|
966
|
+
this._oneOverRadiiSquared,
|
967
|
+
result
|
968
|
+
);
|
969
|
+
return Cartesian3_default.normalize(result, result);
|
970
|
+
};
|
971
|
+
var cartographicToCartesianNormal = new Cartesian3_default();
|
972
|
+
var cartographicToCartesianK = new Cartesian3_default();
|
973
|
+
Ellipsoid.prototype.cartographicToCartesian = function(cartographic, result) {
|
974
|
+
const n = cartographicToCartesianNormal;
|
975
|
+
const k = cartographicToCartesianK;
|
976
|
+
this.geodeticSurfaceNormalCartographic(cartographic, n);
|
977
|
+
Cartesian3_default.multiplyComponents(this._radiiSquared, n, k);
|
978
|
+
const gamma = Math.sqrt(Cartesian3_default.dot(n, k));
|
979
|
+
Cartesian3_default.divideByScalar(k, gamma, k);
|
980
|
+
Cartesian3_default.multiplyByScalar(n, cartographic.height, n);
|
981
|
+
if (!defined_default(result)) {
|
982
|
+
result = new Cartesian3_default();
|
983
|
+
}
|
984
|
+
return Cartesian3_default.add(k, n, result);
|
985
|
+
};
|
986
|
+
Ellipsoid.prototype.cartographicArrayToCartesianArray = function(cartographics, result) {
|
987
|
+
Check_default.defined("cartographics", cartographics);
|
988
|
+
const length = cartographics.length;
|
989
|
+
if (!defined_default(result)) {
|
990
|
+
result = new Array(length);
|
991
|
+
} else {
|
992
|
+
result.length = length;
|
993
|
+
}
|
994
|
+
for (let i = 0; i < length; i++) {
|
995
|
+
result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
|
996
|
+
}
|
997
|
+
return result;
|
998
|
+
};
|
999
|
+
var cartesianToCartographicN2 = new Cartesian3_default();
|
1000
|
+
var cartesianToCartographicP2 = new Cartesian3_default();
|
1001
|
+
var cartesianToCartographicH2 = new Cartesian3_default();
|
1002
|
+
Ellipsoid.prototype.cartesianToCartographic = function(cartesian, result) {
|
1003
|
+
const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP2);
|
1004
|
+
if (!defined_default(p)) {
|
1005
|
+
return void 0;
|
1006
|
+
}
|
1007
|
+
const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN2);
|
1008
|
+
const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH2);
|
1009
|
+
const longitude = Math.atan2(n.y, n.x);
|
1010
|
+
const latitude = Math.asin(n.z);
|
1011
|
+
const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
|
1012
|
+
if (!defined_default(result)) {
|
1013
|
+
return new Cartographic_default(longitude, latitude, height);
|
1014
|
+
}
|
1015
|
+
result.longitude = longitude;
|
1016
|
+
result.latitude = latitude;
|
1017
|
+
result.height = height;
|
1018
|
+
return result;
|
1019
|
+
};
|
1020
|
+
Ellipsoid.prototype.cartesianArrayToCartographicArray = function(cartesians, result) {
|
1021
|
+
Check_default.defined("cartesians", cartesians);
|
1022
|
+
const length = cartesians.length;
|
1023
|
+
if (!defined_default(result)) {
|
1024
|
+
result = new Array(length);
|
1025
|
+
} else {
|
1026
|
+
result.length = length;
|
1027
|
+
}
|
1028
|
+
for (let i = 0; i < length; ++i) {
|
1029
|
+
result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
|
1030
|
+
}
|
1031
|
+
return result;
|
1032
|
+
};
|
1033
|
+
Ellipsoid.prototype.scaleToGeodeticSurface = function(cartesian, result) {
|
1034
|
+
return scaleToGeodeticSurface_default(
|
1035
|
+
cartesian,
|
1036
|
+
this._oneOverRadii,
|
1037
|
+
this._oneOverRadiiSquared,
|
1038
|
+
this._centerToleranceSquared,
|
1039
|
+
result
|
1040
|
+
);
|
1041
|
+
};
|
1042
|
+
Ellipsoid.prototype.scaleToGeocentricSurface = function(cartesian, result) {
|
1043
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
1044
|
+
if (!defined_default(result)) {
|
1045
|
+
result = new Cartesian3_default();
|
1046
|
+
}
|
1047
|
+
const positionX = cartesian.x;
|
1048
|
+
const positionY = cartesian.y;
|
1049
|
+
const positionZ = cartesian.z;
|
1050
|
+
const oneOverRadiiSquared = this._oneOverRadiiSquared;
|
1051
|
+
const beta = 1 / Math.sqrt(
|
1052
|
+
positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z
|
1053
|
+
);
|
1054
|
+
return Cartesian3_default.multiplyByScalar(cartesian, beta, result);
|
1055
|
+
};
|
1056
|
+
Ellipsoid.prototype.transformPositionToScaledSpace = function(position, result) {
|
1057
|
+
if (!defined_default(result)) {
|
1058
|
+
result = new Cartesian3_default();
|
1059
|
+
}
|
1060
|
+
return Cartesian3_default.multiplyComponents(position, this._oneOverRadii, result);
|
1061
|
+
};
|
1062
|
+
Ellipsoid.prototype.transformPositionFromScaledSpace = function(position, result) {
|
1063
|
+
if (!defined_default(result)) {
|
1064
|
+
result = new Cartesian3_default();
|
1065
|
+
}
|
1066
|
+
return Cartesian3_default.multiplyComponents(position, this._radii, result);
|
1067
|
+
};
|
1068
|
+
Ellipsoid.prototype.equals = function(right) {
|
1069
|
+
return this === right || defined_default(right) && Cartesian3_default.equals(this._radii, right._radii);
|
1070
|
+
};
|
1071
|
+
Ellipsoid.prototype.toString = function() {
|
1072
|
+
return this._radii.toString();
|
1073
|
+
};
|
1074
|
+
Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function(position, buffer, result) {
|
1075
|
+
Check_default.typeOf.object("position", position);
|
1076
|
+
if (!Math_default.equalsEpsilon(
|
1077
|
+
this._radii.x,
|
1078
|
+
this._radii.y,
|
1079
|
+
Math_default.EPSILON15
|
1080
|
+
)) {
|
1081
|
+
throw new DeveloperError_default(
|
1082
|
+
"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
|
1083
|
+
);
|
1084
|
+
}
|
1085
|
+
Check_default.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
|
1086
|
+
buffer = defaultValue_default(buffer, 0);
|
1087
|
+
const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
|
1088
|
+
if (!defined_default(result)) {
|
1089
|
+
result = new Cartesian3_default();
|
1090
|
+
}
|
1091
|
+
result.x = 0;
|
1092
|
+
result.y = 0;
|
1093
|
+
result.z = position.z * (1 - squaredXOverSquaredZ);
|
1094
|
+
if (Math.abs(result.z) >= this._radii.z - buffer) {
|
1095
|
+
return void 0;
|
1096
|
+
}
|
1097
|
+
return result;
|
1098
|
+
};
|
1099
|
+
var abscissas = [
|
1100
|
+
0.14887433898163,
|
1101
|
+
0.43339539412925,
|
1102
|
+
0.67940956829902,
|
1103
|
+
0.86506336668898,
|
1104
|
+
0.97390652851717,
|
1105
|
+
0
|
1106
|
+
];
|
1107
|
+
var weights = [
|
1108
|
+
0.29552422471475,
|
1109
|
+
0.26926671930999,
|
1110
|
+
0.21908636251598,
|
1111
|
+
0.14945134915058,
|
1112
|
+
0.066671344308684,
|
1113
|
+
0
|
1114
|
+
];
|
1115
|
+
function gaussLegendreQuadrature(a, b, func) {
|
1116
|
+
Check_default.typeOf.number("a", a);
|
1117
|
+
Check_default.typeOf.number("b", b);
|
1118
|
+
Check_default.typeOf.func("func", func);
|
1119
|
+
const xMean = 0.5 * (b + a);
|
1120
|
+
const xRange = 0.5 * (b - a);
|
1121
|
+
let sum = 0;
|
1122
|
+
for (let i = 0; i < 5; i++) {
|
1123
|
+
const dx = xRange * abscissas[i];
|
1124
|
+
sum += weights[i] * (func(xMean + dx) + func(xMean - dx));
|
1125
|
+
}
|
1126
|
+
sum *= xRange;
|
1127
|
+
return sum;
|
1128
|
+
}
|
1129
|
+
Ellipsoid.prototype.surfaceArea = function(rectangle) {
|
1130
|
+
Check_default.typeOf.object("rectangle", rectangle);
|
1131
|
+
const minLongitude = rectangle.west;
|
1132
|
+
let maxLongitude = rectangle.east;
|
1133
|
+
const minLatitude = rectangle.south;
|
1134
|
+
const maxLatitude = rectangle.north;
|
1135
|
+
while (maxLongitude < minLongitude) {
|
1136
|
+
maxLongitude += Math_default.TWO_PI;
|
1137
|
+
}
|
1138
|
+
const radiiSquared = this._radiiSquared;
|
1139
|
+
const a2 = radiiSquared.x;
|
1140
|
+
const b2 = radiiSquared.y;
|
1141
|
+
const c2 = radiiSquared.z;
|
1142
|
+
const a2b2 = a2 * b2;
|
1143
|
+
return gaussLegendreQuadrature(minLatitude, maxLatitude, function(lat) {
|
1144
|
+
const sinPhi = Math.cos(lat);
|
1145
|
+
const cosPhi = Math.sin(lat);
|
1146
|
+
return Math.cos(lat) * gaussLegendreQuadrature(minLongitude, maxLongitude, function(lon) {
|
1147
|
+
const cosTheta = Math.cos(lon);
|
1148
|
+
const sinTheta = Math.sin(lon);
|
1149
|
+
return Math.sqrt(
|
1150
|
+
a2b2 * cosPhi * cosPhi + c2 * (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) * sinPhi * sinPhi
|
1151
|
+
);
|
1152
|
+
});
|
1153
|
+
});
|
1154
|
+
};
|
1155
|
+
var Ellipsoid_default = Ellipsoid;
|
1156
|
+
|
1157
|
+
// packages/engine/Source/Core/Matrix3.js
|
1158
|
+
function Matrix3(column0Row0, column1Row0, column2Row0, column0Row1, column1Row1, column2Row1, column0Row2, column1Row2, column2Row2) {
|
1159
|
+
this[0] = defaultValue_default(column0Row0, 0);
|
1160
|
+
this[1] = defaultValue_default(column0Row1, 0);
|
1161
|
+
this[2] = defaultValue_default(column0Row2, 0);
|
1162
|
+
this[3] = defaultValue_default(column1Row0, 0);
|
1163
|
+
this[4] = defaultValue_default(column1Row1, 0);
|
1164
|
+
this[5] = defaultValue_default(column1Row2, 0);
|
1165
|
+
this[6] = defaultValue_default(column2Row0, 0);
|
1166
|
+
this[7] = defaultValue_default(column2Row1, 0);
|
1167
|
+
this[8] = defaultValue_default(column2Row2, 0);
|
1168
|
+
}
|
1169
|
+
Matrix3.packedLength = 9;
|
1170
|
+
Matrix3.pack = function(value, array, startingIndex) {
|
1171
|
+
Check_default.typeOf.object("value", value);
|
1172
|
+
Check_default.defined("array", array);
|
1173
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
1174
|
+
array[startingIndex++] = value[0];
|
1175
|
+
array[startingIndex++] = value[1];
|
1176
|
+
array[startingIndex++] = value[2];
|
1177
|
+
array[startingIndex++] = value[3];
|
1178
|
+
array[startingIndex++] = value[4];
|
1179
|
+
array[startingIndex++] = value[5];
|
1180
|
+
array[startingIndex++] = value[6];
|
1181
|
+
array[startingIndex++] = value[7];
|
1182
|
+
array[startingIndex++] = value[8];
|
1183
|
+
return array;
|
1184
|
+
};
|
1185
|
+
Matrix3.unpack = function(array, startingIndex, result) {
|
1186
|
+
Check_default.defined("array", array);
|
1187
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
1188
|
+
if (!defined_default(result)) {
|
1189
|
+
result = new Matrix3();
|
1190
|
+
}
|
1191
|
+
result[0] = array[startingIndex++];
|
1192
|
+
result[1] = array[startingIndex++];
|
1193
|
+
result[2] = array[startingIndex++];
|
1194
|
+
result[3] = array[startingIndex++];
|
1195
|
+
result[4] = array[startingIndex++];
|
1196
|
+
result[5] = array[startingIndex++];
|
1197
|
+
result[6] = array[startingIndex++];
|
1198
|
+
result[7] = array[startingIndex++];
|
1199
|
+
result[8] = array[startingIndex++];
|
1200
|
+
return result;
|
1201
|
+
};
|
1202
|
+
Matrix3.packArray = function(array, result) {
|
1203
|
+
Check_default.defined("array", array);
|
1204
|
+
const length = array.length;
|
1205
|
+
const resultLength = length * 9;
|
1206
|
+
if (!defined_default(result)) {
|
1207
|
+
result = new Array(resultLength);
|
1208
|
+
} else if (!Array.isArray(result) && result.length !== resultLength) {
|
1209
|
+
throw new DeveloperError_default(
|
1210
|
+
"If result is a typed array, it must have exactly array.length * 9 elements"
|
1211
|
+
);
|
1212
|
+
} else if (result.length !== resultLength) {
|
1213
|
+
result.length = resultLength;
|
1214
|
+
}
|
1215
|
+
for (let i = 0; i < length; ++i) {
|
1216
|
+
Matrix3.pack(array[i], result, i * 9);
|
1217
|
+
}
|
1218
|
+
return result;
|
1219
|
+
};
|
1220
|
+
Matrix3.unpackArray = function(array, result) {
|
1221
|
+
Check_default.defined("array", array);
|
1222
|
+
Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 9);
|
1223
|
+
if (array.length % 9 !== 0) {
|
1224
|
+
throw new DeveloperError_default("array length must be a multiple of 9.");
|
1225
|
+
}
|
1226
|
+
const length = array.length;
|
1227
|
+
if (!defined_default(result)) {
|
1228
|
+
result = new Array(length / 9);
|
1229
|
+
} else {
|
1230
|
+
result.length = length / 9;
|
1231
|
+
}
|
1232
|
+
for (let i = 0; i < length; i += 9) {
|
1233
|
+
const index = i / 9;
|
1234
|
+
result[index] = Matrix3.unpack(array, i, result[index]);
|
1235
|
+
}
|
1236
|
+
return result;
|
1237
|
+
};
|
1238
|
+
Matrix3.clone = function(matrix, result) {
|
1239
|
+
if (!defined_default(matrix)) {
|
1240
|
+
return void 0;
|
1241
|
+
}
|
1242
|
+
if (!defined_default(result)) {
|
1243
|
+
return new Matrix3(
|
1244
|
+
matrix[0],
|
1245
|
+
matrix[3],
|
1246
|
+
matrix[6],
|
1247
|
+
matrix[1],
|
1248
|
+
matrix[4],
|
1249
|
+
matrix[7],
|
1250
|
+
matrix[2],
|
1251
|
+
matrix[5],
|
1252
|
+
matrix[8]
|
1253
|
+
);
|
1254
|
+
}
|
1255
|
+
result[0] = matrix[0];
|
1256
|
+
result[1] = matrix[1];
|
1257
|
+
result[2] = matrix[2];
|
1258
|
+
result[3] = matrix[3];
|
1259
|
+
result[4] = matrix[4];
|
1260
|
+
result[5] = matrix[5];
|
1261
|
+
result[6] = matrix[6];
|
1262
|
+
result[7] = matrix[7];
|
1263
|
+
result[8] = matrix[8];
|
1264
|
+
return result;
|
1265
|
+
};
|
1266
|
+
Matrix3.fromArray = Matrix3.unpack;
|
1267
|
+
Matrix3.fromColumnMajorArray = function(values, result) {
|
1268
|
+
Check_default.defined("values", values);
|
1269
|
+
return Matrix3.clone(values, result);
|
1270
|
+
};
|
1271
|
+
Matrix3.fromRowMajorArray = function(values, result) {
|
1272
|
+
Check_default.defined("values", values);
|
1273
|
+
if (!defined_default(result)) {
|
1274
|
+
return new Matrix3(
|
1275
|
+
values[0],
|
1276
|
+
values[1],
|
1277
|
+
values[2],
|
1278
|
+
values[3],
|
1279
|
+
values[4],
|
1280
|
+
values[5],
|
1281
|
+
values[6],
|
1282
|
+
values[7],
|
1283
|
+
values[8]
|
1284
|
+
);
|
1285
|
+
}
|
1286
|
+
result[0] = values[0];
|
1287
|
+
result[1] = values[3];
|
1288
|
+
result[2] = values[6];
|
1289
|
+
result[3] = values[1];
|
1290
|
+
result[4] = values[4];
|
1291
|
+
result[5] = values[7];
|
1292
|
+
result[6] = values[2];
|
1293
|
+
result[7] = values[5];
|
1294
|
+
result[8] = values[8];
|
1295
|
+
return result;
|
1296
|
+
};
|
1297
|
+
Matrix3.fromQuaternion = function(quaternion, result) {
|
1298
|
+
Check_default.typeOf.object("quaternion", quaternion);
|
1299
|
+
const x2 = quaternion.x * quaternion.x;
|
1300
|
+
const xy = quaternion.x * quaternion.y;
|
1301
|
+
const xz = quaternion.x * quaternion.z;
|
1302
|
+
const xw = quaternion.x * quaternion.w;
|
1303
|
+
const y2 = quaternion.y * quaternion.y;
|
1304
|
+
const yz = quaternion.y * quaternion.z;
|
1305
|
+
const yw = quaternion.y * quaternion.w;
|
1306
|
+
const z2 = quaternion.z * quaternion.z;
|
1307
|
+
const zw = quaternion.z * quaternion.w;
|
1308
|
+
const w2 = quaternion.w * quaternion.w;
|
1309
|
+
const m00 = x2 - y2 - z2 + w2;
|
1310
|
+
const m01 = 2 * (xy - zw);
|
1311
|
+
const m02 = 2 * (xz + yw);
|
1312
|
+
const m10 = 2 * (xy + zw);
|
1313
|
+
const m11 = -x2 + y2 - z2 + w2;
|
1314
|
+
const m12 = 2 * (yz - xw);
|
1315
|
+
const m20 = 2 * (xz - yw);
|
1316
|
+
const m21 = 2 * (yz + xw);
|
1317
|
+
const m22 = -x2 - y2 + z2 + w2;
|
1318
|
+
if (!defined_default(result)) {
|
1319
|
+
return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
|
1320
|
+
}
|
1321
|
+
result[0] = m00;
|
1322
|
+
result[1] = m10;
|
1323
|
+
result[2] = m20;
|
1324
|
+
result[3] = m01;
|
1325
|
+
result[4] = m11;
|
1326
|
+
result[5] = m21;
|
1327
|
+
result[6] = m02;
|
1328
|
+
result[7] = m12;
|
1329
|
+
result[8] = m22;
|
1330
|
+
return result;
|
1331
|
+
};
|
1332
|
+
Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) {
|
1333
|
+
Check_default.typeOf.object("headingPitchRoll", headingPitchRoll);
|
1334
|
+
const cosTheta = Math.cos(-headingPitchRoll.pitch);
|
1335
|
+
const cosPsi = Math.cos(-headingPitchRoll.heading);
|
1336
|
+
const cosPhi = Math.cos(headingPitchRoll.roll);
|
1337
|
+
const sinTheta = Math.sin(-headingPitchRoll.pitch);
|
1338
|
+
const sinPsi = Math.sin(-headingPitchRoll.heading);
|
1339
|
+
const sinPhi = Math.sin(headingPitchRoll.roll);
|
1340
|
+
const m00 = cosTheta * cosPsi;
|
1341
|
+
const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;
|
1342
|
+
const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;
|
1343
|
+
const m10 = cosTheta * sinPsi;
|
1344
|
+
const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;
|
1345
|
+
const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;
|
1346
|
+
const m20 = -sinTheta;
|
1347
|
+
const m21 = sinPhi * cosTheta;
|
1348
|
+
const m22 = cosPhi * cosTheta;
|
1349
|
+
if (!defined_default(result)) {
|
1350
|
+
return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
|
1351
|
+
}
|
1352
|
+
result[0] = m00;
|
1353
|
+
result[1] = m10;
|
1354
|
+
result[2] = m20;
|
1355
|
+
result[3] = m01;
|
1356
|
+
result[4] = m11;
|
1357
|
+
result[5] = m21;
|
1358
|
+
result[6] = m02;
|
1359
|
+
result[7] = m12;
|
1360
|
+
result[8] = m22;
|
1361
|
+
return result;
|
1362
|
+
};
|
1363
|
+
Matrix3.fromScale = function(scale, result) {
|
1364
|
+
Check_default.typeOf.object("scale", scale);
|
1365
|
+
if (!defined_default(result)) {
|
1366
|
+
return new Matrix3(scale.x, 0, 0, 0, scale.y, 0, 0, 0, scale.z);
|
1367
|
+
}
|
1368
|
+
result[0] = scale.x;
|
1369
|
+
result[1] = 0;
|
1370
|
+
result[2] = 0;
|
1371
|
+
result[3] = 0;
|
1372
|
+
result[4] = scale.y;
|
1373
|
+
result[5] = 0;
|
1374
|
+
result[6] = 0;
|
1375
|
+
result[7] = 0;
|
1376
|
+
result[8] = scale.z;
|
1377
|
+
return result;
|
1378
|
+
};
|
1379
|
+
Matrix3.fromUniformScale = function(scale, result) {
|
1380
|
+
Check_default.typeOf.number("scale", scale);
|
1381
|
+
if (!defined_default(result)) {
|
1382
|
+
return new Matrix3(scale, 0, 0, 0, scale, 0, 0, 0, scale);
|
1383
|
+
}
|
1384
|
+
result[0] = scale;
|
1385
|
+
result[1] = 0;
|
1386
|
+
result[2] = 0;
|
1387
|
+
result[3] = 0;
|
1388
|
+
result[4] = scale;
|
1389
|
+
result[5] = 0;
|
1390
|
+
result[6] = 0;
|
1391
|
+
result[7] = 0;
|
1392
|
+
result[8] = scale;
|
1393
|
+
return result;
|
1394
|
+
};
|
1395
|
+
Matrix3.fromCrossProduct = function(vector, result) {
|
1396
|
+
Check_default.typeOf.object("vector", vector);
|
1397
|
+
if (!defined_default(result)) {
|
1398
|
+
return new Matrix3(
|
1399
|
+
0,
|
1400
|
+
-vector.z,
|
1401
|
+
vector.y,
|
1402
|
+
vector.z,
|
1403
|
+
0,
|
1404
|
+
-vector.x,
|
1405
|
+
-vector.y,
|
1406
|
+
vector.x,
|
1407
|
+
0
|
1408
|
+
);
|
1409
|
+
}
|
1410
|
+
result[0] = 0;
|
1411
|
+
result[1] = vector.z;
|
1412
|
+
result[2] = -vector.y;
|
1413
|
+
result[3] = -vector.z;
|
1414
|
+
result[4] = 0;
|
1415
|
+
result[5] = vector.x;
|
1416
|
+
result[6] = vector.y;
|
1417
|
+
result[7] = -vector.x;
|
1418
|
+
result[8] = 0;
|
1419
|
+
return result;
|
1420
|
+
};
|
1421
|
+
Matrix3.fromRotationX = function(angle, result) {
|
1422
|
+
Check_default.typeOf.number("angle", angle);
|
1423
|
+
const cosAngle = Math.cos(angle);
|
1424
|
+
const sinAngle = Math.sin(angle);
|
1425
|
+
if (!defined_default(result)) {
|
1426
|
+
return new Matrix3(
|
1427
|
+
1,
|
1428
|
+
0,
|
1429
|
+
0,
|
1430
|
+
0,
|
1431
|
+
cosAngle,
|
1432
|
+
-sinAngle,
|
1433
|
+
0,
|
1434
|
+
sinAngle,
|
1435
|
+
cosAngle
|
1436
|
+
);
|
1437
|
+
}
|
1438
|
+
result[0] = 1;
|
1439
|
+
result[1] = 0;
|
1440
|
+
result[2] = 0;
|
1441
|
+
result[3] = 0;
|
1442
|
+
result[4] = cosAngle;
|
1443
|
+
result[5] = sinAngle;
|
1444
|
+
result[6] = 0;
|
1445
|
+
result[7] = -sinAngle;
|
1446
|
+
result[8] = cosAngle;
|
1447
|
+
return result;
|
1448
|
+
};
|
1449
|
+
Matrix3.fromRotationY = function(angle, result) {
|
1450
|
+
Check_default.typeOf.number("angle", angle);
|
1451
|
+
const cosAngle = Math.cos(angle);
|
1452
|
+
const sinAngle = Math.sin(angle);
|
1453
|
+
if (!defined_default(result)) {
|
1454
|
+
return new Matrix3(
|
1455
|
+
cosAngle,
|
1456
|
+
0,
|
1457
|
+
sinAngle,
|
1458
|
+
0,
|
1459
|
+
1,
|
1460
|
+
0,
|
1461
|
+
-sinAngle,
|
1462
|
+
0,
|
1463
|
+
cosAngle
|
1464
|
+
);
|
1465
|
+
}
|
1466
|
+
result[0] = cosAngle;
|
1467
|
+
result[1] = 0;
|
1468
|
+
result[2] = -sinAngle;
|
1469
|
+
result[3] = 0;
|
1470
|
+
result[4] = 1;
|
1471
|
+
result[5] = 0;
|
1472
|
+
result[6] = sinAngle;
|
1473
|
+
result[7] = 0;
|
1474
|
+
result[8] = cosAngle;
|
1475
|
+
return result;
|
1476
|
+
};
|
1477
|
+
Matrix3.fromRotationZ = function(angle, result) {
|
1478
|
+
Check_default.typeOf.number("angle", angle);
|
1479
|
+
const cosAngle = Math.cos(angle);
|
1480
|
+
const sinAngle = Math.sin(angle);
|
1481
|
+
if (!defined_default(result)) {
|
1482
|
+
return new Matrix3(
|
1483
|
+
cosAngle,
|
1484
|
+
-sinAngle,
|
1485
|
+
0,
|
1486
|
+
sinAngle,
|
1487
|
+
cosAngle,
|
1488
|
+
0,
|
1489
|
+
0,
|
1490
|
+
0,
|
1491
|
+
1
|
1492
|
+
);
|
1493
|
+
}
|
1494
|
+
result[0] = cosAngle;
|
1495
|
+
result[1] = sinAngle;
|
1496
|
+
result[2] = 0;
|
1497
|
+
result[3] = -sinAngle;
|
1498
|
+
result[4] = cosAngle;
|
1499
|
+
result[5] = 0;
|
1500
|
+
result[6] = 0;
|
1501
|
+
result[7] = 0;
|
1502
|
+
result[8] = 1;
|
1503
|
+
return result;
|
1504
|
+
};
|
1505
|
+
Matrix3.toArray = function(matrix, result) {
|
1506
|
+
Check_default.typeOf.object("matrix", matrix);
|
1507
|
+
if (!defined_default(result)) {
|
1508
|
+
return [
|
1509
|
+
matrix[0],
|
1510
|
+
matrix[1],
|
1511
|
+
matrix[2],
|
1512
|
+
matrix[3],
|
1513
|
+
matrix[4],
|
1514
|
+
matrix[5],
|
1515
|
+
matrix[6],
|
1516
|
+
matrix[7],
|
1517
|
+
matrix[8]
|
1518
|
+
];
|
1519
|
+
}
|
1520
|
+
result[0] = matrix[0];
|
1521
|
+
result[1] = matrix[1];
|
1522
|
+
result[2] = matrix[2];
|
1523
|
+
result[3] = matrix[3];
|
1524
|
+
result[4] = matrix[4];
|
1525
|
+
result[5] = matrix[5];
|
1526
|
+
result[6] = matrix[6];
|
1527
|
+
result[7] = matrix[7];
|
1528
|
+
result[8] = matrix[8];
|
1529
|
+
return result;
|
1530
|
+
};
|
1531
|
+
Matrix3.getElementIndex = function(column, row) {
|
1532
|
+
Check_default.typeOf.number.greaterThanOrEquals("row", row, 0);
|
1533
|
+
Check_default.typeOf.number.lessThanOrEquals("row", row, 2);
|
1534
|
+
Check_default.typeOf.number.greaterThanOrEquals("column", column, 0);
|
1535
|
+
Check_default.typeOf.number.lessThanOrEquals("column", column, 2);
|
1536
|
+
return column * 3 + row;
|
1537
|
+
};
|
1538
|
+
Matrix3.getColumn = function(matrix, index, result) {
|
1539
|
+
Check_default.typeOf.object("matrix", matrix);
|
1540
|
+
Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
|
1541
|
+
Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
|
1542
|
+
Check_default.typeOf.object("result", result);
|
1543
|
+
const startIndex = index * 3;
|
1544
|
+
const x = matrix[startIndex];
|
1545
|
+
const y = matrix[startIndex + 1];
|
1546
|
+
const z = matrix[startIndex + 2];
|
1547
|
+
result.x = x;
|
1548
|
+
result.y = y;
|
1549
|
+
result.z = z;
|
1550
|
+
return result;
|
1551
|
+
};
|
1552
|
+
Matrix3.setColumn = function(matrix, index, cartesian, result) {
|
1553
|
+
Check_default.typeOf.object("matrix", matrix);
|
1554
|
+
Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
|
1555
|
+
Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
|
1556
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
1557
|
+
Check_default.typeOf.object("result", result);
|
1558
|
+
result = Matrix3.clone(matrix, result);
|
1559
|
+
const startIndex = index * 3;
|
1560
|
+
result[startIndex] = cartesian.x;
|
1561
|
+
result[startIndex + 1] = cartesian.y;
|
1562
|
+
result[startIndex + 2] = cartesian.z;
|
1563
|
+
return result;
|
1564
|
+
};
|
1565
|
+
Matrix3.getRow = function(matrix, index, result) {
|
1566
|
+
Check_default.typeOf.object("matrix", matrix);
|
1567
|
+
Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
|
1568
|
+
Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
|
1569
|
+
Check_default.typeOf.object("result", result);
|
1570
|
+
const x = matrix[index];
|
1571
|
+
const y = matrix[index + 3];
|
1572
|
+
const z = matrix[index + 6];
|
1573
|
+
result.x = x;
|
1574
|
+
result.y = y;
|
1575
|
+
result.z = z;
|
1576
|
+
return result;
|
1577
|
+
};
|
1578
|
+
Matrix3.setRow = function(matrix, index, cartesian, result) {
|
1579
|
+
Check_default.typeOf.object("matrix", matrix);
|
1580
|
+
Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
|
1581
|
+
Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
|
1582
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
1583
|
+
Check_default.typeOf.object("result", result);
|
1584
|
+
result = Matrix3.clone(matrix, result);
|
1585
|
+
result[index] = cartesian.x;
|
1586
|
+
result[index + 3] = cartesian.y;
|
1587
|
+
result[index + 6] = cartesian.z;
|
1588
|
+
return result;
|
1589
|
+
};
|
1590
|
+
var scaleScratch1 = new Cartesian3_default();
|
1591
|
+
Matrix3.setScale = function(matrix, scale, result) {
|
1592
|
+
Check_default.typeOf.object("matrix", matrix);
|
1593
|
+
Check_default.typeOf.object("scale", scale);
|
1594
|
+
Check_default.typeOf.object("result", result);
|
1595
|
+
const existingScale = Matrix3.getScale(matrix, scaleScratch1);
|
1596
|
+
const scaleRatioX = scale.x / existingScale.x;
|
1597
|
+
const scaleRatioY = scale.y / existingScale.y;
|
1598
|
+
const scaleRatioZ = scale.z / existingScale.z;
|
1599
|
+
result[0] = matrix[0] * scaleRatioX;
|
1600
|
+
result[1] = matrix[1] * scaleRatioX;
|
1601
|
+
result[2] = matrix[2] * scaleRatioX;
|
1602
|
+
result[3] = matrix[3] * scaleRatioY;
|
1603
|
+
result[4] = matrix[4] * scaleRatioY;
|
1604
|
+
result[5] = matrix[5] * scaleRatioY;
|
1605
|
+
result[6] = matrix[6] * scaleRatioZ;
|
1606
|
+
result[7] = matrix[7] * scaleRatioZ;
|
1607
|
+
result[8] = matrix[8] * scaleRatioZ;
|
1608
|
+
return result;
|
1609
|
+
};
|
1610
|
+
var scaleScratch2 = new Cartesian3_default();
|
1611
|
+
Matrix3.setUniformScale = function(matrix, scale, result) {
|
1612
|
+
Check_default.typeOf.object("matrix", matrix);
|
1613
|
+
Check_default.typeOf.number("scale", scale);
|
1614
|
+
Check_default.typeOf.object("result", result);
|
1615
|
+
const existingScale = Matrix3.getScale(matrix, scaleScratch2);
|
1616
|
+
const scaleRatioX = scale / existingScale.x;
|
1617
|
+
const scaleRatioY = scale / existingScale.y;
|
1618
|
+
const scaleRatioZ = scale / existingScale.z;
|
1619
|
+
result[0] = matrix[0] * scaleRatioX;
|
1620
|
+
result[1] = matrix[1] * scaleRatioX;
|
1621
|
+
result[2] = matrix[2] * scaleRatioX;
|
1622
|
+
result[3] = matrix[3] * scaleRatioY;
|
1623
|
+
result[4] = matrix[4] * scaleRatioY;
|
1624
|
+
result[5] = matrix[5] * scaleRatioY;
|
1625
|
+
result[6] = matrix[6] * scaleRatioZ;
|
1626
|
+
result[7] = matrix[7] * scaleRatioZ;
|
1627
|
+
result[8] = matrix[8] * scaleRatioZ;
|
1628
|
+
return result;
|
1629
|
+
};
|
1630
|
+
var scratchColumn = new Cartesian3_default();
|
1631
|
+
Matrix3.getScale = function(matrix, result) {
|
1632
|
+
Check_default.typeOf.object("matrix", matrix);
|
1633
|
+
Check_default.typeOf.object("result", result);
|
1634
|
+
result.x = Cartesian3_default.magnitude(
|
1635
|
+
Cartesian3_default.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)
|
1636
|
+
);
|
1637
|
+
result.y = Cartesian3_default.magnitude(
|
1638
|
+
Cartesian3_default.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)
|
1639
|
+
);
|
1640
|
+
result.z = Cartesian3_default.magnitude(
|
1641
|
+
Cartesian3_default.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)
|
1642
|
+
);
|
1643
|
+
return result;
|
1644
|
+
};
|
1645
|
+
var scaleScratch3 = new Cartesian3_default();
|
1646
|
+
Matrix3.getMaximumScale = function(matrix) {
|
1647
|
+
Matrix3.getScale(matrix, scaleScratch3);
|
1648
|
+
return Cartesian3_default.maximumComponent(scaleScratch3);
|
1649
|
+
};
|
1650
|
+
var scaleScratch4 = new Cartesian3_default();
|
1651
|
+
Matrix3.setRotation = function(matrix, rotation, result) {
|
1652
|
+
Check_default.typeOf.object("matrix", matrix);
|
1653
|
+
Check_default.typeOf.object("result", result);
|
1654
|
+
const scale = Matrix3.getScale(matrix, scaleScratch4);
|
1655
|
+
result[0] = rotation[0] * scale.x;
|
1656
|
+
result[1] = rotation[1] * scale.x;
|
1657
|
+
result[2] = rotation[2] * scale.x;
|
1658
|
+
result[3] = rotation[3] * scale.y;
|
1659
|
+
result[4] = rotation[4] * scale.y;
|
1660
|
+
result[5] = rotation[5] * scale.y;
|
1661
|
+
result[6] = rotation[6] * scale.z;
|
1662
|
+
result[7] = rotation[7] * scale.z;
|
1663
|
+
result[8] = rotation[8] * scale.z;
|
1664
|
+
return result;
|
1665
|
+
};
|
1666
|
+
var scaleScratch5 = new Cartesian3_default();
|
1667
|
+
Matrix3.getRotation = function(matrix, result) {
|
1668
|
+
Check_default.typeOf.object("matrix", matrix);
|
1669
|
+
Check_default.typeOf.object("result", result);
|
1670
|
+
const scale = Matrix3.getScale(matrix, scaleScratch5);
|
1671
|
+
result[0] = matrix[0] / scale.x;
|
1672
|
+
result[1] = matrix[1] / scale.x;
|
1673
|
+
result[2] = matrix[2] / scale.x;
|
1674
|
+
result[3] = matrix[3] / scale.y;
|
1675
|
+
result[4] = matrix[4] / scale.y;
|
1676
|
+
result[5] = matrix[5] / scale.y;
|
1677
|
+
result[6] = matrix[6] / scale.z;
|
1678
|
+
result[7] = matrix[7] / scale.z;
|
1679
|
+
result[8] = matrix[8] / scale.z;
|
1680
|
+
return result;
|
1681
|
+
};
|
1682
|
+
Matrix3.multiply = function(left, right, result) {
|
1683
|
+
Check_default.typeOf.object("left", left);
|
1684
|
+
Check_default.typeOf.object("right", right);
|
1685
|
+
Check_default.typeOf.object("result", result);
|
1686
|
+
const column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2];
|
1687
|
+
const column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2];
|
1688
|
+
const column0Row2 = left[2] * right[0] + left[5] * right[1] + left[8] * right[2];
|
1689
|
+
const column1Row0 = left[0] * right[3] + left[3] * right[4] + left[6] * right[5];
|
1690
|
+
const column1Row1 = left[1] * right[3] + left[4] * right[4] + left[7] * right[5];
|
1691
|
+
const column1Row2 = left[2] * right[3] + left[5] * right[4] + left[8] * right[5];
|
1692
|
+
const column2Row0 = left[0] * right[6] + left[3] * right[7] + left[6] * right[8];
|
1693
|
+
const column2Row1 = left[1] * right[6] + left[4] * right[7] + left[7] * right[8];
|
1694
|
+
const column2Row2 = left[2] * right[6] + left[5] * right[7] + left[8] * right[8];
|
1695
|
+
result[0] = column0Row0;
|
1696
|
+
result[1] = column0Row1;
|
1697
|
+
result[2] = column0Row2;
|
1698
|
+
result[3] = column1Row0;
|
1699
|
+
result[4] = column1Row1;
|
1700
|
+
result[5] = column1Row2;
|
1701
|
+
result[6] = column2Row0;
|
1702
|
+
result[7] = column2Row1;
|
1703
|
+
result[8] = column2Row2;
|
1704
|
+
return result;
|
1705
|
+
};
|
1706
|
+
Matrix3.add = function(left, right, result) {
|
1707
|
+
Check_default.typeOf.object("left", left);
|
1708
|
+
Check_default.typeOf.object("right", right);
|
1709
|
+
Check_default.typeOf.object("result", result);
|
1710
|
+
result[0] = left[0] + right[0];
|
1711
|
+
result[1] = left[1] + right[1];
|
1712
|
+
result[2] = left[2] + right[2];
|
1713
|
+
result[3] = left[3] + right[3];
|
1714
|
+
result[4] = left[4] + right[4];
|
1715
|
+
result[5] = left[5] + right[5];
|
1716
|
+
result[6] = left[6] + right[6];
|
1717
|
+
result[7] = left[7] + right[7];
|
1718
|
+
result[8] = left[8] + right[8];
|
1719
|
+
return result;
|
1720
|
+
};
|
1721
|
+
Matrix3.subtract = function(left, right, result) {
|
1722
|
+
Check_default.typeOf.object("left", left);
|
1723
|
+
Check_default.typeOf.object("right", right);
|
1724
|
+
Check_default.typeOf.object("result", result);
|
1725
|
+
result[0] = left[0] - right[0];
|
1726
|
+
result[1] = left[1] - right[1];
|
1727
|
+
result[2] = left[2] - right[2];
|
1728
|
+
result[3] = left[3] - right[3];
|
1729
|
+
result[4] = left[4] - right[4];
|
1730
|
+
result[5] = left[5] - right[5];
|
1731
|
+
result[6] = left[6] - right[6];
|
1732
|
+
result[7] = left[7] - right[7];
|
1733
|
+
result[8] = left[8] - right[8];
|
1734
|
+
return result;
|
1735
|
+
};
|
1736
|
+
Matrix3.multiplyByVector = function(matrix, cartesian, result) {
|
1737
|
+
Check_default.typeOf.object("matrix", matrix);
|
1738
|
+
Check_default.typeOf.object("cartesian", cartesian);
|
1739
|
+
Check_default.typeOf.object("result", result);
|
1740
|
+
const vX = cartesian.x;
|
1741
|
+
const vY = cartesian.y;
|
1742
|
+
const vZ = cartesian.z;
|
1743
|
+
const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;
|
1744
|
+
const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;
|
1745
|
+
const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;
|
1746
|
+
result.x = x;
|
1747
|
+
result.y = y;
|
1748
|
+
result.z = z;
|
1749
|
+
return result;
|
1750
|
+
};
|
1751
|
+
Matrix3.multiplyByScalar = function(matrix, scalar, result) {
|
1752
|
+
Check_default.typeOf.object("matrix", matrix);
|
1753
|
+
Check_default.typeOf.number("scalar", scalar);
|
1754
|
+
Check_default.typeOf.object("result", result);
|
1755
|
+
result[0] = matrix[0] * scalar;
|
1756
|
+
result[1] = matrix[1] * scalar;
|
1757
|
+
result[2] = matrix[2] * scalar;
|
1758
|
+
result[3] = matrix[3] * scalar;
|
1759
|
+
result[4] = matrix[4] * scalar;
|
1760
|
+
result[5] = matrix[5] * scalar;
|
1761
|
+
result[6] = matrix[6] * scalar;
|
1762
|
+
result[7] = matrix[7] * scalar;
|
1763
|
+
result[8] = matrix[8] * scalar;
|
1764
|
+
return result;
|
1765
|
+
};
|
1766
|
+
Matrix3.multiplyByScale = function(matrix, scale, result) {
|
1767
|
+
Check_default.typeOf.object("matrix", matrix);
|
1768
|
+
Check_default.typeOf.object("scale", scale);
|
1769
|
+
Check_default.typeOf.object("result", result);
|
1770
|
+
result[0] = matrix[0] * scale.x;
|
1771
|
+
result[1] = matrix[1] * scale.x;
|
1772
|
+
result[2] = matrix[2] * scale.x;
|
1773
|
+
result[3] = matrix[3] * scale.y;
|
1774
|
+
result[4] = matrix[4] * scale.y;
|
1775
|
+
result[5] = matrix[5] * scale.y;
|
1776
|
+
result[6] = matrix[6] * scale.z;
|
1777
|
+
result[7] = matrix[7] * scale.z;
|
1778
|
+
result[8] = matrix[8] * scale.z;
|
1779
|
+
return result;
|
1780
|
+
};
|
1781
|
+
Matrix3.multiplyByUniformScale = function(matrix, scale, result) {
|
1782
|
+
Check_default.typeOf.object("matrix", matrix);
|
1783
|
+
Check_default.typeOf.number("scale", scale);
|
1784
|
+
Check_default.typeOf.object("result", result);
|
1785
|
+
result[0] = matrix[0] * scale;
|
1786
|
+
result[1] = matrix[1] * scale;
|
1787
|
+
result[2] = matrix[2] * scale;
|
1788
|
+
result[3] = matrix[3] * scale;
|
1789
|
+
result[4] = matrix[4] * scale;
|
1790
|
+
result[5] = matrix[5] * scale;
|
1791
|
+
result[6] = matrix[6] * scale;
|
1792
|
+
result[7] = matrix[7] * scale;
|
1793
|
+
result[8] = matrix[8] * scale;
|
1794
|
+
return result;
|
1795
|
+
};
|
1796
|
+
Matrix3.negate = function(matrix, result) {
|
1797
|
+
Check_default.typeOf.object("matrix", matrix);
|
1798
|
+
Check_default.typeOf.object("result", result);
|
1799
|
+
result[0] = -matrix[0];
|
1800
|
+
result[1] = -matrix[1];
|
1801
|
+
result[2] = -matrix[2];
|
1802
|
+
result[3] = -matrix[3];
|
1803
|
+
result[4] = -matrix[4];
|
1804
|
+
result[5] = -matrix[5];
|
1805
|
+
result[6] = -matrix[6];
|
1806
|
+
result[7] = -matrix[7];
|
1807
|
+
result[8] = -matrix[8];
|
1808
|
+
return result;
|
1809
|
+
};
|
1810
|
+
Matrix3.transpose = function(matrix, result) {
|
1811
|
+
Check_default.typeOf.object("matrix", matrix);
|
1812
|
+
Check_default.typeOf.object("result", result);
|
1813
|
+
const column0Row0 = matrix[0];
|
1814
|
+
const column0Row1 = matrix[3];
|
1815
|
+
const column0Row2 = matrix[6];
|
1816
|
+
const column1Row0 = matrix[1];
|
1817
|
+
const column1Row1 = matrix[4];
|
1818
|
+
const column1Row2 = matrix[7];
|
1819
|
+
const column2Row0 = matrix[2];
|
1820
|
+
const column2Row1 = matrix[5];
|
1821
|
+
const column2Row2 = matrix[8];
|
1822
|
+
result[0] = column0Row0;
|
1823
|
+
result[1] = column0Row1;
|
1824
|
+
result[2] = column0Row2;
|
1825
|
+
result[3] = column1Row0;
|
1826
|
+
result[4] = column1Row1;
|
1827
|
+
result[5] = column1Row2;
|
1828
|
+
result[6] = column2Row0;
|
1829
|
+
result[7] = column2Row1;
|
1830
|
+
result[8] = column2Row2;
|
1831
|
+
return result;
|
1832
|
+
};
|
1833
|
+
function computeFrobeniusNorm(matrix) {
|
1834
|
+
let norm = 0;
|
1835
|
+
for (let i = 0; i < 9; ++i) {
|
1836
|
+
const temp = matrix[i];
|
1837
|
+
norm += temp * temp;
|
1838
|
+
}
|
1839
|
+
return Math.sqrt(norm);
|
1840
|
+
}
|
1841
|
+
var rowVal = [1, 0, 0];
|
1842
|
+
var colVal = [2, 2, 1];
|
1843
|
+
function offDiagonalFrobeniusNorm(matrix) {
|
1844
|
+
let norm = 0;
|
1845
|
+
for (let i = 0; i < 3; ++i) {
|
1846
|
+
const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];
|
1847
|
+
norm += 2 * temp * temp;
|
1848
|
+
}
|
1849
|
+
return Math.sqrt(norm);
|
1850
|
+
}
|
1851
|
+
function shurDecomposition(matrix, result) {
|
1852
|
+
const tolerance = Math_default.EPSILON15;
|
1853
|
+
let maxDiagonal = 0;
|
1854
|
+
let rotAxis = 1;
|
1855
|
+
for (let i = 0; i < 3; ++i) {
|
1856
|
+
const temp = Math.abs(
|
1857
|
+
matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]
|
1858
|
+
);
|
1859
|
+
if (temp > maxDiagonal) {
|
1860
|
+
rotAxis = i;
|
1861
|
+
maxDiagonal = temp;
|
1862
|
+
}
|
1863
|
+
}
|
1864
|
+
let c = 1;
|
1865
|
+
let s = 0;
|
1866
|
+
const p = rowVal[rotAxis];
|
1867
|
+
const q = colVal[rotAxis];
|
1868
|
+
if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {
|
1869
|
+
const qq = matrix[Matrix3.getElementIndex(q, q)];
|
1870
|
+
const pp = matrix[Matrix3.getElementIndex(p, p)];
|
1871
|
+
const qp = matrix[Matrix3.getElementIndex(q, p)];
|
1872
|
+
const tau = (qq - pp) / 2 / qp;
|
1873
|
+
let t;
|
1874
|
+
if (tau < 0) {
|
1875
|
+
t = -1 / (-tau + Math.sqrt(1 + tau * tau));
|
1876
|
+
} else {
|
1877
|
+
t = 1 / (tau + Math.sqrt(1 + tau * tau));
|
1878
|
+
}
|
1879
|
+
c = 1 / Math.sqrt(1 + t * t);
|
1880
|
+
s = t * c;
|
1881
|
+
}
|
1882
|
+
result = Matrix3.clone(Matrix3.IDENTITY, result);
|
1883
|
+
result[Matrix3.getElementIndex(p, p)] = result[Matrix3.getElementIndex(q, q)] = c;
|
1884
|
+
result[Matrix3.getElementIndex(q, p)] = s;
|
1885
|
+
result[Matrix3.getElementIndex(p, q)] = -s;
|
1886
|
+
return result;
|
1887
|
+
}
|
1888
|
+
var jMatrix = new Matrix3();
|
1889
|
+
var jMatrixTranspose = new Matrix3();
|
1890
|
+
Matrix3.computeEigenDecomposition = function(matrix, result) {
|
1891
|
+
Check_default.typeOf.object("matrix", matrix);
|
1892
|
+
const tolerance = Math_default.EPSILON20;
|
1893
|
+
const maxSweeps = 10;
|
1894
|
+
let count = 0;
|
1895
|
+
let sweep = 0;
|
1896
|
+
if (!defined_default(result)) {
|
1897
|
+
result = {};
|
1898
|
+
}
|
1899
|
+
const unitaryMatrix = result.unitary = Matrix3.clone(
|
1900
|
+
Matrix3.IDENTITY,
|
1901
|
+
result.unitary
|
1902
|
+
);
|
1903
|
+
const diagMatrix = result.diagonal = Matrix3.clone(matrix, result.diagonal);
|
1904
|
+
const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);
|
1905
|
+
while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {
|
1906
|
+
shurDecomposition(diagMatrix, jMatrix);
|
1907
|
+
Matrix3.transpose(jMatrix, jMatrixTranspose);
|
1908
|
+
Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);
|
1909
|
+
Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);
|
1910
|
+
Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);
|
1911
|
+
if (++count > 2) {
|
1912
|
+
++sweep;
|
1913
|
+
count = 0;
|
1914
|
+
}
|
1915
|
+
}
|
1916
|
+
return result;
|
1917
|
+
};
|
1918
|
+
Matrix3.abs = function(matrix, result) {
|
1919
|
+
Check_default.typeOf.object("matrix", matrix);
|
1920
|
+
Check_default.typeOf.object("result", result);
|
1921
|
+
result[0] = Math.abs(matrix[0]);
|
1922
|
+
result[1] = Math.abs(matrix[1]);
|
1923
|
+
result[2] = Math.abs(matrix[2]);
|
1924
|
+
result[3] = Math.abs(matrix[3]);
|
1925
|
+
result[4] = Math.abs(matrix[4]);
|
1926
|
+
result[5] = Math.abs(matrix[5]);
|
1927
|
+
result[6] = Math.abs(matrix[6]);
|
1928
|
+
result[7] = Math.abs(matrix[7]);
|
1929
|
+
result[8] = Math.abs(matrix[8]);
|
1930
|
+
return result;
|
1931
|
+
};
|
1932
|
+
Matrix3.determinant = function(matrix) {
|
1933
|
+
Check_default.typeOf.object("matrix", matrix);
|
1934
|
+
const m11 = matrix[0];
|
1935
|
+
const m21 = matrix[3];
|
1936
|
+
const m31 = matrix[6];
|
1937
|
+
const m12 = matrix[1];
|
1938
|
+
const m22 = matrix[4];
|
1939
|
+
const m32 = matrix[7];
|
1940
|
+
const m13 = matrix[2];
|
1941
|
+
const m23 = matrix[5];
|
1942
|
+
const m33 = matrix[8];
|
1943
|
+
return m11 * (m22 * m33 - m23 * m32) + m12 * (m23 * m31 - m21 * m33) + m13 * (m21 * m32 - m22 * m31);
|
1944
|
+
};
|
1945
|
+
Matrix3.inverse = function(matrix, result) {
|
1946
|
+
Check_default.typeOf.object("matrix", matrix);
|
1947
|
+
Check_default.typeOf.object("result", result);
|
1948
|
+
const m11 = matrix[0];
|
1949
|
+
const m21 = matrix[1];
|
1950
|
+
const m31 = matrix[2];
|
1951
|
+
const m12 = matrix[3];
|
1952
|
+
const m22 = matrix[4];
|
1953
|
+
const m32 = matrix[5];
|
1954
|
+
const m13 = matrix[6];
|
1955
|
+
const m23 = matrix[7];
|
1956
|
+
const m33 = matrix[8];
|
1957
|
+
const determinant = Matrix3.determinant(matrix);
|
1958
|
+
if (Math.abs(determinant) <= Math_default.EPSILON15) {
|
1959
|
+
throw new DeveloperError_default("matrix is not invertible");
|
1960
|
+
}
|
1961
|
+
result[0] = m22 * m33 - m23 * m32;
|
1962
|
+
result[1] = m23 * m31 - m21 * m33;
|
1963
|
+
result[2] = m21 * m32 - m22 * m31;
|
1964
|
+
result[3] = m13 * m32 - m12 * m33;
|
1965
|
+
result[4] = m11 * m33 - m13 * m31;
|
1966
|
+
result[5] = m12 * m31 - m11 * m32;
|
1967
|
+
result[6] = m12 * m23 - m13 * m22;
|
1968
|
+
result[7] = m13 * m21 - m11 * m23;
|
1969
|
+
result[8] = m11 * m22 - m12 * m21;
|
1970
|
+
const scale = 1 / determinant;
|
1971
|
+
return Matrix3.multiplyByScalar(result, scale, result);
|
1972
|
+
};
|
1973
|
+
var scratchTransposeMatrix = new Matrix3();
|
1974
|
+
Matrix3.inverseTranspose = function(matrix, result) {
|
1975
|
+
Check_default.typeOf.object("matrix", matrix);
|
1976
|
+
Check_default.typeOf.object("result", result);
|
1977
|
+
return Matrix3.inverse(
|
1978
|
+
Matrix3.transpose(matrix, scratchTransposeMatrix),
|
1979
|
+
result
|
1980
|
+
);
|
1981
|
+
};
|
1982
|
+
Matrix3.equals = function(left, right) {
|
1983
|
+
return left === right || defined_default(left) && defined_default(right) && left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[3] === right[3] && left[4] === right[4] && left[5] === right[5] && left[6] === right[6] && left[7] === right[7] && left[8] === right[8];
|
1984
|
+
};
|
1985
|
+
Matrix3.equalsEpsilon = function(left, right, epsilon) {
|
1986
|
+
epsilon = defaultValue_default(epsilon, 0);
|
1987
|
+
return left === right || defined_default(left) && defined_default(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon && Math.abs(left[4] - right[4]) <= epsilon && Math.abs(left[5] - right[5]) <= epsilon && Math.abs(left[6] - right[6]) <= epsilon && Math.abs(left[7] - right[7]) <= epsilon && Math.abs(left[8] - right[8]) <= epsilon;
|
1988
|
+
};
|
1989
|
+
Matrix3.IDENTITY = Object.freeze(
|
1990
|
+
new Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1)
|
1991
|
+
);
|
1992
|
+
Matrix3.ZERO = Object.freeze(
|
1993
|
+
new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0)
|
1994
|
+
);
|
1995
|
+
Matrix3.COLUMN0ROW0 = 0;
|
1996
|
+
Matrix3.COLUMN0ROW1 = 1;
|
1997
|
+
Matrix3.COLUMN0ROW2 = 2;
|
1998
|
+
Matrix3.COLUMN1ROW0 = 3;
|
1999
|
+
Matrix3.COLUMN1ROW1 = 4;
|
2000
|
+
Matrix3.COLUMN1ROW2 = 5;
|
2001
|
+
Matrix3.COLUMN2ROW0 = 6;
|
2002
|
+
Matrix3.COLUMN2ROW1 = 7;
|
2003
|
+
Matrix3.COLUMN2ROW2 = 8;
|
2004
|
+
Object.defineProperties(Matrix3.prototype, {
|
2005
|
+
/**
|
2006
|
+
* Gets the number of items in the collection.
|
2007
|
+
* @memberof Matrix3.prototype
|
2008
|
+
*
|
2009
|
+
* @type {number}
|
2010
|
+
*/
|
2011
|
+
length: {
|
2012
|
+
get: function() {
|
2013
|
+
return Matrix3.packedLength;
|
2014
|
+
}
|
2015
|
+
}
|
2016
|
+
});
|
2017
|
+
Matrix3.prototype.clone = function(result) {
|
2018
|
+
return Matrix3.clone(this, result);
|
2019
|
+
};
|
2020
|
+
Matrix3.prototype.equals = function(right) {
|
2021
|
+
return Matrix3.equals(this, right);
|
2022
|
+
};
|
2023
|
+
Matrix3.equalsArray = function(matrix, array, offset) {
|
2024
|
+
return matrix[0] === array[offset] && matrix[1] === array[offset + 1] && matrix[2] === array[offset + 2] && matrix[3] === array[offset + 3] && matrix[4] === array[offset + 4] && matrix[5] === array[offset + 5] && matrix[6] === array[offset + 6] && matrix[7] === array[offset + 7] && matrix[8] === array[offset + 8];
|
2025
|
+
};
|
2026
|
+
Matrix3.prototype.equalsEpsilon = function(right, epsilon) {
|
2027
|
+
return Matrix3.equalsEpsilon(this, right, epsilon);
|
2028
|
+
};
|
2029
|
+
Matrix3.prototype.toString = function() {
|
2030
|
+
return `(${this[0]}, ${this[3]}, ${this[6]})
|
2031
|
+
(${this[1]}, ${this[4]}, ${this[7]})
|
2032
|
+
(${this[2]}, ${this[5]}, ${this[8]})`;
|
2033
|
+
};
|
2034
|
+
var Matrix3_default = Matrix3;
|
2035
|
+
|
2036
|
+
export {
|
2037
|
+
Cartesian3_default,
|
2038
|
+
Cartographic_default,
|
2039
|
+
Ellipsoid_default,
|
2040
|
+
Matrix3_default
|
2041
|
+
};
|