@vcmap/ui 5.0.0-rc.8 → 5.0.0
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/README.md +95 -64
- package/app.config.json +3 -0
- package/build/.eslintrc +3 -0
- package/build/build.js +302 -165
- package/build/buildCesium.js +39 -19
- package/build/buildHelpers.js +279 -88
- package/build/buildPreview.js +16 -6
- package/build/bundle.js +57 -0
- package/build/commonViteConfig.js +7 -16
- package/build/determineHost.js +17 -4
- package/build/generateOLLib.js +15 -18
- package/build/getPluginProxies.js +35 -3
- package/build/info/conf.json +21 -19
- package/build/info/publish.js +16 -5
- package/config/aerowest.config.json +47 -54
- package/config/base.config.json +597 -662
- package/config/codes.config.json +401 -0
- package/config/dev.config.json +460 -14
- package/config/graphFeatureInfo.config.json +141 -0
- package/config/projects.config.json +29 -0
- package/config/www.config.json +1801 -0
- package/dist/assets/@mdi/font/LICENSE +20 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
- package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +3 -0
- package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- 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/chunk-MPAZH4BF.js +37 -0
- 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 +67 -1
- package/dist/assets/cesium/Workers/createBoxGeometry.js +57 -1
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +234 -1
- package/dist/assets/cesium/Workers/createCircleGeometry.js +196 -1
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +146 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +506 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +224 -1
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1262 -1
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +567 -1
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +59 -1
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +231 -1
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +70 -1
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +63 -1
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +58 -1
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +60 -1
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +57 -1
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +234 -1
- package/dist/assets/cesium/Workers/createGeometry.js +150 -1
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1607 -1
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +223 -1
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +123 -1
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1134 -1
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +542 -1
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +495 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +379 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +277 -1
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1273 -1
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +480 -1
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +399 -1
- package/dist/assets/cesium/Workers/createSphereGeometry.js +117 -1
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +117 -1
- package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -1
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +492 -1
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +386 -1
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +112 -1
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +384 -1
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +262 -1
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -1
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2277 -3
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -1
- package/dist/assets/cesium/Workers/createWallGeometry.js +489 -1
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +337 -1
- package/dist/assets/cesium/Workers/decodeDraco.js +369 -1
- package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -1
- package/dist/assets/cesium/Workers/decodeI3S.js +835 -0
- package/dist/assets/cesium/Workers/transcodeKTX2.js +3425 -1
- package/dist/assets/cesium/Workers/transferTypedArrayTest.js +41 -1
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +818 -1
- package/dist/assets/cesium.4137c8.js +164897 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/core.306872.js +19286 -0
- package/dist/assets/core.js +1 -1
- package/dist/assets/favicon-128.4c4ce5.png +0 -0
- package/dist/assets/favicon-180.5b99c0.png +0 -0
- package/dist/assets/favicon-192.0e205e.png +0 -0
- package/dist/assets/favicon-32.6b9add.png +0 -0
- package/dist/assets/favicon.d5ec97.svg +10 -0
- package/dist/assets/font/OFL.txt +93 -0
- package/dist/assets/font/TitilliumWeb-Regular.9ca076.woff2 +0 -0
- package/dist/assets/index-cfed33b1.js +1 -0
- package/dist/assets/ol.328bbf.js +60117 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
- package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
- package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
- package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
- package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
- package/dist/assets/style/icon-marker-o.036477.png +0 -0
- package/dist/assets/style/icon-marker-red.313d03.png +0 -0
- package/dist/assets/style/icon-marker.70960f.png +0 -0
- package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
- package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
- package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
- package/dist/assets/style/icon-pin.b7ce77.png +0 -0
- package/dist/assets/ui.e84ce9.css +5 -0
- package/dist/assets/ui.e84ce9.js +16488 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.1c8696.js +4911 -0
- package/dist/assets/vue.js +5 -1
- package/dist/assets/vuetify.008fac.css +5 -0
- package/dist/assets/vuetify.008fac.js +21262 -0
- package/dist/assets/vuetify.js +5 -2
- package/dist/index.html +90 -8
- package/index.html +111 -0
- package/index.js +203 -18
- package/lib/cesium.js +1 -1
- package/lib/core.js +1 -1
- package/lib/olLib.js +861 -843
- package/lib/ui.js +1 -1
- package/lib/vue.js +2 -1
- package/lib/vuetify.js +2 -2
- package/package.json +53 -34
- package/plugins/.eslintrc +9 -0
- package/plugins/@vcmap-show-case/README.md +28 -0
- package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
- package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +282 -0
- package/plugins/@vcmap-show-case/buttons-example/src/index.js +51 -0
- package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +135 -0
- package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +209 -0
- package/plugins/@vcmap-show-case/category-tester/src/index.js +73 -0
- package/plugins/@vcmap-show-case/collection-manager-example/README.md +3 -0
- package/plugins/@vcmap-show-case/collection-manager-example/package.json +5 -0
- package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +182 -0
- package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +79 -0
- package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
- package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
- package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +62 -0
- package/plugins/@vcmap-show-case/config-editor/src/index.js +49 -0
- package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/context-menu-tester/src/index.js +41 -0
- package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
- package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
- package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +516 -0
- package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +36 -0
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/index.js +123 -39
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/validation.js +14 -2
- package/plugins/@vcmap-show-case/hello-world/README.md +31 -0
- package/plugins/@vcmap-show-case/hello-world/package.json +6 -0
- package/plugins/@vcmap-show-case/hello-world/plugin-assets/vcs_logo.png +0 -0
- package/plugins/@vcmap-show-case/hello-world/src/defaultOptions.js +4 -0
- package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +69 -0
- package/plugins/@vcmap-show-case/hello-world/src/index.js +142 -0
- package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +53 -0
- package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
- package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
- package/plugins/@vcmap-show-case/icons-example/src/AllIconsComponent.vue +51 -0
- package/plugins/@vcmap-show-case/icons-example/src/index.js +46 -0
- package/plugins/@vcmap-show-case/list-example/README.md +3 -0
- package/plugins/@vcmap-show-case/list-example/package.json +5 -0
- package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +411 -0
- package/plugins/@vcmap-show-case/list-example/src/index.js +46 -0
- package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/notifier-tester/src/NotifierTester.vue +82 -0
- package/plugins/@vcmap-show-case/notifier-tester/src/index.js +42 -0
- package/plugins/@vcmap-show-case/plugin-editors/README.md +4 -0
- package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
- package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +119 -0
- package/plugins/@vcmap-show-case/plugin-editors/src/index.js +41 -0
- package/plugins/@vcmap-show-case/project-selector/README.md +25 -0
- package/plugins/@vcmap-show-case/project-selector/config.json +15 -0
- package/plugins/@vcmap-show-case/project-selector/package.json +13 -0
- package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +65 -0
- package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +102 -0
- package/plugins/@vcmap-show-case/project-selector/src/de.json +10 -0
- package/plugins/@vcmap-show-case/project-selector/src/en.json +10 -0
- package/plugins/@vcmap-show-case/project-selector/src/index.js +269 -0
- package/plugins/@vcmap-show-case/simple-graph/README.md +71 -0
- package/plugins/@vcmap-show-case/simple-graph/package.json +11 -0
- package/plugins/@vcmap-show-case/simple-graph/src/SimpleGraphComponent.vue +59 -0
- package/plugins/@vcmap-show-case/simple-graph/src/index.js +17 -0
- package/plugins/@vcmap-show-case/simple-graph/src/simpleGraphView.js +78 -0
- package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
- package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
- package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +190 -0
- package/plugins/@vcmap-show-case/style-input-example/src/index.js +42 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +21 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/config.json +3 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +5 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +34 -0
- package/plugins/@vcmap-show-case/switch-map-callback-example/src/switchMapCallback.js +47 -0
- package/plugins/@vcmap-show-case/table-example/README.md +3 -0
- package/plugins/@vcmap-show-case/table-example/package.json +5 -0
- package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +182 -0
- package/plugins/@vcmap-show-case/table-example/src/index.js +49 -0
- package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
- package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
- package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/src/TextfieldsExample.vue} +13 -31
- package/plugins/@vcmap-show-case/textfields-example/src/index.js +64 -0
- package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +5 -3
- package/plugins/@vcmap-show-case/theme-changer/config.json +69 -0
- package/plugins/@vcmap-show-case/theme-changer/package.json +11 -0
- package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/ThemeChangerComponent.vue +36 -8
- package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/index.js +20 -14
- package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
- package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +128 -0
- package/plugins/@vcmap-show-case/vector-properties-example/src/index.js +40 -0
- package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +18 -0
- package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +31 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +185 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +18 -0
- package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +45 -0
- package/plugins/@vcmap-show-case/window-tester/src/index.js +80 -0
- package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +288 -0
- package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
- package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
- package/plugins/@vcmap-show-case/wizard-example/src/WizardExample.vue +127 -0
- package/plugins/@vcmap-show-case/wizard-example/src/index.js +53 -0
- package/plugins/package.json +9 -2
- package/public/assets/@mdi/font/LICENSE +20 -0
- package/public/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
- package/public/assets/@mdi/font/css/materialdesignicons.min.css +3 -0
- package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/public/assets/favicon-128.png +0 -0
- package/public/assets/favicon-180.png +0 -0
- package/public/assets/favicon-192.png +0 -0
- package/public/assets/favicon-32.png +0 -0
- package/public/assets/favicon.svg +10 -0
- package/public/assets/font/OFL.txt +93 -0
- package/public/assets/font/TitilliumWeb-Regular.woff2 +0 -0
- package/public/assets/style/icon-marker-blue.png +0 -0
- package/public/assets/style/icon-marker-green.png +0 -0
- package/public/assets/style/icon-marker-o-blue.png +0 -0
- package/public/assets/style/icon-marker-o-green.png +0 -0
- package/public/assets/style/icon-marker-o-red.png +0 -0
- package/public/assets/style/icon-marker-o.png +0 -0
- package/public/assets/style/icon-marker-red.png +0 -0
- package/public/assets/style/icon-marker.png +0 -0
- package/public/assets/style/icon-pin-blue.png +0 -0
- package/public/assets/style/icon-pin-green.png +0 -0
- package/public/assets/style/icon-pin-red.png +0 -0
- package/public/assets/style/icon-pin.png +0 -0
- package/src/actions/StyleSelector.vue +121 -0
- package/src/actions/actionHelper.js +186 -50
- package/src/actions/stateRefAction.js +2 -3
- package/src/application/VcsApp.vue +539 -93
- package/src/application/VcsAppWrapper.vue +32 -0
- package/src/application/VcsAttributions.vue +83 -0
- package/src/application/VcsAttributionsFooter.vue +83 -0
- package/src/application/VcsMap.vue +22 -5
- package/src/application/VcsNavbar.vue +217 -0
- package/src/application/VcsSettings.vue +98 -0
- package/src/application/attributionsHelper.js +162 -0
- package/src/callback/activateLayersCallback.js +54 -0
- package/src/callback/applyLayerStyleCallback.js +63 -0
- package/src/callback/deactivateLayersCallback.js +54 -0
- package/src/callback/goToViewpointCallback.js +54 -0
- package/src/callback/vcsCallback.js +66 -0
- package/src/components/ImageElementInjector.vue +24 -0
- package/src/components/buttons/VcsActionButtonList.vue +129 -0
- package/src/components/buttons/VcsButton.vue +151 -0
- package/src/components/buttons/VcsFormButton.vue +178 -0
- package/src/components/buttons/VcsToolButton.vue +161 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +115 -0
- package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
- package/src/components/form-inputs-controls/VcsDatePicker.vue +156 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +150 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +56 -0
- package/src/components/form-inputs-controls/VcsRadio.vue +149 -0
- package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +211 -0
- package/src/components/form-inputs-controls/VcsSlider.vue +73 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +180 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +298 -0
- package/src/components/form-inputs-controls/VcsWizard.vue +137 -0
- package/src/components/form-inputs-controls/VcsWizardStep.vue +161 -0
- package/src/components/form-inputs-controls/composables.js +31 -0
- package/src/components/form-output/VcsFormattedNumber.vue +103 -0
- package/src/components/icons/+all.js +463 -0
- package/src/components/icons/2DAreaIcon.vue +58 -0
- package/src/components/icons/2DDistanceIcon.vue +24 -0
- package/src/components/icons/3DAreaIcon.vue +58 -0
- package/src/components/icons/3DDistanceIcon.vue +24 -0
- package/src/components/icons/3DHeightIcon.vue +24 -0
- package/src/components/icons/AngleIcon.vue +16 -0
- package/src/components/icons/AssociationsIcon.vue +37 -0
- package/src/components/icons/AxisIcon.vue +35 -0
- package/src/components/icons/BoundingBoxIcon.vue +38 -0
- package/src/components/icons/CheckboxCheckedIcon.vue +12 -0
- package/src/components/icons/CheckboxIcon.vue +21 -0
- package/src/components/icons/CheckboxIndeterminateIcon.vue +10 -0
- package/src/components/icons/CircleIcon.vue +25 -0
- package/src/components/icons/ClippingHorizontalIcon.vue +18 -0
- package/src/components/icons/ClippingIcon.vue +17 -0
- package/src/components/icons/ClippingVerticalIcon.vue +18 -0
- package/src/components/icons/ColorPickerIcon.vue +17 -0
- package/src/components/icons/ColorSwatchIcon.vue +21 -0
- package/src/components/icons/CommentIcon.vue +19 -0
- package/src/components/icons/CompassIcon.vue +24 -0
- package/src/components/icons/ComponentsIcon.vue +18 -0
- package/src/components/icons/ConeIcon.vue +30 -0
- package/src/components/icons/DimensionsHouseIcon.vue +20 -0
- package/src/components/icons/EditIcon.vue +17 -0
- package/src/components/icons/EditVerticesIcon.vue +35 -0
- package/src/components/icons/ElevationProfileIcon.vue +104 -0
- package/src/components/icons/ExportAreaIcon.vue +17 -0
- package/src/components/icons/ExportFlightIcon.vue +17 -0
- package/src/components/icons/ExportIcon.vue +24 -0
- package/src/components/icons/ExternalLinkIcon.vue +23 -0
- package/src/components/icons/EyeIcon.vue +17 -0
- package/src/components/icons/FastForwardIcon.vue +17 -0
- package/src/components/icons/FilterIcon.vue +18 -0
- package/src/components/icons/GlobalTerrainIcon.vue +19 -0
- package/src/components/icons/GlobeNatureIcon.vue +17 -0
- package/src/components/icons/GroundIcon.vue +27 -0
- package/src/components/icons/HealthCareIndustriesIcon.vue +113 -0
- package/src/components/icons/HelpIcon.vue +17 -0
- package/src/components/icons/HideIcon.vue +25 -0
- package/src/components/icons/HomePointIcon.vue +17 -0
- package/src/components/icons/HospitalsIcon.vue +223 -0
- package/src/components/icons/HouseIcon.vue +32 -0
- package/src/components/icons/ImportIcon.vue +18 -0
- package/src/components/icons/InfoIcon.vue +24 -0
- package/src/components/icons/KebabIcon.vue +38 -0
- package/src/components/icons/LabelIcon.vue +23 -0
- package/src/components/icons/LayersIcon.vue +28 -0
- package/src/components/icons/LegendIcon.vue +24 -0
- package/src/components/icons/LineIcon.vue +22 -0
- package/src/components/icons/LinkIcon.vue +17 -0
- package/src/components/icons/LogoutIcon.vue +17 -0
- package/src/components/icons/MapIcon.vue +18 -0
- package/src/components/icons/MenuIcon.vue +36 -0
- package/src/components/icons/MinusIcon.vue +18 -0
- package/src/components/icons/ObjectAttributeIcon.vue +18 -0
- package/src/components/icons/ObjectSelectIcon.vue +18 -0
- package/src/components/icons/ObliqueViewIcon.vue +19 -0
- package/src/components/icons/PdfIcon.vue +19 -0
- package/src/components/icons/PedestrianIcon.vue +17 -0
- package/src/components/icons/PenIcon.vue +16 -0
- package/src/components/icons/PlayCircleIcon.vue +20 -0
- package/src/components/icons/PlusIcon.vue +18 -0
- package/src/components/icons/PoiIcon.vue +23 -0
- package/src/components/icons/PointIcon.vue +40 -0
- package/src/components/icons/PointSelectIcon.vue +18 -0
- package/src/components/icons/PresentationModeIcon.vue +17 -0
- package/src/components/icons/ProgressIcon.vue +26 -0
- package/src/components/icons/QueryIcon.vue +39 -0
- package/src/components/icons/RectangleIcon.vue +24 -0
- package/src/components/icons/ReturnIcon.vue +17 -0
- package/src/components/icons/RewindIcon.vue +16 -0
- package/src/components/icons/RotateLeftIcon.vue +17 -0
- package/src/components/icons/RotateRightIcon.vue +17 -0
- package/src/components/icons/ScreenshotIcon.vue +53 -0
- package/src/components/icons/SearchIcon.vue +17 -0
- package/src/components/icons/ShadowIcon.vue +18 -0
- package/src/components/icons/ShapesIcon.vue +35 -0
- package/src/components/icons/ShareIcon.vue +22 -0
- package/src/components/icons/SimpleCircleFilledIcon.vue +18 -0
- package/src/components/icons/SimpleCircleHalfFilledIcon.vue +16 -0
- package/src/components/icons/SimpleCircleOutlinedIcon.vue +13 -0
- package/src/components/icons/SkipNextIcon.vue +18 -0
- package/src/components/icons/SkipPreviousIcon.vue +18 -0
- package/src/components/icons/SplitViewIcon.vue +19 -0
- package/src/components/icons/TerrainBoxIcon.vue +19 -0
- package/src/components/icons/TextStyleIcon.vue +17 -0
- package/src/components/icons/ThreeDimensionsIcon.vue +17 -0
- package/src/components/icons/ToolsIcon.vue +16 -0
- package/src/components/icons/TouchIcon.vue +18 -0
- package/src/components/icons/TrashCanIcon.vue +18 -0
- package/src/components/icons/TriangleIcon.vue +16 -0
- package/src/components/icons/TwoDimensionsIcon.vue +18 -0
- package/src/components/icons/UploadIcon.vue +17 -0
- package/src/components/icons/UserProfileIcon.vue +17 -0
- package/src/components/icons/UserShareIcon.vue +16 -0
- package/src/components/icons/VideoRecorderIcon.vue +23 -0
- package/src/components/icons/ViewpointFlightIcon.vue +28 -0
- package/src/components/icons/ViewpointIcon.vue +28 -0
- package/src/components/icons/Viewshed360Icon.vue +18 -0
- package/src/components/icons/ViewshedConeIcon.vue +17 -0
- package/src/components/icons/ViewshedIcon.vue +18 -0
- package/src/components/icons/WalkingIcon.vue +17 -0
- package/src/components/icons/WallIcon.vue +22 -0
- package/src/components/icons/WandIcon.vue +123 -0
- package/src/components/lists/VcsActionList.vue +132 -0
- package/src/components/lists/VcsList.vue +590 -0
- package/src/components/lists/VcsTreeview.vue +112 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +81 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +148 -0
- package/src/components/notification/VcsBadge.vue +29 -0
- package/src/components/notification/VcsHelp.vue +39 -0
- package/src/components/notification/VcsTooltip.vue +160 -0
- package/src/components/notification/validation.js +19 -0
- package/src/components/plugins/AbstractConfigEditor.vue +84 -0
- package/src/components/style/MenuWrapper.vue +140 -0
- package/src/components/style/VcsFillMenu.vue +61 -0
- package/src/components/style/VcsFillSelector.vue +45 -0
- package/src/components/style/VcsImageMenu.vue +83 -0
- package/src/components/style/VcsImageSelector.vue +577 -0
- package/src/components/style/VcsStrokeMenu.vue +73 -0
- package/src/components/style/VcsStrokeSelector.vue +88 -0
- package/src/components/style/VcsTextMenu.vue +81 -0
- package/src/components/style/VcsTextSelector.vue +269 -0
- package/src/components/style/VcsVectorStyleComponent.vue +114 -0
- package/src/components/style/composables.js +84 -0
- package/src/components/tables/VcsDataTable.vue +475 -0
- package/src/components/tables/VcsTable.vue +145 -0
- package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +778 -0
- package/src/components/vector-properties/composables.js +93 -0
- package/src/contentTree/LayerTree.vue +19 -15
- package/src/contentTree/contentTreeCollection.js +114 -42
- package/src/contentTree/contentTreeItem.js +109 -43
- package/src/contentTree/groupContentTreeItem.js +46 -23
- package/src/contentTree/layerContentTreeItem.js +54 -23
- package/src/contentTree/layerGroupContentTreeItem.js +58 -26
- package/src/contentTree/nodeContentTreeItem.js +19 -8
- package/src/contentTree/obliqueCollectionContentTreeItem.js +51 -22
- package/src/contentTree/subContentTreeItem.js +14 -5
- package/src/contentTree/vcsObjectContentTreeItem.js +27 -16
- package/src/contentTree/viewpointContentTreeItem.js +121 -0
- package/src/downloadHelper.js +52 -0
- package/src/featureInfo/AddressBalloonComponent.vue +58 -0
- package/src/featureInfo/BalloonComponent.vue +193 -0
- package/src/featureInfo/abstractFeatureInfoView.js +346 -0
- package/src/featureInfo/addressBalloonFeatureInfoView.js +130 -0
- package/src/featureInfo/balloonFeatureInfoView.js +159 -0
- package/src/featureInfo/balloonHelper.js +172 -0
- package/src/featureInfo/featureInfo.js +525 -0
- package/src/featureInfo/featureInfoInteraction.js +48 -0
- package/src/featureInfo/iframeFeatureInfoView.js +97 -0
- package/src/featureInfo/tableFeatureInfoView.js +120 -0
- package/src/i18n/de.js +195 -0
- package/src/i18n/en.js +195 -0
- package/src/i18n/i18nCollection.js +137 -0
- package/src/init.js +121 -36
- package/src/legend/StyleLegendItem.vue +176 -0
- package/src/legend/VcsLegend.vue +140 -0
- package/src/legend/legendHelper.js +204 -0
- package/src/logo-mobile.svg +9 -0
- package/src/logo.svg +26 -0
- package/src/manager/buttonManager.js +30 -61
- package/src/manager/collectionManager/CollectionComponent.vue +140 -0
- package/src/manager/collectionManager/CollectionComponentList.vue +77 -0
- package/src/manager/collectionManager/CollectionComponentProvider.vue +39 -0
- package/src/manager/collectionManager/CollectionManager.vue +62 -0
- package/src/manager/collectionManager/categoryManager.js +83 -0
- package/src/manager/collectionManager/collectionComponent.js +470 -0
- package/src/manager/collectionManager/collectionManager.js +432 -0
- package/src/manager/contextMenu/ContextMenuComponent.vue +43 -0
- package/src/manager/contextMenu/contextMenuInteraction.js +47 -0
- package/src/manager/contextMenu/contextMenuManager.js +220 -0
- package/src/manager/navbarManager.js +115 -0
- package/src/manager/toolbox/GroupToolboxComponent.vue +128 -0
- package/src/manager/toolbox/SelectToolboxComponent.vue +144 -0
- package/src/manager/toolbox/ToolboxManager.vue +139 -74
- package/src/manager/toolbox/toolboxManager.js +371 -0
- package/src/manager/window/WindowComponent.vue +105 -85
- package/src/manager/window/WindowComponentHeader.vue +116 -25
- package/src/manager/window/WindowManager.vue +133 -50
- package/src/manager/window/windowHelper.js +465 -0
- package/src/manager/window/windowManager.js +297 -91
- package/src/navigation/{mapNavCompass.vue → MapNavCompass.vue} +31 -11
- package/src/navigation/MapNavigation.vue +291 -0
- package/src/navigation/ObliqueRotation.vue +69 -0
- package/src/navigation/{orientationToolsButton.vue → OrientationToolsButton.vue} +14 -13
- package/src/navigation/{tiltSlider.vue → TiltSlider.vue} +40 -17
- package/src/navigation/VcsCompass.vue +69 -0
- package/src/navigation/VcsZoomButton.vue +52 -0
- package/src/navigation/overviewMap.js +142 -104
- package/src/navigation/overviewMapClickedInteraction.js +6 -1
- package/src/notifier/NotifierComponent.vue +86 -0
- package/src/notifier/notifier.js +129 -0
- package/src/pluginHelper.js +148 -20
- package/src/search/ResultItem.vue +83 -0
- package/src/search/ResultsComponent.vue +103 -0
- package/src/search/SearchComponent.vue +116 -0
- package/src/search/search.js +342 -0
- package/src/setup.js +9 -10
- package/src/state.js +272 -0
- package/src/styles/_theming.scss +69 -11
- package/src/styles/_typography.scss +3 -6
- package/src/styles/main.scss +12 -0
- package/src/styles/shades.scss +4 -0
- package/src/styles/utils/_border.scss +1 -1
- package/src/styles/utils/_cursor.scss +4 -0
- package/src/styles/utils/_display.scss +1 -1
- package/src/styles/variables.scss +138 -0
- package/src/styles/vcsFont.scss +2 -0
- package/src/styles/vcsGrid.scss +13 -0
- package/src/uiConfig.js +83 -0
- package/src/vcsUiApp.js +510 -69
- package/src/vuePlugins/i18n.js +51 -13
- package/src/vuePlugins/vuetify.js +104 -43
- package/config/berlin.config.json +0 -529
- package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +0 -1
- package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +0 -1
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +0 -1
- package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +0 -1
- package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +0 -1
- package/dist/assets/cesium/Workers/Color-de06a177.js +0 -1
- package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +0 -1
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +0 -1
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +0 -1
- package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +0 -1
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +0 -1
- package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +0 -1
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +0 -1
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +0 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +0 -1
- package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +0 -1
- package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +0 -1
- package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +0 -1
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +0 -1
- package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +0 -1
- package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +0 -1
- package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +0 -1
- package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +0 -1
- package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +0 -1
- package/dist/assets/cesium/Workers/Plane-3f01019d.js +0 -1
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +0 -1
- package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +0 -1
- package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +0 -1
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +0 -1
- package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +0 -1
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +0 -1
- package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +0 -1
- package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +0 -1
- package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +0 -39
- package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +0 -1
- package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +0 -1
- package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +0 -1
- package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +0 -1
- package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +0 -1
- package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +0 -1
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +0 -1
- package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -6
- package/dist/assets/cesium/Workers/combine-3c023bda.js +0 -1
- package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +0 -1
- package/dist/assets/cesium.6b5bb6.js +0 -9105
- package/dist/assets/core.98f9bb.js +0 -4
- package/dist/assets/index.0be2842f.js +0 -1
- package/dist/assets/index.60dea538.css +0 -1
- package/dist/assets/ol.0561aa.js +0 -318
- package/dist/assets/ui.b7c1e3.css +0 -1
- package/dist/assets/ui.b7c1e3.js +0 -39
- package/dist/assets/uicomponents.682c5f.css +0 -1
- package/dist/assets/uicomponents.682c5f.js +0 -32
- package/dist/assets/uicomponents.js +0 -1
- package/dist/assets/vue-composition-api.f926fa.js +0 -14
- package/dist/assets/vue-composition-api.js +0 -2
- package/dist/assets/vue.ddcb6b.js +0 -9
- package/dist/assets/vuetify.d21163.css +0 -5
- package/dist/assets/vuetify.d21163.js +0 -48
- package/lib/uicomponents.js +0 -1
- package/lib/vue-composition-api.js +0 -2
- package/map.config.json +0 -35
- package/plugins/@vcmap/pluginExample/config.json +0 -6
- package/plugins/@vcmap/pluginExample/package.json +0 -7
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +0 -374
- package/plugins/@vcmap/project-selector/ContextsListComponent.vue +0 -62
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +0 -81
- package/plugins/@vcmap/project-selector/README.md +0 -29
- package/plugins/@vcmap/project-selector/config.json +0 -15
- package/plugins/@vcmap/project-selector/index.js +0 -254
- package/plugins/@vcmap/project-selector/package.json +0 -15
- package/plugins/@vcmap/theme-changer/config.json +0 -69
- package/plugins/@vcmap/theme-changer/package.json +0 -12
- package/plugins/buttonExamples/ButtonExamples.vue +0 -190
- package/plugins/buttonExamples/index.js +0 -40
- package/plugins/categoryTest/Categories.vue +0 -145
- package/plugins/categoryTest/Category.vue +0 -114
- package/plugins/categoryTest/ItemEditor.vue +0 -13
- package/plugins/categoryTest/index.js +0 -41
- package/plugins/example/index.js +0 -56
- package/plugins/test/editor.vue +0 -63
- package/plugins/test/index.js +0 -93
- package/plugins/test/myCustomHeader.vue +0 -19
- package/plugins/test/toolbox-data.js +0 -49
- package/plugins/test/vcsContent.vue +0 -23
- package/plugins/test/windowManagerExample.vue +0 -144
- package/src/actions/styleSelector.vue +0 -90
- package/src/application/Navbar.vue +0 -118
- package/src/application/empty-cmp.vue +0 -6
- package/src/assets/logo.svg +0 -26
- package/src/contentTree/viewPointContentTreeItem.js +0 -107
- package/src/lang/de.js +0 -60
- package/src/lang/en.js +0 -53
- package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
- package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
- package/src/manager/toolbox/toolbox-manager.js +0 -203
- package/src/navigation/mapNavigation.vue +0 -201
- package/src/navigation/obliqueRotation.vue +0 -48
- package/src/navigation/vcsCompass.vue +0 -144
- package/src/navigation/vcsZoomButton.vue +0 -27
- package/start.js +0 -3
@@ -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
|
+
};
|