deeptwins-cesium-engine 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/zip-web-worker.js +640 -0
- package/Build/Workers/chunk-2363JE27.js +163 -0
- package/Build/Workers/chunk-23T2IPHV.js +55 -0
- package/Build/Workers/chunk-27SAH2Q2.js +55 -0
- package/Build/Workers/chunk-2AM4E2WD.js +101 -0
- package/Build/Workers/chunk-2H4D4HBM.js +101 -0
- package/Build/Workers/chunk-2KBLMCYQ.js +198 -0
- package/Build/Workers/chunk-2MWF4IES.js +398 -0
- package/Build/Workers/chunk-2O7PRNCW.js +288 -0
- package/Build/Workers/chunk-2RCIRXNI.js +75 -0
- package/Build/Workers/chunk-3JIEAYRM.js +940 -0
- package/Build/Workers/chunk-3VNQVXD6.js +837 -0
- package/Build/Workers/chunk-3XR54LVR.js +75 -0
- package/Build/Workers/chunk-3YTMGEXW.js +1443 -0
- package/Build/Workers/chunk-3ZP3VA4L.js +171 -0
- package/Build/Workers/chunk-4AKOLNCZ.js +139 -0
- package/Build/Workers/chunk-4BHWJWS3.js +171 -0
- package/Build/Workers/chunk-4QSCEADX.js +1800 -0
- package/Build/Workers/chunk-4ZKQXB7T.js +1460 -0
- package/Build/Workers/chunk-4ZX6BO6C.js +476 -0
- package/Build/Workers/chunk-55NHNEI7.js +163 -0
- package/Build/Workers/chunk-5F3SUA6W.js +8366 -0
- package/Build/Workers/chunk-5FBLADWD.js +692 -0
- package/Build/Workers/chunk-5H7FXJTE.js +2719 -0
- package/Build/Workers/chunk-5JKH4AMT.js +58 -0
- package/Build/Workers/chunk-5MTUN2SE.js +642 -0
- package/Build/Workers/chunk-5PWCXSID.js +256 -0
- package/Build/Workers/chunk-5RL7XAZS.js +256 -0
- package/Build/Workers/chunk-5TZVQOFD.js +305 -0
- package/Build/Workers/chunk-67FTKXPJ.js +352 -0
- package/Build/Workers/chunk-6AIBN5NQ.js +1054 -0
- package/Build/Workers/chunk-6D6BOTSA.js +414 -0
- package/Build/Workers/chunk-6FGAWC5J.js +44 -0
- package/Build/Workers/chunk-6HKAPCSO.js +280 -0
- package/Build/Workers/chunk-6UJDVUJ4.js +8366 -0
- package/Build/Workers/chunk-73Q77JO7.js +138 -0
- package/Build/Workers/chunk-7A6QUBKY.js +58 -0
- package/Build/Workers/chunk-7APZZMCL.js +73 -0
- package/Build/Workers/chunk-7BHC3VOI.js +511 -0
- package/Build/Workers/chunk-7GQHESFY.js +368 -0
- package/Build/Workers/chunk-7MVC3OLP.js +58 -0
- package/Build/Workers/chunk-7UNMLR74.js +1800 -0
- package/Build/Workers/chunk-A2QTGP5S.js +55 -0
- package/Build/Workers/chunk-A3FZIBXG.js +55 -0
- package/Build/Workers/chunk-A53R2F2L.js +305 -0
- package/Build/Workers/chunk-A6LIUE7X.js +692 -0
- package/Build/Workers/chunk-A6YFUGJO.js +139 -0
- package/Build/Workers/chunk-AJYWXC6I.js +97 -0
- package/Build/Workers/chunk-ALTIGQTT.js +288 -0
- package/Build/Workers/chunk-AOIO5VUS.js +8366 -0
- package/Build/Workers/chunk-AT2CG6PG.js +3514 -0
- package/Build/Workers/chunk-ATX74V7S.js +55 -0
- package/Build/Workers/chunk-AZPXT6RB.js +1067 -0
- package/Build/Workers/chunk-B7JRBTT6.js +682 -0
- package/Build/Workers/chunk-BALMTCKJ.js +138 -0
- package/Build/Workers/chunk-BBYRID6W.js +352 -0
- package/Build/Workers/chunk-BDX4AYXL.js +162 -0
- package/Build/Workers/chunk-BG2DK4Q5.js +101 -0
- package/Build/Workers/chunk-BSNC3NBZ.js +139 -0
- package/Build/Workers/chunk-BZLYQCIC.js +958 -0
- package/Build/Workers/chunk-C4NX77B5.js +57 -0
- package/Build/Workers/chunk-CHNDJRYA.js +1054 -0
- package/Build/Workers/chunk-CJOV55CW.js +1067 -0
- package/Build/Workers/chunk-COGPE5Z2.js +241 -0
- package/Build/Workers/chunk-CRCK5VX6.js +497 -0
- package/Build/Workers/chunk-CTLQNSVP.js +455 -0
- package/Build/Workers/chunk-CW7W27IZ.js +299 -0
- package/Build/Workers/chunk-DICY26ID.js +2719 -0
- package/Build/Workers/chunk-DLAVWLZW.js +682 -0
- package/Build/Workers/chunk-DMEFNTUV.js +1317 -0
- package/Build/Workers/chunk-DQSJEOZY.js +55 -0
- package/Build/Workers/chunk-F6UXXCPK.js +3514 -0
- package/Build/Workers/chunk-FKIR6F3B.js +97 -0
- package/Build/Workers/chunk-FRBZJJVU.js +2719 -0
- package/Build/Workers/chunk-FRLH26PM.js +940 -0
- package/Build/Workers/chunk-FT6HYEKU.js +3514 -0
- package/Build/Workers/chunk-FYDCQ2VN.js +73 -0
- package/Build/Workers/chunk-G5OKIL5P.js +55 -0
- package/Build/Workers/chunk-G6VHLVWG.js +101 -0
- package/Build/Workers/chunk-GBGV4U6Z.js +219 -0
- package/Build/Workers/chunk-GDU4RZSZ.js +940 -0
- package/Build/Workers/chunk-GJRVCSXV.js +37 -0
- package/Build/Workers/chunk-GKWOUMYA.js +37 -0
- package/Build/Workers/chunk-GNDFFW5Z.js +1443 -0
- package/Build/Workers/chunk-GNQ5BH75.js +352 -0
- package/Build/Workers/chunk-GNQUZV4R.js +171 -0
- package/Build/Workers/chunk-GOCJHCLA.js +352 -0
- package/Build/Workers/chunk-GTY4K4IA.js +219 -0
- package/Build/Workers/chunk-GXBTJBHN.js +102 -0
- package/Build/Workers/chunk-H6Q7E4BQ.js +114 -0
- package/Build/Workers/chunk-HEGESGGY.js +219 -0
- package/Build/Workers/chunk-HG3HIMYL.js +241 -0
- package/Build/Workers/chunk-HGEYVFMI.js +1800 -0
- package/Build/Workers/chunk-HHGOFZVQ.js +124 -0
- package/Build/Workers/chunk-HXEVICMT.js +37 -0
- package/Build/Workers/chunk-HXKUEOOD.js +352 -0
- package/Build/Workers/chunk-I4REFVXB.js +256 -0
- package/Build/Workers/chunk-IL5F6WEE.js +497 -0
- package/Build/Workers/chunk-IOODZNYE.js +629 -0
- package/Build/Workers/chunk-IVLDVV5R.js +788 -0
- package/Build/Workers/chunk-IWP4XCPO.js +778 -0
- package/Build/Workers/chunk-JBTUZNI2.js +398 -0
- package/Build/Workers/chunk-JMSXZ6AI.js +414 -0
- package/Build/Workers/chunk-JTGVXCP2.js +2058 -0
- package/Build/Workers/chunk-JUK2ZSWT.js +198 -0
- package/Build/Workers/chunk-K6HQ5W6R.js +171 -0
- package/Build/Workers/chunk-KC3G7WHZ.js +57 -0
- package/Build/Workers/chunk-KGPKBCGY.js +97 -0
- package/Build/Workers/chunk-KKGD7HAW.js +414 -0
- package/Build/Workers/chunk-KQSN3QZM.js +368 -0
- package/Build/Workers/chunk-KROSQJUA.js +44 -0
- package/Build/Workers/chunk-L4JLDVCM.js +57 -0
- package/Build/Workers/chunk-LAOFDSKL.js +642 -0
- package/Build/Workers/chunk-LIYMRHGR.js +387 -0
- package/Build/Workers/chunk-LKCCQ3AW.js +198 -0
- package/Build/Workers/chunk-LLQFSX7U.js +139 -0
- package/Build/Workers/chunk-LSDXP6EX.js +75 -0
- package/Build/Workers/chunk-LTYK7VYQ.js +138 -0
- package/Build/Workers/chunk-LYMP3LWI.js +387 -0
- package/Build/Workers/chunk-M2WCZSU6.js +241 -0
- package/Build/Workers/chunk-M35VLUHY.js +352 -0
- package/Build/Workers/chunk-MAPGTIYK.js +2058 -0
- package/Build/Workers/chunk-MG6SYM3V.js +455 -0
- package/Build/Workers/chunk-MKMZHRB3.js +788 -0
- package/Build/Workers/chunk-MNR7L6SQ.js +1483 -0
- package/Build/Workers/chunk-MO25ZQ2I.js +958 -0
- package/Build/Workers/chunk-MOCL5YUJ.js +8366 -0
- package/Build/Workers/chunk-MRYY6ETH.js +280 -0
- package/Build/Workers/chunk-NAIA5L2S.js +682 -0
- package/Build/Workers/chunk-NMDV3OGH.js +958 -0
- package/Build/Workers/chunk-NYE77VTA.js +1054 -0
- package/Build/Workers/chunk-O6RZEKHZ.js +778 -0
- package/Build/Workers/chunk-OFOJ5HD6.js +1460 -0
- package/Build/Workers/chunk-OJNNQSZI.js +788 -0
- package/Build/Workers/chunk-OJXQBSG4.js +692 -0
- package/Build/Workers/chunk-OOCGX2OD.js +102 -0
- package/Build/Workers/chunk-OOY3DP7Z.js +788 -0
- package/Build/Workers/chunk-OSDDHXLU.js +1483 -0
- package/Build/Workers/chunk-OVZNLF46.js +241 -0
- package/Build/Workers/chunk-OXFU5HNU.js +162 -0
- package/Build/Workers/chunk-P5CGIJUY.js +73 -0
- package/Build/Workers/chunk-POLLOX2O.js +352 -0
- package/Build/Workers/chunk-POUR54ZW.js +37 -0
- package/Build/Workers/chunk-PR6F33M6.js +682 -0
- package/Build/Workers/chunk-Q6GCDF2J.js +44 -0
- package/Build/Workers/chunk-Q7HIBRGE.js +97 -0
- package/Build/Workers/chunk-QCJPQ5CQ.js +57 -0
- package/Build/Workers/chunk-QDKQNKG3.js +256 -0
- package/Build/Workers/chunk-QDTDTLQY.js +1067 -0
- package/Build/Workers/chunk-QEANVUGT.js +163 -0
- package/Build/Workers/chunk-QFBCIX7J.js +455 -0
- package/Build/Workers/chunk-QIKGPNLN.js +299 -0
- package/Build/Workers/chunk-QTKDUHWH.js +497 -0
- package/Build/Workers/chunk-QUAH3XOT.js +138 -0
- package/Build/Workers/chunk-R4MI537H.js +1443 -0
- package/Build/Workers/chunk-R5GL5C3T.js +1483 -0
- package/Build/Workers/chunk-RBAGNNPN.js +219 -0
- package/Build/Workers/chunk-RH6GMTSG.js +497 -0
- package/Build/Workers/chunk-RHJJWKSH.js +73 -0
- package/Build/Workers/chunk-RHV6AHJW.js +305 -0
- package/Build/Workers/chunk-RUZPDKUX.js +114 -0
- package/Build/Workers/chunk-RXZDTDIY.js +439 -0
- package/Build/Workers/chunk-SCSEVBY4.js +102 -0
- package/Build/Workers/chunk-SKMYTWWS.js +299 -0
- package/Build/Workers/chunk-SKVAQOZZ.js +1443 -0
- package/Build/Workers/chunk-SPA2KPH3.js +368 -0
- package/Build/Workers/chunk-STDNU6SV.js +1460 -0
- package/Build/Workers/chunk-SXOBEELD.js +55 -0
- package/Build/Workers/chunk-SYDXDJY5.js +2058 -0
- package/Build/Workers/chunk-SZ4ALZDU.js +305 -0
- package/Build/Workers/chunk-T2AGEECA.js +387 -0
- package/Build/Workers/chunk-T5ZG4SFF.js +1067 -0
- package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
- package/Build/Workers/chunk-TJF36YYN.js +837 -0
- package/Build/Workers/chunk-TNZHNGKK.js +439 -0
- package/Build/Workers/chunk-TTWIV2BN.js +102 -0
- package/Build/Workers/chunk-TX3TQPIA.js +44 -0
- package/Build/Workers/chunk-TYPTCQPI.js +1317 -0
- package/Build/Workers/chunk-TZA4ZWFC.js +75 -0
- package/Build/Workers/chunk-UFDTAQBE.js +476 -0
- package/Build/Workers/chunk-UG2DPFOL.js +352 -0
- package/Build/Workers/chunk-UG3AH5C3.js +629 -0
- package/Build/Workers/chunk-UPPGWBJU.js +511 -0
- package/Build/Workers/chunk-URGEDZBS.js +476 -0
- package/Build/Workers/chunk-V35NQOJC.js +642 -0
- package/Build/Workers/chunk-VDNDTTCD.js +958 -0
- package/Build/Workers/chunk-VQIKTYAO.js +368 -0
- package/Build/Workers/chunk-VRXHACYU.js +476 -0
- package/Build/Workers/chunk-VTYZVS6I.js +455 -0
- package/Build/Workers/chunk-VVNCCJGH.js +398 -0
- package/Build/Workers/chunk-W4V3BNFU.js +114 -0
- package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
- package/Build/Workers/chunk-W7UYJE5O.js +2719 -0
- package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
- package/Build/Workers/chunk-WGZVYW2C.js +124 -0
- package/Build/Workers/chunk-WNFIOIKE.js +414 -0
- package/Build/Workers/chunk-WNHOCO2K.js +280 -0
- package/Build/Workers/chunk-WQG2W2WD.js +837 -0
- package/Build/Workers/chunk-WTLYD4FE.js +1483 -0
- package/Build/Workers/chunk-WV2G6UNC.js +940 -0
- package/Build/Workers/chunk-WVC3OW5V.js +629 -0
- package/Build/Workers/chunk-WWQFFOV6.js +299 -0
- package/Build/Workers/chunk-XD7QHRAY.js +288 -0
- package/Build/Workers/chunk-XH6GW5M4.js +58 -0
- package/Build/Workers/chunk-XIX2VR7Z.js +778 -0
- package/Build/Workers/chunk-XJYSONL4.js +1054 -0
- package/Build/Workers/chunk-XP6ASNFM.js +1317 -0
- package/Build/Workers/chunk-XRDMBCX3.js +439 -0
- package/Build/Workers/chunk-XUA6BCV5.js +642 -0
- package/Build/Workers/chunk-XVBMYEYQ.js +124 -0
- package/Build/Workers/chunk-XWOAVRWZ.js +124 -0
- package/Build/Workers/chunk-Y4ALZ4SS.js +198 -0
- package/Build/Workers/chunk-Y4GOZA56.js +163 -0
- package/Build/Workers/chunk-YF2NVO5B.js +837 -0
- package/Build/Workers/chunk-YGVXG7IR.js +114 -0
- package/Build/Workers/chunk-YI7RTZGC.js +280 -0
- package/Build/Workers/chunk-YM4UTBTX.js +1800 -0
- package/Build/Workers/chunk-YP5ZF2MJ.js +162 -0
- package/Build/Workers/chunk-YSSL4KKM.js +387 -0
- package/Build/Workers/chunk-YSYSXSHF.js +629 -0
- package/Build/Workers/chunk-YX562XOB.js +692 -0
- package/Build/Workers/chunk-YZWA5B4R.js +511 -0
- package/Build/Workers/chunk-Z6DFT4D3.js +288 -0
- package/Build/Workers/chunk-Z6PVZUIE.js +398 -0
- package/Build/Workers/chunk-ZAI6LCSI.js +511 -0
- package/Build/Workers/chunk-ZBIINVUF.js +778 -0
- package/Build/Workers/chunk-ZG3TBDRX.js +1317 -0
- package/Build/Workers/chunk-ZGXHZJ75.js +439 -0
- package/Build/Workers/chunk-ZWDOE2JF.js +162 -0
- package/Build/Workers/combineGeometry.js +66 -0
- package/Build/Workers/createBoxGeometry.js +58 -0
- package/Build/Workers/createBoxOutlineGeometry.js +231 -0
- package/Build/Workers/createCircleGeometry.js +201 -0
- package/Build/Workers/createCircleOutlineGeometry.js +147 -0
- package/Build/Workers/createCoplanarPolygonGeometry.js +505 -0
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +225 -0
- package/Build/Workers/createCorridorGeometry.js +1258 -0
- package/Build/Workers/createCorridorOutlineGeometry.js +563 -0
- package/Build/Workers/createCylinderGeometry.js +60 -0
- package/Build/Workers/createCylinderOutlineGeometry.js +231 -0
- package/Build/Workers/createEllipseGeometry.js +72 -0
- package/Build/Workers/createEllipseOutlineGeometry.js +65 -0
- package/Build/Workers/createEllipsoidGeometry.js +59 -0
- package/Build/Workers/createEllipsoidOutlineGeometry.js +61 -0
- package/Build/Workers/createFrustumGeometry.js +58 -0
- package/Build/Workers/createFrustumOutlineGeometry.js +234 -0
- package/Build/Workers/createGeometry.js +173 -0
- package/Build/Workers/createGroundPolylineGeometry.js +1602 -0
- package/Build/Workers/createPlaneGeometry.js +223 -0
- package/Build/Workers/createPlaneOutlineGeometry.js +124 -0
- package/Build/Workers/createPolygonGeometry.js +1404 -0
- package/Build/Workers/createPolygonOutlineGeometry.js +532 -0
- package/Build/Workers/createPolylineGeometry.js +491 -0
- package/Build/Workers/createPolylineVolumeGeometry.js +374 -0
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -0
- package/Build/Workers/createRectangleGeometry.js +1264 -0
- package/Build/Workers/createRectangleOutlineGeometry.js +476 -0
- package/Build/Workers/createSimplePolylineGeometry.js +397 -0
- package/Build/Workers/createSphereGeometry.js +116 -0
- package/Build/Workers/createSphereOutlineGeometry.js +116 -0
- package/Build/Workers/createTaskProcessorWorker.js +32 -0
- package/Build/Workers/createVectorTileClampedPolylines.js +492 -0
- package/Build/Workers/createVectorTileGeometries.js +387 -0
- package/Build/Workers/createVectorTilePoints.js +114 -0
- package/Build/Workers/createVectorTilePolygons.js +386 -0
- package/Build/Workers/createVectorTilePolylines.js +262 -0
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +565 -0
- package/Build/Workers/createVerticesFromHeightmap.js +2254 -0
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +499 -0
- package/Build/Workers/createWallGeometry.js +487 -0
- package/Build/Workers/createWallOutlineGeometry.js +335 -0
- package/Build/Workers/decodeDraco.js +369 -0
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2666 -0
- package/Build/Workers/decodeI3S.js +1339 -0
- package/Build/Workers/gaussianSplatSorter.js +62 -0
- package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +3463 -0
- package/Build/Workers/transferTypedArrayTest.js +41 -0
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +820 -0
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/LICENSE.md +928 -0
- package/README.md +3 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/Source/Assets/Images/bing_maps_credit.png +0 -0
- package/Source/Assets/Images/cesium_credit.png +0 -0
- package/Source/Assets/Images/google_earth_credit.png +0 -0
- package/Source/Assets/Images/ion-credit.png +0 -0
- package/Source/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/Source/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/Source/Assets/Textures/maki/airfield.png +0 -0
- package/Source/Assets/Textures/maki/airport.png +0 -0
- package/Source/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/Source/Assets/Textures/maki/america-football.png +0 -0
- package/Source/Assets/Textures/maki/art-gallery.png +0 -0
- package/Source/Assets/Textures/maki/bakery.png +0 -0
- package/Source/Assets/Textures/maki/bank.png +0 -0
- package/Source/Assets/Textures/maki/bar.png +0 -0
- package/Source/Assets/Textures/maki/baseball.png +0 -0
- package/Source/Assets/Textures/maki/basketball.png +0 -0
- package/Source/Assets/Textures/maki/beer.png +0 -0
- package/Source/Assets/Textures/maki/bicycle.png +0 -0
- package/Source/Assets/Textures/maki/building.png +0 -0
- package/Source/Assets/Textures/maki/bus.png +0 -0
- package/Source/Assets/Textures/maki/cafe.png +0 -0
- package/Source/Assets/Textures/maki/camera.png +0 -0
- package/Source/Assets/Textures/maki/campsite.png +0 -0
- package/Source/Assets/Textures/maki/car.png +0 -0
- package/Source/Assets/Textures/maki/cemetery.png +0 -0
- package/Source/Assets/Textures/maki/cesium.png +0 -0
- package/Source/Assets/Textures/maki/chemist.png +0 -0
- package/Source/Assets/Textures/maki/cinema.png +0 -0
- package/Source/Assets/Textures/maki/circle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/circle.png +0 -0
- package/Source/Assets/Textures/maki/city.png +0 -0
- package/Source/Assets/Textures/maki/clothing-store.png +0 -0
- package/Source/Assets/Textures/maki/college.png +0 -0
- package/Source/Assets/Textures/maki/commercial.png +0 -0
- package/Source/Assets/Textures/maki/cricket.png +0 -0
- package/Source/Assets/Textures/maki/cross.png +0 -0
- package/Source/Assets/Textures/maki/dam.png +0 -0
- package/Source/Assets/Textures/maki/danger.png +0 -0
- package/Source/Assets/Textures/maki/disability.png +0 -0
- package/Source/Assets/Textures/maki/dog-park.png +0 -0
- package/Source/Assets/Textures/maki/embassy.png +0 -0
- package/Source/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/Source/Assets/Textures/maki/entrance.png +0 -0
- package/Source/Assets/Textures/maki/farm.png +0 -0
- package/Source/Assets/Textures/maki/fast-food.png +0 -0
- package/Source/Assets/Textures/maki/ferry.png +0 -0
- package/Source/Assets/Textures/maki/fire-station.png +0 -0
- package/Source/Assets/Textures/maki/fuel.png +0 -0
- package/Source/Assets/Textures/maki/garden.png +0 -0
- package/Source/Assets/Textures/maki/gift.png +0 -0
- package/Source/Assets/Textures/maki/golf.png +0 -0
- package/Source/Assets/Textures/maki/grocery.png +0 -0
- package/Source/Assets/Textures/maki/hairdresser.png +0 -0
- package/Source/Assets/Textures/maki/harbor.png +0 -0
- package/Source/Assets/Textures/maki/heart.png +0 -0
- package/Source/Assets/Textures/maki/heliport.png +0 -0
- package/Source/Assets/Textures/maki/hospital.png +0 -0
- package/Source/Assets/Textures/maki/ice-cream.png +0 -0
- package/Source/Assets/Textures/maki/industrial.png +0 -0
- package/Source/Assets/Textures/maki/land-use.png +0 -0
- package/Source/Assets/Textures/maki/laundry.png +0 -0
- package/Source/Assets/Textures/maki/library.png +0 -0
- package/Source/Assets/Textures/maki/lighthouse.png +0 -0
- package/Source/Assets/Textures/maki/lodging.png +0 -0
- package/Source/Assets/Textures/maki/logging.png +0 -0
- package/Source/Assets/Textures/maki/london-underground.png +0 -0
- package/Source/Assets/Textures/maki/marker-stroked.png +0 -0
- package/Source/Assets/Textures/maki/marker.png +0 -0
- package/Source/Assets/Textures/maki/minefield.png +0 -0
- package/Source/Assets/Textures/maki/mobilephone.png +0 -0
- package/Source/Assets/Textures/maki/monument.png +0 -0
- package/Source/Assets/Textures/maki/museum.png +0 -0
- package/Source/Assets/Textures/maki/music.png +0 -0
- package/Source/Assets/Textures/maki/oil-well.png +0 -0
- package/Source/Assets/Textures/maki/park.png +0 -0
- package/Source/Assets/Textures/maki/park2.png +0 -0
- package/Source/Assets/Textures/maki/parking-garage.png +0 -0
- package/Source/Assets/Textures/maki/parking.png +0 -0
- package/Source/Assets/Textures/maki/pharmacy.png +0 -0
- package/Source/Assets/Textures/maki/pitch.png +0 -0
- package/Source/Assets/Textures/maki/place-of-worship.png +0 -0
- package/Source/Assets/Textures/maki/playground.png +0 -0
- package/Source/Assets/Textures/maki/police.png +0 -0
- package/Source/Assets/Textures/maki/polling-place.png +0 -0
- package/Source/Assets/Textures/maki/post.png +0 -0
- package/Source/Assets/Textures/maki/prison.png +0 -0
- package/Source/Assets/Textures/maki/rail-above.png +0 -0
- package/Source/Assets/Textures/maki/rail-light.png +0 -0
- package/Source/Assets/Textures/maki/rail-metro.png +0 -0
- package/Source/Assets/Textures/maki/rail-underground.png +0 -0
- package/Source/Assets/Textures/maki/rail.png +0 -0
- package/Source/Assets/Textures/maki/religious-christian.png +0 -0
- package/Source/Assets/Textures/maki/religious-jewish.png +0 -0
- package/Source/Assets/Textures/maki/religious-muslim.png +0 -0
- package/Source/Assets/Textures/maki/restaurant.png +0 -0
- package/Source/Assets/Textures/maki/roadblock.png +0 -0
- package/Source/Assets/Textures/maki/rocket.png +0 -0
- package/Source/Assets/Textures/maki/school.png +0 -0
- package/Source/Assets/Textures/maki/scooter.png +0 -0
- package/Source/Assets/Textures/maki/shop.png +0 -0
- package/Source/Assets/Textures/maki/skiing.png +0 -0
- package/Source/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/Source/Assets/Textures/maki/soccer.png +0 -0
- package/Source/Assets/Textures/maki/square-stroked.png +0 -0
- package/Source/Assets/Textures/maki/square.png +0 -0
- package/Source/Assets/Textures/maki/star-stroked.png +0 -0
- package/Source/Assets/Textures/maki/star.png +0 -0
- package/Source/Assets/Textures/maki/suitcase.png +0 -0
- package/Source/Assets/Textures/maki/swimming.png +0 -0
- package/Source/Assets/Textures/maki/telephone.png +0 -0
- package/Source/Assets/Textures/maki/tennis.png +0 -0
- package/Source/Assets/Textures/maki/theatre.png +0 -0
- package/Source/Assets/Textures/maki/toilets.png +0 -0
- package/Source/Assets/Textures/maki/town-hall.png +0 -0
- package/Source/Assets/Textures/maki/town.png +0 -0
- package/Source/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/triangle.png +0 -0
- package/Source/Assets/Textures/maki/village.png +0 -0
- package/Source/Assets/Textures/maki/warehouse.png +0 -0
- package/Source/Assets/Textures/maki/waste-basket.png +0 -0
- package/Source/Assets/Textures/maki/water.png +0 -0
- package/Source/Assets/Textures/maki/wetland.png +0 -0
- package/Source/Assets/Textures/maki/zoo.png +0 -0
- package/Source/Assets/Textures/moonSmall.jpg +0 -0
- package/Source/Assets/Textures/pin.svg +1 -0
- package/Source/Assets/Textures/waterNormals.jpg +0 -0
- package/Source/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/Source/Assets/approximateTerrainHeights.json +1 -0
- package/Source/Core/ApproximateTerrainHeights.js +255 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +755 -0
- package/Source/Core/ArcType.js +31 -0
- package/Source/Core/ArticulationStageType.js +23 -0
- package/Source/Core/AssociativeArray.js +127 -0
- package/Source/Core/AttributeCompression.js +527 -0
- package/Source/Core/AxisAlignedBoundingBox.js +294 -0
- package/Source/Core/BingMapsGeocoderService.js +127 -0
- package/Source/Core/BoundingRectangle.js +374 -0
- package/Source/Core/BoundingSphere.js +1506 -0
- package/Source/Core/BoxGeometry.js +893 -0
- package/Source/Core/BoxOutlineGeometry.js +312 -0
- package/Source/Core/Cartesian2.js +823 -0
- package/Source/Core/Cartesian3.js +1220 -0
- package/Source/Core/Cartesian4.js +979 -0
- package/Source/Core/Cartographic.js +304 -0
- package/Source/Core/CartographicGeocoderService.js +73 -0
- package/Source/Core/CatmullRomSpline.js +324 -0
- package/Source/Core/Cesium3DTilesTerrainData.js +932 -0
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1868 -0
- package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
- package/Source/Core/CesiumTerrainProvider.js +1408 -0
- package/Source/Core/Check.d.ts +131 -0
- package/Source/Core/Check.js +212 -0
- package/Source/Core/CircleGeometry.js +207 -0
- package/Source/Core/CircleOutlineGeometry.js +149 -0
- package/Source/Core/Clock.js +316 -0
- package/Source/Core/ClockRange.js +39 -0
- package/Source/Core/ClockStep.js +38 -0
- package/Source/Core/Color.js +2283 -0
- package/Source/Core/ColorGeometryInstanceAttribute.js +181 -0
- package/Source/Core/ComponentDatatype.js +338 -0
- package/Source/Core/CompressedTextureBuffer.js +125 -0
- package/Source/Core/ConstantSpline.js +119 -0
- package/Source/Core/CoplanarPolygonGeometry.js +600 -0
- package/Source/Core/CoplanarPolygonGeometryLibrary.js +132 -0
- package/Source/Core/CoplanarPolygonOutlineGeometry.js +237 -0
- package/Source/Core/CornerType.js +37 -0
- package/Source/Core/CorridorGeometry.js +1411 -0
- package/Source/Core/CorridorGeometryLibrary.js +501 -0
- package/Source/Core/CorridorOutlineGeometry.js +599 -0
- package/Source/Core/Credit.js +172 -0
- package/Source/Core/CubicRealPolynomial.js +238 -0
- package/Source/Core/CullingVolume.js +216 -0
- package/Source/Core/CustomHeightmapTerrainProvider.js +287 -0
- package/Source/Core/CylinderGeometry.js +479 -0
- package/Source/Core/CylinderGeometryLibrary.js +59 -0
- package/Source/Core/CylinderOutlineGeometry.js +269 -0
- package/Source/Core/DefaultProxy.js +26 -0
- package/Source/Core/DeveloperError.js +75 -0
- package/Source/Core/DistanceDisplayCondition.js +171 -0
- package/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +179 -0
- package/Source/Core/DoubleEndedPriorityQueue.js +405 -0
- package/Source/Core/DoublyLinkedList.js +112 -0
- package/Source/Core/EarthOrientationParameters.js +431 -0
- package/Source/Core/EarthOrientationParametersSample.js +52 -0
- package/Source/Core/EasingFunction.js +257 -0
- package/Source/Core/EllipseGeometry.js +1318 -0
- package/Source/Core/EllipseGeometryLibrary.js +365 -0
- package/Source/Core/EllipseOutlineGeometry.js +451 -0
- package/Source/Core/Ellipsoid.js +889 -0
- package/Source/Core/EllipsoidGeodesic.js +523 -0
- package/Source/Core/EllipsoidGeometry.js +650 -0
- package/Source/Core/EllipsoidOutlineGeometry.js +464 -0
- package/Source/Core/EllipsoidRhumbLine.js +751 -0
- package/Source/Core/EllipsoidTangentPlane.js +382 -0
- package/Source/Core/EllipsoidTerrainProvider.js +201 -0
- package/Source/Core/EllipsoidalOccluder.js +538 -0
- package/Source/Core/EncodedCartesian3.js +170 -0
- package/Source/Core/Event.js +205 -0
- package/Source/Core/EventHelper.js +74 -0
- package/Source/Core/ExtrapolationType.js +34 -0
- package/Source/Core/FeatureDetection.js +435 -0
- package/Source/Core/Frozen.js +24 -0
- package/Source/Core/FrustumGeometry.js +583 -0
- package/Source/Core/FrustumOutlineGeometry.js +253 -0
- package/Source/Core/Fullscreen.js +249 -0
- package/Source/Core/GeocodeType.js +24 -0
- package/Source/Core/GeocoderService.js +60 -0
- package/Source/Core/GeographicProjection.js +105 -0
- package/Source/Core/GeographicTilingScheme.js +245 -0
- package/Source/Core/Geometry.js +371 -0
- package/Source/Core/GeometryAttribute.js +133 -0
- package/Source/Core/GeometryAttributes.js +88 -0
- package/Source/Core/GeometryFactory.js +25 -0
- package/Source/Core/GeometryInstance.js +118 -0
- package/Source/Core/GeometryInstanceAttribute.js +133 -0
- package/Source/Core/GeometryOffsetAttribute.js +10 -0
- package/Source/Core/GeometryPipeline.js +3291 -0
- package/Source/Core/GeometryType.js +10 -0
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +584 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +606 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +574 -0
- package/Source/Core/GoogleEarthEnterpriseTileInformation.js +136 -0
- package/Source/Core/GoogleGeocoderService.js +110 -0
- package/Source/Core/GoogleMaps.js +40 -0
- package/Source/Core/GregorianDate.js +153 -0
- package/Source/Core/GroundPolylineGeometry.js +1659 -0
- package/Source/Core/HeadingPitchRange.js +59 -0
- package/Source/Core/HeadingPitchRoll.js +235 -0
- package/Source/Core/Heap.js +233 -0
- package/Source/Core/HeightmapEncoding.js +25 -0
- package/Source/Core/HeightmapTerrainData.js +903 -0
- package/Source/Core/HeightmapTessellator.js +518 -0
- package/Source/Core/HermitePolynomialApproximation.js +341 -0
- package/Source/Core/HermiteSpline.js +620 -0
- package/Source/Core/HilbertOrder.js +112 -0
- package/Source/Core/ITwinPlatform.js +388 -0
- package/Source/Core/Iau2000Orientation.js +167 -0
- package/Source/Core/Iau2006XysData.js +275 -0
- package/Source/Core/Iau2006XysSample.js +32 -0
- package/Source/Core/IauOrientationAxes.js +105 -0
- package/Source/Core/IauOrientationParameters.js +54 -0
- package/Source/Core/IndexDatatype.js +199 -0
- package/Source/Core/InterpolationAlgorithm.js +65 -0
- package/Source/Core/InterpolationType.js +14 -0
- package/Source/Core/Intersect.js +34 -0
- package/Source/Core/IntersectionTests.js +1087 -0
- package/Source/Core/Intersections2D.js +358 -0
- package/Source/Core/Interval.js +23 -0
- package/Source/Core/Ion.js +56 -0
- package/Source/Core/IonGeocodeProviderType.js +33 -0
- package/Source/Core/IonGeocoderService.js +147 -0
- package/Source/Core/IonResource.js +321 -0
- package/Source/Core/Iso8601.js +54 -0
- package/Source/Core/JulianDate.js +1229 -0
- package/Source/Core/KTX2Transcoder.js +92 -0
- package/Source/Core/KeyboardEventModifier.js +32 -0
- package/Source/Core/LagrangePolynomialApproximation.js +71 -0
- package/Source/Core/LeapSecond.js +24 -0
- package/Source/Core/LinearApproximation.js +83 -0
- package/Source/Core/LinearSpline.js +166 -0
- package/Source/Core/ManagedArray.js +162 -0
- package/Source/Core/MapProjection.js +62 -0
- package/Source/Core/Math.js +1125 -0
- package/Source/Core/Matrix2.js +1092 -0
- package/Source/Core/Matrix3.js +1838 -0
- package/Source/Core/Matrix4.js +3233 -0
- package/Source/Core/MorphWeightSpline.js +161 -0
- package/Source/Core/MortonOrder.js +214 -0
- package/Source/Core/NearFarScalar.js +173 -0
- package/Source/Core/Occluder.js +727 -0
- package/Source/Core/OffsetGeometryInstanceAttribute.js +125 -0
- package/Source/Core/OpenCageGeocoderService.js +134 -0
- package/Source/Core/OrientedBoundingBox.js +1272 -0
- package/Source/Core/OrthographicFrustum.js +351 -0
- package/Source/Core/OrthographicOffCenterFrustum.js +463 -0
- package/Source/Core/Packable.js +40 -0
- package/Source/Core/PackableForInterpolation.js +43 -0
- package/Source/Core/PeliasGeocoderService.js +106 -0
- package/Source/Core/PerspectiveFrustum.js +459 -0
- package/Source/Core/PerspectiveOffCenterFrustum.js +522 -0
- package/Source/Core/PinBuilder.js +234 -0
- package/Source/Core/PixelFormat.js +603 -0
- package/Source/Core/Plane.js +312 -0
- package/Source/Core/PlaneGeometry.js +250 -0
- package/Source/Core/PlaneOutlineGeometry.js +113 -0
- package/Source/Core/PolygonGeometry.js +1580 -0
- package/Source/Core/PolygonGeometryLibrary.js +1301 -0
- package/Source/Core/PolygonHierarchy.js +25 -0
- package/Source/Core/PolygonOutlineGeometry.js +687 -0
- package/Source/Core/PolygonPipeline.js +632 -0
- package/Source/Core/PolylineGeometry.js +573 -0
- package/Source/Core/PolylinePipeline.js +573 -0
- package/Source/Core/PolylineVolumeGeometry.js +412 -0
- package/Source/Core/PolylineVolumeGeometryLibrary.js +701 -0
- package/Source/Core/PolylineVolumeOutlineGeometry.js +294 -0
- package/Source/Core/PrimitiveType.js +107 -0
- package/Source/Core/Proxy.js +24 -0
- package/Source/Core/QuadraticRealPolynomial.js +147 -0
- package/Source/Core/QuantizedMeshTerrainData.js +735 -0
- package/Source/Core/QuarticRealPolynomial.js +342 -0
- package/Source/Core/Quaternion.js +1145 -0
- package/Source/Core/QuaternionSpline.js +155 -0
- package/Source/Core/Queue.js +126 -0
- package/Source/Core/Ray.js +79 -0
- package/Source/Core/Rectangle.js +1071 -0
- package/Source/Core/RectangleCollisionChecker.js +95 -0
- package/Source/Core/RectangleGeometry.js +1480 -0
- package/Source/Core/RectangleGeometryLibrary.js +286 -0
- package/Source/Core/RectangleOutlineGeometry.js +532 -0
- package/Source/Core/ReferenceFrame.js +23 -0
- package/Source/Core/Request.js +193 -0
- package/Source/Core/RequestErrorEvent.js +58 -0
- package/Source/Core/RequestScheduler.js +519 -0
- package/Source/Core/RequestState.js +55 -0
- package/Source/Core/RequestType.js +39 -0
- package/Source/Core/Resource.js +2280 -0
- package/Source/Core/RuntimeError.js +65 -0
- package/Source/Core/S2Cell.js +734 -0
- package/Source/Core/ScreenSpaceEventHandler.js +1140 -0
- package/Source/Core/ScreenSpaceEventType.js +127 -0
- package/Source/Core/ShowGeometryInstanceAttribute.js +122 -0
- package/Source/Core/Simon1994PlanetaryPositions.js +684 -0
- package/Source/Core/SimplePolylineGeometry.js +454 -0
- package/Source/Core/SphereGeometry.js +117 -0
- package/Source/Core/SphereOutlineGeometry.js +119 -0
- package/Source/Core/Spherical.js +183 -0
- package/Source/Core/Spline.js +188 -0
- package/Source/Core/SteppedSpline.js +160 -0
- package/Source/Core/Stereographic.js +247 -0
- package/Source/Core/TaskProcessor.js +403 -0
- package/Source/Core/TerrainData.js +126 -0
- package/Source/Core/TerrainEncoding.js +772 -0
- package/Source/Core/TerrainMesh.js +361 -0
- package/Source/Core/TerrainPicker.js +607 -0
- package/Source/Core/TerrainProvider.js +585 -0
- package/Source/Core/TerrainQuantization.js +25 -0
- package/Source/Core/TexturePacker.js +181 -0
- package/Source/Core/TileAvailability.js +564 -0
- package/Source/Core/TileEdge.js +14 -0
- package/Source/Core/TileProviderError.js +170 -0
- package/Source/Core/TilingScheme.js +132 -0
- package/Source/Core/TimeConstants.js +83 -0
- package/Source/Core/TimeInterval.js +438 -0
- package/Source/Core/TimeIntervalCollection.js +1137 -0
- package/Source/Core/TimeStandard.js +30 -0
- package/Source/Core/Tipsify.js +314 -0
- package/Source/Core/TrackingReferenceFrame.js +45 -0
- package/Source/Core/Transforms.js +1277 -0
- package/Source/Core/TranslationRotationScale.js +57 -0
- package/Source/Core/TridiagonalSystemSolver.js +113 -0
- package/Source/Core/TrustedServers.js +146 -0
- package/Source/Core/VRTheWorldTerrainProvider.js +462 -0
- package/Source/Core/VertexFormat.js +311 -0
- package/Source/Core/VerticalExaggeration.js +70 -0
- package/Source/Core/VideoSynchronizer.js +222 -0
- package/Source/Core/Visibility.js +34 -0
- package/Source/Core/VulkanConstants.js +286 -0
- package/Source/Core/WallGeometry.js +623 -0
- package/Source/Core/WallGeometryLibrary.js +212 -0
- package/Source/Core/WallOutlineGeometry.js +431 -0
- package/Source/Core/WebGLConstants.js +614 -0
- package/Source/Core/WebMercatorProjection.js +152 -0
- package/Source/Core/WebMercatorTilingScheme.js +291 -0
- package/Source/Core/WindingOrder.js +36 -0
- package/Source/Core/WireframeIndexGenerator.js +238 -0
- package/Source/Core/addAllToArray.js +40 -0
- package/Source/Core/appendForwardSlash.js +10 -0
- package/Source/Core/arrayRemoveDuplicates.js +129 -0
- package/Source/Core/barycentricCoordinates.js +109 -0
- package/Source/Core/binarySearch.js +67 -0
- package/Source/Core/buildModuleUrl.js +153 -0
- package/Source/Core/clone.js +30 -0
- package/Source/Core/combine.js +79 -0
- package/Source/Core/createGuid.js +22 -0
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/Core/createWorldTerrainAsync.js +50 -0
- package/Source/Core/decodeGoogleEarthEnterpriseData.js +93 -0
- package/Source/Core/decodeVectorPolylinePositions.js +51 -0
- package/Source/Core/defaultValue.js +29 -0
- package/Source/Core/defer.js +44 -0
- package/Source/Core/defined.d.ts +11 -0
- package/Source/Core/defined.js +17 -0
- package/Source/Core/deprecationWarning.js +53 -0
- package/Source/Core/destroyObject.js +53 -0
- package/Source/Core/formatError.js +30 -0
- package/Source/Core/getAbsoluteUri.js +46 -0
- package/Source/Core/getBaseUri.js +47 -0
- package/Source/Core/getExtensionFromUri.js +38 -0
- package/Source/Core/getFilenameFromUri.js +32 -0
- package/Source/Core/getImageFromTypedArray.js +24 -0
- package/Source/Core/getImagePixels.js +44 -0
- package/Source/Core/getJsonFromTypedArray.js +21 -0
- package/Source/Core/getMagic.js +14 -0
- package/Source/Core/getStringFromTypedArray.js +165 -0
- package/Source/Core/getTimestamp.js +26 -0
- package/Source/Core/isBitSet.js +7 -0
- package/Source/Core/isBlobUri.js +22 -0
- package/Source/Core/isCrossOriginUrl.js +30 -0
- package/Source/Core/isDataUri.js +22 -0
- package/Source/Core/isLeapYear.js +23 -0
- package/Source/Core/loadAndExecuteScript.js +27 -0
- package/Source/Core/loadImageFromTypedArray.js +66 -0
- package/Source/Core/loadKTX2.js +104 -0
- package/Source/Core/mergeSort.js +111 -0
- package/Source/Core/objectToQuery.js +57 -0
- package/Source/Core/oneTimeWarning.js +51 -0
- package/Source/Core/parseResponseHeaders.js +37 -0
- package/Source/Core/pointInsideTriangle.js +39 -0
- package/Source/Core/queryToObject.js +60 -0
- package/Source/Core/resizeImageToNextPowerOfTwo.js +31 -0
- package/Source/Core/sampleTerrain.js +291 -0
- package/Source/Core/sampleTerrainMostDetailed.js +132 -0
- package/Source/Core/scaleToGeodeticSurface.js +147 -0
- package/Source/Core/srgbToLinear.js +32 -0
- package/Source/Core/subdivideArray.js +35 -0
- package/Source/Core/webGLConstantToGlslType.js +25 -0
- package/Source/Core/wrapFunction.js +26 -0
- package/Source/Core/writeTextToCanvas.js +219 -0
- package/Source/DataSources/BillboardGraphics.js +419 -0
- package/Source/DataSources/BillboardVisualizer.js +351 -0
- package/Source/DataSources/BoundingSphereState.js +26 -0
- package/Source/DataSources/BoxGeometryUpdater.js +326 -0
- package/Source/DataSources/BoxGraphics.js +208 -0
- package/Source/DataSources/CallbackPositionProperty.js +172 -0
- package/Source/DataSources/CallbackProperty.js +117 -0
- package/Source/DataSources/Cesium3DTilesetGraphics.js +111 -0
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +261 -0
- package/Source/DataSources/CheckerboardMaterialProperty.js +157 -0
- package/Source/DataSources/ColorMaterialProperty.js +112 -0
- package/Source/DataSources/CompositeEntityCollection.js +591 -0
- package/Source/DataSources/CompositeMaterialProperty.js +128 -0
- package/Source/DataSources/CompositePositionProperty.js +153 -0
- package/Source/DataSources/CompositeProperty.js +154 -0
- package/Source/DataSources/ConstantPositionProperty.js +151 -0
- package/Source/DataSources/ConstantProperty.js +116 -0
- package/Source/DataSources/CorridorGeometryUpdater.js +409 -0
- package/Source/DataSources/CorridorGraphics.js +316 -0
- package/Source/DataSources/CustomDataSource.js +173 -0
- package/Source/DataSources/CylinderGeometryUpdater.js +375 -0
- package/Source/DataSources/CylinderGraphics.js +258 -0
- package/Source/DataSources/CzmlDataSource.js +5142 -0
- package/Source/DataSources/DataSource.js +121 -0
- package/Source/DataSources/DataSourceClock.js +164 -0
- package/Source/DataSources/DataSourceCollection.js +335 -0
- package/Source/DataSources/DataSourceDisplay.js +543 -0
- package/Source/DataSources/DynamicGeometryBatch.js +56 -0
- package/Source/DataSources/DynamicGeometryUpdater.js +270 -0
- package/Source/DataSources/EllipseGeometryUpdater.js +434 -0
- package/Source/DataSources/EllipseGraphics.js +343 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +710 -0
- package/Source/DataSources/EllipsoidGraphics.js +312 -0
- package/Source/DataSources/Entity.js +789 -0
- package/Source/DataSources/EntityCluster.js +1022 -0
- package/Source/DataSources/EntityCollection.js +439 -0
- package/Source/DataSources/EntityView.js +476 -0
- package/Source/DataSources/GeoJsonDataSource.js +1064 -0
- package/Source/DataSources/GeometryUpdater.js +538 -0
- package/Source/DataSources/GeometryUpdaterSet.js +114 -0
- package/Source/DataSources/GeometryVisualizer.js +549 -0
- package/Source/DataSources/GpxDataSource.js +1018 -0
- package/Source/DataSources/GridMaterialProperty.js +204 -0
- package/Source/DataSources/GroundGeometryUpdater.js +234 -0
- package/Source/DataSources/ImageMaterialProperty.js +173 -0
- package/Source/DataSources/KmlCamera.js +13 -0
- package/Source/DataSources/KmlDataSource.js +4249 -0
- package/Source/DataSources/KmlLookAt.js +12 -0
- package/Source/DataSources/KmlTour.js +165 -0
- package/Source/DataSources/KmlTourFlyTo.js +109 -0
- package/Source/DataSources/KmlTourWait.js +52 -0
- package/Source/DataSources/LabelGraphics.js +401 -0
- package/Source/DataSources/LabelVisualizer.js +359 -0
- package/Source/DataSources/MaterialProperty.js +111 -0
- package/Source/DataSources/ModelGraphics.js +456 -0
- package/Source/DataSources/ModelVisualizer.js +560 -0
- package/Source/DataSources/NodeTransformationProperty.js +150 -0
- package/Source/DataSources/PathGraphics.js +161 -0
- package/Source/DataSources/PathVisualizer.js +823 -0
- package/Source/DataSources/PlaneGeometryUpdater.js +385 -0
- package/Source/DataSources/PlaneGraphics.js +208 -0
- package/Source/DataSources/PointGraphics.js +223 -0
- package/Source/DataSources/PointVisualizer.js +438 -0
- package/Source/DataSources/PolygonGeometryUpdater.js +591 -0
- package/Source/DataSources/PolygonGraphics.js +383 -0
- package/Source/DataSources/PolylineArrowMaterialProperty.js +110 -0
- package/Source/DataSources/PolylineDashMaterialProperty.js +174 -0
- package/Source/DataSources/PolylineGeometryUpdater.js +878 -0
- package/Source/DataSources/PolylineGlowMaterialProperty.js +152 -0
- package/Source/DataSources/PolylineGraphics.js +241 -0
- package/Source/DataSources/PolylineOutlineMaterialProperty.js +158 -0
- package/Source/DataSources/PolylineVisualizer.js +409 -0
- package/Source/DataSources/PolylineVolumeGeometryUpdater.js +306 -0
- package/Source/DataSources/PolylineVolumeGraphics.js +235 -0
- package/Source/DataSources/PositionProperty.js +131 -0
- package/Source/DataSources/PositionPropertyArray.js +192 -0
- package/Source/DataSources/Property.js +137 -0
- package/Source/DataSources/PropertyArray.js +147 -0
- package/Source/DataSources/PropertyBag.js +275 -0
- package/Source/DataSources/RectangleGeometryUpdater.js +427 -0
- package/Source/DataSources/RectangleGraphics.js +317 -0
- package/Source/DataSources/ReferenceProperty.js +371 -0
- package/Source/DataSources/Rotation.js +155 -0
- package/Source/DataSources/SampledPositionProperty.js +330 -0
- package/Source/DataSources/SampledProperty.js +855 -0
- package/Source/DataSources/ScaledPositionProperty.js +103 -0
- package/Source/DataSources/StaticGeometryColorBatch.js +570 -0
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +488 -0
- package/Source/DataSources/StaticGroundGeometryColorBatch.js +394 -0
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +456 -0
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +434 -0
- package/Source/DataSources/StaticOutlineGeometryBatch.js +465 -0
- package/Source/DataSources/StripeMaterialProperty.js +193 -0
- package/Source/DataSources/StripeOrientation.js +19 -0
- package/Source/DataSources/TerrainOffsetProperty.js +243 -0
- package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +155 -0
- package/Source/DataSources/TimeIntervalCollectionProperty.js +136 -0
- package/Source/DataSources/VelocityOrientationProperty.js +158 -0
- package/Source/DataSources/VelocityVectorProperty.js +213 -0
- package/Source/DataSources/Visualizer.js +61 -0
- package/Source/DataSources/WallGeometryUpdater.js +275 -0
- package/Source/DataSources/WallGraphics.js +236 -0
- package/Source/DataSources/createMaterialPropertyDescriptor.js +35 -0
- package/Source/DataSources/createPropertyDescriptor.js +71 -0
- package/Source/DataSources/createRawPropertyDescriptor.js +13 -0
- package/Source/DataSources/exportKml.js +1517 -0
- package/Source/DataSources/getElement.js +26 -0
- package/Source/DataSources/heightReferenceOnEntityPropertyChanged.js +47 -0
- package/Source/Renderer/AutomaticUniforms.js +1857 -0
- package/Source/Renderer/Buffer.js +452 -0
- package/Source/Renderer/BufferUsage.js +21 -0
- package/Source/Renderer/ClearCommand.js +102 -0
- package/Source/Renderer/ComputeCommand.js +119 -0
- package/Source/Renderer/ComputeEngine.js +135 -0
- package/Source/Renderer/Context.js +1752 -0
- package/Source/Renderer/ContextLimits.js +299 -0
- package/Source/Renderer/CubeMap.js +686 -0
- package/Source/Renderer/CubeMapFace.js +415 -0
- package/Source/Renderer/DrawCommand.js +644 -0
- package/Source/Renderer/Framebuffer.js +447 -0
- package/Source/Renderer/FramebufferManager.js +489 -0
- package/Source/Renderer/MipmapHint.js +19 -0
- package/Source/Renderer/MultisampleFramebuffer.js +136 -0
- package/Source/Renderer/Pass.js +29 -0
- package/Source/Renderer/PassState.js +57 -0
- package/Source/Renderer/PixelDatatype.js +121 -0
- package/Source/Renderer/RenderState.js +967 -0
- package/Source/Renderer/Renderbuffer.js +105 -0
- package/Source/Renderer/RenderbufferFormat.js +42 -0
- package/Source/Renderer/Sampler.js +116 -0
- package/Source/Renderer/ShaderBuilder.js +597 -0
- package/Source/Renderer/ShaderCache.js +287 -0
- package/Source/Renderer/ShaderDestination.js +51 -0
- package/Source/Renderer/ShaderFunction.js +66 -0
- package/Source/Renderer/ShaderProgram.js +619 -0
- package/Source/Renderer/ShaderSource.js +524 -0
- package/Source/Renderer/ShaderStruct.js +55 -0
- package/Source/Renderer/SharedContext.js +186 -0
- package/Source/Renderer/Sync.js +104 -0
- package/Source/Renderer/Texture.js +1126 -0
- package/Source/Renderer/Texture3D.js +578 -0
- package/Source/Renderer/TextureAtlas.js +833 -0
- package/Source/Renderer/TextureCache.js +81 -0
- package/Source/Renderer/TextureMagnificationFilter.js +41 -0
- package/Source/Renderer/TextureMinificationFilter.js +94 -0
- package/Source/Renderer/TextureWrap.js +19 -0
- package/Source/Renderer/UniformState.js +1948 -0
- package/Source/Renderer/VertexArray.js +869 -0
- package/Source/Renderer/VertexArrayFacade.js +509 -0
- package/Source/Renderer/createUniform.js +422 -0
- package/Source/Renderer/createUniformArray.js +638 -0
- package/Source/Renderer/demodernizeShader.js +84 -0
- package/Source/Renderer/freezeRenderState.js +30 -0
- package/Source/Renderer/loadCubeMap.js +88 -0
- package/Source/Scene/AlphaMode.js +33 -0
- package/Source/Scene/Appearance.js +204 -0
- package/Source/Scene/ArcGisBaseMapType.js +12 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +875 -0
- package/Source/Scene/ArcGisMapService.js +80 -0
- package/Source/Scene/Atmosphere.js +149 -0
- package/Source/Scene/AttributeType.js +200 -0
- package/Source/Scene/AutoExposure.js +386 -0
- package/Source/Scene/Axis.js +116 -0
- package/Source/Scene/Azure2DImageryProvider.js +393 -0
- package/Source/Scene/B3dmParser.js +173 -0
- package/Source/Scene/BatchTable.js +636 -0
- package/Source/Scene/BatchTableHierarchy.js +504 -0
- package/Source/Scene/BatchTexture.js +574 -0
- package/Source/Scene/Billboard.js +1601 -0
- package/Source/Scene/BillboardCollection.js +2396 -0
- package/Source/Scene/BillboardLoadState.js +44 -0
- package/Source/Scene/BillboardTexture.js +397 -0
- package/Source/Scene/BingMapsImageryProvider.js +769 -0
- package/Source/Scene/BingMapsStyle.js +93 -0
- package/Source/Scene/BlendEquation.js +53 -0
- package/Source/Scene/BlendFunction.js +129 -0
- package/Source/Scene/BlendOption.js +28 -0
- package/Source/Scene/BlendingState.js +73 -0
- package/Source/Scene/BoundingVolumeSemantics.js +169 -0
- package/Source/Scene/BoxEmitter.js +74 -0
- package/Source/Scene/BrdfLutGenerator.js +75 -0
- package/Source/Scene/BufferLoader.js +141 -0
- package/Source/Scene/Camera.js +3978 -0
- package/Source/Scene/CameraEventAggregator.js +619 -0
- package/Source/Scene/CameraEventType.js +47 -0
- package/Source/Scene/CameraFlightPath.js +576 -0
- package/Source/Scene/Cesium3DContentGroup.js +44 -0
- package/Source/Scene/Cesium3DTile.js +2475 -0
- package/Source/Scene/Cesium3DTileBatchTable.js +1132 -0
- package/Source/Scene/Cesium3DTileColorBlendMode.js +52 -0
- package/Source/Scene/Cesium3DTileContent.js +411 -0
- package/Source/Scene/Cesium3DTileContentFactory.js +118 -0
- package/Source/Scene/Cesium3DTileContentState.js +12 -0
- package/Source/Scene/Cesium3DTileContentType.js +179 -0
- package/Source/Scene/Cesium3DTileFeature.js +444 -0
- package/Source/Scene/Cesium3DTileFeatureTable.js +131 -0
- package/Source/Scene/Cesium3DTileOptimizationHint.js +13 -0
- package/Source/Scene/Cesium3DTileOptimizations.js +115 -0
- package/Source/Scene/Cesium3DTilePass.js +79 -0
- package/Source/Scene/Cesium3DTilePassState.js +52 -0
- package/Source/Scene/Cesium3DTilePointFeature.js +856 -0
- package/Source/Scene/Cesium3DTileRefine.js +29 -0
- package/Source/Scene/Cesium3DTileStyle.js +1475 -0
- package/Source/Scene/Cesium3DTileStyleEngine.js +78 -0
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +760 -0
- package/Source/Scene/Cesium3DTileset.js +3932 -0
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +291 -0
- package/Source/Scene/Cesium3DTilesetCache.js +80 -0
- package/Source/Scene/Cesium3DTilesetHeatmap.js +165 -0
- package/Source/Scene/Cesium3DTilesetMetadata.js +199 -0
- package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +131 -0
- package/Source/Scene/Cesium3DTilesetSkipTraversal.js +420 -0
- package/Source/Scene/Cesium3DTilesetStatistics.js +195 -0
- package/Source/Scene/Cesium3DTilesetTraversal.js +323 -0
- package/Source/Scene/CircleEmitter.js +61 -0
- package/Source/Scene/ClassificationPrimitive.js +1387 -0
- package/Source/Scene/ClassificationType.js +35 -0
- package/Source/Scene/ClippingPlane.js +184 -0
- package/Source/Scene/ClippingPlaneCollection.js +764 -0
- package/Source/Scene/ClippingPolygon.js +300 -0
- package/Source/Scene/ClippingPolygonCollection.js +965 -0
- package/Source/Scene/CloudCollection.js +1041 -0
- package/Source/Scene/CloudType.js +33 -0
- package/Source/Scene/ColorBlendMode.js +33 -0
- package/Source/Scene/Composite3DTileContent.js +403 -0
- package/Source/Scene/ConditionsExpression.js +219 -0
- package/Source/Scene/ConeEmitter.js +61 -0
- package/Source/Scene/ContentMetadata.js +184 -0
- package/Source/Scene/CreditDisplay.js +654 -0
- package/Source/Scene/CullFace.js +33 -0
- package/Source/Scene/CumulusCloud.js +347 -0
- package/Source/Scene/DebugAppearance.js +266 -0
- package/Source/Scene/DebugCameraPrimitive.js +257 -0
- package/Source/Scene/DebugInspector.js +151 -0
- package/Source/Scene/DebugModelMatrixPrimitive.js +220 -0
- package/Source/Scene/DepthFunction.js +73 -0
- package/Source/Scene/DepthPlane.js +238 -0
- package/Source/Scene/DerivedCommand.js +708 -0
- package/Source/Scene/DeviceOrientationCameraController.js +120 -0
- package/Source/Scene/DirectionalLight.js +49 -0
- package/Source/Scene/DiscardEmptyTileImagePolicy.js +54 -0
- package/Source/Scene/DiscardMissingTileImagePolicy.js +148 -0
- package/Source/Scene/DracoLoader.js +99 -0
- package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
- package/Source/Scene/DynamicEnvironmentMapManager.js +1022 -0
- package/Source/Scene/EdgeFramebuffer.js +245 -0
- package/Source/Scene/EllipsoidPrimitive.js +496 -0
- package/Source/Scene/EllipsoidSurfaceAppearance.js +278 -0
- package/Source/Scene/Empty3DTileContent.js +164 -0
- package/Source/Scene/Expression.js +2233 -0
- package/Source/Scene/ExpressionNodeType.js +25 -0
- package/Source/Scene/Fog.js +166 -0
- package/Source/Scene/FrameRateMonitor.js +375 -0
- package/Source/Scene/FrameState.js +477 -0
- package/Source/Scene/FrustumCommands.js +29 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +826 -0
- package/Source/Scene/GaussianSplatPrimitive.js +1065 -0
- package/Source/Scene/GaussianSplatRenderResources.js +81 -0
- package/Source/Scene/GaussianSplatSorter.js +73 -0
- package/Source/Scene/GaussianSplatTextureGenerator.js +64 -0
- package/Source/Scene/Geometry3DTileContent.js +534 -0
- package/Source/Scene/GetFeatureInfoFormat.js +396 -0
- package/Source/Scene/Globe.js +1135 -0
- package/Source/Scene/GlobeDepth.js +407 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +485 -0
- package/Source/Scene/GlobeSurfaceTile.js +967 -0
- package/Source/Scene/GlobeSurfaceTileProvider.js +2910 -0
- package/Source/Scene/GlobeTranslucency.js +239 -0
- package/Source/Scene/GlobeTranslucencyFramebuffer.js +201 -0
- package/Source/Scene/GlobeTranslucencyState.js +1102 -0
- package/Source/Scene/GltfBufferViewLoader.js +242 -0
- package/Source/Scene/GltfDracoLoader.js +293 -0
- package/Source/Scene/GltfImageLoader.js +320 -0
- package/Source/Scene/GltfIndexBufferLoader.js +421 -0
- package/Source/Scene/GltfJsonLoader.js +314 -0
- package/Source/Scene/GltfLoader.js +2989 -0
- package/Source/Scene/GltfLoaderUtil.js +184 -0
- package/Source/Scene/GltfPipeline/ForEach.js +424 -0
- package/Source/Scene/GltfPipeline/addBuffer.js +30 -0
- package/Source/Scene/GltfPipeline/addDefaults.js +208 -0
- package/Source/Scene/GltfPipeline/addExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/addExtensionsUsed.js +22 -0
- package/Source/Scene/GltfPipeline/addPipelineExtras.js +36 -0
- package/Source/Scene/GltfPipeline/addToArray.js +25 -0
- package/Source/Scene/GltfPipeline/findAccessorMinMax.js +71 -0
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +155 -0
- package/Source/Scene/GltfPipeline/getAccessorByteStride.js +29 -0
- package/Source/Scene/GltfPipeline/getComponentReader.js +147 -0
- package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +135 -0
- package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +145 -0
- package/Source/Scene/GltfPipeline/numberOfComponentsForType.js +29 -0
- package/Source/Scene/GltfPipeline/parseGlb.js +118 -0
- package/Source/Scene/GltfPipeline/readAccessorPacked.js +54 -0
- package/Source/Scene/GltfPipeline/removeExtension.js +64 -0
- package/Source/Scene/GltfPipeline/removeExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/removeExtensionsUsed.js +26 -0
- package/Source/Scene/GltfPipeline/removePipelineExtras.js +42 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +906 -0
- package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +53 -0
- package/Source/Scene/GltfPipeline/updateVersion.js +1148 -0
- package/Source/Scene/GltfPipeline/usesExtension.js +18 -0
- package/Source/Scene/GltfSpzLoader.js +224 -0
- package/Source/Scene/GltfStructuralMetadataLoader.js +505 -0
- package/Source/Scene/GltfTextureLoader.js +399 -0
- package/Source/Scene/GltfVertexBufferLoader.js +634 -0
- package/Source/Scene/Google2DImageryProvider.js +621 -0
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +548 -0
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +589 -0
- package/Source/Scene/GridImageryProvider.js +322 -0
- package/Source/Scene/GroundPolylinePrimitive.js +890 -0
- package/Source/Scene/GroundPrimitive.js +1000 -0
- package/Source/Scene/GroupMetadata.js +203 -0
- package/Source/Scene/HeightReference.js +85 -0
- package/Source/Scene/HorizontalOrigin.js +41 -0
- package/Source/Scene/I3SDataProvider.js +860 -0
- package/Source/Scene/I3SDecoder.js +133 -0
- package/Source/Scene/I3SFeature.js +61 -0
- package/Source/Scene/I3SField.js +360 -0
- package/Source/Scene/I3SGeometry.js +477 -0
- package/Source/Scene/I3SLayer.js +460 -0
- package/Source/Scene/I3SNode.js +927 -0
- package/Source/Scene/I3SStatistics.js +94 -0
- package/Source/Scene/I3SSublayer.js +175 -0
- package/Source/Scene/I3SSymbology.js +336 -0
- package/Source/Scene/I3dmParser.js +140 -0
- package/Source/Scene/ITwinData.js +283 -0
- package/Source/Scene/ImageBasedLighting.js +463 -0
- package/Source/Scene/Imagery.js +120 -0
- package/Source/Scene/ImageryLayer.js +1747 -0
- package/Source/Scene/ImageryLayerCollection.js +645 -0
- package/Source/Scene/ImageryLayerFeatureInfo.js +111 -0
- package/Source/Scene/ImageryProvider.js +267 -0
- package/Source/Scene/ImageryState.js +14 -0
- package/Source/Scene/Implicit3DTileContent.js +1206 -0
- package/Source/Scene/ImplicitAvailabilityBitstream.js +134 -0
- package/Source/Scene/ImplicitMetadataView.js +178 -0
- package/Source/Scene/ImplicitSubdivisionScheme.js +48 -0
- package/Source/Scene/ImplicitSubtree.js +1161 -0
- package/Source/Scene/ImplicitSubtreeCache.js +127 -0
- package/Source/Scene/ImplicitSubtreeMetadata.js +191 -0
- package/Source/Scene/ImplicitTileCoordinates.js +647 -0
- package/Source/Scene/ImplicitTileset.js +269 -0
- package/Source/Scene/InstanceAttributeSemantic.js +79 -0
- package/Source/Scene/InvertClassification.js +381 -0
- package/Source/Scene/IonImageryProvider.js +346 -0
- package/Source/Scene/IonImageryProviderFactory.js +194 -0
- package/Source/Scene/IonWorldImageryStyle.js +33 -0
- package/Source/Scene/JobScheduler.js +199 -0
- package/Source/Scene/JobType.js +10 -0
- package/Source/Scene/JsonMetadataTable.js +114 -0
- package/Source/Scene/KeyframeNode.js +61 -0
- package/Source/Scene/Label.js +1618 -0
- package/Source/Scene/LabelCollection.js +1032 -0
- package/Source/Scene/LabelStyle.js +33 -0
- package/Source/Scene/Light.js +34 -0
- package/Source/Scene/MapMode2D.js +23 -0
- package/Source/Scene/MapboxImageryProvider.js +332 -0
- package/Source/Scene/MapboxStyleImageryProvider.js +342 -0
- package/Source/Scene/Material.js +1929 -0
- package/Source/Scene/MaterialAppearance.js +328 -0
- package/Source/Scene/Megatexture.js +550 -0
- package/Source/Scene/MetadataClass.js +202 -0
- package/Source/Scene/MetadataClassProperty.js +1191 -0
- package/Source/Scene/MetadataComponentType.js +469 -0
- package/Source/Scene/MetadataEntity.js +425 -0
- package/Source/Scene/MetadataEnum.js +219 -0
- package/Source/Scene/MetadataEnumValue.js +131 -0
- package/Source/Scene/MetadataPicking.js +396 -0
- package/Source/Scene/MetadataSchema.js +202 -0
- package/Source/Scene/MetadataSchemaLoader.js +135 -0
- package/Source/Scene/MetadataSemantic.js +153 -0
- package/Source/Scene/MetadataTable.js +357 -0
- package/Source/Scene/MetadataTableProperty.js +840 -0
- package/Source/Scene/MetadataType.js +220 -0
- package/Source/Scene/Model/AlphaPipelineStage.js +51 -0
- package/Source/Scene/Model/AtmospherePipelineStage.js +64 -0
- package/Source/Scene/Model/B3dmLoader.js +368 -0
- package/Source/Scene/Model/BatchTexturePipelineStage.js +71 -0
- package/Source/Scene/Model/CPUStylingPipelineStage.js +77 -0
- package/Source/Scene/Model/CartesianRectangle.js +108 -0
- package/Source/Scene/Model/ClassificationModelDrawCommand.js +534 -0
- package/Source/Scene/Model/ClassificationPipelineStage.js +132 -0
- package/Source/Scene/Model/CustomShader.js +469 -0
- package/Source/Scene/Model/CustomShaderMode.js +40 -0
- package/Source/Scene/Model/CustomShaderPipelineStage.js +667 -0
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +35 -0
- package/Source/Scene/Model/DequantizationPipelineStage.js +178 -0
- package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
- package/Source/Scene/Model/Extensions/Gpm/AnchorPointDirect.js +61 -0
- package/Source/Scene/Model/Extensions/Gpm/AnchorPointIndirect.js +77 -0
- package/Source/Scene/Model/Extensions/Gpm/CorrelationGroup.js +81 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +248 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js +179 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js +543 -0
- package/Source/Scene/Model/Extensions/Gpm/MeshPrimitiveGpmLocal.js +28 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeMetadata.js +79 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +75 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeTexture.js +127 -0
- package/Source/Scene/Model/Extensions/Gpm/Spdcf.js +103 -0
- package/Source/Scene/Model/Extensions/Gpm/StorageType.js +30 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +523 -0
- package/Source/Scene/Model/GeoJsonLoader.js +697 -0
- package/Source/Scene/Model/GeometryPipelineStage.js +529 -0
- package/Source/Scene/Model/I3dmLoader.js +883 -0
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +168 -0
- package/Source/Scene/Model/ImageryConfiguration.js +26 -0
- package/Source/Scene/Model/ImageryCoverage.js +488 -0
- package/Source/Scene/Model/ImageryFlags.js +31 -0
- package/Source/Scene/Model/ImageryInput.js +60 -0
- package/Source/Scene/Model/ImageryPipelineStage.js +1046 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +1056 -0
- package/Source/Scene/Model/LightingModel.js +30 -0
- package/Source/Scene/Model/LightingPipelineStage.js +73 -0
- package/Source/Scene/Model/MappedPositions.js +84 -0
- package/Source/Scene/Model/MaterialPipelineStage.js +869 -0
- package/Source/Scene/Model/MetadataPickingPipelineStage.js +96 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +657 -0
- package/Source/Scene/Model/Model.js +3340 -0
- package/Source/Scene/Model/Model3DTileContent.js +551 -0
- package/Source/Scene/Model/ModelAlphaOptions.js +26 -0
- package/Source/Scene/Model/ModelAnimation.js +421 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +294 -0
- package/Source/Scene/Model/ModelAnimationCollection.js +553 -0
- package/Source/Scene/Model/ModelArticulation.js +214 -0
- package/Source/Scene/Model/ModelArticulationStage.js +261 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +126 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +98 -0
- package/Source/Scene/Model/ModelColorPipelineStage.js +98 -0
- package/Source/Scene/Model/ModelDrawCommand.js +922 -0
- package/Source/Scene/Model/ModelDrawCommands.js +218 -0
- package/Source/Scene/Model/ModelFeature.js +229 -0
- package/Source/Scene/Model/ModelFeatureTable.js +316 -0
- package/Source/Scene/Model/ModelImagery.js +410 -0
- package/Source/Scene/Model/ModelImageryMapping.js +489 -0
- package/Source/Scene/Model/ModelLightingOptions.js +29 -0
- package/Source/Scene/Model/ModelMatrixUpdateStage.js +120 -0
- package/Source/Scene/Model/ModelNode.js +125 -0
- package/Source/Scene/Model/ModelPrimitiveImagery.js +972 -0
- package/Source/Scene/Model/ModelReader.js +810 -0
- package/Source/Scene/Model/ModelRenderResources.js +119 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +648 -0
- package/Source/Scene/Model/ModelRuntimePrimitive.js +380 -0
- package/Source/Scene/Model/ModelSceneGraph.js +1098 -0
- package/Source/Scene/Model/ModelSilhouettePipelineStage.js +109 -0
- package/Source/Scene/Model/ModelSkin.js +180 -0
- package/Source/Scene/Model/ModelSplitterPipelineStage.js +65 -0
- package/Source/Scene/Model/ModelStatistics.js +225 -0
- package/Source/Scene/Model/ModelType.js +94 -0
- package/Source/Scene/Model/ModelUtility.js +395 -0
- package/Source/Scene/Model/MorphTargetsPipelineStage.js +249 -0
- package/Source/Scene/Model/NodeRenderResources.js +170 -0
- package/Source/Scene/Model/NodeStatisticsPipelineStage.js +75 -0
- package/Source/Scene/Model/PickingPipelineStage.js +218 -0
- package/Source/Scene/Model/PntsLoader.js +716 -0
- package/Source/Scene/Model/PointCloudStylingPipelineStage.js +392 -0
- package/Source/Scene/Model/PrimitiveOutlineGenerator.js +689 -0
- package/Source/Scene/Model/PrimitiveOutlinePipelineStage.js +99 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +297 -0
- package/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js +253 -0
- package/Source/Scene/Model/SceneMode2DPipelineStage.js +301 -0
- package/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +180 -0
- package/Source/Scene/Model/SkinningPipelineStage.js +118 -0
- package/Source/Scene/Model/StyleCommandsNeeded.js +29 -0
- package/Source/Scene/Model/TextureManager.js +244 -0
- package/Source/Scene/Model/TextureUniform.js +71 -0
- package/Source/Scene/Model/TilesetPipelineStage.js +73 -0
- package/Source/Scene/Model/UniformType.js +124 -0
- package/Source/Scene/Model/VaryingType.js +61 -0
- package/Source/Scene/Model/VerticalExaggerationPipelineStage.js +58 -0
- package/Source/Scene/Model/WireframePipelineStage.js +118 -0
- package/Source/Scene/Model/pickModel.js +425 -0
- package/Source/Scene/ModelAnimationLoop.js +33 -0
- package/Source/Scene/ModelAnimationState.js +9 -0
- package/Source/Scene/ModelComponents.js +1662 -0
- package/Source/Scene/Moon.js +175 -0
- package/Source/Scene/Multiple3DTileContent.js +722 -0
- package/Source/Scene/NeverTileDiscardPolicy.js +28 -0
- package/Source/Scene/OIT.js +946 -0
- package/Source/Scene/OpenStreetMapImageryProvider.js +128 -0
- package/Source/Scene/OrderedGroundPrimitiveCollection.js +218 -0
- package/Source/Scene/Particle.js +149 -0
- package/Source/Scene/ParticleBurst.js +51 -0
- package/Source/Scene/ParticleEmitter.js +36 -0
- package/Source/Scene/ParticleSystem.js +885 -0
- package/Source/Scene/PerInstanceColorAppearance.js +296 -0
- package/Source/Scene/PerformanceDisplay.js +120 -0
- package/Source/Scene/PickDepth.js +125 -0
- package/Source/Scene/PickDepthFramebuffer.js +79 -0
- package/Source/Scene/PickFramebuffer.js +255 -0
- package/Source/Scene/PickedMetadataInfo.js +57 -0
- package/Source/Scene/Picking.js +1683 -0
- package/Source/Scene/PntsParser.js +547 -0
- package/Source/Scene/PointCloud.js +1412 -0
- package/Source/Scene/PointCloudEyeDomeLighting.js +284 -0
- package/Source/Scene/PointCloudShading.js +104 -0
- package/Source/Scene/PointPrimitive.js +690 -0
- package/Source/Scene/PointPrimitiveCollection.js +1223 -0
- package/Source/Scene/Polyline.js +431 -0
- package/Source/Scene/PolylineCollection.js +1950 -0
- package/Source/Scene/PolylineColorAppearance.js +220 -0
- package/Source/Scene/PolylineMaterialAppearance.js +231 -0
- package/Source/Scene/PostProcessStage.js +1000 -0
- package/Source/Scene/PostProcessStageCollection.js +900 -0
- package/Source/Scene/PostProcessStageComposite.js +359 -0
- package/Source/Scene/PostProcessStageLibrary.js +826 -0
- package/Source/Scene/PostProcessStageSampleMode.js +22 -0
- package/Source/Scene/PostProcessStageTextureCache.js +454 -0
- package/Source/Scene/Primitive.js +2504 -0
- package/Source/Scene/PrimitiveCollection.js +532 -0
- package/Source/Scene/PrimitiveLoadPlan.js +303 -0
- package/Source/Scene/PrimitivePipeline.js +854 -0
- package/Source/Scene/PrimitiveState.js +136 -0
- package/Source/Scene/PropertyAttribute.js +160 -0
- package/Source/Scene/PropertyAttributeProperty.js +177 -0
- package/Source/Scene/PropertyTable.js +536 -0
- package/Source/Scene/PropertyTexture.js +162 -0
- package/Source/Scene/PropertyTextureProperty.js +304 -0
- package/Source/Scene/QuadtreeOccluders.js +30 -0
- package/Source/Scene/QuadtreePrimitive.js +1575 -0
- package/Source/Scene/QuadtreeTile.js +729 -0
- package/Source/Scene/QuadtreeTileLoadState.js +39 -0
- package/Source/Scene/QuadtreeTileProvider.js +212 -0
- package/Source/Scene/ResourceCache.js +824 -0
- package/Source/Scene/ResourceCacheKey.js +601 -0
- package/Source/Scene/ResourceCacheStatistics.js +149 -0
- package/Source/Scene/ResourceLoader.js +127 -0
- package/Source/Scene/ResourceLoaderState.js +56 -0
- package/Source/Scene/SDFSettings.js +39 -0
- package/Source/Scene/Scene.js +5280 -0
- package/Source/Scene/SceneFramebuffer.js +106 -0
- package/Source/Scene/SceneMode.js +56 -0
- package/Source/Scene/SceneTransforms.js +463 -0
- package/Source/Scene/SceneTransitioner.js +1111 -0
- package/Source/Scene/ScreenSpaceCameraController.js +3098 -0
- package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
- package/Source/Scene/ShadowMap.js +1957 -0
- package/Source/Scene/ShadowMapShader.js +395 -0
- package/Source/Scene/ShadowMode.js +78 -0
- package/Source/Scene/ShadowVolumeAppearance.js +936 -0
- package/Source/Scene/SingleTileImageryProvider.js +380 -0
- package/Source/Scene/SkyAtmosphere.js +400 -0
- package/Source/Scene/SkyBox.js +289 -0
- package/Source/Scene/SpatialNode.js +377 -0
- package/Source/Scene/SpecularEnvironmentCubeMap.js +240 -0
- package/Source/Scene/SphereEmitter.js +65 -0
- package/Source/Scene/SplitDirection.js +34 -0
- package/Source/Scene/Splitter.js +49 -0
- package/Source/Scene/StencilConstants.js +37 -0
- package/Source/Scene/StencilFunction.js +73 -0
- package/Source/Scene/StencilOperation.js +73 -0
- package/Source/Scene/StructuralMetadata.js +243 -0
- package/Source/Scene/StyleExpression.js +86 -0
- package/Source/Scene/Sun.js +363 -0
- package/Source/Scene/SunLight.js +31 -0
- package/Source/Scene/SunPostProcess.js +288 -0
- package/Source/Scene/SupportedImageFormats.js +18 -0
- package/Source/Scene/Terrain.js +245 -0
- package/Source/Scene/TerrainFillMesh.js +2222 -0
- package/Source/Scene/TerrainState.js +13 -0
- package/Source/Scene/TileBoundingRegion.js +489 -0
- package/Source/Scene/TileBoundingS2Cell.js +699 -0
- package/Source/Scene/TileBoundingSphere.js +167 -0
- package/Source/Scene/TileBoundingVolume.js +68 -0
- package/Source/Scene/TileCoordinatesImageryProvider.js +269 -0
- package/Source/Scene/TileDiscardPolicy.js +34 -0
- package/Source/Scene/TileImagery.js +126 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +442 -0
- package/Source/Scene/TileMetadata.js +184 -0
- package/Source/Scene/TileOrientedBoundingBox.js +219 -0
- package/Source/Scene/TileReplacementQueue.js +119 -0
- package/Source/Scene/TileSelectionResult.js +80 -0
- package/Source/Scene/TileState.js +10 -0
- package/Source/Scene/Tileset3DTileContent.js +182 -0
- package/Source/Scene/TilesetMetadata.js +186 -0
- package/Source/Scene/TimeDynamicImagery.js +308 -0
- package/Source/Scene/TimeDynamicPointCloud.js +802 -0
- package/Source/Scene/Tonemapper.js +64 -0
- package/Source/Scene/TranslucentTileClassification.js +514 -0
- package/Source/Scene/TweenCollection.js +585 -0
- package/Source/Scene/UrlTemplateImageryProvider.js +989 -0
- package/Source/Scene/Vector3DTileBatch.js +37 -0
- package/Source/Scene/Vector3DTileClampedPolylines.js +783 -0
- package/Source/Scene/Vector3DTileContent.js +770 -0
- package/Source/Scene/Vector3DTileGeometry.js +497 -0
- package/Source/Scene/Vector3DTilePoints.js +548 -0
- package/Source/Scene/Vector3DTilePolygons.js +479 -0
- package/Source/Scene/Vector3DTilePolylines.js +679 -0
- package/Source/Scene/Vector3DTilePrimitive.js +1276 -0
- package/Source/Scene/VertexAttributeSemantic.js +305 -0
- package/Source/Scene/VerticalOrigin.js +49 -0
- package/Source/Scene/View.js +465 -0
- package/Source/Scene/ViewportQuad.js +182 -0
- package/Source/Scene/ViewshedShadowMap.js +1953 -0
- package/Source/Scene/VoxelBoundsCollection.js +494 -0
- package/Source/Scene/VoxelBoxShape.js +595 -0
- package/Source/Scene/VoxelCell.js +274 -0
- package/Source/Scene/VoxelContent.js +231 -0
- package/Source/Scene/VoxelCylinderShape.js +868 -0
- package/Source/Scene/VoxelEllipsoidShape.js +1174 -0
- package/Source/Scene/VoxelMetadataOrder.js +24 -0
- package/Source/Scene/VoxelPrimitive.js +2169 -0
- package/Source/Scene/VoxelProvider.js +234 -0
- package/Source/Scene/VoxelRenderResources.js +259 -0
- package/Source/Scene/VoxelShape.js +179 -0
- package/Source/Scene/VoxelShapeType.js +105 -0
- package/Source/Scene/VoxelTraversal.js +1264 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +649 -0
- package/Source/Scene/WebMapTileServiceImageryProvider.js +575 -0
- package/Source/Scene/buildVoxelDrawCommands.js +177 -0
- package/Source/Scene/computeFlyToLocationForRectangle.js +74 -0
- package/Source/Scene/createBillboardPointCallback.js +70 -0
- package/Source/Scene/createElevationBandMaterial.js +580 -0
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +116 -0
- package/Source/Scene/createOsmBuildingsAsync.js +79 -0
- package/Source/Scene/createTangentSpaceDebugPrimitive.js +114 -0
- package/Source/Scene/createWorldImageryAsync.js +39 -0
- package/Source/Scene/findContentMetadata.js +51 -0
- package/Source/Scene/findGroupMetadata.js +39 -0
- package/Source/Scene/findTileMetadata.js +53 -0
- package/Source/Scene/getBinaryAccessor.js +56 -0
- package/Source/Scene/getClipAndStyleCode.js +34 -0
- package/Source/Scene/getClippingFunction.js +154 -0
- package/Source/Scene/getMeshPrimitives.js +72 -0
- package/Source/Scene/getMetadataClassProperty.js +43 -0
- package/Source/Scene/getMetadataProperty.js +48 -0
- package/Source/Scene/hasExtension.js +19 -0
- package/Source/Scene/parseBatchTable.js +448 -0
- package/Source/Scene/parseFeatureMetadataLegacy.js +139 -0
- package/Source/Scene/parseStructuralMetadata.js +102 -0
- package/Source/Scene/preprocess3DTileContent.js +102 -0
- package/Source/Scene/processVoxelProperties.js +398 -0
- package/Source/Shaders/AdjustTranslucentFS.glsl +27 -0
- package/Source/Shaders/AdjustTranslucentFS.js +29 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +29 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +31 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +26 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +28 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +23 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +25 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +17 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +33 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +35 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +21 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +24 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +26 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +22 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +6 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +8 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +15 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +17 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +28 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +30 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +33 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +35 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +25 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +27 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +22 -0
- package/Source/Shaders/AtmosphereCommon.glsl +187 -0
- package/Source/Shaders/AtmosphereCommon.js +189 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +261 -0
- package/Source/Shaders/BillboardCollectionFS.js +262 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +445 -0
- package/Source/Shaders/BillboardCollectionVS.js +447 -0
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +100 -0
- package/Source/Shaders/BrdfLutGeneratorFS.js +102 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.js +18 -0
- package/Source/Shaders/Builtin/Constants/depthRange.glsl +14 -0
- package/Source/Shaders/Builtin/Constants/depthRange.js +16 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.js +9 -0
- package/Source/Shaders/Builtin/Constants/infinity.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/infinity.js +9 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCompute.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCompute.js +11 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +11 -0
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passVoxels.js +11 -0
- package/Source/Shaders/Builtin/Constants/pi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/pi.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.js +18 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.js +18 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.js +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.glsl +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.js +15 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.js +18 -0
- package/Source/Shaders/Builtin/Constants/twoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/twoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js +18 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +280 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.js +26 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.js +33 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.js +29 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.glsl +34 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.js +36 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.js +32 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.js +32 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.js +18 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.js +13 -0
- package/Source/Shaders/Builtin/Functions/antialias.glsl +39 -0
- package/Source/Shaders/Builtin/Functions/antialias.js +41 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js +20 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
- package/Source/Shaders/Builtin/Functions/backFacing.glsl +13 -0
- package/Source/Shaders/Builtin/Functions/backFacing.js +15 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.glsl +71 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.js +73 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.glsl +8 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.js +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.glsl +7 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.js +9 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.js +12 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.js +12 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +39 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +14 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +88 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +90 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
- package/Source/Shaders/Builtin/Functions/computePosition.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/computePosition.js +24 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +149 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.js +151 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.glsl +211 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.js +213 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.glsl +17 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js +19 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.glsl +47 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.js +49 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +33 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +35 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js +14 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.js +12 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.js +38 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.js +22 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js +34 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.glsl +55 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.js +57 -0
- package/Source/Shaders/Builtin/Functions/fog.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/fog.js +40 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.js +24 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js +18 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.js +29 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.js +24 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.js +31 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.js +39 -0
- package/Source/Shaders/Builtin/Functions/hue.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/hue.js +32 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.js +14 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.js +21 -0
- package/Source/Shaders/Builtin/Functions/isFull.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isFull.js +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js +23 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.js +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.js +18 -0
- package/Source/Shaders/Builtin/Functions/luminance.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/luminance.js +22 -0
- package/Source/Shaders/Builtin/Functions/maximumComponent.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/maximumComponent.js +23 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.glsl +61 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.js +63 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +40 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js +20 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.glsl +26 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.js +28 -0
- package/Source/Shaders/Builtin/Functions/octDecode.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/octDecode.js +85 -0
- package/Source/Shaders/Builtin/Functions/packDepth.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/packDepth.js +20 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +164 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +166 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.glsl +23 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.js +25 -0
- package/Source/Shaders/Builtin/Functions/phong.glsl +63 -0
- package/Source/Shaders/Builtin/Functions/phong.js +65 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.glsl +28 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.js +30 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.js +21 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js +85 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js +38 -0
- package/Source/Shaders/Builtin/Functions/readDepth.glsl +4 -0
- package/Source/Shaders/Builtin/Functions/readDepth.js +6 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.js +33 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.js +13 -0
- package/Source/Shaders/Builtin/Functions/round.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/round.js +24 -0
- package/Source/Shaders/Builtin/Functions/saturation.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/saturation.js +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +26 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.glsl +66 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.js +68 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.js +31 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +46 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.js +18 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +25 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +27 -0
- package/Source/Shaders/Builtin/Functions/textureCube.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/textureCube.js +37 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.glsl +15 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.js +17 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +45 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +47 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.js +29 -0
- package/Source/Shaders/Builtin/Functions/transpose.glsl +45 -0
- package/Source/Shaders/Builtin/Functions/transpose.js +47 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +15 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.js +18 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.js +26 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.js +33 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.js +40 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +64 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +66 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +110 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +112 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +26 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +79 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.js +81 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.js +34 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.glsl +9 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.js +11 -0
- package/Source/Shaders/Builtin/Structs/material.glsl +22 -0
- package/Source/Shaders/Builtin/Structs/material.js +24 -0
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +30 -0
- package/Source/Shaders/Builtin/Structs/materialInput.js +32 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +45 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.js +47 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.glsl +16 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.js +18 -0
- package/Source/Shaders/Builtin/Structs/ray.glsl +11 -0
- package/Source/Shaders/Builtin/Structs/ray.js +13 -0
- package/Source/Shaders/Builtin/Structs/raySegment.glsl +27 -0
- package/Source/Shaders/Builtin/Structs/raySegment.js +29 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.glsl +15 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.js +17 -0
- package/Source/Shaders/CloudCollectionFS.glsl +263 -0
- package/Source/Shaders/CloudCollectionFS.js +265 -0
- package/Source/Shaders/CloudCollectionVS.glsl +48 -0
- package/Source/Shaders/CloudCollectionVS.js +50 -0
- package/Source/Shaders/CloudNoiseFS.glsl +92 -0
- package/Source/Shaders/CloudNoiseFS.js +94 -0
- package/Source/Shaders/CloudNoiseVS.glsl +18 -0
- package/Source/Shaders/CloudNoiseVS.js +20 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +12 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.js +14 -0
- package/Source/Shaders/CompositeOITFS.glsl +31 -0
- package/Source/Shaders/CompositeOITFS.js +33 -0
- package/Source/Shaders/ComputeIrradianceFS.glsl +103 -0
- package/Source/Shaders/ComputeIrradianceFS.js +105 -0
- package/Source/Shaders/ComputeRadianceMapFS.glsl +107 -0
- package/Source/Shaders/ComputeRadianceMapFS.js +109 -0
- package/Source/Shaders/ConvolveSpecularMapFS.glsl +70 -0
- package/Source/Shaders/ConvolveSpecularMapFS.js +72 -0
- package/Source/Shaders/ConvolveSpecularMapVS.glsl +24 -0
- package/Source/Shaders/ConvolveSpecularMapVS.js +26 -0
- package/Source/Shaders/DepthPlaneFS.glsl +36 -0
- package/Source/Shaders/DepthPlaneFS.js +38 -0
- package/Source/Shaders/DepthPlaneVS.glsl +11 -0
- package/Source/Shaders/DepthPlaneVS.js +13 -0
- package/Source/Shaders/EllipsoidFS.glsl +104 -0
- package/Source/Shaders/EllipsoidFS.js +106 -0
- package/Source/Shaders/EllipsoidVS.glsl +28 -0
- package/Source/Shaders/EllipsoidVS.js +30 -0
- package/Source/Shaders/FXAA3_11.glsl +650 -0
- package/Source/Shaders/FXAA3_11.js +680 -0
- package/Source/Shaders/GlobeFS.glsl +692 -0
- package/Source/Shaders/GlobeFS.js +694 -0
- package/Source/Shaders/GlobeVS.glsl +286 -0
- package/Source/Shaders/GlobeVS.js +288 -0
- package/Source/Shaders/GroundAtmosphere.glsl +18 -0
- package/Source/Shaders/GroundAtmosphere.js +20 -0
- package/Source/Shaders/Materials/AspectRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/AspectRampMaterial.js +13 -0
- package/Source/Shaders/Materials/BumpMapMaterial.glsl +29 -0
- package/Source/Shaders/Materials/BumpMapMaterial.js +31 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.glsl +29 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.js +31 -0
- package/Source/Shaders/Materials/DotMaterial.glsl +18 -0
- package/Source/Shaders/Materials/DotMaterial.js +20 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.glsl +74 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.js +76 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.glsl +26 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.js +28 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.glsl +14 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.js +16 -0
- package/Source/Shaders/Materials/FadeMaterial.glsl +37 -0
- package/Source/Shaders/Materials/FadeMaterial.js +39 -0
- package/Source/Shaders/Materials/GridMaterial.glsl +57 -0
- package/Source/Shaders/Materials/GridMaterial.js +59 -0
- package/Source/Shaders/Materials/NormalMapMaterial.glsl +19 -0
- package/Source/Shaders/Materials/NormalMapMaterial.js +21 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +63 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.js +65 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.glsl +39 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.js +41 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +25 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +27 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +29 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.js +31 -0
- package/Source/Shaders/Materials/RimLightingMaterial.glsl +21 -0
- package/Source/Shaders/Materials/RimLightingMaterial.js +23 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.js +13 -0
- package/Source/Shaders/Materials/StripeMaterial.glsl +24 -0
- package/Source/Shaders/Materials/StripeMaterial.js +26 -0
- package/Source/Shaders/Materials/Water.glsl +58 -0
- package/Source/Shaders/Materials/Water.js +60 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.glsl +15 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.js +17 -0
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +108 -0
- package/Source/Shaders/Model/AtmosphereStageFS.js +110 -0
- package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
- package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
- package/Source/Shaders/Model/CPUStylingStageFS.glsl +49 -0
- package/Source/Shaders/Model/CPUStylingStageFS.js +51 -0
- package/Source/Shaders/Model/CPUStylingStageVS.glsl +30 -0
- package/Source/Shaders/Model/CPUStylingStageVS.js +32 -0
- package/Source/Shaders/Model/CustomShaderStageFS.glsl +18 -0
- package/Source/Shaders/Model/CustomShaderStageFS.js +20 -0
- package/Source/Shaders/Model/CustomShaderStageVS.glsl +19 -0
- package/Source/Shaders/Model/CustomShaderStageVS.js +21 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
- package/Source/Shaders/Model/FeatureIdStageFS.glsl +4 -0
- package/Source/Shaders/Model/FeatureIdStageFS.js +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.glsl +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.js +8 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +25 -0
- package/Source/Shaders/Model/GeometryStageFS.js +27 -0
- package/Source/Shaders/Model/GeometryStageVS.glsl +42 -0
- package/Source/Shaders/Model/GeometryStageVS.js +44 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +101 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +103 -0
- package/Source/Shaders/Model/InstancingStageCommon.glsl +67 -0
- package/Source/Shaders/Model/InstancingStageCommon.js +69 -0
- package/Source/Shaders/Model/InstancingStageVS.glsl +18 -0
- package/Source/Shaders/Model/InstancingStageVS.js +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.glsl +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.js +22 -0
- package/Source/Shaders/Model/LightingStageFS.glsl +120 -0
- package/Source/Shaders/Model/LightingStageFS.js +122 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +497 -0
- package/Source/Shaders/Model/MaterialStageFS.js +499 -0
- package/Source/Shaders/Model/MetadataStageFS.glsl +9 -0
- package/Source/Shaders/Model/MetadataStageFS.js +11 -0
- package/Source/Shaders/Model/MetadataStageVS.glsl +10 -0
- package/Source/Shaders/Model/MetadataStageVS.js +12 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +88 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +90 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +8 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +27 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +29 -0
- package/Source/Shaders/Model/ModelColorStageFS.glsl +7 -0
- package/Source/Shaders/Model/ModelColorStageFS.js +9 -0
- package/Source/Shaders/Model/ModelFS.glsl +133 -0
- package/Source/Shaders/Model/ModelFS.js +135 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.glsl +5 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.js +6 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.glsl +10 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.js +12 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.glsl +9 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.js +11 -0
- package/Source/Shaders/Model/ModelVS.glsl +161 -0
- package/Source/Shaders/Model/ModelVS.js +163 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.glsl +15 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.js +16 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.glsl +45 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.js +47 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +15 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +17 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.glsl +3 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.js +5 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +51 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +53 -0
- package/Source/Shaders/Model/SkinningStageVS.glsl +18 -0
- package/Source/Shaders/Model/SkinningStageVS.js +19 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +39 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +41 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +47 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +49 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +185 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.js +187 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +100 -0
- package/Source/Shaders/PolygonSignedDistanceFS.js +101 -0
- package/Source/Shaders/PolylineCommon.glsl +176 -0
- package/Source/Shaders/PolylineCommon.js +178 -0
- package/Source/Shaders/PolylineFS.glsl +25 -0
- package/Source/Shaders/PolylineFS.js +27 -0
- package/Source/Shaders/PolylineShadowVolumeFS.glsl +86 -0
- package/Source/Shaders/PolylineShadowVolumeFS.js +88 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +45 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.js +47 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +177 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.js +179 -0
- package/Source/Shaders/PolylineShadowVolumeVS.glsl +168 -0
- package/Source/Shaders/PolylineShadowVolumeVS.js +170 -0
- package/Source/Shaders/PolylineVS.glsl +103 -0
- package/Source/Shaders/PolylineVS.js +105 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +25 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +27 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +17 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.js +19 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +144 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +146 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +11 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +13 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +19 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.js +21 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.glsl +20 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.js +22 -0
- package/Source/Shaders/PostProcessStages/BrightPass.glsl +30 -0
- package/Source/Shaders/PostProcessStages/BrightPass.js +32 -0
- package/Source/Shaders/PostProcessStages/Brightness.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Brightness.js +13 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +31 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +33 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.glsl +17 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.js +19 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.glsl +39 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.js +41 -0
- package/Source/Shaders/PostProcessStages/DepthView.glsl +9 -0
- package/Source/Shaders/PostProcessStages/DepthView.js +11 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +14 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.js +16 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +60 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.js +62 -0
- package/Source/Shaders/PostProcessStages/FXAA.glsl +21 -0
- package/Source/Shaders/PostProcessStages/FXAA.js +23 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +40 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +42 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +47 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +49 -0
- package/Source/Shaders/PostProcessStages/LensFlare.glsl +153 -0
- package/Source/Shaders/PostProcessStages/LensFlare.js +155 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +28 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +30 -0
- package/Source/Shaders/PostProcessStages/NightVision.glsl +16 -0
- package/Source/Shaders/PostProcessStages/NightVision.js +18 -0
- package/Source/Shaders/PostProcessStages/PassThrough.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThrough.js +10 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.js +10 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.glsl +25 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.js +27 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +61 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +63 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +27 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +29 -0
- package/Source/Shaders/PostProcessStages/Silhouette.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Silhouette.js +13 -0
- package/Source/Shaders/PrimitiveGaussianSplatFS.glsl +18 -0
- package/Source/Shaders/PrimitiveGaussianSplatFS.js +20 -0
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +189 -0
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +190 -0
- package/Source/Shaders/ReprojectWebMercatorFS.glsl +8 -0
- package/Source/Shaders/ReprojectWebMercatorFS.js +10 -0
- package/Source/Shaders/ReprojectWebMercatorVS.glsl +12 -0
- package/Source/Shaders/ReprojectWebMercatorVS.js +14 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +153 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +155 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +101 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.js +103 -0
- package/Source/Shaders/ShadowVolumeFS.glsl +13 -0
- package/Source/Shaders/ShadowVolumeFS.js +15 -0
- package/Source/Shaders/SkyAtmosphereCommon.glsl +81 -0
- package/Source/Shaders/SkyAtmosphereCommon.js +83 -0
- package/Source/Shaders/SkyAtmosphereFS.glsl +59 -0
- package/Source/Shaders/SkyAtmosphereFS.js +61 -0
- package/Source/Shaders/SkyAtmosphereVS.glsl +32 -0
- package/Source/Shaders/SkyAtmosphereVS.js +34 -0
- package/Source/Shaders/SkyBoxFS.glsl +9 -0
- package/Source/Shaders/SkyBoxFS.js +11 -0
- package/Source/Shaders/SkyBoxVS.glsl +9 -0
- package/Source/Shaders/SkyBoxVS.js +11 -0
- package/Source/Shaders/SunFS.glsl +9 -0
- package/Source/Shaders/SunFS.js +11 -0
- package/Source/Shaders/SunTextureFS.glsl +55 -0
- package/Source/Shaders/SunTextureFS.js +57 -0
- package/Source/Shaders/SunVS.glsl +28 -0
- package/Source/Shaders/SunVS.js +30 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +48 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +50 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +85 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +87 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.glsl +22 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.js +24 -0
- package/Source/Shaders/VectorTileVS.glsl +9 -0
- package/Source/Shaders/VectorTileVS.js +11 -0
- package/Source/Shaders/ViewportQuadFS.glsl +16 -0
- package/Source/Shaders/ViewportQuadFS.js +18 -0
- package/Source/Shaders/ViewportQuadVS.glsl +10 -0
- package/Source/Shaders/ViewportQuadVS.js +12 -0
- package/Source/Shaders/Voxels/IntersectBox.glsl +34 -0
- package/Source/Shaders/Voxels/IntersectBox.js +36 -0
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +142 -0
- package/Source/Shaders/Voxels/IntersectCylinder.js +144 -0
- package/Source/Shaders/Voxels/IntersectDepth.glsl +27 -0
- package/Source/Shaders/Voxels/IntersectDepth.js +29 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +330 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +332 -0
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +114 -0
- package/Source/Shaders/Voxels/IntersectLongitude.js +116 -0
- package/Source/Shaders/Voxels/IntersectPlane.glsl +80 -0
- package/Source/Shaders/Voxels/IntersectPlane.js +82 -0
- package/Source/Shaders/Voxels/Intersection.glsl +50 -0
- package/Source/Shaders/Voxels/Intersection.js +52 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +167 -0
- package/Source/Shaders/Voxels/IntersectionUtils.js +169 -0
- package/Source/Shaders/Voxels/Megatexture.glsl +123 -0
- package/Source/Shaders/Voxels/Megatexture.js +125 -0
- package/Source/Shaders/Voxels/Octree.glsl +257 -0
- package/Source/Shaders/Voxels/Octree.js +259 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +267 -0
- package/Source/Shaders/Voxels/VoxelFS.js +269 -0
- package/Source/Shaders/Voxels/VoxelUtils.glsl +12 -0
- package/Source/Shaders/Voxels/VoxelUtils.js +14 -0
- package/Source/Shaders/Voxels/VoxelVS.glsl +11 -0
- package/Source/Shaders/Voxels/VoxelVS.js +13 -0
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +30 -0
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +32 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +97 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +99 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +193 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +195 -0
- package/Source/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/Source/ThirdParty/Workers/package.json +1 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/Source/ThirdParty/basis_transcoder.wasm +0 -0
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/Source/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/Source/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.css +119 -0
- package/Source/Widget/CesiumWidget.js +1606 -0
- package/Source/Widget/lighter.css +14 -0
- package/Source/Workers/combineGeometry.js +13 -0
- package/Source/Workers/createBoxGeometry.js +10 -0
- package/Source/Workers/createBoxOutlineGeometry.js +10 -0
- package/Source/Workers/createCircleGeometry.js +18 -0
- package/Source/Workers/createCircleOutlineGeometry.js +18 -0
- package/Source/Workers/createCoplanarPolygonGeometry.js +10 -0
- package/Source/Workers/createCoplanarPolygonOutlineGeometry.js +15 -0
- package/Source/Workers/createCorridorGeometry.js +12 -0
- package/Source/Workers/createCorridorOutlineGeometry.js +17 -0
- package/Source/Workers/createCylinderGeometry.js +10 -0
- package/Source/Workers/createCylinderOutlineGeometry.js +10 -0
- package/Source/Workers/createEllipseGeometry.js +14 -0
- package/Source/Workers/createEllipseOutlineGeometry.js +14 -0
- package/Source/Workers/createEllipsoidGeometry.js +10 -0
- package/Source/Workers/createEllipsoidOutlineGeometry.js +13 -0
- package/Source/Workers/createFrustumGeometry.js +10 -0
- package/Source/Workers/createFrustumOutlineGeometry.js +10 -0
- package/Source/Workers/createGeometry.js +78 -0
- package/Source/Workers/createGroundPolylineGeometry.js +16 -0
- package/Source/Workers/createPlaneGeometry.js +10 -0
- package/Source/Workers/createPlaneOutlineGeometry.js +10 -0
- package/Source/Workers/createPolygonGeometry.js +12 -0
- package/Source/Workers/createPolygonOutlineGeometry.js +12 -0
- package/Source/Workers/createPolylineGeometry.js +12 -0
- package/Source/Workers/createPolylineVolumeGeometry.js +17 -0
- package/Source/Workers/createPolylineVolumeOutlineGeometry.js +22 -0
- package/Source/Workers/createRectangleGeometry.js +14 -0
- package/Source/Workers/createRectangleOutlineGeometry.js +17 -0
- package/Source/Workers/createSimplePolylineGeometry.js +17 -0
- package/Source/Workers/createSphereGeometry.js +10 -0
- package/Source/Workers/createSphereOutlineGeometry.js +10 -0
- package/Source/Workers/createTaskProcessorWorker.js +113 -0
- package/Source/Workers/createVectorTileClampedPolylines.js +541 -0
- package/Source/Workers/createVectorTileGeometries.js +414 -0
- package/Source/Workers/createVectorTilePoints.js +81 -0
- package/Source/Workers/createVectorTilePolygons.js +412 -0
- package/Source/Workers/createVectorTilePolylines.js +210 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +651 -0
- package/Source/Workers/createVerticesFromHeightmap.js +53 -0
- package/Source/Workers/createVerticesFromQuantizedTerrainMesh.js +549 -0
- package/Source/Workers/createWallGeometry.js +12 -0
- package/Source/Workers/createWallOutlineGeometry.js +12 -0
- package/Source/Workers/decodeDraco.js +383 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +268 -0
- package/Source/Workers/decodeI3S.js +1652 -0
- package/Source/Workers/gaussianSplatSorter.js +34 -0
- package/Source/Workers/gaussianSplatTextureGenerator.js +39 -0
- package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
- package/Source/Workers/transcodeKTX2.js +308 -0
- package/Source/Workers/transferTypedArrayTest.js +16 -0
- package/Source/Workers/upsampleQuantizedTerrainMesh.js +681 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +46026 -0
- package/index.js +1227 -0
- package/package.json +79 -0
|
@@ -0,0 +1,3978 @@
|
|
|
1
|
+
import BoundingSphere from "../Core/BoundingSphere.js";
|
|
2
|
+
import Cartesian2 from "../Core/Cartesian2.js";
|
|
3
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
4
|
+
import Cartesian4 from "../Core/Cartesian4.js";
|
|
5
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
6
|
+
import Frozen from "../Core/Frozen.js";
|
|
7
|
+
import defined from "../Core/defined.js";
|
|
8
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
9
|
+
import EasingFunction from "../Core/EasingFunction.js";
|
|
10
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
11
|
+
import EllipsoidGeodesic from "../Core/EllipsoidGeodesic.js";
|
|
12
|
+
import Event from "../Core/Event.js";
|
|
13
|
+
import getTimestamp from "../Core/getTimestamp.js";
|
|
14
|
+
import HeadingPitchRange from "../Core/HeadingPitchRange.js";
|
|
15
|
+
import HeadingPitchRoll from "../Core/HeadingPitchRoll.js";
|
|
16
|
+
import Intersect from "../Core/Intersect.js";
|
|
17
|
+
import IntersectionTests from "../Core/IntersectionTests.js";
|
|
18
|
+
import CesiumMath from "../Core/Math.js";
|
|
19
|
+
import Matrix3 from "../Core/Matrix3.js";
|
|
20
|
+
import Matrix4 from "../Core/Matrix4.js";
|
|
21
|
+
import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
22
|
+
import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
|
|
23
|
+
import PerspectiveFrustum from "../Core/PerspectiveFrustum.js";
|
|
24
|
+
import Quaternion from "../Core/Quaternion.js";
|
|
25
|
+
import Ray from "../Core/Ray.js";
|
|
26
|
+
import Rectangle from "../Core/Rectangle.js";
|
|
27
|
+
import Transforms from "../Core/Transforms.js";
|
|
28
|
+
import CameraFlightPath from "./CameraFlightPath.js";
|
|
29
|
+
import MapMode2D from "./MapMode2D.js";
|
|
30
|
+
import SceneMode from "./SceneMode.js";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {object} DirectionUp
|
|
34
|
+
*
|
|
35
|
+
* An orientation given by a pair of unit vectors
|
|
36
|
+
*
|
|
37
|
+
* @property {Cartesian3} direction The unit "direction" vector
|
|
38
|
+
* @property {Cartesian3} up The unit "up" vector
|
|
39
|
+
**/
|
|
40
|
+
/**
|
|
41
|
+
* @typedef {object} HeadingPitchRollValues
|
|
42
|
+
*
|
|
43
|
+
* An orientation given by numeric heading, pitch, and roll
|
|
44
|
+
*
|
|
45
|
+
* @property {number} [heading=0.0] The heading in radians
|
|
46
|
+
* @property {number} [pitch=-CesiumMath.PI_OVER_TWO] The pitch in radians
|
|
47
|
+
* @property {number} [roll=0.0] The roll in radians
|
|
48
|
+
**/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The camera is defined by a position, orientation, and view frustum.
|
|
52
|
+
* <br /><br />
|
|
53
|
+
* The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
|
|
54
|
+
* <br /><br />
|
|
55
|
+
* The viewing frustum is defined by 6 planes.
|
|
56
|
+
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
|
|
57
|
+
* define the unit vector normal to the plane, and the w component is the distance of the
|
|
58
|
+
* plane from the origin/camera position.
|
|
59
|
+
*
|
|
60
|
+
* @alias Camera
|
|
61
|
+
*
|
|
62
|
+
* @constructor
|
|
63
|
+
*
|
|
64
|
+
* @param {Scene} scene The scene.
|
|
65
|
+
*
|
|
66
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=Camera.html|Cesium Sandcastle Camera Demo}
|
|
67
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=Camera%20Tutorial.html|Cesium Sandcastle Camera Tutorial Example}
|
|
68
|
+
* @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // Create a camera looking down the negative z-axis, positioned at the origin,
|
|
72
|
+
* // with a field of view of 60 degrees, and 1:1 aspect ratio.
|
|
73
|
+
* const camera = new Cesium.Camera(scene);
|
|
74
|
+
* camera.position = new Cesium.Cartesian3();
|
|
75
|
+
* camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
|
|
76
|
+
* camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
|
|
77
|
+
* camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
|
|
78
|
+
* camera.frustum.near = 1.0;
|
|
79
|
+
* camera.frustum.far = 2.0;
|
|
80
|
+
*/
|
|
81
|
+
function Camera(scene) {
|
|
82
|
+
//>>includeStart('debug', pragmas.debug);
|
|
83
|
+
if (!defined(scene)) {
|
|
84
|
+
throw new DeveloperError("scene is required.");
|
|
85
|
+
}
|
|
86
|
+
//>>includeEnd('debug');
|
|
87
|
+
this._scene = scene;
|
|
88
|
+
|
|
89
|
+
this._transform = Matrix4.clone(Matrix4.IDENTITY);
|
|
90
|
+
this._invTransform = Matrix4.clone(Matrix4.IDENTITY);
|
|
91
|
+
this._actualTransform = Matrix4.clone(Matrix4.IDENTITY);
|
|
92
|
+
this._actualInvTransform = Matrix4.clone(Matrix4.IDENTITY);
|
|
93
|
+
this._transformChanged = false;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The position of the camera.
|
|
97
|
+
*
|
|
98
|
+
* @type {Cartesian3}
|
|
99
|
+
*/
|
|
100
|
+
this.position = new Cartesian3();
|
|
101
|
+
this._position = new Cartesian3();
|
|
102
|
+
this._positionWC = new Cartesian3();
|
|
103
|
+
this._positionCartographic = new Cartographic();
|
|
104
|
+
this._oldPositionWC = undefined;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The position delta magnitude.
|
|
108
|
+
*
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
this.positionWCDeltaMagnitude = 0.0;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The position delta magnitude last frame.
|
|
115
|
+
*
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
this.positionWCDeltaMagnitudeLastFrame = 0.0;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* How long in seconds since the camera has stopped moving
|
|
122
|
+
*
|
|
123
|
+
* @private
|
|
124
|
+
*/
|
|
125
|
+
this.timeSinceMoved = 0.0;
|
|
126
|
+
this._lastMovedTimestamp = 0.0;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The view direction of the camera.
|
|
130
|
+
*
|
|
131
|
+
* @type {Cartesian3}
|
|
132
|
+
*/
|
|
133
|
+
this.direction = new Cartesian3();
|
|
134
|
+
this._direction = new Cartesian3();
|
|
135
|
+
this._directionWC = new Cartesian3();
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The up direction of the camera.
|
|
139
|
+
*
|
|
140
|
+
* @type {Cartesian3}
|
|
141
|
+
*/
|
|
142
|
+
this.up = new Cartesian3();
|
|
143
|
+
this._up = new Cartesian3();
|
|
144
|
+
this._upWC = new Cartesian3();
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The right direction of the camera.
|
|
148
|
+
*
|
|
149
|
+
* @type {Cartesian3}
|
|
150
|
+
*/
|
|
151
|
+
this.right = new Cartesian3();
|
|
152
|
+
this._right = new Cartesian3();
|
|
153
|
+
this._rightWC = new Cartesian3();
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The region of space in view.
|
|
157
|
+
*
|
|
158
|
+
* @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum}
|
|
159
|
+
* @default PerspectiveFrustum()
|
|
160
|
+
*
|
|
161
|
+
* @see PerspectiveFrustum
|
|
162
|
+
* @see PerspectiveOffCenterFrustum
|
|
163
|
+
* @see OrthographicFrustum
|
|
164
|
+
*/
|
|
165
|
+
this.frustum = new PerspectiveFrustum();
|
|
166
|
+
this.frustum.aspectRatio =
|
|
167
|
+
scene.drawingBufferWidth / scene.drawingBufferHeight;
|
|
168
|
+
this.frustum.fov = CesiumMath.toRadians(60.0);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The default amount to move the camera when an argument is not
|
|
172
|
+
* provided to the move methods.
|
|
173
|
+
* @type {number}
|
|
174
|
+
* @default 100000.0;
|
|
175
|
+
*/
|
|
176
|
+
this.defaultMoveAmount = 100000.0;
|
|
177
|
+
/**
|
|
178
|
+
* The default amount to rotate the camera when an argument is not
|
|
179
|
+
* provided to the look methods.
|
|
180
|
+
* @type {number}
|
|
181
|
+
* @default Math.PI / 60.0
|
|
182
|
+
*/
|
|
183
|
+
this.defaultLookAmount = Math.PI / 60.0;
|
|
184
|
+
/**
|
|
185
|
+
* The default amount to rotate the camera when an argument is not
|
|
186
|
+
* provided to the rotate methods.
|
|
187
|
+
* @type {number}
|
|
188
|
+
* @default Math.PI / 3600.0
|
|
189
|
+
*/
|
|
190
|
+
this.defaultRotateAmount = Math.PI / 3600.0;
|
|
191
|
+
/**
|
|
192
|
+
* The default amount to move the camera when an argument is not
|
|
193
|
+
* provided to the zoom methods.
|
|
194
|
+
* @type {number}
|
|
195
|
+
* @default 100000.0;
|
|
196
|
+
*/
|
|
197
|
+
this.defaultZoomAmount = 100000.0;
|
|
198
|
+
/**
|
|
199
|
+
* If set, the camera will not be able to rotate past this axis in either direction.
|
|
200
|
+
* @type {Cartesian3 | undefined}
|
|
201
|
+
* @default undefined
|
|
202
|
+
*/
|
|
203
|
+
this.constrainedAxis = undefined;
|
|
204
|
+
/**
|
|
205
|
+
* The factor multiplied by the the map size used to determine where to clamp the camera position
|
|
206
|
+
* when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
|
|
207
|
+
* @type {number}
|
|
208
|
+
* @default 1.5
|
|
209
|
+
*/
|
|
210
|
+
this.maximumZoomFactor = 1.5;
|
|
211
|
+
|
|
212
|
+
this._moveStart = new Event();
|
|
213
|
+
this._moveEnd = new Event();
|
|
214
|
+
|
|
215
|
+
this._changed = new Event();
|
|
216
|
+
this._changedPosition = undefined;
|
|
217
|
+
this._changedDirection = undefined;
|
|
218
|
+
this._changedFrustum = undefined;
|
|
219
|
+
this._changedHeading = undefined;
|
|
220
|
+
this._changedRoll = undefined;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.
|
|
224
|
+
* @type {number}
|
|
225
|
+
* @default 0.5
|
|
226
|
+
*/
|
|
227
|
+
this.percentageChanged = 0.5;
|
|
228
|
+
|
|
229
|
+
this._viewMatrix = new Matrix4();
|
|
230
|
+
this._invViewMatrix = new Matrix4();
|
|
231
|
+
updateViewMatrix(this);
|
|
232
|
+
|
|
233
|
+
this._mode = SceneMode.SCENE3D;
|
|
234
|
+
this._modeChanged = true;
|
|
235
|
+
const projection = scene.mapProjection;
|
|
236
|
+
this._projection = projection;
|
|
237
|
+
this._maxCoord = projection.project(
|
|
238
|
+
new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO),
|
|
239
|
+
);
|
|
240
|
+
this._max2Dfrustum = undefined;
|
|
241
|
+
|
|
242
|
+
// set default view
|
|
243
|
+
rectangleCameraPosition3D(
|
|
244
|
+
this,
|
|
245
|
+
Camera.DEFAULT_VIEW_RECTANGLE,
|
|
246
|
+
this.position,
|
|
247
|
+
true,
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
let mag = Cartesian3.magnitude(this.position);
|
|
251
|
+
mag += mag * Camera.DEFAULT_VIEW_FACTOR;
|
|
252
|
+
Cartesian3.normalize(this.position, this.position);
|
|
253
|
+
Cartesian3.multiplyByScalar(this.position, mag, this.position);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @private
|
|
258
|
+
*/
|
|
259
|
+
Camera.TRANSFORM_2D = new Matrix4(
|
|
260
|
+
0.0,
|
|
261
|
+
0.0,
|
|
262
|
+
1.0,
|
|
263
|
+
0.0,
|
|
264
|
+
1.0,
|
|
265
|
+
0.0,
|
|
266
|
+
0.0,
|
|
267
|
+
0.0,
|
|
268
|
+
0.0,
|
|
269
|
+
1.0,
|
|
270
|
+
0.0,
|
|
271
|
+
0.0,
|
|
272
|
+
0.0,
|
|
273
|
+
0.0,
|
|
274
|
+
0.0,
|
|
275
|
+
1.0,
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
Camera.TRANSFORM_2D_INVERSE = Matrix4.inverseTransformation(
|
|
282
|
+
Camera.TRANSFORM_2D,
|
|
283
|
+
new Matrix4(),
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The default rectangle the camera will view on creation.
|
|
288
|
+
* @type Rectangle
|
|
289
|
+
*/
|
|
290
|
+
Camera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees(
|
|
291
|
+
-95.0,
|
|
292
|
+
-20.0,
|
|
293
|
+
-70.0,
|
|
294
|
+
90.0,
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
|
|
299
|
+
* A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
|
|
300
|
+
* will move it further away from the extent, and a value less than zero will move it close to the extent.
|
|
301
|
+
* @type {number}
|
|
302
|
+
*/
|
|
303
|
+
Camera.DEFAULT_VIEW_FACTOR = 0.5;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
|
|
307
|
+
* @type HeadingPitchRange
|
|
308
|
+
*/
|
|
309
|
+
Camera.DEFAULT_OFFSET = new HeadingPitchRange(
|
|
310
|
+
0.0,
|
|
311
|
+
-CesiumMath.PI_OVER_FOUR,
|
|
312
|
+
0.0,
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
function updateViewMatrix(camera) {
|
|
316
|
+
Matrix4.computeView(
|
|
317
|
+
camera._position,
|
|
318
|
+
camera._direction,
|
|
319
|
+
camera._up,
|
|
320
|
+
camera._right,
|
|
321
|
+
camera._viewMatrix,
|
|
322
|
+
);
|
|
323
|
+
Matrix4.multiply(
|
|
324
|
+
camera._viewMatrix,
|
|
325
|
+
camera._actualInvTransform,
|
|
326
|
+
camera._viewMatrix,
|
|
327
|
+
);
|
|
328
|
+
Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function updateCameraDeltas(camera) {
|
|
332
|
+
if (!defined(camera._oldPositionWC)) {
|
|
333
|
+
camera._oldPositionWC = Cartesian3.clone(
|
|
334
|
+
camera.positionWC,
|
|
335
|
+
camera._oldPositionWC,
|
|
336
|
+
);
|
|
337
|
+
} else {
|
|
338
|
+
camera.positionWCDeltaMagnitudeLastFrame = camera.positionWCDeltaMagnitude;
|
|
339
|
+
const delta = Cartesian3.subtract(
|
|
340
|
+
camera.positionWC,
|
|
341
|
+
camera._oldPositionWC,
|
|
342
|
+
camera._oldPositionWC,
|
|
343
|
+
);
|
|
344
|
+
camera.positionWCDeltaMagnitude = Cartesian3.magnitude(delta);
|
|
345
|
+
camera._oldPositionWC = Cartesian3.clone(
|
|
346
|
+
camera.positionWC,
|
|
347
|
+
camera._oldPositionWC,
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
// Update move timers
|
|
351
|
+
if (camera.positionWCDeltaMagnitude > 0.0) {
|
|
352
|
+
camera.timeSinceMoved = 0.0;
|
|
353
|
+
camera._lastMovedTimestamp = getTimestamp();
|
|
354
|
+
} else {
|
|
355
|
+
camera.timeSinceMoved =
|
|
356
|
+
Math.max(getTimestamp() - camera._lastMovedTimestamp, 0.0) / 1000.0;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Checks if there's a camera flight with preload for this camera.
|
|
363
|
+
*
|
|
364
|
+
* @returns {boolean} Whether or not this camera has a current flight with a valid preloadFlightCamera in scene.
|
|
365
|
+
*
|
|
366
|
+
* @private
|
|
367
|
+
*
|
|
368
|
+
*/
|
|
369
|
+
Camera.prototype.canPreloadFlight = function () {
|
|
370
|
+
return defined(this._currentFlight) && this._mode !== SceneMode.SCENE2D;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
Camera.prototype._updateCameraChanged = function () {
|
|
374
|
+
const camera = this;
|
|
375
|
+
|
|
376
|
+
updateCameraDeltas(camera);
|
|
377
|
+
|
|
378
|
+
if (camera._changed.numberOfListeners === 0) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const percentageChanged = camera.percentageChanged;
|
|
383
|
+
|
|
384
|
+
// check heading
|
|
385
|
+
const currentHeading = camera.heading;
|
|
386
|
+
|
|
387
|
+
if (!defined(camera._changedHeading)) {
|
|
388
|
+
camera._changedHeading = currentHeading;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
let headingDelta =
|
|
392
|
+
Math.abs(camera._changedHeading - currentHeading) % CesiumMath.TWO_PI;
|
|
393
|
+
headingDelta =
|
|
394
|
+
headingDelta > CesiumMath.PI
|
|
395
|
+
? CesiumMath.TWO_PI - headingDelta
|
|
396
|
+
: headingDelta;
|
|
397
|
+
|
|
398
|
+
// Since delta is computed as the shortest distance between two angles
|
|
399
|
+
// the percentage is relative to the half circle.
|
|
400
|
+
const headingChangedPercentage = headingDelta / Math.PI;
|
|
401
|
+
|
|
402
|
+
if (headingChangedPercentage > percentageChanged) {
|
|
403
|
+
camera._changedHeading = currentHeading;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// check roll
|
|
407
|
+
const currentRoll = camera.roll;
|
|
408
|
+
|
|
409
|
+
if (!defined(camera._changedRoll)) {
|
|
410
|
+
camera._changedRoll = currentRoll;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
let rollDelta =
|
|
414
|
+
Math.abs(camera._changedRoll - currentRoll) % CesiumMath.TWO_PI;
|
|
415
|
+
rollDelta =
|
|
416
|
+
rollDelta > CesiumMath.PI ? CesiumMath.TWO_PI - rollDelta : rollDelta;
|
|
417
|
+
|
|
418
|
+
// Since delta is computed as the shortest distance between two angles
|
|
419
|
+
// the percentage is relative to the half circle.
|
|
420
|
+
const rollChangedPercentage = rollDelta / Math.PI;
|
|
421
|
+
|
|
422
|
+
if (rollChangedPercentage > percentageChanged) {
|
|
423
|
+
camera._changedRoll = currentRoll;
|
|
424
|
+
}
|
|
425
|
+
if (
|
|
426
|
+
rollChangedPercentage > percentageChanged ||
|
|
427
|
+
headingChangedPercentage > percentageChanged
|
|
428
|
+
) {
|
|
429
|
+
camera._changed.raiseEvent(
|
|
430
|
+
Math.max(rollChangedPercentage, headingChangedPercentage),
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
if (camera._mode === SceneMode.SCENE2D) {
|
|
434
|
+
if (!defined(camera._changedFrustum)) {
|
|
435
|
+
camera._changedPosition = Cartesian3.clone(
|
|
436
|
+
camera.position,
|
|
437
|
+
camera._changedPosition,
|
|
438
|
+
);
|
|
439
|
+
camera._changedFrustum = camera.frustum.clone();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const position = camera.position;
|
|
444
|
+
const lastPosition = camera._changedPosition;
|
|
445
|
+
|
|
446
|
+
const frustum = camera.frustum;
|
|
447
|
+
const lastFrustum = camera._changedFrustum;
|
|
448
|
+
|
|
449
|
+
const x0 = position.x + frustum.left;
|
|
450
|
+
const x1 = position.x + frustum.right;
|
|
451
|
+
const x2 = lastPosition.x + lastFrustum.left;
|
|
452
|
+
const x3 = lastPosition.x + lastFrustum.right;
|
|
453
|
+
|
|
454
|
+
const y0 = position.y + frustum.bottom;
|
|
455
|
+
const y1 = position.y + frustum.top;
|
|
456
|
+
const y2 = lastPosition.y + lastFrustum.bottom;
|
|
457
|
+
const y3 = lastPosition.y + lastFrustum.top;
|
|
458
|
+
|
|
459
|
+
const leftX = Math.max(x0, x2);
|
|
460
|
+
const rightX = Math.min(x1, x3);
|
|
461
|
+
const bottomY = Math.max(y0, y2);
|
|
462
|
+
const topY = Math.min(y1, y3);
|
|
463
|
+
|
|
464
|
+
let areaPercentage;
|
|
465
|
+
if (leftX >= rightX || bottomY >= y1) {
|
|
466
|
+
areaPercentage = 1.0;
|
|
467
|
+
} else {
|
|
468
|
+
let areaRef = lastFrustum;
|
|
469
|
+
if (x0 < x2 && x1 > x3 && y0 < y2 && y1 > y3) {
|
|
470
|
+
areaRef = frustum;
|
|
471
|
+
}
|
|
472
|
+
areaPercentage =
|
|
473
|
+
1.0 -
|
|
474
|
+
((rightX - leftX) * (topY - bottomY)) /
|
|
475
|
+
((areaRef.right - areaRef.left) * (areaRef.top - areaRef.bottom));
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (areaPercentage > percentageChanged) {
|
|
479
|
+
camera._changed.raiseEvent(areaPercentage);
|
|
480
|
+
camera._changedPosition = Cartesian3.clone(
|
|
481
|
+
camera.position,
|
|
482
|
+
camera._changedPosition,
|
|
483
|
+
);
|
|
484
|
+
camera._changedFrustum = camera.frustum.clone(camera._changedFrustum);
|
|
485
|
+
}
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (!defined(camera._changedDirection)) {
|
|
490
|
+
camera._changedPosition = Cartesian3.clone(
|
|
491
|
+
camera.positionWC,
|
|
492
|
+
camera._changedPosition,
|
|
493
|
+
);
|
|
494
|
+
camera._changedDirection = Cartesian3.clone(
|
|
495
|
+
camera.directionWC,
|
|
496
|
+
camera._changedDirection,
|
|
497
|
+
);
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const dirAngle = CesiumMath.acosClamped(
|
|
502
|
+
Cartesian3.dot(camera.directionWC, camera._changedDirection),
|
|
503
|
+
);
|
|
504
|
+
|
|
505
|
+
let dirPercentage;
|
|
506
|
+
if (defined(camera.frustum.fovy)) {
|
|
507
|
+
dirPercentage = dirAngle / (camera.frustum.fovy * 0.5);
|
|
508
|
+
} else {
|
|
509
|
+
dirPercentage = dirAngle;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const distance = Cartesian3.distance(
|
|
513
|
+
camera.positionWC,
|
|
514
|
+
camera._changedPosition,
|
|
515
|
+
);
|
|
516
|
+
const heightPercentage = distance / camera.positionCartographic.height;
|
|
517
|
+
|
|
518
|
+
if (
|
|
519
|
+
dirPercentage > percentageChanged ||
|
|
520
|
+
heightPercentage > percentageChanged
|
|
521
|
+
) {
|
|
522
|
+
camera._changed.raiseEvent(Math.max(dirPercentage, heightPercentage));
|
|
523
|
+
camera._changedPosition = Cartesian3.clone(
|
|
524
|
+
camera.positionWC,
|
|
525
|
+
camera._changedPosition,
|
|
526
|
+
);
|
|
527
|
+
camera._changedDirection = Cartesian3.clone(
|
|
528
|
+
camera.directionWC,
|
|
529
|
+
camera._changedDirection,
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
function convertTransformForColumbusView(camera) {
|
|
535
|
+
Transforms.basisTo2D(
|
|
536
|
+
camera._projection,
|
|
537
|
+
camera._transform,
|
|
538
|
+
camera._actualTransform,
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const scratchCartographic = new Cartographic();
|
|
543
|
+
const scratchCartesian3Projection = new Cartesian3();
|
|
544
|
+
const scratchCartesian3 = new Cartesian3();
|
|
545
|
+
const scratchCartesian4Origin = new Cartesian4();
|
|
546
|
+
const scratchCartesian4NewOrigin = new Cartesian4();
|
|
547
|
+
const scratchCartesian4NewXAxis = new Cartesian4();
|
|
548
|
+
const scratchCartesian4NewYAxis = new Cartesian4();
|
|
549
|
+
const scratchCartesian4NewZAxis = new Cartesian4();
|
|
550
|
+
|
|
551
|
+
function convertTransformFor2D(camera) {
|
|
552
|
+
const projection = camera._projection;
|
|
553
|
+
const ellipsoid = projection.ellipsoid;
|
|
554
|
+
|
|
555
|
+
const origin = Matrix4.getColumn(
|
|
556
|
+
camera._transform,
|
|
557
|
+
3,
|
|
558
|
+
scratchCartesian4Origin,
|
|
559
|
+
);
|
|
560
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
561
|
+
origin,
|
|
562
|
+
scratchCartographic,
|
|
563
|
+
);
|
|
564
|
+
|
|
565
|
+
const projectedPosition = projection.project(
|
|
566
|
+
cartographic,
|
|
567
|
+
scratchCartesian3Projection,
|
|
568
|
+
);
|
|
569
|
+
const newOrigin = scratchCartesian4NewOrigin;
|
|
570
|
+
newOrigin.x = projectedPosition.z;
|
|
571
|
+
newOrigin.y = projectedPosition.x;
|
|
572
|
+
newOrigin.z = projectedPosition.y;
|
|
573
|
+
newOrigin.w = 1.0;
|
|
574
|
+
|
|
575
|
+
const newZAxis = Cartesian4.clone(
|
|
576
|
+
Cartesian4.UNIT_X,
|
|
577
|
+
scratchCartesian4NewZAxis,
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
const xAxis = Cartesian4.add(
|
|
581
|
+
Matrix4.getColumn(camera._transform, 0, scratchCartesian3),
|
|
582
|
+
origin,
|
|
583
|
+
scratchCartesian3,
|
|
584
|
+
);
|
|
585
|
+
ellipsoid.cartesianToCartographic(xAxis, cartographic);
|
|
586
|
+
|
|
587
|
+
projection.project(cartographic, projectedPosition);
|
|
588
|
+
const newXAxis = scratchCartesian4NewXAxis;
|
|
589
|
+
newXAxis.x = projectedPosition.z;
|
|
590
|
+
newXAxis.y = projectedPosition.x;
|
|
591
|
+
newXAxis.z = projectedPosition.y;
|
|
592
|
+
newXAxis.w = 0.0;
|
|
593
|
+
|
|
594
|
+
Cartesian3.subtract(newXAxis, newOrigin, newXAxis);
|
|
595
|
+
newXAxis.x = 0.0;
|
|
596
|
+
|
|
597
|
+
const newYAxis = scratchCartesian4NewYAxis;
|
|
598
|
+
if (Cartesian3.magnitudeSquared(newXAxis) > CesiumMath.EPSILON10) {
|
|
599
|
+
Cartesian3.cross(newZAxis, newXAxis, newYAxis);
|
|
600
|
+
} else {
|
|
601
|
+
const yAxis = Cartesian4.add(
|
|
602
|
+
Matrix4.getColumn(camera._transform, 1, scratchCartesian3),
|
|
603
|
+
origin,
|
|
604
|
+
scratchCartesian3,
|
|
605
|
+
);
|
|
606
|
+
ellipsoid.cartesianToCartographic(yAxis, cartographic);
|
|
607
|
+
|
|
608
|
+
projection.project(cartographic, projectedPosition);
|
|
609
|
+
newYAxis.x = projectedPosition.z;
|
|
610
|
+
newYAxis.y = projectedPosition.x;
|
|
611
|
+
newYAxis.z = projectedPosition.y;
|
|
612
|
+
newYAxis.w = 0.0;
|
|
613
|
+
|
|
614
|
+
Cartesian3.subtract(newYAxis, newOrigin, newYAxis);
|
|
615
|
+
newYAxis.x = 0.0;
|
|
616
|
+
|
|
617
|
+
if (Cartesian3.magnitudeSquared(newYAxis) < CesiumMath.EPSILON10) {
|
|
618
|
+
Cartesian4.clone(Cartesian4.UNIT_Y, newXAxis);
|
|
619
|
+
Cartesian4.clone(Cartesian4.UNIT_Z, newYAxis);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
Cartesian3.cross(newYAxis, newZAxis, newXAxis);
|
|
624
|
+
Cartesian3.normalize(newXAxis, newXAxis);
|
|
625
|
+
Cartesian3.cross(newZAxis, newXAxis, newYAxis);
|
|
626
|
+
Cartesian3.normalize(newYAxis, newYAxis);
|
|
627
|
+
|
|
628
|
+
Matrix4.setColumn(
|
|
629
|
+
camera._actualTransform,
|
|
630
|
+
0,
|
|
631
|
+
newXAxis,
|
|
632
|
+
camera._actualTransform,
|
|
633
|
+
);
|
|
634
|
+
Matrix4.setColumn(
|
|
635
|
+
camera._actualTransform,
|
|
636
|
+
1,
|
|
637
|
+
newYAxis,
|
|
638
|
+
camera._actualTransform,
|
|
639
|
+
);
|
|
640
|
+
Matrix4.setColumn(
|
|
641
|
+
camera._actualTransform,
|
|
642
|
+
2,
|
|
643
|
+
newZAxis,
|
|
644
|
+
camera._actualTransform,
|
|
645
|
+
);
|
|
646
|
+
Matrix4.setColumn(
|
|
647
|
+
camera._actualTransform,
|
|
648
|
+
3,
|
|
649
|
+
newOrigin,
|
|
650
|
+
camera._actualTransform,
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
const scratchCartesian = new Cartesian3();
|
|
655
|
+
|
|
656
|
+
function updateMembers(camera) {
|
|
657
|
+
const mode = camera._mode;
|
|
658
|
+
|
|
659
|
+
let heightChanged = false;
|
|
660
|
+
let height = 0.0;
|
|
661
|
+
if (mode === SceneMode.SCENE2D) {
|
|
662
|
+
height = camera.frustum.right - camera.frustum.left;
|
|
663
|
+
heightChanged = height !== camera._positionCartographic.height;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
let position = camera._position;
|
|
667
|
+
const positionChanged =
|
|
668
|
+
!Cartesian3.equals(position, camera.position) || heightChanged;
|
|
669
|
+
if (positionChanged) {
|
|
670
|
+
position = Cartesian3.clone(camera.position, camera._position);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
let direction = camera._direction;
|
|
674
|
+
const directionChanged = !Cartesian3.equals(direction, camera.direction);
|
|
675
|
+
if (directionChanged) {
|
|
676
|
+
Cartesian3.normalize(camera.direction, camera.direction);
|
|
677
|
+
direction = Cartesian3.clone(camera.direction, camera._direction);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
let up = camera._up;
|
|
681
|
+
const upChanged = !Cartesian3.equals(up, camera.up);
|
|
682
|
+
if (upChanged) {
|
|
683
|
+
Cartesian3.normalize(camera.up, camera.up);
|
|
684
|
+
up = Cartesian3.clone(camera.up, camera._up);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
let right = camera._right;
|
|
688
|
+
const rightChanged = !Cartesian3.equals(right, camera.right);
|
|
689
|
+
if (rightChanged) {
|
|
690
|
+
Cartesian3.normalize(camera.right, camera.right);
|
|
691
|
+
right = Cartesian3.clone(camera.right, camera._right);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
const transformChanged = camera._transformChanged || camera._modeChanged;
|
|
695
|
+
camera._transformChanged = false;
|
|
696
|
+
|
|
697
|
+
if (transformChanged) {
|
|
698
|
+
Matrix4.inverseTransformation(camera._transform, camera._invTransform);
|
|
699
|
+
|
|
700
|
+
if (
|
|
701
|
+
camera._mode === SceneMode.COLUMBUS_VIEW ||
|
|
702
|
+
camera._mode === SceneMode.SCENE2D
|
|
703
|
+
) {
|
|
704
|
+
if (Matrix4.equals(Matrix4.IDENTITY, camera._transform)) {
|
|
705
|
+
Matrix4.clone(Camera.TRANSFORM_2D, camera._actualTransform);
|
|
706
|
+
} else if (camera._mode === SceneMode.COLUMBUS_VIEW) {
|
|
707
|
+
convertTransformForColumbusView(camera);
|
|
708
|
+
} else {
|
|
709
|
+
convertTransformFor2D(camera);
|
|
710
|
+
}
|
|
711
|
+
} else {
|
|
712
|
+
Matrix4.clone(camera._transform, camera._actualTransform);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
Matrix4.inverseTransformation(
|
|
716
|
+
camera._actualTransform,
|
|
717
|
+
camera._actualInvTransform,
|
|
718
|
+
);
|
|
719
|
+
|
|
720
|
+
camera._modeChanged = false;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
const transform = camera._actualTransform;
|
|
724
|
+
|
|
725
|
+
if (positionChanged || transformChanged) {
|
|
726
|
+
camera._positionWC = Matrix4.multiplyByPoint(
|
|
727
|
+
transform,
|
|
728
|
+
position,
|
|
729
|
+
camera._positionWC,
|
|
730
|
+
);
|
|
731
|
+
|
|
732
|
+
// Compute the Cartographic position of the camera.
|
|
733
|
+
if (mode === SceneMode.SCENE3D || mode === SceneMode.MORPHING) {
|
|
734
|
+
camera._positionCartographic =
|
|
735
|
+
camera._projection.ellipsoid.cartesianToCartographic(
|
|
736
|
+
camera._positionWC,
|
|
737
|
+
camera._positionCartographic,
|
|
738
|
+
);
|
|
739
|
+
} else {
|
|
740
|
+
// The camera position is expressed in the 2D coordinate system where the Y axis is to the East,
|
|
741
|
+
// the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where
|
|
742
|
+
// X is to the East, Y is to the North, and Z is out of the local horizontal plane.
|
|
743
|
+
const positionENU = scratchCartesian;
|
|
744
|
+
positionENU.x = camera._positionWC.y;
|
|
745
|
+
positionENU.y = camera._positionWC.z;
|
|
746
|
+
positionENU.z = camera._positionWC.x;
|
|
747
|
+
|
|
748
|
+
// In 2D, the camera height is always 12.7 million meters.
|
|
749
|
+
// The apparent height is equal to half the frustum width.
|
|
750
|
+
if (mode === SceneMode.SCENE2D) {
|
|
751
|
+
positionENU.z = height;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
camera._projection.unproject(positionENU, camera._positionCartographic);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (directionChanged || upChanged || rightChanged) {
|
|
759
|
+
const det = Cartesian3.dot(
|
|
760
|
+
direction,
|
|
761
|
+
Cartesian3.cross(up, right, scratchCartesian),
|
|
762
|
+
);
|
|
763
|
+
if (Math.abs(1.0 - det) > CesiumMath.EPSILON2) {
|
|
764
|
+
//orthonormalize axes
|
|
765
|
+
const invUpMag = 1.0 / Cartesian3.magnitudeSquared(up);
|
|
766
|
+
const scalar = Cartesian3.dot(up, direction) * invUpMag;
|
|
767
|
+
const w0 = Cartesian3.multiplyByScalar(
|
|
768
|
+
direction,
|
|
769
|
+
scalar,
|
|
770
|
+
scratchCartesian,
|
|
771
|
+
);
|
|
772
|
+
up = Cartesian3.normalize(
|
|
773
|
+
Cartesian3.subtract(up, w0, camera._up),
|
|
774
|
+
camera._up,
|
|
775
|
+
);
|
|
776
|
+
Cartesian3.clone(up, camera.up);
|
|
777
|
+
|
|
778
|
+
right = Cartesian3.cross(direction, up, camera._right);
|
|
779
|
+
Cartesian3.clone(right, camera.right);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
if (directionChanged || transformChanged) {
|
|
784
|
+
camera._directionWC = Matrix4.multiplyByPointAsVector(
|
|
785
|
+
transform,
|
|
786
|
+
direction,
|
|
787
|
+
camera._directionWC,
|
|
788
|
+
);
|
|
789
|
+
Cartesian3.normalize(camera._directionWC, camera._directionWC);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
if (upChanged || transformChanged) {
|
|
793
|
+
camera._upWC = Matrix4.multiplyByPointAsVector(transform, up, camera._upWC);
|
|
794
|
+
Cartesian3.normalize(camera._upWC, camera._upWC);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
if (rightChanged || transformChanged) {
|
|
798
|
+
camera._rightWC = Matrix4.multiplyByPointAsVector(
|
|
799
|
+
transform,
|
|
800
|
+
right,
|
|
801
|
+
camera._rightWC,
|
|
802
|
+
);
|
|
803
|
+
Cartesian3.normalize(camera._rightWC, camera._rightWC);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (
|
|
807
|
+
positionChanged ||
|
|
808
|
+
directionChanged ||
|
|
809
|
+
upChanged ||
|
|
810
|
+
rightChanged ||
|
|
811
|
+
transformChanged
|
|
812
|
+
) {
|
|
813
|
+
updateViewMatrix(camera);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function getHeading(direction, up) {
|
|
818
|
+
let heading;
|
|
819
|
+
if (
|
|
820
|
+
!CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)
|
|
821
|
+
) {
|
|
822
|
+
heading = Math.atan2(direction.y, direction.x) - CesiumMath.PI_OVER_TWO;
|
|
823
|
+
} else {
|
|
824
|
+
heading = Math.atan2(up.y, up.x) - CesiumMath.PI_OVER_TWO;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
return CesiumMath.TWO_PI - CesiumMath.zeroToTwoPi(heading);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
function getPitch(direction) {
|
|
831
|
+
return CesiumMath.PI_OVER_TWO - CesiumMath.acosClamped(direction.z);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
function getRoll(direction, up, right) {
|
|
835
|
+
let roll = 0.0;
|
|
836
|
+
if (
|
|
837
|
+
!CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)
|
|
838
|
+
) {
|
|
839
|
+
roll = Math.atan2(-right.z, up.z);
|
|
840
|
+
roll = CesiumMath.zeroToTwoPi(roll + CesiumMath.TWO_PI);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
return roll;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
const scratchHPRMatrix1 = new Matrix4();
|
|
847
|
+
const scratchHPRMatrix2 = new Matrix4();
|
|
848
|
+
|
|
849
|
+
Object.defineProperties(Camera.prototype, {
|
|
850
|
+
/**
|
|
851
|
+
* Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
|
|
852
|
+
* @memberof Camera.prototype
|
|
853
|
+
*
|
|
854
|
+
* @type {Matrix4}
|
|
855
|
+
* @readonly
|
|
856
|
+
*
|
|
857
|
+
* @default {@link Matrix4.IDENTITY}
|
|
858
|
+
*/
|
|
859
|
+
transform: {
|
|
860
|
+
get: function () {
|
|
861
|
+
return this._transform;
|
|
862
|
+
},
|
|
863
|
+
},
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Gets the inverse camera transform.
|
|
867
|
+
* @memberof Camera.prototype
|
|
868
|
+
*
|
|
869
|
+
* @type {Matrix4}
|
|
870
|
+
* @readonly
|
|
871
|
+
*
|
|
872
|
+
* @default {@link Matrix4.IDENTITY}
|
|
873
|
+
*/
|
|
874
|
+
inverseTransform: {
|
|
875
|
+
get: function () {
|
|
876
|
+
updateMembers(this);
|
|
877
|
+
return this._invTransform;
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Gets the view matrix.
|
|
883
|
+
* @memberof Camera.prototype
|
|
884
|
+
*
|
|
885
|
+
* @type {Matrix4}
|
|
886
|
+
* @readonly
|
|
887
|
+
*
|
|
888
|
+
* @see Camera#inverseViewMatrix
|
|
889
|
+
*/
|
|
890
|
+
viewMatrix: {
|
|
891
|
+
get: function () {
|
|
892
|
+
updateMembers(this);
|
|
893
|
+
return this._viewMatrix;
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Gets the inverse view matrix.
|
|
899
|
+
* @memberof Camera.prototype
|
|
900
|
+
*
|
|
901
|
+
* @type {Matrix4}
|
|
902
|
+
* @readonly
|
|
903
|
+
*
|
|
904
|
+
* @see Camera#viewMatrix
|
|
905
|
+
*/
|
|
906
|
+
inverseViewMatrix: {
|
|
907
|
+
get: function () {
|
|
908
|
+
updateMembers(this);
|
|
909
|
+
return this._invViewMatrix;
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Gets the {@link Cartographic} position of the camera, with longitude and latitude
|
|
915
|
+
* expressed in radians and height in meters. In 2D and Columbus View, it is possible
|
|
916
|
+
* for the returned longitude and latitude to be outside the range of valid longitudes
|
|
917
|
+
* and latitudes when the camera is outside the map.
|
|
918
|
+
* @memberof Camera.prototype
|
|
919
|
+
*
|
|
920
|
+
* @type {Cartographic}
|
|
921
|
+
* @readonly
|
|
922
|
+
*/
|
|
923
|
+
positionCartographic: {
|
|
924
|
+
get: function () {
|
|
925
|
+
updateMembers(this);
|
|
926
|
+
return this._positionCartographic;
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Gets the position of the camera in world coordinates.
|
|
932
|
+
* @memberof Camera.prototype
|
|
933
|
+
*
|
|
934
|
+
* @type {Cartesian3}
|
|
935
|
+
* @readonly
|
|
936
|
+
*/
|
|
937
|
+
positionWC: {
|
|
938
|
+
get: function () {
|
|
939
|
+
updateMembers(this);
|
|
940
|
+
return this._positionWC;
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Gets the view direction of the camera in world coordinates.
|
|
946
|
+
* @memberof Camera.prototype
|
|
947
|
+
*
|
|
948
|
+
* @type {Cartesian3}
|
|
949
|
+
* @readonly
|
|
950
|
+
*/
|
|
951
|
+
directionWC: {
|
|
952
|
+
get: function () {
|
|
953
|
+
updateMembers(this);
|
|
954
|
+
return this._directionWC;
|
|
955
|
+
},
|
|
956
|
+
},
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Gets the up direction of the camera in world coordinates.
|
|
960
|
+
* @memberof Camera.prototype
|
|
961
|
+
*
|
|
962
|
+
* @type {Cartesian3}
|
|
963
|
+
* @readonly
|
|
964
|
+
*/
|
|
965
|
+
upWC: {
|
|
966
|
+
get: function () {
|
|
967
|
+
updateMembers(this);
|
|
968
|
+
return this._upWC;
|
|
969
|
+
},
|
|
970
|
+
},
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Gets the right direction of the camera in world coordinates.
|
|
974
|
+
* @memberof Camera.prototype
|
|
975
|
+
*
|
|
976
|
+
* @type {Cartesian3}
|
|
977
|
+
* @readonly
|
|
978
|
+
*/
|
|
979
|
+
rightWC: {
|
|
980
|
+
get: function () {
|
|
981
|
+
updateMembers(this);
|
|
982
|
+
return this._rightWC;
|
|
983
|
+
},
|
|
984
|
+
},
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Gets the camera heading in radians.
|
|
988
|
+
* @memberof Camera.prototype
|
|
989
|
+
*
|
|
990
|
+
* @type {number}
|
|
991
|
+
* @readonly
|
|
992
|
+
*/
|
|
993
|
+
heading: {
|
|
994
|
+
get: function () {
|
|
995
|
+
if (this._mode !== SceneMode.MORPHING) {
|
|
996
|
+
const ellipsoid = this._projection.ellipsoid;
|
|
997
|
+
|
|
998
|
+
const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
|
|
999
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1000
|
+
this.positionWC,
|
|
1001
|
+
ellipsoid,
|
|
1002
|
+
scratchHPRMatrix2,
|
|
1003
|
+
);
|
|
1004
|
+
this._setTransform(transform);
|
|
1005
|
+
|
|
1006
|
+
const heading = getHeading(this.direction, this.up);
|
|
1007
|
+
|
|
1008
|
+
this._setTransform(oldTransform);
|
|
1009
|
+
|
|
1010
|
+
return heading;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return undefined;
|
|
1014
|
+
},
|
|
1015
|
+
},
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Gets the camera pitch in radians.
|
|
1019
|
+
* @memberof Camera.prototype
|
|
1020
|
+
*
|
|
1021
|
+
* @type {number}
|
|
1022
|
+
* @readonly
|
|
1023
|
+
*/
|
|
1024
|
+
pitch: {
|
|
1025
|
+
get: function () {
|
|
1026
|
+
if (this._mode !== SceneMode.MORPHING) {
|
|
1027
|
+
const ellipsoid = this._projection.ellipsoid;
|
|
1028
|
+
|
|
1029
|
+
const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
|
|
1030
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1031
|
+
this.positionWC,
|
|
1032
|
+
ellipsoid,
|
|
1033
|
+
scratchHPRMatrix2,
|
|
1034
|
+
);
|
|
1035
|
+
this._setTransform(transform);
|
|
1036
|
+
|
|
1037
|
+
const pitch = getPitch(this.direction);
|
|
1038
|
+
|
|
1039
|
+
this._setTransform(oldTransform);
|
|
1040
|
+
|
|
1041
|
+
return pitch;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
return undefined;
|
|
1045
|
+
},
|
|
1046
|
+
},
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Gets the camera roll in radians.
|
|
1050
|
+
* @memberof Camera.prototype
|
|
1051
|
+
*
|
|
1052
|
+
* @type {number}
|
|
1053
|
+
* @readonly
|
|
1054
|
+
*/
|
|
1055
|
+
roll: {
|
|
1056
|
+
get: function () {
|
|
1057
|
+
if (this._mode !== SceneMode.MORPHING) {
|
|
1058
|
+
const ellipsoid = this._projection.ellipsoid;
|
|
1059
|
+
|
|
1060
|
+
const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
|
|
1061
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1062
|
+
this.positionWC,
|
|
1063
|
+
ellipsoid,
|
|
1064
|
+
scratchHPRMatrix2,
|
|
1065
|
+
);
|
|
1066
|
+
this._setTransform(transform);
|
|
1067
|
+
|
|
1068
|
+
const roll = getRoll(this.direction, this.up, this.right);
|
|
1069
|
+
|
|
1070
|
+
this._setTransform(oldTransform);
|
|
1071
|
+
|
|
1072
|
+
return roll;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return undefined;
|
|
1076
|
+
},
|
|
1077
|
+
},
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Gets the event that will be raised at when the camera starts to move.
|
|
1081
|
+
* @memberof Camera.prototype
|
|
1082
|
+
* @type {Event}
|
|
1083
|
+
* @readonly
|
|
1084
|
+
*/
|
|
1085
|
+
moveStart: {
|
|
1086
|
+
get: function () {
|
|
1087
|
+
return this._moveStart;
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Gets the event that will be raised when the camera has stopped moving.
|
|
1093
|
+
* @memberof Camera.prototype
|
|
1094
|
+
* @type {Event}
|
|
1095
|
+
* @readonly
|
|
1096
|
+
*/
|
|
1097
|
+
moveEnd: {
|
|
1098
|
+
get: function () {
|
|
1099
|
+
return this._moveEnd;
|
|
1100
|
+
},
|
|
1101
|
+
},
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
|
|
1105
|
+
* @memberof Camera.prototype
|
|
1106
|
+
* @type {Event}
|
|
1107
|
+
* @readonly
|
|
1108
|
+
*/
|
|
1109
|
+
changed: {
|
|
1110
|
+
get: function () {
|
|
1111
|
+
return this._changed;
|
|
1112
|
+
},
|
|
1113
|
+
},
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* @private
|
|
1118
|
+
*/
|
|
1119
|
+
Camera.prototype.update = function (mode) {
|
|
1120
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1121
|
+
if (!defined(mode)) {
|
|
1122
|
+
throw new DeveloperError("mode is required.");
|
|
1123
|
+
}
|
|
1124
|
+
if (
|
|
1125
|
+
mode === SceneMode.SCENE2D &&
|
|
1126
|
+
!(this.frustum instanceof OrthographicOffCenterFrustum)
|
|
1127
|
+
) {
|
|
1128
|
+
throw new DeveloperError(
|
|
1129
|
+
"An OrthographicOffCenterFrustum is required in 2D.",
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
if (
|
|
1133
|
+
(mode === SceneMode.SCENE3D || mode === SceneMode.COLUMBUS_VIEW) &&
|
|
1134
|
+
!(this.frustum instanceof PerspectiveFrustum) &&
|
|
1135
|
+
!(this.frustum instanceof OrthographicFrustum)
|
|
1136
|
+
) {
|
|
1137
|
+
throw new DeveloperError(
|
|
1138
|
+
"A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view",
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
//>>includeEnd('debug');
|
|
1142
|
+
|
|
1143
|
+
let updateFrustum = false;
|
|
1144
|
+
if (mode !== this._mode) {
|
|
1145
|
+
this._mode = mode;
|
|
1146
|
+
this._modeChanged = mode !== SceneMode.MORPHING;
|
|
1147
|
+
updateFrustum = this._mode === SceneMode.SCENE2D;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
if (updateFrustum) {
|
|
1151
|
+
const frustum = (this._max2Dfrustum = this.frustum.clone());
|
|
1152
|
+
|
|
1153
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1154
|
+
if (!(frustum instanceof OrthographicOffCenterFrustum)) {
|
|
1155
|
+
throw new DeveloperError(
|
|
1156
|
+
"The camera frustum is expected to be orthographic for 2D camera control.",
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
//>>includeEnd('debug');
|
|
1160
|
+
|
|
1161
|
+
const maxZoomOut = 2.0;
|
|
1162
|
+
const ratio = frustum.top / frustum.right;
|
|
1163
|
+
frustum.right = this._maxCoord.x * maxZoomOut;
|
|
1164
|
+
frustum.left = -frustum.right;
|
|
1165
|
+
frustum.top = ratio * frustum.right;
|
|
1166
|
+
frustum.bottom = -frustum.top;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
1170
|
+
clampMove2D(this, this.position);
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
const setTransformPosition = new Cartesian3();
|
|
1175
|
+
const setTransformUp = new Cartesian3();
|
|
1176
|
+
const setTransformDirection = new Cartesian3();
|
|
1177
|
+
|
|
1178
|
+
Camera.prototype._setTransform = function (transform) {
|
|
1179
|
+
const position = Cartesian3.clone(this.positionWC, setTransformPosition);
|
|
1180
|
+
const up = Cartesian3.clone(this.upWC, setTransformUp);
|
|
1181
|
+
const direction = Cartesian3.clone(this.directionWC, setTransformDirection);
|
|
1182
|
+
|
|
1183
|
+
Matrix4.clone(transform, this._transform);
|
|
1184
|
+
this._transformChanged = true;
|
|
1185
|
+
updateMembers(this);
|
|
1186
|
+
const inverse = this._actualInvTransform;
|
|
1187
|
+
|
|
1188
|
+
Matrix4.multiplyByPoint(inverse, position, this.position);
|
|
1189
|
+
Matrix4.multiplyByPointAsVector(inverse, direction, this.direction);
|
|
1190
|
+
Matrix4.multiplyByPointAsVector(inverse, up, this.up);
|
|
1191
|
+
Cartesian3.cross(this.direction, this.up, this.right);
|
|
1192
|
+
|
|
1193
|
+
updateMembers(this);
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1196
|
+
const scratchAdjustOrthographicFrustumMousePosition = new Cartesian2();
|
|
1197
|
+
const scratchPickRay = new Ray();
|
|
1198
|
+
const scratchRayIntersection = new Cartesian3();
|
|
1199
|
+
const scratchDepthIntersection = new Cartesian3();
|
|
1200
|
+
|
|
1201
|
+
function calculateOrthographicFrustumWidth(camera) {
|
|
1202
|
+
// Camera is fixed to an object, so keep frustum width constant.
|
|
1203
|
+
if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {
|
|
1204
|
+
return Cartesian3.magnitude(camera.position);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
const scene = camera._scene;
|
|
1208
|
+
const globe = scene.globe;
|
|
1209
|
+
|
|
1210
|
+
const mousePosition = scratchAdjustOrthographicFrustumMousePosition;
|
|
1211
|
+
mousePosition.x = scene.drawingBufferWidth / scene.pixelRatio / 2.0;
|
|
1212
|
+
mousePosition.y = scene.drawingBufferHeight / scene.pixelRatio / 2.0;
|
|
1213
|
+
|
|
1214
|
+
let rayIntersection;
|
|
1215
|
+
if (defined(globe)) {
|
|
1216
|
+
const ray = camera.getPickRay(mousePosition, scratchPickRay);
|
|
1217
|
+
rayIntersection = globe.pickWorldCoordinates(
|
|
1218
|
+
ray,
|
|
1219
|
+
scene,
|
|
1220
|
+
true,
|
|
1221
|
+
scratchRayIntersection,
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
let depthIntersection;
|
|
1226
|
+
if (scene.pickPositionSupported) {
|
|
1227
|
+
depthIntersection = scene.pickPositionWorldCoordinates(
|
|
1228
|
+
mousePosition,
|
|
1229
|
+
scratchDepthIntersection,
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
let distance;
|
|
1234
|
+
if (defined(rayIntersection) || defined(depthIntersection)) {
|
|
1235
|
+
const depthDistance = defined(depthIntersection)
|
|
1236
|
+
? Cartesian3.distance(depthIntersection, camera.positionWC)
|
|
1237
|
+
: Number.POSITIVE_INFINITY;
|
|
1238
|
+
const rayDistance = defined(rayIntersection)
|
|
1239
|
+
? Cartesian3.distance(rayIntersection, camera.positionWC)
|
|
1240
|
+
: Number.POSITIVE_INFINITY;
|
|
1241
|
+
distance = Math.min(depthDistance, rayDistance);
|
|
1242
|
+
} else {
|
|
1243
|
+
distance = Math.max(camera.positionCartographic.height, 0.0);
|
|
1244
|
+
}
|
|
1245
|
+
return distance;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
Camera.prototype._adjustOrthographicFrustum = function (zooming) {
|
|
1249
|
+
if (!(this.frustum instanceof OrthographicFrustum)) {
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
if (!zooming && this._positionCartographic.height < 150000.0) {
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
this.frustum.width = calculateOrthographicFrustumWidth(this);
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
const scratchSetViewCartesian = new Cartesian3();
|
|
1261
|
+
const scratchSetViewTransform1 = new Matrix4();
|
|
1262
|
+
const scratchSetViewTransform2 = new Matrix4();
|
|
1263
|
+
const scratchSetViewQuaternion = new Quaternion();
|
|
1264
|
+
const scratchSetViewMatrix3 = new Matrix3();
|
|
1265
|
+
const scratchSetViewCartographic = new Cartographic();
|
|
1266
|
+
|
|
1267
|
+
function setView3D(camera, position, hpr) {
|
|
1268
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1269
|
+
if (isNaN(position.x) || isNaN(position.y) || isNaN(position.z)) {
|
|
1270
|
+
throw new DeveloperError("position has a NaN component");
|
|
1271
|
+
}
|
|
1272
|
+
//>>includeEnd('debug');
|
|
1273
|
+
const currentTransform = Matrix4.clone(
|
|
1274
|
+
camera.transform,
|
|
1275
|
+
scratchSetViewTransform1,
|
|
1276
|
+
);
|
|
1277
|
+
const localTransform = Transforms.eastNorthUpToFixedFrame(
|
|
1278
|
+
position,
|
|
1279
|
+
camera._projection.ellipsoid,
|
|
1280
|
+
scratchSetViewTransform2,
|
|
1281
|
+
);
|
|
1282
|
+
camera._setTransform(localTransform);
|
|
1283
|
+
|
|
1284
|
+
Cartesian3.clone(Cartesian3.ZERO, camera.position);
|
|
1285
|
+
hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
|
|
1286
|
+
|
|
1287
|
+
const rotQuat = Quaternion.fromHeadingPitchRoll(
|
|
1288
|
+
hpr,
|
|
1289
|
+
scratchSetViewQuaternion,
|
|
1290
|
+
);
|
|
1291
|
+
const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
|
|
1292
|
+
|
|
1293
|
+
Matrix3.getColumn(rotMat, 0, camera.direction);
|
|
1294
|
+
Matrix3.getColumn(rotMat, 2, camera.up);
|
|
1295
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
1296
|
+
|
|
1297
|
+
camera._setTransform(currentTransform);
|
|
1298
|
+
|
|
1299
|
+
camera._adjustOrthographicFrustum(true);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function setViewCV(camera, position, hpr, convert) {
|
|
1303
|
+
const currentTransform = Matrix4.clone(
|
|
1304
|
+
camera.transform,
|
|
1305
|
+
scratchSetViewTransform1,
|
|
1306
|
+
);
|
|
1307
|
+
camera._setTransform(Matrix4.IDENTITY);
|
|
1308
|
+
|
|
1309
|
+
if (!Cartesian3.equals(position, camera.positionWC)) {
|
|
1310
|
+
if (convert) {
|
|
1311
|
+
const projection = camera._projection;
|
|
1312
|
+
const cartographic = projection.ellipsoid.cartesianToCartographic(
|
|
1313
|
+
position,
|
|
1314
|
+
scratchSetViewCartographic,
|
|
1315
|
+
);
|
|
1316
|
+
position = projection.project(cartographic, scratchSetViewCartesian);
|
|
1317
|
+
}
|
|
1318
|
+
Cartesian3.clone(position, camera.position);
|
|
1319
|
+
}
|
|
1320
|
+
hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
|
|
1321
|
+
|
|
1322
|
+
const rotQuat = Quaternion.fromHeadingPitchRoll(
|
|
1323
|
+
hpr,
|
|
1324
|
+
scratchSetViewQuaternion,
|
|
1325
|
+
);
|
|
1326
|
+
const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
|
|
1327
|
+
|
|
1328
|
+
Matrix3.getColumn(rotMat, 0, camera.direction);
|
|
1329
|
+
Matrix3.getColumn(rotMat, 2, camera.up);
|
|
1330
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
1331
|
+
|
|
1332
|
+
camera._setTransform(currentTransform);
|
|
1333
|
+
|
|
1334
|
+
camera._adjustOrthographicFrustum(true);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
function setView2D(camera, position, hpr, convert) {
|
|
1338
|
+
const currentTransform = Matrix4.clone(
|
|
1339
|
+
camera.transform,
|
|
1340
|
+
scratchSetViewTransform1,
|
|
1341
|
+
);
|
|
1342
|
+
camera._setTransform(Matrix4.IDENTITY);
|
|
1343
|
+
|
|
1344
|
+
if (!Cartesian3.equals(position, camera.positionWC)) {
|
|
1345
|
+
if (convert) {
|
|
1346
|
+
const projection = camera._projection;
|
|
1347
|
+
const cartographic = projection.ellipsoid.cartesianToCartographic(
|
|
1348
|
+
position,
|
|
1349
|
+
scratchSetViewCartographic,
|
|
1350
|
+
);
|
|
1351
|
+
position = projection.project(cartographic, scratchSetViewCartesian);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
Cartesian2.clone(position, camera.position);
|
|
1355
|
+
|
|
1356
|
+
const newLeft = -position.z * 0.5;
|
|
1357
|
+
const newRight = -newLeft;
|
|
1358
|
+
|
|
1359
|
+
const frustum = camera.frustum;
|
|
1360
|
+
if (newRight > newLeft) {
|
|
1361
|
+
const ratio = frustum.top / frustum.right;
|
|
1362
|
+
frustum.right = newRight;
|
|
1363
|
+
frustum.left = newLeft;
|
|
1364
|
+
frustum.top = frustum.right * ratio;
|
|
1365
|
+
frustum.bottom = -frustum.top;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
|
|
1370
|
+
hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
|
|
1371
|
+
hpr.pitch = -CesiumMath.PI_OVER_TWO;
|
|
1372
|
+
hpr.roll = 0.0;
|
|
1373
|
+
const rotQuat = Quaternion.fromHeadingPitchRoll(
|
|
1374
|
+
hpr,
|
|
1375
|
+
scratchSetViewQuaternion,
|
|
1376
|
+
);
|
|
1377
|
+
const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
|
|
1378
|
+
|
|
1379
|
+
Matrix3.getColumn(rotMat, 2, camera.up);
|
|
1380
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
camera._setTransform(currentTransform);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
const scratchToHPRDirection = new Cartesian3();
|
|
1387
|
+
const scratchToHPRUp = new Cartesian3();
|
|
1388
|
+
const scratchToHPRRight = new Cartesian3();
|
|
1389
|
+
|
|
1390
|
+
function directionUpToHeadingPitchRoll(camera, position, orientation, result) {
|
|
1391
|
+
const direction = Cartesian3.clone(
|
|
1392
|
+
orientation.direction,
|
|
1393
|
+
scratchToHPRDirection,
|
|
1394
|
+
);
|
|
1395
|
+
const up = Cartesian3.clone(orientation.up, scratchToHPRUp);
|
|
1396
|
+
|
|
1397
|
+
if (camera._scene.mode === SceneMode.SCENE3D) {
|
|
1398
|
+
const ellipsoid = camera._projection.ellipsoid;
|
|
1399
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1400
|
+
position,
|
|
1401
|
+
ellipsoid,
|
|
1402
|
+
scratchHPRMatrix1,
|
|
1403
|
+
);
|
|
1404
|
+
const invTransform = Matrix4.inverseTransformation(
|
|
1405
|
+
transform,
|
|
1406
|
+
scratchHPRMatrix2,
|
|
1407
|
+
);
|
|
1408
|
+
|
|
1409
|
+
Matrix4.multiplyByPointAsVector(invTransform, direction, direction);
|
|
1410
|
+
Matrix4.multiplyByPointAsVector(invTransform, up, up);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
const right = Cartesian3.cross(direction, up, scratchToHPRRight);
|
|
1414
|
+
|
|
1415
|
+
result.heading = getHeading(direction, up);
|
|
1416
|
+
result.pitch = getPitch(direction);
|
|
1417
|
+
result.roll = getRoll(direction, up, right);
|
|
1418
|
+
|
|
1419
|
+
return result;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
const scratchSetViewOptions = {
|
|
1423
|
+
destination: undefined,
|
|
1424
|
+
orientation: {
|
|
1425
|
+
direction: undefined,
|
|
1426
|
+
up: undefined,
|
|
1427
|
+
heading: undefined,
|
|
1428
|
+
pitch: undefined,
|
|
1429
|
+
roll: undefined,
|
|
1430
|
+
},
|
|
1431
|
+
convert: undefined,
|
|
1432
|
+
endTransform: undefined,
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
const scratchHpr = new HeadingPitchRoll();
|
|
1436
|
+
/**
|
|
1437
|
+
* Sets the camera position, orientation and transform.
|
|
1438
|
+
*
|
|
1439
|
+
* @param {object} options Object with the following properties:
|
|
1440
|
+
* @param {Cartesian3|Rectangle} [options.destination] The final position of the camera in world coordinates or a rectangle that would be visible from a top-down view.
|
|
1441
|
+
* @param {HeadingPitchRollValues|DirectionUp} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
|
|
1442
|
+
* towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
|
|
1443
|
+
* y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
|
|
1444
|
+
* @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame of the camera.
|
|
1445
|
+
* @param {boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
|
|
1446
|
+
*
|
|
1447
|
+
* @example
|
|
1448
|
+
* // 1. Set position with a top-down view
|
|
1449
|
+
* viewer.camera.setView({
|
|
1450
|
+
* destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
|
|
1451
|
+
* });
|
|
1452
|
+
*
|
|
1453
|
+
* // 2 Set view with heading, pitch and roll
|
|
1454
|
+
* viewer.camera.setView({
|
|
1455
|
+
* destination : cartesianPosition,
|
|
1456
|
+
* orientation: {
|
|
1457
|
+
* heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
|
|
1458
|
+
* pitch : Cesium.Math.toRadians(-90), // default value (looking down)
|
|
1459
|
+
* roll : 0.0 // default value
|
|
1460
|
+
* }
|
|
1461
|
+
* });
|
|
1462
|
+
*
|
|
1463
|
+
* // 3. Change heading, pitch and roll with the camera position remaining the same.
|
|
1464
|
+
* viewer.camera.setView({
|
|
1465
|
+
* orientation: {
|
|
1466
|
+
* heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
|
|
1467
|
+
* pitch : Cesium.Math.toRadians(-90), // default value (looking down)
|
|
1468
|
+
* roll : 0.0 // default value
|
|
1469
|
+
* }
|
|
1470
|
+
* });
|
|
1471
|
+
*
|
|
1472
|
+
*
|
|
1473
|
+
* // 4. View rectangle with a top-down view
|
|
1474
|
+
* viewer.camera.setView({
|
|
1475
|
+
* destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
|
|
1476
|
+
* });
|
|
1477
|
+
*
|
|
1478
|
+
* // 5. Set position with an orientation using unit vectors.
|
|
1479
|
+
* viewer.camera.setView({
|
|
1480
|
+
* destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
|
|
1481
|
+
* orientation : {
|
|
1482
|
+
* direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
|
|
1483
|
+
* up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
|
|
1484
|
+
* }
|
|
1485
|
+
* });
|
|
1486
|
+
*/
|
|
1487
|
+
Camera.prototype.setView = function (options) {
|
|
1488
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
1489
|
+
let orientation = options.orientation ?? Frozen.EMPTY_OBJECT;
|
|
1490
|
+
|
|
1491
|
+
const mode = this._mode;
|
|
1492
|
+
if (mode === SceneMode.MORPHING) {
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
if (defined(options.endTransform)) {
|
|
1497
|
+
this._setTransform(options.endTransform);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
let convert = options.convert ?? true;
|
|
1501
|
+
let destination =
|
|
1502
|
+
options.destination ??
|
|
1503
|
+
Cartesian3.clone(this.positionWC, scratchSetViewCartesian);
|
|
1504
|
+
if (defined(destination) && defined(destination.west)) {
|
|
1505
|
+
destination = this.getRectangleCameraCoordinates(
|
|
1506
|
+
destination,
|
|
1507
|
+
scratchSetViewCartesian,
|
|
1508
|
+
);
|
|
1509
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1510
|
+
// destination.z may be null in 2D, but .x and .y should be numeric
|
|
1511
|
+
if (isNaN(destination.x) || isNaN(destination.y)) {
|
|
1512
|
+
throw new DeveloperError(`destination has a NaN component`);
|
|
1513
|
+
}
|
|
1514
|
+
//>>includeEnd('debug');
|
|
1515
|
+
convert = false;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
if (defined(orientation.direction)) {
|
|
1519
|
+
orientation = directionUpToHeadingPitchRoll(
|
|
1520
|
+
this,
|
|
1521
|
+
destination,
|
|
1522
|
+
orientation,
|
|
1523
|
+
scratchSetViewOptions.orientation,
|
|
1524
|
+
);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
scratchHpr.heading = orientation.heading ?? 0.0;
|
|
1528
|
+
scratchHpr.pitch = orientation.pitch ?? -CesiumMath.PI_OVER_TWO;
|
|
1529
|
+
scratchHpr.roll = orientation.roll ?? 0.0;
|
|
1530
|
+
|
|
1531
|
+
if (mode === SceneMode.SCENE3D) {
|
|
1532
|
+
setView3D(this, destination, scratchHpr);
|
|
1533
|
+
} else if (mode === SceneMode.SCENE2D) {
|
|
1534
|
+
setView2D(this, destination, scratchHpr, convert);
|
|
1535
|
+
} else {
|
|
1536
|
+
setViewCV(this, destination, scratchHpr, convert);
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
const pitchScratch = new Cartesian3();
|
|
1541
|
+
/**
|
|
1542
|
+
* Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
|
|
1543
|
+
* the default view for the 3D scene. The home view for 2D and columbus view shows the
|
|
1544
|
+
* entire map.
|
|
1545
|
+
*
|
|
1546
|
+
* @param {number} [duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo}
|
|
1547
|
+
*/
|
|
1548
|
+
Camera.prototype.flyHome = function (duration) {
|
|
1549
|
+
const mode = this._mode;
|
|
1550
|
+
|
|
1551
|
+
if (mode === SceneMode.MORPHING) {
|
|
1552
|
+
this._scene.completeMorph();
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
if (mode === SceneMode.SCENE2D) {
|
|
1556
|
+
this.flyTo({
|
|
1557
|
+
destination: Camera.DEFAULT_VIEW_RECTANGLE,
|
|
1558
|
+
duration: duration,
|
|
1559
|
+
endTransform: Matrix4.IDENTITY,
|
|
1560
|
+
});
|
|
1561
|
+
} else if (mode === SceneMode.SCENE3D) {
|
|
1562
|
+
const destination = this.getRectangleCameraCoordinates(
|
|
1563
|
+
Camera.DEFAULT_VIEW_RECTANGLE,
|
|
1564
|
+
);
|
|
1565
|
+
|
|
1566
|
+
let mag = Cartesian3.magnitude(destination);
|
|
1567
|
+
mag += mag * Camera.DEFAULT_VIEW_FACTOR;
|
|
1568
|
+
Cartesian3.normalize(destination, destination);
|
|
1569
|
+
Cartesian3.multiplyByScalar(destination, mag, destination);
|
|
1570
|
+
|
|
1571
|
+
this.flyTo({
|
|
1572
|
+
destination: destination,
|
|
1573
|
+
duration: duration,
|
|
1574
|
+
endTransform: Matrix4.IDENTITY,
|
|
1575
|
+
});
|
|
1576
|
+
} else if (mode === SceneMode.COLUMBUS_VIEW) {
|
|
1577
|
+
const maxRadii = this._projection.ellipsoid.maximumRadius;
|
|
1578
|
+
let position = new Cartesian3(0.0, -1.0, 1.0);
|
|
1579
|
+
position = Cartesian3.multiplyByScalar(
|
|
1580
|
+
Cartesian3.normalize(position, position),
|
|
1581
|
+
5.0 * maxRadii,
|
|
1582
|
+
position,
|
|
1583
|
+
);
|
|
1584
|
+
this.flyTo({
|
|
1585
|
+
destination: position,
|
|
1586
|
+
duration: duration,
|
|
1587
|
+
orientation: {
|
|
1588
|
+
heading: 0.0,
|
|
1589
|
+
pitch: -Math.acos(Cartesian3.normalize(position, pitchScratch).z),
|
|
1590
|
+
roll: 0.0,
|
|
1591
|
+
},
|
|
1592
|
+
endTransform: Matrix4.IDENTITY,
|
|
1593
|
+
convert: false,
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* Transform a vector or point from world coordinates to the camera's reference frame.
|
|
1600
|
+
*
|
|
1601
|
+
* @param {Cartesian4} cartesian The vector or point to transform.
|
|
1602
|
+
* @param {Cartesian4} [result] The object onto which to store the result.
|
|
1603
|
+
* @returns {Cartesian4} The transformed vector or point.
|
|
1604
|
+
*/
|
|
1605
|
+
Camera.prototype.worldToCameraCoordinates = function (cartesian, result) {
|
|
1606
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1607
|
+
if (!defined(cartesian)) {
|
|
1608
|
+
throw new DeveloperError("cartesian is required.");
|
|
1609
|
+
}
|
|
1610
|
+
//>>includeEnd('debug');
|
|
1611
|
+
|
|
1612
|
+
if (!defined(result)) {
|
|
1613
|
+
result = new Cartesian4();
|
|
1614
|
+
}
|
|
1615
|
+
updateMembers(this);
|
|
1616
|
+
return Matrix4.multiplyByVector(this._actualInvTransform, cartesian, result);
|
|
1617
|
+
};
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* Transform a point from world coordinates to the camera's reference frame.
|
|
1621
|
+
*
|
|
1622
|
+
* @param {Cartesian3} cartesian The point to transform.
|
|
1623
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
1624
|
+
* @returns {Cartesian3} The transformed point.
|
|
1625
|
+
*/
|
|
1626
|
+
Camera.prototype.worldToCameraCoordinatesPoint = function (cartesian, result) {
|
|
1627
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1628
|
+
if (!defined(cartesian)) {
|
|
1629
|
+
throw new DeveloperError("cartesian is required.");
|
|
1630
|
+
}
|
|
1631
|
+
//>>includeEnd('debug');
|
|
1632
|
+
|
|
1633
|
+
if (!defined(result)) {
|
|
1634
|
+
result = new Cartesian3();
|
|
1635
|
+
}
|
|
1636
|
+
updateMembers(this);
|
|
1637
|
+
return Matrix4.multiplyByPoint(this._actualInvTransform, cartesian, result);
|
|
1638
|
+
};
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Transform a vector from world coordinates to the camera's reference frame.
|
|
1642
|
+
*
|
|
1643
|
+
* @param {Cartesian3} cartesian The vector to transform.
|
|
1644
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
1645
|
+
* @returns {Cartesian3} The transformed vector.
|
|
1646
|
+
*/
|
|
1647
|
+
Camera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) {
|
|
1648
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1649
|
+
if (!defined(cartesian)) {
|
|
1650
|
+
throw new DeveloperError("cartesian is required.");
|
|
1651
|
+
}
|
|
1652
|
+
//>>includeEnd('debug');
|
|
1653
|
+
|
|
1654
|
+
if (!defined(result)) {
|
|
1655
|
+
result = new Cartesian3();
|
|
1656
|
+
}
|
|
1657
|
+
updateMembers(this);
|
|
1658
|
+
return Matrix4.multiplyByPointAsVector(
|
|
1659
|
+
this._actualInvTransform,
|
|
1660
|
+
cartesian,
|
|
1661
|
+
result,
|
|
1662
|
+
);
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Transform a vector or point from the camera's reference frame to world coordinates.
|
|
1667
|
+
*
|
|
1668
|
+
* @param {Cartesian4} cartesian The vector or point to transform.
|
|
1669
|
+
* @param {Cartesian4} [result] The object onto which to store the result.
|
|
1670
|
+
* @returns {Cartesian4} The transformed vector or point.
|
|
1671
|
+
*/
|
|
1672
|
+
Camera.prototype.cameraToWorldCoordinates = function (cartesian, result) {
|
|
1673
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1674
|
+
if (!defined(cartesian)) {
|
|
1675
|
+
throw new DeveloperError("cartesian is required.");
|
|
1676
|
+
}
|
|
1677
|
+
//>>includeEnd('debug');
|
|
1678
|
+
|
|
1679
|
+
if (!defined(result)) {
|
|
1680
|
+
result = new Cartesian4();
|
|
1681
|
+
}
|
|
1682
|
+
updateMembers(this);
|
|
1683
|
+
return Matrix4.multiplyByVector(this._actualTransform, cartesian, result);
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Transform a point from the camera's reference frame to world coordinates.
|
|
1688
|
+
*
|
|
1689
|
+
* @param {Cartesian3} cartesian The point to transform.
|
|
1690
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
1691
|
+
* @returns {Cartesian3} The transformed point.
|
|
1692
|
+
*/
|
|
1693
|
+
Camera.prototype.cameraToWorldCoordinatesPoint = function (cartesian, result) {
|
|
1694
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1695
|
+
if (!defined(cartesian)) {
|
|
1696
|
+
throw new DeveloperError("cartesian is required.");
|
|
1697
|
+
}
|
|
1698
|
+
//>>includeEnd('debug');
|
|
1699
|
+
|
|
1700
|
+
if (!defined(result)) {
|
|
1701
|
+
result = new Cartesian3();
|
|
1702
|
+
}
|
|
1703
|
+
updateMembers(this);
|
|
1704
|
+
return Matrix4.multiplyByPoint(this._actualTransform, cartesian, result);
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1707
|
+
/**
|
|
1708
|
+
* Transform a vector from the camera's reference frame to world coordinates.
|
|
1709
|
+
*
|
|
1710
|
+
* @param {Cartesian3} cartesian The vector to transform.
|
|
1711
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
1712
|
+
* @returns {Cartesian3} The transformed vector.
|
|
1713
|
+
*/
|
|
1714
|
+
Camera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) {
|
|
1715
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1716
|
+
if (!defined(cartesian)) {
|
|
1717
|
+
throw new DeveloperError("cartesian is required.");
|
|
1718
|
+
}
|
|
1719
|
+
//>>includeEnd('debug');
|
|
1720
|
+
|
|
1721
|
+
if (!defined(result)) {
|
|
1722
|
+
result = new Cartesian3();
|
|
1723
|
+
}
|
|
1724
|
+
updateMembers(this);
|
|
1725
|
+
return Matrix4.multiplyByPointAsVector(
|
|
1726
|
+
this._actualTransform,
|
|
1727
|
+
cartesian,
|
|
1728
|
+
result,
|
|
1729
|
+
);
|
|
1730
|
+
};
|
|
1731
|
+
|
|
1732
|
+
function clampMove2D(camera, position) {
|
|
1733
|
+
const rotatable2D = camera._scene.mapMode2D === MapMode2D.ROTATE;
|
|
1734
|
+
const maxProjectedX = camera._maxCoord.x;
|
|
1735
|
+
const maxProjectedY = camera._maxCoord.y;
|
|
1736
|
+
|
|
1737
|
+
let minX;
|
|
1738
|
+
let maxX;
|
|
1739
|
+
if (rotatable2D) {
|
|
1740
|
+
maxX = maxProjectedX;
|
|
1741
|
+
minX = -maxX;
|
|
1742
|
+
} else {
|
|
1743
|
+
maxX = position.x - maxProjectedX * 2.0;
|
|
1744
|
+
minX = position.x + maxProjectedX * 2.0;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
if (position.x > maxProjectedX) {
|
|
1748
|
+
position.x = maxX;
|
|
1749
|
+
}
|
|
1750
|
+
if (position.x < -maxProjectedX) {
|
|
1751
|
+
position.x = minX;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
if (position.y > maxProjectedY) {
|
|
1755
|
+
position.y = maxProjectedY;
|
|
1756
|
+
}
|
|
1757
|
+
if (position.y < -maxProjectedY) {
|
|
1758
|
+
position.y = -maxProjectedY;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
const moveScratch = new Cartesian3();
|
|
1763
|
+
/**
|
|
1764
|
+
* Translates the camera's position by <code>amount</code> along <code>direction</code>.
|
|
1765
|
+
*
|
|
1766
|
+
* @param {Cartesian3} direction The direction to move.
|
|
1767
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1768
|
+
*
|
|
1769
|
+
* @see Camera#moveBackward
|
|
1770
|
+
* @see Camera#moveForward
|
|
1771
|
+
* @see Camera#moveLeft
|
|
1772
|
+
* @see Camera#moveRight
|
|
1773
|
+
* @see Camera#moveUp
|
|
1774
|
+
* @see Camera#moveDown
|
|
1775
|
+
*/
|
|
1776
|
+
Camera.prototype.move = function (direction, amount) {
|
|
1777
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1778
|
+
if (!defined(direction)) {
|
|
1779
|
+
throw new DeveloperError("direction is required.");
|
|
1780
|
+
}
|
|
1781
|
+
//>>includeEnd('debug');
|
|
1782
|
+
|
|
1783
|
+
const cameraPosition = this.position;
|
|
1784
|
+
Cartesian3.multiplyByScalar(direction, amount, moveScratch);
|
|
1785
|
+
Cartesian3.add(cameraPosition, moveScratch, cameraPosition);
|
|
1786
|
+
|
|
1787
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
1788
|
+
clampMove2D(this, cameraPosition);
|
|
1789
|
+
}
|
|
1790
|
+
this._adjustOrthographicFrustum(true);
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Translates the camera's position by <code>amount</code> along the camera's view vector.
|
|
1795
|
+
* When in 2D mode, this will zoom in the camera instead of translating the camera's position.
|
|
1796
|
+
*
|
|
1797
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1798
|
+
*
|
|
1799
|
+
* @see Camera#moveBackward
|
|
1800
|
+
*/
|
|
1801
|
+
Camera.prototype.moveForward = function (amount) {
|
|
1802
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1803
|
+
|
|
1804
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
1805
|
+
// 2D mode
|
|
1806
|
+
zoom2D(this, amount);
|
|
1807
|
+
} else {
|
|
1808
|
+
// 3D or Columbus view mode
|
|
1809
|
+
this.move(this.direction, amount);
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* Translates the camera's position by <code>amount</code> along the opposite direction
|
|
1815
|
+
* of the camera's view vector.
|
|
1816
|
+
* When in 2D mode, this will zoom out the camera instead of translating the camera's position.
|
|
1817
|
+
*
|
|
1818
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1819
|
+
*
|
|
1820
|
+
* @see Camera#moveForward
|
|
1821
|
+
*/
|
|
1822
|
+
Camera.prototype.moveBackward = function (amount) {
|
|
1823
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1824
|
+
|
|
1825
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
1826
|
+
// 2D mode
|
|
1827
|
+
zoom2D(this, -amount);
|
|
1828
|
+
} else {
|
|
1829
|
+
// 3D or Columbus view mode
|
|
1830
|
+
this.move(this.direction, -amount);
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Translates the camera's position by <code>amount</code> along the camera's up vector.
|
|
1836
|
+
*
|
|
1837
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1838
|
+
*
|
|
1839
|
+
* @see Camera#moveDown
|
|
1840
|
+
*/
|
|
1841
|
+
Camera.prototype.moveUp = function (amount) {
|
|
1842
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1843
|
+
this.move(this.up, amount);
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Translates the camera's position by <code>amount</code> along the opposite direction
|
|
1848
|
+
* of the camera's up vector.
|
|
1849
|
+
*
|
|
1850
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1851
|
+
*
|
|
1852
|
+
* @see Camera#moveUp
|
|
1853
|
+
*/
|
|
1854
|
+
Camera.prototype.moveDown = function (amount) {
|
|
1855
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1856
|
+
this.move(this.up, -amount);
|
|
1857
|
+
};
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Translates the camera's position by <code>amount</code> along the camera's right vector.
|
|
1861
|
+
*
|
|
1862
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1863
|
+
*
|
|
1864
|
+
* @see Camera#moveLeft
|
|
1865
|
+
*/
|
|
1866
|
+
Camera.prototype.moveRight = function (amount) {
|
|
1867
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1868
|
+
this.move(this.right, amount);
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* Translates the camera's position by <code>amount</code> along the opposite direction
|
|
1873
|
+
* of the camera's right vector.
|
|
1874
|
+
*
|
|
1875
|
+
* @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
|
|
1876
|
+
*
|
|
1877
|
+
* @see Camera#moveRight
|
|
1878
|
+
*/
|
|
1879
|
+
Camera.prototype.moveLeft = function (amount) {
|
|
1880
|
+
amount = amount ?? this.defaultMoveAmount;
|
|
1881
|
+
this.move(this.right, -amount);
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Rotates the camera around its up vector by amount, in radians, in the opposite direction
|
|
1886
|
+
* of its right vector if not in 2D mode.
|
|
1887
|
+
*
|
|
1888
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1889
|
+
*
|
|
1890
|
+
* @see Camera#lookRight
|
|
1891
|
+
*/
|
|
1892
|
+
Camera.prototype.lookLeft = function (amount) {
|
|
1893
|
+
amount = amount ?? this.defaultLookAmount;
|
|
1894
|
+
|
|
1895
|
+
// only want view of map to change in 3D mode, 2D visual is incorrect when look changes
|
|
1896
|
+
if (this._mode !== SceneMode.SCENE2D) {
|
|
1897
|
+
this.look(this.up, -amount);
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* Rotates the camera around its up vector by amount, in radians, in the direction
|
|
1903
|
+
* of its right vector if not in 2D mode.
|
|
1904
|
+
*
|
|
1905
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1906
|
+
*
|
|
1907
|
+
* @see Camera#lookLeft
|
|
1908
|
+
*/
|
|
1909
|
+
Camera.prototype.lookRight = function (amount) {
|
|
1910
|
+
amount = amount ?? this.defaultLookAmount;
|
|
1911
|
+
|
|
1912
|
+
// only want view of map to change in 3D mode, 2D visual is incorrect when look changes
|
|
1913
|
+
if (this._mode !== SceneMode.SCENE2D) {
|
|
1914
|
+
this.look(this.up, amount);
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* Rotates the camera around its right vector by amount, in radians, in the direction
|
|
1920
|
+
* of its up vector if not in 2D mode.
|
|
1921
|
+
*
|
|
1922
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1923
|
+
*
|
|
1924
|
+
* @see Camera#lookDown
|
|
1925
|
+
*/
|
|
1926
|
+
Camera.prototype.lookUp = function (amount) {
|
|
1927
|
+
amount = amount ?? this.defaultLookAmount;
|
|
1928
|
+
|
|
1929
|
+
// only want view of map to change in 3D mode, 2D visual is incorrect when look changes
|
|
1930
|
+
if (this._mode !== SceneMode.SCENE2D) {
|
|
1931
|
+
this.look(this.right, -amount);
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Rotates the camera around its right vector by amount, in radians, in the opposite direction
|
|
1937
|
+
* of its up vector if not in 2D mode.
|
|
1938
|
+
*
|
|
1939
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1940
|
+
*
|
|
1941
|
+
* @see Camera#lookUp
|
|
1942
|
+
*/
|
|
1943
|
+
Camera.prototype.lookDown = function (amount) {
|
|
1944
|
+
amount = amount ?? this.defaultLookAmount;
|
|
1945
|
+
|
|
1946
|
+
// only want view of map to change in 3D mode, 2D visual is incorrect when look changes
|
|
1947
|
+
if (this._mode !== SceneMode.SCENE2D) {
|
|
1948
|
+
this.look(this.right, amount);
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
const lookScratchQuaternion = new Quaternion();
|
|
1953
|
+
const lookScratchMatrix = new Matrix3();
|
|
1954
|
+
/**
|
|
1955
|
+
* Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
|
|
1956
|
+
*
|
|
1957
|
+
* @param {Cartesian3} axis The axis to rotate around.
|
|
1958
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1959
|
+
*
|
|
1960
|
+
* @see Camera#lookUp
|
|
1961
|
+
* @see Camera#lookDown
|
|
1962
|
+
* @see Camera#lookLeft
|
|
1963
|
+
* @see Camera#lookRight
|
|
1964
|
+
*/
|
|
1965
|
+
Camera.prototype.look = function (axis, angle) {
|
|
1966
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1967
|
+
if (!defined(axis)) {
|
|
1968
|
+
throw new DeveloperError("axis is required.");
|
|
1969
|
+
}
|
|
1970
|
+
//>>includeEnd('debug');
|
|
1971
|
+
|
|
1972
|
+
const turnAngle = angle ?? this.defaultLookAmount;
|
|
1973
|
+
const quaternion = Quaternion.fromAxisAngle(
|
|
1974
|
+
axis,
|
|
1975
|
+
-turnAngle,
|
|
1976
|
+
lookScratchQuaternion,
|
|
1977
|
+
);
|
|
1978
|
+
const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix);
|
|
1979
|
+
|
|
1980
|
+
const direction = this.direction;
|
|
1981
|
+
const up = this.up;
|
|
1982
|
+
const right = this.right;
|
|
1983
|
+
|
|
1984
|
+
Matrix3.multiplyByVector(rotation, direction, direction);
|
|
1985
|
+
Matrix3.multiplyByVector(rotation, up, up);
|
|
1986
|
+
Matrix3.multiplyByVector(rotation, right, right);
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Rotate the camera counter-clockwise around its direction vector by amount, in radians.
|
|
1991
|
+
*
|
|
1992
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
1993
|
+
*
|
|
1994
|
+
* @see Camera#twistRight
|
|
1995
|
+
*/
|
|
1996
|
+
Camera.prototype.twistLeft = function (amount) {
|
|
1997
|
+
amount = amount ?? this.defaultLookAmount;
|
|
1998
|
+
this.look(this.direction, amount);
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* Rotate the camera clockwise around its direction vector by amount, in radians.
|
|
2003
|
+
*
|
|
2004
|
+
* @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
|
|
2005
|
+
*
|
|
2006
|
+
* @see Camera#twistLeft
|
|
2007
|
+
*/
|
|
2008
|
+
Camera.prototype.twistRight = function (amount) {
|
|
2009
|
+
amount = amount ?? this.defaultLookAmount;
|
|
2010
|
+
this.look(this.direction, -amount);
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
const rotateScratchQuaternion = new Quaternion();
|
|
2014
|
+
const rotateScratchMatrix = new Matrix3();
|
|
2015
|
+
/**
|
|
2016
|
+
* Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
|
|
2017
|
+
* of the camera's position to the center of the camera's reference frame remains the same.
|
|
2018
|
+
*
|
|
2019
|
+
* @param {Cartesian3} axis The axis to rotate around given in world coordinates.
|
|
2020
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
|
|
2021
|
+
*
|
|
2022
|
+
* @see Camera#rotateUp
|
|
2023
|
+
* @see Camera#rotateDown
|
|
2024
|
+
* @see Camera#rotateLeft
|
|
2025
|
+
* @see Camera#rotateRight
|
|
2026
|
+
*/
|
|
2027
|
+
Camera.prototype.rotate = function (axis, angle) {
|
|
2028
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2029
|
+
if (!defined(axis)) {
|
|
2030
|
+
throw new DeveloperError("axis is required.");
|
|
2031
|
+
}
|
|
2032
|
+
//>>includeEnd('debug');
|
|
2033
|
+
|
|
2034
|
+
const turnAngle = angle ?? this.defaultRotateAmount;
|
|
2035
|
+
const quaternion = Quaternion.fromAxisAngle(
|
|
2036
|
+
axis,
|
|
2037
|
+
-turnAngle,
|
|
2038
|
+
rotateScratchQuaternion,
|
|
2039
|
+
);
|
|
2040
|
+
const rotation = Matrix3.fromQuaternion(quaternion, rotateScratchMatrix);
|
|
2041
|
+
Matrix3.multiplyByVector(rotation, this.position, this.position);
|
|
2042
|
+
Matrix3.multiplyByVector(rotation, this.direction, this.direction);
|
|
2043
|
+
Matrix3.multiplyByVector(rotation, this.up, this.up);
|
|
2044
|
+
Cartesian3.cross(this.direction, this.up, this.right);
|
|
2045
|
+
Cartesian3.cross(this.right, this.direction, this.up);
|
|
2046
|
+
|
|
2047
|
+
this._adjustOrthographicFrustum(false);
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Rotates the camera around the center of the camera's reference frame by angle downwards.
|
|
2052
|
+
*
|
|
2053
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
|
|
2054
|
+
*
|
|
2055
|
+
* @see Camera#rotateUp
|
|
2056
|
+
* @see Camera#rotate
|
|
2057
|
+
*/
|
|
2058
|
+
Camera.prototype.rotateDown = function (angle) {
|
|
2059
|
+
angle = angle ?? this.defaultRotateAmount;
|
|
2060
|
+
rotateVertical(this, angle);
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* Rotates the camera around the center of the camera's reference frame by angle upwards.
|
|
2065
|
+
*
|
|
2066
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
|
|
2067
|
+
*
|
|
2068
|
+
* @see Camera#rotateDown
|
|
2069
|
+
* @see Camera#rotate
|
|
2070
|
+
*/
|
|
2071
|
+
Camera.prototype.rotateUp = function (angle) {
|
|
2072
|
+
angle = angle ?? this.defaultRotateAmount;
|
|
2073
|
+
rotateVertical(this, -angle);
|
|
2074
|
+
};
|
|
2075
|
+
|
|
2076
|
+
const rotateVertScratchP = new Cartesian3();
|
|
2077
|
+
const rotateVertScratchA = new Cartesian3();
|
|
2078
|
+
const rotateVertScratchTan = new Cartesian3();
|
|
2079
|
+
const rotateVertScratchNegate = new Cartesian3();
|
|
2080
|
+
function rotateVertical(camera, angle) {
|
|
2081
|
+
const position = camera.position;
|
|
2082
|
+
if (
|
|
2083
|
+
defined(camera.constrainedAxis) &&
|
|
2084
|
+
!Cartesian3.equalsEpsilon(
|
|
2085
|
+
camera.position,
|
|
2086
|
+
Cartesian3.ZERO,
|
|
2087
|
+
CesiumMath.EPSILON2,
|
|
2088
|
+
)
|
|
2089
|
+
) {
|
|
2090
|
+
const p = Cartesian3.normalize(position, rotateVertScratchP);
|
|
2091
|
+
const northParallel = Cartesian3.equalsEpsilon(
|
|
2092
|
+
p,
|
|
2093
|
+
camera.constrainedAxis,
|
|
2094
|
+
CesiumMath.EPSILON2,
|
|
2095
|
+
);
|
|
2096
|
+
const southParallel = Cartesian3.equalsEpsilon(
|
|
2097
|
+
p,
|
|
2098
|
+
Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate),
|
|
2099
|
+
CesiumMath.EPSILON2,
|
|
2100
|
+
);
|
|
2101
|
+
if (!northParallel && !southParallel) {
|
|
2102
|
+
const constrainedAxis = Cartesian3.normalize(
|
|
2103
|
+
camera.constrainedAxis,
|
|
2104
|
+
rotateVertScratchA,
|
|
2105
|
+
);
|
|
2106
|
+
|
|
2107
|
+
let dot = Cartesian3.dot(p, constrainedAxis);
|
|
2108
|
+
let angleToAxis = CesiumMath.acosClamped(dot);
|
|
2109
|
+
if (angle > 0 && angle > angleToAxis) {
|
|
2110
|
+
angle = angleToAxis - CesiumMath.EPSILON4;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
dot = Cartesian3.dot(
|
|
2114
|
+
p,
|
|
2115
|
+
Cartesian3.negate(constrainedAxis, rotateVertScratchNegate),
|
|
2116
|
+
);
|
|
2117
|
+
angleToAxis = CesiumMath.acosClamped(dot);
|
|
2118
|
+
if (angle < 0 && -angle > angleToAxis) {
|
|
2119
|
+
angle = -angleToAxis + CesiumMath.EPSILON4;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
const tangent = Cartesian3.cross(
|
|
2123
|
+
constrainedAxis,
|
|
2124
|
+
p,
|
|
2125
|
+
rotateVertScratchTan,
|
|
2126
|
+
);
|
|
2127
|
+
camera.rotate(tangent, angle);
|
|
2128
|
+
} else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {
|
|
2129
|
+
camera.rotate(camera.right, angle);
|
|
2130
|
+
}
|
|
2131
|
+
} else {
|
|
2132
|
+
camera.rotate(camera.right, angle);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* Rotates the camera around the center of the camera's reference frame by angle to the right.
|
|
2138
|
+
*
|
|
2139
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
|
|
2140
|
+
*
|
|
2141
|
+
* @see Camera#rotateLeft
|
|
2142
|
+
* @see Camera#rotate
|
|
2143
|
+
*/
|
|
2144
|
+
Camera.prototype.rotateRight = function (angle) {
|
|
2145
|
+
angle = angle ?? this.defaultRotateAmount;
|
|
2146
|
+
rotateHorizontal(this, -angle);
|
|
2147
|
+
};
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Rotates the camera around the center of the camera's reference frame by angle to the left.
|
|
2151
|
+
*
|
|
2152
|
+
* @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
|
|
2153
|
+
*
|
|
2154
|
+
* @see Camera#rotateRight
|
|
2155
|
+
* @see Camera#rotate
|
|
2156
|
+
*/
|
|
2157
|
+
Camera.prototype.rotateLeft = function (angle) {
|
|
2158
|
+
angle = angle ?? this.defaultRotateAmount;
|
|
2159
|
+
rotateHorizontal(this, angle);
|
|
2160
|
+
};
|
|
2161
|
+
|
|
2162
|
+
function rotateHorizontal(camera, angle) {
|
|
2163
|
+
if (defined(camera.constrainedAxis)) {
|
|
2164
|
+
camera.rotate(camera.constrainedAxis, angle);
|
|
2165
|
+
} else {
|
|
2166
|
+
camera.rotate(camera.up, angle);
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
function zoom2D(camera, amount) {
|
|
2171
|
+
const frustum = camera.frustum;
|
|
2172
|
+
|
|
2173
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2174
|
+
if (
|
|
2175
|
+
!(frustum instanceof OrthographicOffCenterFrustum) ||
|
|
2176
|
+
!defined(frustum.left) ||
|
|
2177
|
+
!defined(frustum.right) ||
|
|
2178
|
+
!defined(frustum.bottom) ||
|
|
2179
|
+
!defined(frustum.top)
|
|
2180
|
+
) {
|
|
2181
|
+
throw new DeveloperError(
|
|
2182
|
+
"The camera frustum is expected to be orthographic for 2D camera control.",
|
|
2183
|
+
);
|
|
2184
|
+
}
|
|
2185
|
+
//>>includeEnd('debug');
|
|
2186
|
+
|
|
2187
|
+
let ratio;
|
|
2188
|
+
amount = amount * 0.5;
|
|
2189
|
+
|
|
2190
|
+
if (
|
|
2191
|
+
Math.abs(frustum.top) + Math.abs(frustum.bottom) >
|
|
2192
|
+
Math.abs(frustum.left) + Math.abs(frustum.right)
|
|
2193
|
+
) {
|
|
2194
|
+
let newTop = frustum.top - amount;
|
|
2195
|
+
let newBottom = frustum.bottom + amount;
|
|
2196
|
+
|
|
2197
|
+
let maxBottom = camera._maxCoord.y;
|
|
2198
|
+
if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
|
|
2199
|
+
maxBottom *= camera.maximumZoomFactor;
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
if (newBottom > maxBottom) {
|
|
2203
|
+
newBottom = maxBottom;
|
|
2204
|
+
newTop = -maxBottom;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
if (newTop <= newBottom) {
|
|
2208
|
+
newTop = 1.0;
|
|
2209
|
+
newBottom = -1.0;
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
ratio = frustum.right / frustum.top;
|
|
2213
|
+
frustum.top = newTop;
|
|
2214
|
+
frustum.bottom = newBottom;
|
|
2215
|
+
frustum.right = frustum.top * ratio;
|
|
2216
|
+
frustum.left = -frustum.right;
|
|
2217
|
+
} else {
|
|
2218
|
+
let newRight = frustum.right - amount;
|
|
2219
|
+
let newLeft = frustum.left + amount;
|
|
2220
|
+
|
|
2221
|
+
let maxRight = camera._maxCoord.x;
|
|
2222
|
+
if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
|
|
2223
|
+
maxRight *= camera.maximumZoomFactor;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
if (newRight > maxRight) {
|
|
2227
|
+
newRight = maxRight;
|
|
2228
|
+
newLeft = -maxRight;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
if (newRight <= newLeft) {
|
|
2232
|
+
newRight = 1.0;
|
|
2233
|
+
newLeft = -1.0;
|
|
2234
|
+
}
|
|
2235
|
+
ratio = frustum.top / frustum.right;
|
|
2236
|
+
frustum.right = newRight;
|
|
2237
|
+
frustum.left = newLeft;
|
|
2238
|
+
frustum.top = frustum.right * ratio;
|
|
2239
|
+
frustum.bottom = -frustum.top;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
function zoom3D(camera, amount) {
|
|
2244
|
+
camera.move(camera.direction, amount);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
/**
|
|
2248
|
+
* Zooms <code>amount</code> along the camera's view vector.
|
|
2249
|
+
*
|
|
2250
|
+
* @param {number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.
|
|
2251
|
+
*
|
|
2252
|
+
* @see Camera#zoomOut
|
|
2253
|
+
*/
|
|
2254
|
+
Camera.prototype.zoomIn = function (amount) {
|
|
2255
|
+
amount = amount ?? this.defaultZoomAmount;
|
|
2256
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
2257
|
+
zoom2D(this, amount);
|
|
2258
|
+
} else {
|
|
2259
|
+
zoom3D(this, amount);
|
|
2260
|
+
}
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2263
|
+
/**
|
|
2264
|
+
* Zooms <code>amount</code> along the opposite direction of
|
|
2265
|
+
* the camera's view vector.
|
|
2266
|
+
*
|
|
2267
|
+
* @param {number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.
|
|
2268
|
+
*
|
|
2269
|
+
* @see Camera#zoomIn
|
|
2270
|
+
*/
|
|
2271
|
+
Camera.prototype.zoomOut = function (amount) {
|
|
2272
|
+
amount = amount ?? this.defaultZoomAmount;
|
|
2273
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
2274
|
+
zoom2D(this, -amount);
|
|
2275
|
+
} else {
|
|
2276
|
+
zoom3D(this, -amount);
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
|
|
2282
|
+
* Columbus view, this is the distance to the map.
|
|
2283
|
+
*
|
|
2284
|
+
* @returns {number} The magnitude of the position.
|
|
2285
|
+
*/
|
|
2286
|
+
Camera.prototype.getMagnitude = function () {
|
|
2287
|
+
if (this._mode === SceneMode.SCENE3D) {
|
|
2288
|
+
return Cartesian3.magnitude(this.position);
|
|
2289
|
+
} else if (this._mode === SceneMode.COLUMBUS_VIEW) {
|
|
2290
|
+
return Math.abs(this.position.z);
|
|
2291
|
+
} else if (this._mode === SceneMode.SCENE2D) {
|
|
2292
|
+
return Math.max(
|
|
2293
|
+
this.frustum.right - this.frustum.left,
|
|
2294
|
+
this.frustum.top - this.frustum.bottom,
|
|
2295
|
+
);
|
|
2296
|
+
}
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
const scratchLookAtMatrix4 = new Matrix4();
|
|
2300
|
+
|
|
2301
|
+
/**
|
|
2302
|
+
* Sets the camera position and orientation using a target and offset. The target must be given in
|
|
2303
|
+
* world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target.
|
|
2304
|
+
* If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
|
|
2305
|
+
* is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
|
|
2306
|
+
* The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
|
|
2307
|
+
* angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
|
|
2308
|
+
*
|
|
2309
|
+
* In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
|
|
2310
|
+
* target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
|
|
2311
|
+
* determined from the offset, the heading will be north.
|
|
2312
|
+
*
|
|
2313
|
+
* @param {Cartesian3} target The target position in world coordinates.
|
|
2314
|
+
* @param {Cartesian3|HeadingPitchRange} offset The offset from the target in the local east-north-up reference frame centered at the target.
|
|
2315
|
+
*
|
|
2316
|
+
* @exception {DeveloperError} lookAt is not supported while morphing.
|
|
2317
|
+
*
|
|
2318
|
+
* @example
|
|
2319
|
+
* // 1. Using a cartesian offset
|
|
2320
|
+
* const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
|
|
2321
|
+
* viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
|
|
2322
|
+
*
|
|
2323
|
+
* // 2. Using a HeadingPitchRange offset
|
|
2324
|
+
* const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
|
|
2325
|
+
* const heading = Cesium.Math.toRadians(50.0);
|
|
2326
|
+
* const pitch = Cesium.Math.toRadians(-20.0);
|
|
2327
|
+
* const range = 5000.0;
|
|
2328
|
+
* viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
|
|
2329
|
+
*/
|
|
2330
|
+
Camera.prototype.lookAt = function (target, offset) {
|
|
2331
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2332
|
+
if (!defined(target)) {
|
|
2333
|
+
throw new DeveloperError("target is required");
|
|
2334
|
+
}
|
|
2335
|
+
if (!defined(offset)) {
|
|
2336
|
+
throw new DeveloperError("offset is required");
|
|
2337
|
+
}
|
|
2338
|
+
if (this._mode === SceneMode.MORPHING) {
|
|
2339
|
+
throw new DeveloperError("lookAt is not supported while morphing.");
|
|
2340
|
+
}
|
|
2341
|
+
//>>includeEnd('debug');
|
|
2342
|
+
|
|
2343
|
+
const scene = this._scene;
|
|
2344
|
+
const ellipsoid = scene.ellipsoid ?? Ellipsoid.default;
|
|
2345
|
+
|
|
2346
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
2347
|
+
target,
|
|
2348
|
+
ellipsoid,
|
|
2349
|
+
scratchLookAtMatrix4,
|
|
2350
|
+
);
|
|
2351
|
+
this.lookAtTransform(transform, offset);
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
const scratchLookAtHeadingPitchRangeOffset = new Cartesian3();
|
|
2355
|
+
const scratchLookAtHeadingPitchRangeQuaternion1 = new Quaternion();
|
|
2356
|
+
const scratchLookAtHeadingPitchRangeQuaternion2 = new Quaternion();
|
|
2357
|
+
const scratchHeadingPitchRangeMatrix3 = new Matrix3();
|
|
2358
|
+
|
|
2359
|
+
function offsetFromHeadingPitchRange(heading, pitch, range) {
|
|
2360
|
+
pitch = CesiumMath.clamp(
|
|
2361
|
+
pitch,
|
|
2362
|
+
-CesiumMath.PI_OVER_TWO,
|
|
2363
|
+
CesiumMath.PI_OVER_TWO,
|
|
2364
|
+
);
|
|
2365
|
+
heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO;
|
|
2366
|
+
|
|
2367
|
+
const pitchQuat = Quaternion.fromAxisAngle(
|
|
2368
|
+
Cartesian3.UNIT_Y,
|
|
2369
|
+
-pitch,
|
|
2370
|
+
scratchLookAtHeadingPitchRangeQuaternion1,
|
|
2371
|
+
);
|
|
2372
|
+
const headingQuat = Quaternion.fromAxisAngle(
|
|
2373
|
+
Cartesian3.UNIT_Z,
|
|
2374
|
+
-heading,
|
|
2375
|
+
scratchLookAtHeadingPitchRangeQuaternion2,
|
|
2376
|
+
);
|
|
2377
|
+
const rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat);
|
|
2378
|
+
const rotMatrix = Matrix3.fromQuaternion(
|
|
2379
|
+
rotQuat,
|
|
2380
|
+
scratchHeadingPitchRangeMatrix3,
|
|
2381
|
+
);
|
|
2382
|
+
|
|
2383
|
+
const offset = Cartesian3.clone(
|
|
2384
|
+
Cartesian3.UNIT_X,
|
|
2385
|
+
scratchLookAtHeadingPitchRangeOffset,
|
|
2386
|
+
);
|
|
2387
|
+
Matrix3.multiplyByVector(rotMatrix, offset, offset);
|
|
2388
|
+
Cartesian3.negate(offset, offset);
|
|
2389
|
+
Cartesian3.multiplyByScalar(offset, range, offset);
|
|
2390
|
+
return offset;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
/**
|
|
2394
|
+
* Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
|
|
2395
|
+
* If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
|
|
2396
|
+
* is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
|
|
2397
|
+
* The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
|
|
2398
|
+
* angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
|
|
2399
|
+
*
|
|
2400
|
+
* In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the
|
|
2401
|
+
* target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
|
|
2402
|
+
* determined from the offset, the heading will be north.
|
|
2403
|
+
*
|
|
2404
|
+
* @param {Matrix4} transform The transformation matrix defining the reference frame.
|
|
2405
|
+
* @param {Cartesian3|HeadingPitchRange} [offset] The offset from the target in a reference frame centered at the target.
|
|
2406
|
+
*
|
|
2407
|
+
* @exception {DeveloperError} lookAtTransform is not supported while morphing.
|
|
2408
|
+
*
|
|
2409
|
+
* @example
|
|
2410
|
+
* // 1. Using a cartesian offset
|
|
2411
|
+
* const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
|
|
2412
|
+
* viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
|
|
2413
|
+
*
|
|
2414
|
+
* // 2. Using a HeadingPitchRange offset
|
|
2415
|
+
* const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
|
|
2416
|
+
* const heading = Cesium.Math.toRadians(50.0);
|
|
2417
|
+
* const pitch = Cesium.Math.toRadians(-20.0);
|
|
2418
|
+
* const range = 5000.0;
|
|
2419
|
+
* viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
|
|
2420
|
+
*/
|
|
2421
|
+
Camera.prototype.lookAtTransform = function (transform, offset) {
|
|
2422
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2423
|
+
if (!defined(transform)) {
|
|
2424
|
+
throw new DeveloperError("transform is required");
|
|
2425
|
+
}
|
|
2426
|
+
if (this._mode === SceneMode.MORPHING) {
|
|
2427
|
+
throw new DeveloperError(
|
|
2428
|
+
"lookAtTransform is not supported while morphing.",
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
//>>includeEnd('debug');
|
|
2432
|
+
|
|
2433
|
+
this._setTransform(transform);
|
|
2434
|
+
if (!defined(offset)) {
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
let cartesianOffset;
|
|
2439
|
+
if (defined(offset.heading)) {
|
|
2440
|
+
cartesianOffset = offsetFromHeadingPitchRange(
|
|
2441
|
+
offset.heading,
|
|
2442
|
+
offset.pitch,
|
|
2443
|
+
offset.range,
|
|
2444
|
+
);
|
|
2445
|
+
} else {
|
|
2446
|
+
cartesianOffset = offset;
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
if (this._mode === SceneMode.SCENE2D) {
|
|
2450
|
+
Cartesian2.clone(Cartesian2.ZERO, this.position);
|
|
2451
|
+
|
|
2452
|
+
Cartesian3.negate(cartesianOffset, this.up);
|
|
2453
|
+
this.up.z = 0.0;
|
|
2454
|
+
|
|
2455
|
+
if (Cartesian3.magnitudeSquared(this.up) < CesiumMath.EPSILON10) {
|
|
2456
|
+
Cartesian3.clone(Cartesian3.UNIT_Y, this.up);
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
Cartesian3.normalize(this.up, this.up);
|
|
2460
|
+
|
|
2461
|
+
this._setTransform(Matrix4.IDENTITY);
|
|
2462
|
+
|
|
2463
|
+
Cartesian3.negate(Cartesian3.UNIT_Z, this.direction);
|
|
2464
|
+
Cartesian3.cross(this.direction, this.up, this.right);
|
|
2465
|
+
Cartesian3.normalize(this.right, this.right);
|
|
2466
|
+
|
|
2467
|
+
const frustum = this.frustum;
|
|
2468
|
+
const ratio = frustum.top / frustum.right;
|
|
2469
|
+
frustum.right = Cartesian3.magnitude(cartesianOffset) * 0.5;
|
|
2470
|
+
frustum.left = -frustum.right;
|
|
2471
|
+
frustum.top = ratio * frustum.right;
|
|
2472
|
+
frustum.bottom = -frustum.top;
|
|
2473
|
+
|
|
2474
|
+
this._setTransform(transform);
|
|
2475
|
+
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
Cartesian3.clone(cartesianOffset, this.position);
|
|
2480
|
+
Cartesian3.negate(this.position, this.direction);
|
|
2481
|
+
Cartesian3.normalize(this.direction, this.direction);
|
|
2482
|
+
Cartesian3.cross(this.direction, Cartesian3.UNIT_Z, this.right);
|
|
2483
|
+
|
|
2484
|
+
if (Cartesian3.magnitudeSquared(this.right) < CesiumMath.EPSILON10) {
|
|
2485
|
+
Cartesian3.clone(Cartesian3.UNIT_X, this.right);
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
Cartesian3.normalize(this.right, this.right);
|
|
2489
|
+
Cartesian3.cross(this.right, this.direction, this.up);
|
|
2490
|
+
Cartesian3.normalize(this.up, this.up);
|
|
2491
|
+
|
|
2492
|
+
this._adjustOrthographicFrustum(true);
|
|
2493
|
+
};
|
|
2494
|
+
|
|
2495
|
+
const viewRectangle3DCartographic1 = new Cartographic();
|
|
2496
|
+
const viewRectangle3DCartographic2 = new Cartographic();
|
|
2497
|
+
const viewRectangle3DNorthEast = new Cartesian3();
|
|
2498
|
+
const viewRectangle3DSouthWest = new Cartesian3();
|
|
2499
|
+
const viewRectangle3DNorthWest = new Cartesian3();
|
|
2500
|
+
const viewRectangle3DSouthEast = new Cartesian3();
|
|
2501
|
+
const viewRectangle3DNorthCenter = new Cartesian3();
|
|
2502
|
+
const viewRectangle3DSouthCenter = new Cartesian3();
|
|
2503
|
+
const viewRectangle3DCenter = new Cartesian3();
|
|
2504
|
+
const viewRectangle3DEquator = new Cartesian3();
|
|
2505
|
+
const defaultRF = {
|
|
2506
|
+
direction: new Cartesian3(),
|
|
2507
|
+
right: new Cartesian3(),
|
|
2508
|
+
up: new Cartesian3(),
|
|
2509
|
+
};
|
|
2510
|
+
let viewRectangle3DEllipsoidGeodesic;
|
|
2511
|
+
|
|
2512
|
+
function computeD(direction, upOrRight, corner, tanThetaOrPhi) {
|
|
2513
|
+
const opposite = Math.abs(Cartesian3.dot(upOrRight, corner));
|
|
2514
|
+
return opposite / tanThetaOrPhi - Cartesian3.dot(direction, corner);
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) {
|
|
2518
|
+
const ellipsoid = camera._projection.ellipsoid;
|
|
2519
|
+
const cameraRF = updateCamera ? camera : defaultRF;
|
|
2520
|
+
|
|
2521
|
+
const { north, south, west } = rectangle;
|
|
2522
|
+
let { east } = rectangle;
|
|
2523
|
+
|
|
2524
|
+
// If we go across the International Date Line
|
|
2525
|
+
if (west > east) {
|
|
2526
|
+
east += CesiumMath.TWO_PI;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
// Find the midpoint latitude.
|
|
2530
|
+
//
|
|
2531
|
+
// EllipsoidGeodesic will fail if the north and south edges are very close to being on opposite sides of the ellipsoid.
|
|
2532
|
+
// Ideally we'd just call EllipsoidGeodesic.setEndPoints and let it throw when it detects this case, but sadly it doesn't
|
|
2533
|
+
// even look for this case in optimized builds, so we have to test for it here instead.
|
|
2534
|
+
//
|
|
2535
|
+
// Fortunately, this case can only happen (here) when north is very close to the north pole and south is very close to the south pole,
|
|
2536
|
+
// so handle it just by using 0 latitude as the center. It's certainliy possible to use a smaller tolerance
|
|
2537
|
+
// than one degree here, but one degree is safe and putting the center at 0 latitude should be good enough for any
|
|
2538
|
+
// rectangle that spans 178+ of the 180 degrees of latitude.
|
|
2539
|
+
const longitude = (west + east) * 0.5;
|
|
2540
|
+
let latitude;
|
|
2541
|
+
if (
|
|
2542
|
+
south < -CesiumMath.PI_OVER_TWO + CesiumMath.RADIANS_PER_DEGREE &&
|
|
2543
|
+
north > CesiumMath.PI_OVER_TWO - CesiumMath.RADIANS_PER_DEGREE
|
|
2544
|
+
) {
|
|
2545
|
+
latitude = 0.0;
|
|
2546
|
+
} else {
|
|
2547
|
+
const northCartographic = viewRectangle3DCartographic1;
|
|
2548
|
+
northCartographic.longitude = longitude;
|
|
2549
|
+
northCartographic.latitude = north;
|
|
2550
|
+
northCartographic.height = 0.0;
|
|
2551
|
+
|
|
2552
|
+
const southCartographic = viewRectangle3DCartographic2;
|
|
2553
|
+
southCartographic.longitude = longitude;
|
|
2554
|
+
southCartographic.latitude = south;
|
|
2555
|
+
southCartographic.height = 0.0;
|
|
2556
|
+
|
|
2557
|
+
let ellipsoidGeodesic = viewRectangle3DEllipsoidGeodesic;
|
|
2558
|
+
if (
|
|
2559
|
+
!defined(ellipsoidGeodesic) ||
|
|
2560
|
+
ellipsoidGeodesic.ellipsoid !== ellipsoid
|
|
2561
|
+
) {
|
|
2562
|
+
viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic =
|
|
2563
|
+
new EllipsoidGeodesic(undefined, undefined, ellipsoid);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
ellipsoidGeodesic.setEndPoints(northCartographic, southCartographic);
|
|
2567
|
+
latitude = ellipsoidGeodesic.interpolateUsingFraction(
|
|
2568
|
+
0.5,
|
|
2569
|
+
viewRectangle3DCartographic1,
|
|
2570
|
+
).latitude;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
const centerCartographic = viewRectangle3DCartographic1;
|
|
2574
|
+
centerCartographic.longitude = longitude;
|
|
2575
|
+
centerCartographic.latitude = latitude;
|
|
2576
|
+
centerCartographic.height = 0.0;
|
|
2577
|
+
|
|
2578
|
+
const center = ellipsoid.cartographicToCartesian(
|
|
2579
|
+
centerCartographic,
|
|
2580
|
+
viewRectangle3DCenter,
|
|
2581
|
+
);
|
|
2582
|
+
|
|
2583
|
+
const cart = viewRectangle3DCartographic1;
|
|
2584
|
+
cart.longitude = east;
|
|
2585
|
+
cart.latitude = north;
|
|
2586
|
+
const northEast = ellipsoid.cartographicToCartesian(
|
|
2587
|
+
cart,
|
|
2588
|
+
viewRectangle3DNorthEast,
|
|
2589
|
+
);
|
|
2590
|
+
cart.longitude = west;
|
|
2591
|
+
const northWest = ellipsoid.cartographicToCartesian(
|
|
2592
|
+
cart,
|
|
2593
|
+
viewRectangle3DNorthWest,
|
|
2594
|
+
);
|
|
2595
|
+
cart.longitude = longitude;
|
|
2596
|
+
const northCenter = ellipsoid.cartographicToCartesian(
|
|
2597
|
+
cart,
|
|
2598
|
+
viewRectangle3DNorthCenter,
|
|
2599
|
+
);
|
|
2600
|
+
cart.latitude = south;
|
|
2601
|
+
const southCenter = ellipsoid.cartographicToCartesian(
|
|
2602
|
+
cart,
|
|
2603
|
+
viewRectangle3DSouthCenter,
|
|
2604
|
+
);
|
|
2605
|
+
cart.longitude = east;
|
|
2606
|
+
const southEast = ellipsoid.cartographicToCartesian(
|
|
2607
|
+
cart,
|
|
2608
|
+
viewRectangle3DSouthEast,
|
|
2609
|
+
);
|
|
2610
|
+
cart.longitude = west;
|
|
2611
|
+
const southWest = ellipsoid.cartographicToCartesian(
|
|
2612
|
+
cart,
|
|
2613
|
+
viewRectangle3DSouthWest,
|
|
2614
|
+
);
|
|
2615
|
+
|
|
2616
|
+
Cartesian3.subtract(northWest, center, northWest);
|
|
2617
|
+
Cartesian3.subtract(southEast, center, southEast);
|
|
2618
|
+
Cartesian3.subtract(northEast, center, northEast);
|
|
2619
|
+
Cartesian3.subtract(southWest, center, southWest);
|
|
2620
|
+
Cartesian3.subtract(northCenter, center, northCenter);
|
|
2621
|
+
Cartesian3.subtract(southCenter, center, southCenter);
|
|
2622
|
+
|
|
2623
|
+
const direction = ellipsoid.geodeticSurfaceNormal(center, cameraRF.direction);
|
|
2624
|
+
Cartesian3.negate(direction, direction);
|
|
2625
|
+
const right = Cartesian3.cross(direction, Cartesian3.UNIT_Z, cameraRF.right);
|
|
2626
|
+
Cartesian3.normalize(right, right);
|
|
2627
|
+
const up = Cartesian3.cross(right, direction, cameraRF.up);
|
|
2628
|
+
|
|
2629
|
+
let d;
|
|
2630
|
+
if (camera.frustum instanceof OrthographicFrustum) {
|
|
2631
|
+
const width = Math.max(
|
|
2632
|
+
Cartesian3.distance(northEast, northWest),
|
|
2633
|
+
Cartesian3.distance(southEast, southWest),
|
|
2634
|
+
);
|
|
2635
|
+
const height = Math.max(
|
|
2636
|
+
Cartesian3.distance(northEast, southEast),
|
|
2637
|
+
Cartesian3.distance(northWest, southWest),
|
|
2638
|
+
);
|
|
2639
|
+
|
|
2640
|
+
let rightScalar;
|
|
2641
|
+
let topScalar;
|
|
2642
|
+
const offCenterFrustum = camera.frustum._offCenterFrustum;
|
|
2643
|
+
const ratio = offCenterFrustum.right / offCenterFrustum.top;
|
|
2644
|
+
const heightRatio = height * ratio;
|
|
2645
|
+
if (width > heightRatio) {
|
|
2646
|
+
rightScalar = width;
|
|
2647
|
+
topScalar = rightScalar / ratio;
|
|
2648
|
+
} else {
|
|
2649
|
+
topScalar = height;
|
|
2650
|
+
rightScalar = heightRatio;
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
d = Math.max(rightScalar, topScalar);
|
|
2654
|
+
} else {
|
|
2655
|
+
const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
|
|
2656
|
+
const tanTheta = camera.frustum.aspectRatio * tanPhi;
|
|
2657
|
+
|
|
2658
|
+
d = Math.max(
|
|
2659
|
+
computeD(direction, up, northWest, tanPhi),
|
|
2660
|
+
computeD(direction, up, southEast, tanPhi),
|
|
2661
|
+
computeD(direction, up, northEast, tanPhi),
|
|
2662
|
+
computeD(direction, up, southWest, tanPhi),
|
|
2663
|
+
computeD(direction, up, northCenter, tanPhi),
|
|
2664
|
+
computeD(direction, up, southCenter, tanPhi),
|
|
2665
|
+
computeD(direction, right, northWest, tanTheta),
|
|
2666
|
+
computeD(direction, right, southEast, tanTheta),
|
|
2667
|
+
computeD(direction, right, northEast, tanTheta),
|
|
2668
|
+
computeD(direction, right, southWest, tanTheta),
|
|
2669
|
+
computeD(direction, right, northCenter, tanTheta),
|
|
2670
|
+
computeD(direction, right, southCenter, tanTheta),
|
|
2671
|
+
);
|
|
2672
|
+
|
|
2673
|
+
// If the rectangle crosses the equator, compute D at the equator, too, because that's the
|
|
2674
|
+
// widest part of the rectangle when projected onto the globe.
|
|
2675
|
+
if (south < 0 && north > 0) {
|
|
2676
|
+
const equatorCartographic = viewRectangle3DCartographic1;
|
|
2677
|
+
equatorCartographic.longitude = west;
|
|
2678
|
+
equatorCartographic.latitude = 0.0;
|
|
2679
|
+
equatorCartographic.height = 0.0;
|
|
2680
|
+
let equatorPosition = ellipsoid.cartographicToCartesian(
|
|
2681
|
+
equatorCartographic,
|
|
2682
|
+
viewRectangle3DEquator,
|
|
2683
|
+
);
|
|
2684
|
+
Cartesian3.subtract(equatorPosition, center, equatorPosition);
|
|
2685
|
+
d = Math.max(
|
|
2686
|
+
d,
|
|
2687
|
+
computeD(direction, up, equatorPosition, tanPhi),
|
|
2688
|
+
computeD(direction, right, equatorPosition, tanTheta),
|
|
2689
|
+
);
|
|
2690
|
+
|
|
2691
|
+
equatorCartographic.longitude = east;
|
|
2692
|
+
equatorPosition = ellipsoid.cartographicToCartesian(
|
|
2693
|
+
equatorCartographic,
|
|
2694
|
+
viewRectangle3DEquator,
|
|
2695
|
+
);
|
|
2696
|
+
Cartesian3.subtract(equatorPosition, center, equatorPosition);
|
|
2697
|
+
d = Math.max(
|
|
2698
|
+
d,
|
|
2699
|
+
computeD(direction, up, equatorPosition, tanPhi),
|
|
2700
|
+
computeD(direction, right, equatorPosition, tanTheta),
|
|
2701
|
+
);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
return Cartesian3.add(
|
|
2706
|
+
center,
|
|
2707
|
+
Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator),
|
|
2708
|
+
result,
|
|
2709
|
+
);
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
const viewRectangleCVCartographic = new Cartographic();
|
|
2713
|
+
const viewRectangleCVNorthEast = new Cartesian3();
|
|
2714
|
+
const viewRectangleCVSouthWest = new Cartesian3();
|
|
2715
|
+
function rectangleCameraPositionColumbusView(camera, rectangle, result) {
|
|
2716
|
+
const projection = camera._projection;
|
|
2717
|
+
if (rectangle.west > rectangle.east) {
|
|
2718
|
+
rectangle = Rectangle.MAX_VALUE;
|
|
2719
|
+
}
|
|
2720
|
+
const transform = camera._actualTransform;
|
|
2721
|
+
const invTransform = camera._actualInvTransform;
|
|
2722
|
+
|
|
2723
|
+
const cart = viewRectangleCVCartographic;
|
|
2724
|
+
cart.longitude = rectangle.east;
|
|
2725
|
+
cart.latitude = rectangle.north;
|
|
2726
|
+
const northEast = projection.project(cart, viewRectangleCVNorthEast);
|
|
2727
|
+
Matrix4.multiplyByPoint(transform, northEast, northEast);
|
|
2728
|
+
Matrix4.multiplyByPoint(invTransform, northEast, northEast);
|
|
2729
|
+
|
|
2730
|
+
cart.longitude = rectangle.west;
|
|
2731
|
+
cart.latitude = rectangle.south;
|
|
2732
|
+
const southWest = projection.project(cart, viewRectangleCVSouthWest);
|
|
2733
|
+
Matrix4.multiplyByPoint(transform, southWest, southWest);
|
|
2734
|
+
Matrix4.multiplyByPoint(invTransform, southWest, southWest);
|
|
2735
|
+
|
|
2736
|
+
result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;
|
|
2737
|
+
result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;
|
|
2738
|
+
|
|
2739
|
+
if (defined(camera.frustum.fovy)) {
|
|
2740
|
+
const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
|
|
2741
|
+
const tanTheta = camera.frustum.aspectRatio * tanPhi;
|
|
2742
|
+
result.z =
|
|
2743
|
+
Math.max(
|
|
2744
|
+
(northEast.x - southWest.x) / tanTheta,
|
|
2745
|
+
(northEast.y - southWest.y) / tanPhi,
|
|
2746
|
+
) * 0.5;
|
|
2747
|
+
} else {
|
|
2748
|
+
const width = northEast.x - southWest.x;
|
|
2749
|
+
const height = northEast.y - southWest.y;
|
|
2750
|
+
result.z = Math.max(width, height);
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
return result;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
const viewRectangle2DCartographic = new Cartographic();
|
|
2757
|
+
const viewRectangle2DNorthEast = new Cartesian3();
|
|
2758
|
+
const viewRectangle2DSouthWest = new Cartesian3();
|
|
2759
|
+
function rectangleCameraPosition2D(camera, rectangle, result) {
|
|
2760
|
+
const projection = camera._projection;
|
|
2761
|
+
|
|
2762
|
+
// Account for the rectangle crossing the International Date Line in 2D mode
|
|
2763
|
+
let east = rectangle.east;
|
|
2764
|
+
if (rectangle.west > rectangle.east) {
|
|
2765
|
+
if (camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL) {
|
|
2766
|
+
east += CesiumMath.TWO_PI;
|
|
2767
|
+
} else {
|
|
2768
|
+
rectangle = Rectangle.MAX_VALUE;
|
|
2769
|
+
east = rectangle.east;
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
let cart = viewRectangle2DCartographic;
|
|
2774
|
+
cart.longitude = east;
|
|
2775
|
+
cart.latitude = rectangle.north;
|
|
2776
|
+
const northEast = projection.project(cart, viewRectangle2DNorthEast);
|
|
2777
|
+
cart.longitude = rectangle.west;
|
|
2778
|
+
cart.latitude = rectangle.south;
|
|
2779
|
+
const southWest = projection.project(cart, viewRectangle2DSouthWest);
|
|
2780
|
+
|
|
2781
|
+
const width = Math.abs(northEast.x - southWest.x) * 0.5;
|
|
2782
|
+
let height = Math.abs(northEast.y - southWest.y) * 0.5;
|
|
2783
|
+
|
|
2784
|
+
let right, top;
|
|
2785
|
+
const ratio = camera.frustum.right / camera.frustum.top;
|
|
2786
|
+
const heightRatio = height * ratio;
|
|
2787
|
+
if (width > heightRatio) {
|
|
2788
|
+
right = width;
|
|
2789
|
+
top = right / ratio;
|
|
2790
|
+
} else {
|
|
2791
|
+
top = height;
|
|
2792
|
+
right = heightRatio;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
height = Math.max(2.0 * right, 2.0 * top);
|
|
2796
|
+
|
|
2797
|
+
result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;
|
|
2798
|
+
result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;
|
|
2799
|
+
|
|
2800
|
+
cart = projection.unproject(result, cart);
|
|
2801
|
+
cart.height = height;
|
|
2802
|
+
result = projection.project(cart, result);
|
|
2803
|
+
|
|
2804
|
+
return result;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
/**
|
|
2808
|
+
* Get the camera position needed to view a rectangle on an ellipsoid or map
|
|
2809
|
+
*
|
|
2810
|
+
* @param {Rectangle} rectangle The rectangle to view.
|
|
2811
|
+
* @param {Cartesian3} [result] The camera position needed to view the rectangle
|
|
2812
|
+
* @returns {Cartesian3} The camera position needed to view the rectangle
|
|
2813
|
+
*/
|
|
2814
|
+
Camera.prototype.getRectangleCameraCoordinates = function (rectangle, result) {
|
|
2815
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2816
|
+
if (!defined(rectangle)) {
|
|
2817
|
+
throw new DeveloperError("rectangle is required");
|
|
2818
|
+
}
|
|
2819
|
+
//>>includeEnd('debug');
|
|
2820
|
+
const mode = this._mode;
|
|
2821
|
+
|
|
2822
|
+
if (!defined(result)) {
|
|
2823
|
+
result = new Cartesian3();
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
if (mode === SceneMode.SCENE3D) {
|
|
2827
|
+
return rectangleCameraPosition3D(this, rectangle, result);
|
|
2828
|
+
} else if (mode === SceneMode.COLUMBUS_VIEW) {
|
|
2829
|
+
return rectangleCameraPositionColumbusView(this, rectangle, result);
|
|
2830
|
+
} else if (mode === SceneMode.SCENE2D) {
|
|
2831
|
+
return rectangleCameraPosition2D(this, rectangle, result);
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
return undefined;
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
const pickEllipsoid3DRay = new Ray();
|
|
2838
|
+
function pickEllipsoid3D(camera, windowPosition, ellipsoid, result) {
|
|
2839
|
+
ellipsoid = ellipsoid ?? Ellipsoid.default;
|
|
2840
|
+
const ray = camera.getPickRay(windowPosition, pickEllipsoid3DRay);
|
|
2841
|
+
const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
|
|
2842
|
+
if (!intersection) {
|
|
2843
|
+
return undefined;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
const t = intersection.start > 0.0 ? intersection.start : intersection.stop;
|
|
2847
|
+
return Ray.getPoint(ray, t, result);
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
const pickEllipsoid2DRay = new Ray();
|
|
2851
|
+
function pickMap2D(camera, windowPosition, projection, result) {
|
|
2852
|
+
const ray = camera.getPickRay(windowPosition, pickEllipsoid2DRay);
|
|
2853
|
+
let position = ray.origin;
|
|
2854
|
+
position = Cartesian3.fromElements(position.y, position.z, 0.0, position);
|
|
2855
|
+
const cart = projection.unproject(position);
|
|
2856
|
+
|
|
2857
|
+
if (
|
|
2858
|
+
cart.latitude < -CesiumMath.PI_OVER_TWO ||
|
|
2859
|
+
cart.latitude > CesiumMath.PI_OVER_TWO
|
|
2860
|
+
) {
|
|
2861
|
+
return undefined;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
return projection.ellipsoid.cartographicToCartesian(cart, result);
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
const pickEllipsoidCVRay = new Ray();
|
|
2868
|
+
function pickMapColumbusView(camera, windowPosition, projection, result) {
|
|
2869
|
+
const ray = camera.getPickRay(windowPosition, pickEllipsoidCVRay);
|
|
2870
|
+
const scalar = -ray.origin.x / ray.direction.x;
|
|
2871
|
+
Ray.getPoint(ray, scalar, result);
|
|
2872
|
+
|
|
2873
|
+
const cart = projection.unproject(new Cartesian3(result.y, result.z, 0.0));
|
|
2874
|
+
|
|
2875
|
+
if (
|
|
2876
|
+
cart.latitude < -CesiumMath.PI_OVER_TWO ||
|
|
2877
|
+
cart.latitude > CesiumMath.PI_OVER_TWO ||
|
|
2878
|
+
cart.longitude < -Math.PI ||
|
|
2879
|
+
cart.longitude > Math.PI
|
|
2880
|
+
) {
|
|
2881
|
+
return undefined;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
return projection.ellipsoid.cartographicToCartesian(cart, result);
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
/**
|
|
2888
|
+
* Pick an ellipsoid or map.
|
|
2889
|
+
*
|
|
2890
|
+
* @param {Cartesian2} windowPosition The x and y coordinates of a pixel.
|
|
2891
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to pick.
|
|
2892
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
2893
|
+
* @returns {Cartesian3 | undefined} If the ellipsoid or map was picked,
|
|
2894
|
+
* returns the point on the surface of the ellipsoid or map in world
|
|
2895
|
+
* coordinates. If the ellipsoid or map was not picked, returns undefined.
|
|
2896
|
+
*
|
|
2897
|
+
* @example
|
|
2898
|
+
* const canvas = viewer.scene.canvas;
|
|
2899
|
+
* const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
|
|
2900
|
+
* const ellipsoid = viewer.scene.ellipsoid;
|
|
2901
|
+
* const result = viewer.camera.pickEllipsoid(center, ellipsoid);
|
|
2902
|
+
*/
|
|
2903
|
+
Camera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) {
|
|
2904
|
+
//>>includeStart('debug', pragmas.debug);
|
|
2905
|
+
if (!defined(windowPosition)) {
|
|
2906
|
+
throw new DeveloperError("windowPosition is required.");
|
|
2907
|
+
}
|
|
2908
|
+
//>>includeEnd('debug');
|
|
2909
|
+
|
|
2910
|
+
const canvas = this._scene.canvas;
|
|
2911
|
+
if (canvas.clientWidth === 0 || canvas.clientHeight === 0) {
|
|
2912
|
+
return undefined;
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
if (!defined(result)) {
|
|
2916
|
+
result = new Cartesian3();
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
ellipsoid = ellipsoid ?? Ellipsoid.default;
|
|
2920
|
+
|
|
2921
|
+
if (this._mode === SceneMode.SCENE3D) {
|
|
2922
|
+
result = pickEllipsoid3D(this, windowPosition, ellipsoid, result);
|
|
2923
|
+
} else if (this._mode === SceneMode.SCENE2D) {
|
|
2924
|
+
result = pickMap2D(this, windowPosition, this._projection, result);
|
|
2925
|
+
} else if (this._mode === SceneMode.COLUMBUS_VIEW) {
|
|
2926
|
+
result = pickMapColumbusView(
|
|
2927
|
+
this,
|
|
2928
|
+
windowPosition,
|
|
2929
|
+
this._projection,
|
|
2930
|
+
result,
|
|
2931
|
+
);
|
|
2932
|
+
} else {
|
|
2933
|
+
return undefined;
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
return result;
|
|
2937
|
+
};
|
|
2938
|
+
|
|
2939
|
+
const pickPerspCenter = new Cartesian3();
|
|
2940
|
+
const pickPerspXDir = new Cartesian3();
|
|
2941
|
+
const pickPerspYDir = new Cartesian3();
|
|
2942
|
+
function getPickRayPerspective(camera, windowPosition, result) {
|
|
2943
|
+
const canvas = camera._scene.canvas;
|
|
2944
|
+
const width = canvas.clientWidth;
|
|
2945
|
+
const height = canvas.clientHeight;
|
|
2946
|
+
|
|
2947
|
+
const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
|
|
2948
|
+
const tanTheta = camera.frustum.aspectRatio * tanPhi;
|
|
2949
|
+
const near = camera.frustum.near;
|
|
2950
|
+
|
|
2951
|
+
const x = (2.0 / width) * windowPosition.x - 1.0;
|
|
2952
|
+
const y = (2.0 / height) * (height - windowPosition.y) - 1.0;
|
|
2953
|
+
|
|
2954
|
+
const position = camera.positionWC;
|
|
2955
|
+
Cartesian3.clone(position, result.origin);
|
|
2956
|
+
|
|
2957
|
+
const nearCenter = Cartesian3.multiplyByScalar(
|
|
2958
|
+
camera.directionWC,
|
|
2959
|
+
near,
|
|
2960
|
+
pickPerspCenter,
|
|
2961
|
+
);
|
|
2962
|
+
Cartesian3.add(position, nearCenter, nearCenter);
|
|
2963
|
+
const xDir = Cartesian3.multiplyByScalar(
|
|
2964
|
+
camera.rightWC,
|
|
2965
|
+
x * near * tanTheta,
|
|
2966
|
+
pickPerspXDir,
|
|
2967
|
+
);
|
|
2968
|
+
const yDir = Cartesian3.multiplyByScalar(
|
|
2969
|
+
camera.upWC,
|
|
2970
|
+
y * near * tanPhi,
|
|
2971
|
+
pickPerspYDir,
|
|
2972
|
+
);
|
|
2973
|
+
const direction = Cartesian3.add(nearCenter, xDir, result.direction);
|
|
2974
|
+
Cartesian3.add(direction, yDir, direction);
|
|
2975
|
+
Cartesian3.subtract(direction, position, direction);
|
|
2976
|
+
Cartesian3.normalize(direction, direction);
|
|
2977
|
+
|
|
2978
|
+
return result;
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
const scratchDirection = new Cartesian3();
|
|
2982
|
+
|
|
2983
|
+
function getPickRayOrthographic(camera, windowPosition, result) {
|
|
2984
|
+
const canvas = camera._scene.canvas;
|
|
2985
|
+
const width = canvas.clientWidth;
|
|
2986
|
+
const height = canvas.clientHeight;
|
|
2987
|
+
|
|
2988
|
+
let frustum = camera.frustum;
|
|
2989
|
+
const offCenterFrustum = frustum.offCenterFrustum;
|
|
2990
|
+
if (defined(offCenterFrustum)) {
|
|
2991
|
+
frustum = offCenterFrustum;
|
|
2992
|
+
}
|
|
2993
|
+
let x = (2.0 / width) * windowPosition.x - 1.0;
|
|
2994
|
+
x *= (frustum.right - frustum.left) * 0.5;
|
|
2995
|
+
let y = (2.0 / height) * (height - windowPosition.y) - 1.0;
|
|
2996
|
+
y *= (frustum.top - frustum.bottom) * 0.5;
|
|
2997
|
+
|
|
2998
|
+
const origin = result.origin;
|
|
2999
|
+
Cartesian3.clone(camera.positionWC, origin);
|
|
3000
|
+
|
|
3001
|
+
Cartesian3.multiplyByScalar(camera.rightWC, x, scratchDirection);
|
|
3002
|
+
Cartesian3.add(scratchDirection, origin, origin);
|
|
3003
|
+
Cartesian3.multiplyByScalar(camera.upWC, y, scratchDirection);
|
|
3004
|
+
Cartesian3.add(scratchDirection, origin, origin);
|
|
3005
|
+
|
|
3006
|
+
Cartesian3.clone(camera.directionWC, result.direction);
|
|
3007
|
+
|
|
3008
|
+
return result;
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* Create a ray from the camera position through the pixel at <code>windowPosition</code>
|
|
3013
|
+
* in world coordinates.
|
|
3014
|
+
*
|
|
3015
|
+
* @param {Cartesian2} windowPosition The x and y coordinates of a pixel.
|
|
3016
|
+
* @param {Ray} [result] The object onto which to store the result.
|
|
3017
|
+
* @returns {Ray|undefined} Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.
|
|
3018
|
+
*/
|
|
3019
|
+
Camera.prototype.getPickRay = function (windowPosition, result) {
|
|
3020
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3021
|
+
if (!defined(windowPosition)) {
|
|
3022
|
+
throw new DeveloperError("windowPosition is required.");
|
|
3023
|
+
}
|
|
3024
|
+
//>>includeEnd('debug');
|
|
3025
|
+
|
|
3026
|
+
if (!defined(result)) {
|
|
3027
|
+
result = new Ray();
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
const canvas = this._scene.canvas;
|
|
3031
|
+
if (canvas.clientWidth <= 0 || canvas.clientHeight <= 0) {
|
|
3032
|
+
return undefined;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
const frustum = this.frustum;
|
|
3036
|
+
if (
|
|
3037
|
+
defined(frustum.aspectRatio) &&
|
|
3038
|
+
defined(frustum.fov) &&
|
|
3039
|
+
defined(frustum.near)
|
|
3040
|
+
) {
|
|
3041
|
+
return getPickRayPerspective(this, windowPosition, result);
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
return getPickRayOrthographic(this, windowPosition, result);
|
|
3045
|
+
};
|
|
3046
|
+
|
|
3047
|
+
const scratchToCenter = new Cartesian3();
|
|
3048
|
+
const scratchProj = new Cartesian3();
|
|
3049
|
+
|
|
3050
|
+
/**
|
|
3051
|
+
* Return the distance from the camera to the front of the bounding sphere.
|
|
3052
|
+
*
|
|
3053
|
+
* @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.
|
|
3054
|
+
* @returns {number} The distance to the bounding sphere.
|
|
3055
|
+
*/
|
|
3056
|
+
Camera.prototype.distanceToBoundingSphere = function (boundingSphere) {
|
|
3057
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3058
|
+
if (!defined(boundingSphere)) {
|
|
3059
|
+
throw new DeveloperError("boundingSphere is required.");
|
|
3060
|
+
}
|
|
3061
|
+
//>>includeEnd('debug');
|
|
3062
|
+
|
|
3063
|
+
const toCenter = Cartesian3.subtract(
|
|
3064
|
+
this.positionWC,
|
|
3065
|
+
boundingSphere.center,
|
|
3066
|
+
scratchToCenter,
|
|
3067
|
+
);
|
|
3068
|
+
const proj = Cartesian3.multiplyByScalar(
|
|
3069
|
+
this.directionWC,
|
|
3070
|
+
Cartesian3.dot(toCenter, this.directionWC),
|
|
3071
|
+
scratchProj,
|
|
3072
|
+
);
|
|
3073
|
+
return Math.max(0.0, Cartesian3.magnitude(proj) - boundingSphere.radius);
|
|
3074
|
+
};
|
|
3075
|
+
|
|
3076
|
+
const scratchPixelSize = new Cartesian2();
|
|
3077
|
+
|
|
3078
|
+
/**
|
|
3079
|
+
* Return the pixel size in meters.
|
|
3080
|
+
*
|
|
3081
|
+
* @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.
|
|
3082
|
+
* @param {number} drawingBufferWidth The drawing buffer width.
|
|
3083
|
+
* @param {number} drawingBufferHeight The drawing buffer height.
|
|
3084
|
+
* @returns {number} The pixel size in meters.
|
|
3085
|
+
*/
|
|
3086
|
+
Camera.prototype.getPixelSize = function (
|
|
3087
|
+
boundingSphere,
|
|
3088
|
+
drawingBufferWidth,
|
|
3089
|
+
drawingBufferHeight,
|
|
3090
|
+
) {
|
|
3091
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3092
|
+
if (!defined(boundingSphere)) {
|
|
3093
|
+
throw new DeveloperError("boundingSphere is required.");
|
|
3094
|
+
}
|
|
3095
|
+
if (!defined(drawingBufferWidth)) {
|
|
3096
|
+
throw new DeveloperError("drawingBufferWidth is required.");
|
|
3097
|
+
}
|
|
3098
|
+
if (!defined(drawingBufferHeight)) {
|
|
3099
|
+
throw new DeveloperError("drawingBufferHeight is required.");
|
|
3100
|
+
}
|
|
3101
|
+
//>>includeEnd('debug');
|
|
3102
|
+
|
|
3103
|
+
const distance = this.distanceToBoundingSphere(boundingSphere);
|
|
3104
|
+
const pixelSize = this.frustum.getPixelDimensions(
|
|
3105
|
+
drawingBufferWidth,
|
|
3106
|
+
drawingBufferHeight,
|
|
3107
|
+
distance,
|
|
3108
|
+
this._scene.pixelRatio,
|
|
3109
|
+
scratchPixelSize,
|
|
3110
|
+
);
|
|
3111
|
+
return Math.max(pixelSize.x, pixelSize.y);
|
|
3112
|
+
};
|
|
3113
|
+
|
|
3114
|
+
function createAnimationTemplateCV(
|
|
3115
|
+
camera,
|
|
3116
|
+
position,
|
|
3117
|
+
center,
|
|
3118
|
+
maxX,
|
|
3119
|
+
maxY,
|
|
3120
|
+
duration,
|
|
3121
|
+
) {
|
|
3122
|
+
const newPosition = Cartesian3.clone(position);
|
|
3123
|
+
|
|
3124
|
+
if (center.y > maxX) {
|
|
3125
|
+
newPosition.y -= center.y - maxX;
|
|
3126
|
+
} else if (center.y < -maxX) {
|
|
3127
|
+
newPosition.y += -maxX - center.y;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
if (center.z > maxY) {
|
|
3131
|
+
newPosition.z -= center.z - maxY;
|
|
3132
|
+
} else if (center.z < -maxY) {
|
|
3133
|
+
newPosition.z += -maxY - center.z;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
function updateCV(value) {
|
|
3137
|
+
const interp = Cartesian3.lerp(
|
|
3138
|
+
position,
|
|
3139
|
+
newPosition,
|
|
3140
|
+
value.time,
|
|
3141
|
+
new Cartesian3(),
|
|
3142
|
+
);
|
|
3143
|
+
camera.worldToCameraCoordinatesPoint(interp, camera.position);
|
|
3144
|
+
}
|
|
3145
|
+
return {
|
|
3146
|
+
easingFunction: EasingFunction.EXPONENTIAL_OUT,
|
|
3147
|
+
startObject: {
|
|
3148
|
+
time: 0.0,
|
|
3149
|
+
},
|
|
3150
|
+
stopObject: {
|
|
3151
|
+
time: 1.0,
|
|
3152
|
+
},
|
|
3153
|
+
duration: duration,
|
|
3154
|
+
update: updateCV,
|
|
3155
|
+
};
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
const normalScratch = new Cartesian3();
|
|
3159
|
+
const centerScratch = new Cartesian3();
|
|
3160
|
+
const posScratch = new Cartesian3();
|
|
3161
|
+
const scratchCartesian3Subtract = new Cartesian3();
|
|
3162
|
+
|
|
3163
|
+
function createAnimationCV(camera, duration) {
|
|
3164
|
+
let position = camera.position;
|
|
3165
|
+
const direction = camera.direction;
|
|
3166
|
+
|
|
3167
|
+
const normal = camera.worldToCameraCoordinatesVector(
|
|
3168
|
+
Cartesian3.UNIT_X,
|
|
3169
|
+
normalScratch,
|
|
3170
|
+
);
|
|
3171
|
+
const scalar =
|
|
3172
|
+
-Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);
|
|
3173
|
+
const center = Cartesian3.add(
|
|
3174
|
+
position,
|
|
3175
|
+
Cartesian3.multiplyByScalar(direction, scalar, centerScratch),
|
|
3176
|
+
centerScratch,
|
|
3177
|
+
);
|
|
3178
|
+
camera.cameraToWorldCoordinatesPoint(center, center);
|
|
3179
|
+
|
|
3180
|
+
position = camera.cameraToWorldCoordinatesPoint(camera.position, posScratch);
|
|
3181
|
+
|
|
3182
|
+
const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
|
|
3183
|
+
const tanTheta = camera.frustum.aspectRatio * tanPhi;
|
|
3184
|
+
const distToC = Cartesian3.magnitude(
|
|
3185
|
+
Cartesian3.subtract(position, center, scratchCartesian3Subtract),
|
|
3186
|
+
);
|
|
3187
|
+
const dWidth = tanTheta * distToC;
|
|
3188
|
+
const dHeight = tanPhi * distToC;
|
|
3189
|
+
|
|
3190
|
+
const mapWidth = camera._maxCoord.x;
|
|
3191
|
+
const mapHeight = camera._maxCoord.y;
|
|
3192
|
+
|
|
3193
|
+
const maxX = Math.max(dWidth - mapWidth, mapWidth);
|
|
3194
|
+
const maxY = Math.max(dHeight - mapHeight, mapHeight);
|
|
3195
|
+
|
|
3196
|
+
if (
|
|
3197
|
+
position.z < -maxX ||
|
|
3198
|
+
position.z > maxX ||
|
|
3199
|
+
position.y < -maxY ||
|
|
3200
|
+
position.y > maxY
|
|
3201
|
+
) {
|
|
3202
|
+
const translateX = center.y < -maxX || center.y > maxX;
|
|
3203
|
+
const translateY = center.z < -maxY || center.z > maxY;
|
|
3204
|
+
if (translateX || translateY) {
|
|
3205
|
+
return createAnimationTemplateCV(
|
|
3206
|
+
camera,
|
|
3207
|
+
position,
|
|
3208
|
+
center,
|
|
3209
|
+
maxX,
|
|
3210
|
+
maxY,
|
|
3211
|
+
duration,
|
|
3212
|
+
);
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
return undefined;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
/**
|
|
3220
|
+
* Create an animation to move the map into view. This method is only valid for 2D and Columbus modes.
|
|
3221
|
+
*
|
|
3222
|
+
* @param {number} duration The duration, in seconds, of the animation.
|
|
3223
|
+
* @returns {object} The animation or undefined if the scene mode is 3D or the map is already ion view.
|
|
3224
|
+
*
|
|
3225
|
+
* @private
|
|
3226
|
+
*/
|
|
3227
|
+
Camera.prototype.createCorrectPositionTween = function (duration) {
|
|
3228
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3229
|
+
if (!defined(duration)) {
|
|
3230
|
+
throw new DeveloperError("duration is required.");
|
|
3231
|
+
}
|
|
3232
|
+
//>>includeEnd('debug');
|
|
3233
|
+
|
|
3234
|
+
if (this._mode === SceneMode.COLUMBUS_VIEW) {
|
|
3235
|
+
return createAnimationCV(this, duration);
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
return undefined;
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
const scratchFlyToDestination = new Cartesian3();
|
|
3242
|
+
const newOptions = {
|
|
3243
|
+
destination: undefined,
|
|
3244
|
+
heading: undefined,
|
|
3245
|
+
pitch: undefined,
|
|
3246
|
+
roll: undefined,
|
|
3247
|
+
duration: undefined,
|
|
3248
|
+
complete: undefined,
|
|
3249
|
+
cancel: undefined,
|
|
3250
|
+
endTransform: undefined,
|
|
3251
|
+
maximumHeight: undefined,
|
|
3252
|
+
easingFunction: undefined,
|
|
3253
|
+
};
|
|
3254
|
+
|
|
3255
|
+
/**
|
|
3256
|
+
* Cancels the current camera flight and leaves the camera at its current location.
|
|
3257
|
+
* If no flight is in progress, this function does nothing.
|
|
3258
|
+
*/
|
|
3259
|
+
Camera.prototype.cancelFlight = function () {
|
|
3260
|
+
if (defined(this._currentFlight)) {
|
|
3261
|
+
this._currentFlight.cancelTween();
|
|
3262
|
+
this._currentFlight = undefined;
|
|
3263
|
+
}
|
|
3264
|
+
};
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* Completes the current camera flight and moves the camera immediately to its final destination.
|
|
3268
|
+
* If no flight is in progress, this function does nothing.
|
|
3269
|
+
*/
|
|
3270
|
+
Camera.prototype.completeFlight = function () {
|
|
3271
|
+
if (defined(this._currentFlight)) {
|
|
3272
|
+
this._currentFlight.cancelTween();
|
|
3273
|
+
|
|
3274
|
+
const options = {
|
|
3275
|
+
destination: undefined,
|
|
3276
|
+
orientation: {
|
|
3277
|
+
heading: undefined,
|
|
3278
|
+
pitch: undefined,
|
|
3279
|
+
roll: undefined,
|
|
3280
|
+
},
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
options.destination = newOptions.destination;
|
|
3284
|
+
options.orientation.heading = newOptions.heading;
|
|
3285
|
+
options.orientation.pitch = newOptions.pitch;
|
|
3286
|
+
options.orientation.roll = newOptions.roll;
|
|
3287
|
+
|
|
3288
|
+
this.setView(options);
|
|
3289
|
+
|
|
3290
|
+
if (defined(this._currentFlight.complete)) {
|
|
3291
|
+
this._currentFlight.complete();
|
|
3292
|
+
}
|
|
3293
|
+
|
|
3294
|
+
this._currentFlight = undefined;
|
|
3295
|
+
}
|
|
3296
|
+
};
|
|
3297
|
+
|
|
3298
|
+
/**
|
|
3299
|
+
* Flies the camera from its current position to a new position.
|
|
3300
|
+
*
|
|
3301
|
+
* @param {object} options Object with the following properties:
|
|
3302
|
+
* @param {Cartesian3|Rectangle} options.destination The final position of the camera in world coordinates or a rectangle that would be visible from a top-down view.
|
|
3303
|
+
* @param {object} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
|
|
3304
|
+
* towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
|
|
3305
|
+
* y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
|
|
3306
|
+
* @param {number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
|
|
3307
|
+
* @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.
|
|
3308
|
+
* @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.
|
|
3309
|
+
* @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.
|
|
3310
|
+
* @param {number} [options.maximumHeight] The maximum height at the peak of the flight.
|
|
3311
|
+
* @param {number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
|
|
3312
|
+
* @param {number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
|
|
3313
|
+
* @param {number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
|
|
3314
|
+
* @param {boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
|
|
3315
|
+
* @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.
|
|
3316
|
+
*
|
|
3317
|
+
* @exception {DeveloperError} If either direction or up is given, then both are required.
|
|
3318
|
+
*
|
|
3319
|
+
* @example
|
|
3320
|
+
* // 1. Fly to a position with a top-down view
|
|
3321
|
+
* viewer.camera.flyTo({
|
|
3322
|
+
* destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
|
|
3323
|
+
* });
|
|
3324
|
+
*
|
|
3325
|
+
* // 2. Fly to a Rectangle with a top-down view
|
|
3326
|
+
* viewer.camera.flyTo({
|
|
3327
|
+
* destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
|
|
3328
|
+
* });
|
|
3329
|
+
*
|
|
3330
|
+
* // 3. Fly to a position with an orientation using unit vectors.
|
|
3331
|
+
* viewer.camera.flyTo({
|
|
3332
|
+
* destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
|
|
3333
|
+
* orientation : {
|
|
3334
|
+
* direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
|
|
3335
|
+
* up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
|
|
3336
|
+
* }
|
|
3337
|
+
* });
|
|
3338
|
+
*
|
|
3339
|
+
* // 4. Fly to a position with an orientation using heading, pitch and roll.
|
|
3340
|
+
* viewer.camera.flyTo({
|
|
3341
|
+
* destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
|
|
3342
|
+
* orientation : {
|
|
3343
|
+
* heading : Cesium.Math.toRadians(175.0),
|
|
3344
|
+
* pitch : Cesium.Math.toRadians(-35.0),
|
|
3345
|
+
* roll : 0.0
|
|
3346
|
+
* }
|
|
3347
|
+
* });
|
|
3348
|
+
*/
|
|
3349
|
+
Camera.prototype.flyTo = function (options) {
|
|
3350
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3351
|
+
let destination = options.destination;
|
|
3352
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3353
|
+
if (!defined(destination)) {
|
|
3354
|
+
throw new DeveloperError("destination is required.");
|
|
3355
|
+
}
|
|
3356
|
+
//>>includeEnd('debug');
|
|
3357
|
+
|
|
3358
|
+
const mode = this._mode;
|
|
3359
|
+
if (mode === SceneMode.MORPHING) {
|
|
3360
|
+
return;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
this.cancelFlight();
|
|
3364
|
+
|
|
3365
|
+
const isRectangle = destination instanceof Rectangle;
|
|
3366
|
+
if (isRectangle) {
|
|
3367
|
+
destination = this.getRectangleCameraCoordinates(
|
|
3368
|
+
destination,
|
|
3369
|
+
scratchFlyToDestination,
|
|
3370
|
+
);
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
let orientation = options.orientation ?? Frozen.EMPTY_OBJECT;
|
|
3374
|
+
if (defined(orientation.direction)) {
|
|
3375
|
+
orientation = directionUpToHeadingPitchRoll(
|
|
3376
|
+
this,
|
|
3377
|
+
destination,
|
|
3378
|
+
orientation,
|
|
3379
|
+
scratchSetViewOptions.orientation,
|
|
3380
|
+
);
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
if (defined(options.duration) && options.duration <= 0.0) {
|
|
3384
|
+
const setViewOptions = scratchSetViewOptions;
|
|
3385
|
+
setViewOptions.destination = options.destination;
|
|
3386
|
+
setViewOptions.orientation.heading = orientation.heading;
|
|
3387
|
+
setViewOptions.orientation.pitch = orientation.pitch;
|
|
3388
|
+
setViewOptions.orientation.roll = orientation.roll;
|
|
3389
|
+
setViewOptions.convert = options.convert;
|
|
3390
|
+
setViewOptions.endTransform = options.endTransform;
|
|
3391
|
+
this.setView(setViewOptions);
|
|
3392
|
+
if (typeof options.complete === "function") {
|
|
3393
|
+
options.complete();
|
|
3394
|
+
}
|
|
3395
|
+
return;
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
const that = this;
|
|
3399
|
+
/* eslint-disable-next-line prefer-const */
|
|
3400
|
+
let flightTween;
|
|
3401
|
+
|
|
3402
|
+
newOptions.destination = destination;
|
|
3403
|
+
newOptions.heading = orientation.heading;
|
|
3404
|
+
newOptions.pitch = orientation.pitch;
|
|
3405
|
+
newOptions.roll = orientation.roll;
|
|
3406
|
+
newOptions.duration = options.duration;
|
|
3407
|
+
newOptions.complete = function () {
|
|
3408
|
+
if (flightTween === that._currentFlight) {
|
|
3409
|
+
that._currentFlight = undefined;
|
|
3410
|
+
}
|
|
3411
|
+
if (defined(options.complete)) {
|
|
3412
|
+
options.complete();
|
|
3413
|
+
}
|
|
3414
|
+
};
|
|
3415
|
+
newOptions.cancel = options.cancel;
|
|
3416
|
+
newOptions.endTransform = options.endTransform;
|
|
3417
|
+
newOptions.convert = isRectangle ? false : options.convert;
|
|
3418
|
+
newOptions.maximumHeight = options.maximumHeight;
|
|
3419
|
+
newOptions.pitchAdjustHeight = options.pitchAdjustHeight;
|
|
3420
|
+
newOptions.flyOverLongitude = options.flyOverLongitude;
|
|
3421
|
+
newOptions.flyOverLongitudeWeight = options.flyOverLongitudeWeight;
|
|
3422
|
+
newOptions.easingFunction = options.easingFunction;
|
|
3423
|
+
|
|
3424
|
+
const scene = this._scene;
|
|
3425
|
+
const tweenOptions = CameraFlightPath.createTween(scene, newOptions);
|
|
3426
|
+
// If the camera doesn't actually need to go anywhere, duration
|
|
3427
|
+
// will be 0 and we can just complete the current flight.
|
|
3428
|
+
if (tweenOptions.duration === 0) {
|
|
3429
|
+
if (typeof tweenOptions.complete === "function") {
|
|
3430
|
+
tweenOptions.complete();
|
|
3431
|
+
}
|
|
3432
|
+
return;
|
|
3433
|
+
}
|
|
3434
|
+
flightTween = scene.tweens.add(tweenOptions);
|
|
3435
|
+
this._currentFlight = flightTween;
|
|
3436
|
+
|
|
3437
|
+
// Save the final destination view information for the PRELOAD_FLIGHT pass.
|
|
3438
|
+
let preloadFlightCamera = this._scene.preloadFlightCamera;
|
|
3439
|
+
if (this._mode !== SceneMode.SCENE2D) {
|
|
3440
|
+
if (!defined(preloadFlightCamera)) {
|
|
3441
|
+
preloadFlightCamera = Camera.clone(this);
|
|
3442
|
+
}
|
|
3443
|
+
preloadFlightCamera.setView({
|
|
3444
|
+
destination: destination,
|
|
3445
|
+
orientation: orientation,
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3448
|
+
this._scene.preloadFlightCullingVolume =
|
|
3449
|
+
preloadFlightCamera.frustum.computeCullingVolume(
|
|
3450
|
+
preloadFlightCamera.positionWC,
|
|
3451
|
+
preloadFlightCamera.directionWC,
|
|
3452
|
+
preloadFlightCamera.upWC,
|
|
3453
|
+
);
|
|
3454
|
+
}
|
|
3455
|
+
};
|
|
3456
|
+
|
|
3457
|
+
function distanceToBoundingSphere3D(camera, radius) {
|
|
3458
|
+
const frustum = camera.frustum;
|
|
3459
|
+
const tanPhi = Math.tan(frustum.fovy * 0.5);
|
|
3460
|
+
const tanTheta = frustum.aspectRatio * tanPhi;
|
|
3461
|
+
return Math.max(radius / tanTheta, radius / tanPhi);
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
function distanceToBoundingSphere2D(camera, radius) {
|
|
3465
|
+
let frustum = camera.frustum;
|
|
3466
|
+
const offCenterFrustum = frustum.offCenterFrustum;
|
|
3467
|
+
if (defined(offCenterFrustum)) {
|
|
3468
|
+
frustum = offCenterFrustum;
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
let right, top;
|
|
3472
|
+
const ratio = frustum.right / frustum.top;
|
|
3473
|
+
const heightRatio = radius * ratio;
|
|
3474
|
+
if (radius > heightRatio) {
|
|
3475
|
+
right = radius;
|
|
3476
|
+
top = right / ratio;
|
|
3477
|
+
} else {
|
|
3478
|
+
top = radius;
|
|
3479
|
+
right = heightRatio;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
return Math.max(right, top) * 1.5;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
const MINIMUM_ZOOM = 100.0;
|
|
3486
|
+
|
|
3487
|
+
function adjustBoundingSphereOffset(camera, boundingSphere, offset) {
|
|
3488
|
+
offset = HeadingPitchRange.clone(
|
|
3489
|
+
defined(offset) ? offset : Camera.DEFAULT_OFFSET,
|
|
3490
|
+
);
|
|
3491
|
+
|
|
3492
|
+
const minimumZoom =
|
|
3493
|
+
camera._scene.screenSpaceCameraController.minimumZoomDistance;
|
|
3494
|
+
const maximumZoom =
|
|
3495
|
+
camera._scene.screenSpaceCameraController.maximumZoomDistance;
|
|
3496
|
+
const range = offset.range;
|
|
3497
|
+
if (!defined(range) || range === 0.0) {
|
|
3498
|
+
const radius = boundingSphere.radius;
|
|
3499
|
+
if (radius === 0.0) {
|
|
3500
|
+
offset.range = MINIMUM_ZOOM;
|
|
3501
|
+
} else if (
|
|
3502
|
+
camera.frustum instanceof OrthographicFrustum ||
|
|
3503
|
+
camera._mode === SceneMode.SCENE2D
|
|
3504
|
+
) {
|
|
3505
|
+
offset.range = distanceToBoundingSphere2D(camera, radius);
|
|
3506
|
+
} else {
|
|
3507
|
+
offset.range = distanceToBoundingSphere3D(camera, radius);
|
|
3508
|
+
}
|
|
3509
|
+
offset.range = CesiumMath.clamp(offset.range, minimumZoom, maximumZoom);
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
return offset;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* Sets the camera so that the current view contains the provided bounding sphere.
|
|
3517
|
+
*
|
|
3518
|
+
* <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
|
|
3519
|
+
* The heading and the pitch angles are defined in the local east-north-up reference frame.
|
|
3520
|
+
* The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
|
|
3521
|
+
* angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
|
|
3522
|
+
* zero, a range will be computed such that the whole bounding sphere is visible.</p>
|
|
3523
|
+
*
|
|
3524
|
+
* <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
|
|
3525
|
+
* target will be the range. The heading will be determined from the offset. If the heading cannot be
|
|
3526
|
+
* determined from the offset, the heading will be north.</p>
|
|
3527
|
+
*
|
|
3528
|
+
* @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.
|
|
3529
|
+
* @param {HeadingPitchRange} [offset] The offset from the target in the local east-north-up reference frame centered at the target.
|
|
3530
|
+
*
|
|
3531
|
+
* @exception {DeveloperError} viewBoundingSphere is not supported while morphing.
|
|
3532
|
+
*/
|
|
3533
|
+
Camera.prototype.viewBoundingSphere = function (boundingSphere, offset) {
|
|
3534
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3535
|
+
if (!defined(boundingSphere)) {
|
|
3536
|
+
throw new DeveloperError("boundingSphere is required.");
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
if (this._mode === SceneMode.MORPHING) {
|
|
3540
|
+
throw new DeveloperError(
|
|
3541
|
+
"viewBoundingSphere is not supported while morphing.",
|
|
3542
|
+
);
|
|
3543
|
+
}
|
|
3544
|
+
//>>includeEnd('debug');
|
|
3545
|
+
|
|
3546
|
+
offset = adjustBoundingSphereOffset(this, boundingSphere, offset);
|
|
3547
|
+
this.lookAt(boundingSphere.center, offset);
|
|
3548
|
+
};
|
|
3549
|
+
|
|
3550
|
+
const scratchflyToBoundingSphereTransform = new Matrix4();
|
|
3551
|
+
const scratchflyToBoundingSphereDestination = new Cartesian3();
|
|
3552
|
+
const scratchflyToBoundingSphereDirection = new Cartesian3();
|
|
3553
|
+
const scratchflyToBoundingSphereUp = new Cartesian3();
|
|
3554
|
+
const scratchflyToBoundingSphereRight = new Cartesian3();
|
|
3555
|
+
const scratchFlyToBoundingSphereCart4 = new Cartesian4();
|
|
3556
|
+
const scratchFlyToBoundingSphereQuaternion = new Quaternion();
|
|
3557
|
+
const scratchFlyToBoundingSphereMatrix3 = new Matrix3();
|
|
3558
|
+
|
|
3559
|
+
/**
|
|
3560
|
+
* Flies the camera to a location where the current view contains the provided bounding sphere.
|
|
3561
|
+
*
|
|
3562
|
+
* <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
|
|
3563
|
+
* The heading and the pitch angles are defined in the local east-north-up reference frame.
|
|
3564
|
+
* The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
|
|
3565
|
+
* angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
|
|
3566
|
+
* zero, a range will be computed such that the whole bounding sphere is visible.</p>
|
|
3567
|
+
*
|
|
3568
|
+
* <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the
|
|
3569
|
+
* target will be the range. The heading will be aligned to local north.</p>
|
|
3570
|
+
*
|
|
3571
|
+
* @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.
|
|
3572
|
+
* @param {object} [options] Object with the following properties:
|
|
3573
|
+
* @param {number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
|
|
3574
|
+
* @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.
|
|
3575
|
+
* @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.
|
|
3576
|
+
* @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.
|
|
3577
|
+
* @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.
|
|
3578
|
+
* @param {number} [options.maximumHeight] The maximum height at the peak of the flight.
|
|
3579
|
+
* @param {number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
|
|
3580
|
+
* @param {number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
|
|
3581
|
+
* @param {number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
|
|
3582
|
+
* @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.
|
|
3583
|
+
*/
|
|
3584
|
+
Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) {
|
|
3585
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3586
|
+
if (!defined(boundingSphere)) {
|
|
3587
|
+
throw new DeveloperError("boundingSphere is required.");
|
|
3588
|
+
}
|
|
3589
|
+
//>>includeEnd('debug');
|
|
3590
|
+
|
|
3591
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3592
|
+
const scene2D =
|
|
3593
|
+
this._mode === SceneMode.SCENE2D || this._mode === SceneMode.COLUMBUS_VIEW;
|
|
3594
|
+
this._setTransform(Matrix4.IDENTITY);
|
|
3595
|
+
const offset = adjustBoundingSphereOffset(
|
|
3596
|
+
this,
|
|
3597
|
+
boundingSphere,
|
|
3598
|
+
options.offset,
|
|
3599
|
+
);
|
|
3600
|
+
|
|
3601
|
+
let position;
|
|
3602
|
+
if (scene2D) {
|
|
3603
|
+
position = Cartesian3.multiplyByScalar(
|
|
3604
|
+
Cartesian3.UNIT_Z,
|
|
3605
|
+
offset.range,
|
|
3606
|
+
scratchflyToBoundingSphereDestination,
|
|
3607
|
+
);
|
|
3608
|
+
} else {
|
|
3609
|
+
position = offsetFromHeadingPitchRange(
|
|
3610
|
+
offset.heading,
|
|
3611
|
+
offset.pitch,
|
|
3612
|
+
offset.range,
|
|
3613
|
+
);
|
|
3614
|
+
}
|
|
3615
|
+
|
|
3616
|
+
const scene = this._scene;
|
|
3617
|
+
const ellipsoid = scene.ellipsoid ?? Ellipsoid.default;
|
|
3618
|
+
|
|
3619
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
3620
|
+
boundingSphere.center,
|
|
3621
|
+
ellipsoid,
|
|
3622
|
+
scratchflyToBoundingSphereTransform,
|
|
3623
|
+
);
|
|
3624
|
+
Matrix4.multiplyByPoint(transform, position, position);
|
|
3625
|
+
|
|
3626
|
+
let direction;
|
|
3627
|
+
let up;
|
|
3628
|
+
|
|
3629
|
+
if (!scene2D) {
|
|
3630
|
+
direction = Cartesian3.subtract(
|
|
3631
|
+
boundingSphere.center,
|
|
3632
|
+
position,
|
|
3633
|
+
scratchflyToBoundingSphereDirection,
|
|
3634
|
+
);
|
|
3635
|
+
Cartesian3.normalize(direction, direction);
|
|
3636
|
+
|
|
3637
|
+
up = Matrix4.multiplyByPointAsVector(
|
|
3638
|
+
transform,
|
|
3639
|
+
Cartesian3.UNIT_Z,
|
|
3640
|
+
scratchflyToBoundingSphereUp,
|
|
3641
|
+
);
|
|
3642
|
+
if (1.0 - Math.abs(Cartesian3.dot(direction, up)) < CesiumMath.EPSILON6) {
|
|
3643
|
+
const rotateQuat = Quaternion.fromAxisAngle(
|
|
3644
|
+
direction,
|
|
3645
|
+
offset.heading,
|
|
3646
|
+
scratchFlyToBoundingSphereQuaternion,
|
|
3647
|
+
);
|
|
3648
|
+
const rotation = Matrix3.fromQuaternion(
|
|
3649
|
+
rotateQuat,
|
|
3650
|
+
scratchFlyToBoundingSphereMatrix3,
|
|
3651
|
+
);
|
|
3652
|
+
|
|
3653
|
+
Cartesian3.fromCartesian4(
|
|
3654
|
+
Matrix4.getColumn(transform, 1, scratchFlyToBoundingSphereCart4),
|
|
3655
|
+
up,
|
|
3656
|
+
);
|
|
3657
|
+
Matrix3.multiplyByVector(rotation, up, up);
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
const right = Cartesian3.cross(
|
|
3661
|
+
direction,
|
|
3662
|
+
up,
|
|
3663
|
+
scratchflyToBoundingSphereRight,
|
|
3664
|
+
);
|
|
3665
|
+
Cartesian3.cross(right, direction, up);
|
|
3666
|
+
Cartesian3.normalize(up, up);
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
this.flyTo({
|
|
3670
|
+
destination: position,
|
|
3671
|
+
orientation: {
|
|
3672
|
+
direction: direction,
|
|
3673
|
+
up: up,
|
|
3674
|
+
},
|
|
3675
|
+
duration: options.duration,
|
|
3676
|
+
complete: options.complete,
|
|
3677
|
+
cancel: options.cancel,
|
|
3678
|
+
endTransform: options.endTransform,
|
|
3679
|
+
maximumHeight: options.maximumHeight,
|
|
3680
|
+
easingFunction: options.easingFunction,
|
|
3681
|
+
flyOverLongitude: options.flyOverLongitude,
|
|
3682
|
+
flyOverLongitudeWeight: options.flyOverLongitudeWeight,
|
|
3683
|
+
pitchAdjustHeight: options.pitchAdjustHeight,
|
|
3684
|
+
});
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
const scratchCartesian3_1 = new Cartesian3();
|
|
3688
|
+
const scratchCartesian3_2 = new Cartesian3();
|
|
3689
|
+
const scratchCartesian3_3 = new Cartesian3();
|
|
3690
|
+
const scratchCartesian3_4 = new Cartesian3();
|
|
3691
|
+
const horizonPoints = [
|
|
3692
|
+
new Cartesian3(),
|
|
3693
|
+
new Cartesian3(),
|
|
3694
|
+
new Cartesian3(),
|
|
3695
|
+
new Cartesian3(),
|
|
3696
|
+
];
|
|
3697
|
+
|
|
3698
|
+
function computeHorizonQuad(camera, ellipsoid) {
|
|
3699
|
+
const radii = ellipsoid.radii;
|
|
3700
|
+
const p = camera.positionWC;
|
|
3701
|
+
|
|
3702
|
+
// Find the corresponding position in the scaled space of the ellipsoid.
|
|
3703
|
+
const q = Cartesian3.multiplyComponents(
|
|
3704
|
+
ellipsoid.oneOverRadii,
|
|
3705
|
+
p,
|
|
3706
|
+
scratchCartesian3_1,
|
|
3707
|
+
);
|
|
3708
|
+
|
|
3709
|
+
const qMagnitude = Cartesian3.magnitude(q);
|
|
3710
|
+
const qUnit = Cartesian3.normalize(q, scratchCartesian3_2);
|
|
3711
|
+
|
|
3712
|
+
// Determine the east and north directions at q.
|
|
3713
|
+
let eUnit;
|
|
3714
|
+
let nUnit;
|
|
3715
|
+
if (
|
|
3716
|
+
Cartesian3.equalsEpsilon(qUnit, Cartesian3.UNIT_Z, CesiumMath.EPSILON10)
|
|
3717
|
+
) {
|
|
3718
|
+
eUnit = new Cartesian3(0, 1, 0);
|
|
3719
|
+
nUnit = new Cartesian3(0, 0, 1);
|
|
3720
|
+
} else {
|
|
3721
|
+
eUnit = Cartesian3.normalize(
|
|
3722
|
+
Cartesian3.cross(Cartesian3.UNIT_Z, qUnit, scratchCartesian3_3),
|
|
3723
|
+
scratchCartesian3_3,
|
|
3724
|
+
);
|
|
3725
|
+
nUnit = Cartesian3.normalize(
|
|
3726
|
+
Cartesian3.cross(qUnit, eUnit, scratchCartesian3_4),
|
|
3727
|
+
scratchCartesian3_4,
|
|
3728
|
+
);
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
// Determine the radius of the 'limb' of the ellipsoid.
|
|
3732
|
+
const wMagnitude = Math.sqrt(Cartesian3.magnitudeSquared(q) - 1.0);
|
|
3733
|
+
|
|
3734
|
+
// Compute the center and offsets.
|
|
3735
|
+
const center = Cartesian3.multiplyByScalar(
|
|
3736
|
+
qUnit,
|
|
3737
|
+
1.0 / qMagnitude,
|
|
3738
|
+
scratchCartesian3_1,
|
|
3739
|
+
);
|
|
3740
|
+
const scalar = wMagnitude / qMagnitude;
|
|
3741
|
+
const eastOffset = Cartesian3.multiplyByScalar(
|
|
3742
|
+
eUnit,
|
|
3743
|
+
scalar,
|
|
3744
|
+
scratchCartesian3_2,
|
|
3745
|
+
);
|
|
3746
|
+
const northOffset = Cartesian3.multiplyByScalar(
|
|
3747
|
+
nUnit,
|
|
3748
|
+
scalar,
|
|
3749
|
+
scratchCartesian3_3,
|
|
3750
|
+
);
|
|
3751
|
+
|
|
3752
|
+
// A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.
|
|
3753
|
+
const upperLeft = Cartesian3.add(center, northOffset, horizonPoints[0]);
|
|
3754
|
+
Cartesian3.subtract(upperLeft, eastOffset, upperLeft);
|
|
3755
|
+
Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);
|
|
3756
|
+
|
|
3757
|
+
const lowerLeft = Cartesian3.subtract(center, northOffset, horizonPoints[1]);
|
|
3758
|
+
Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);
|
|
3759
|
+
Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);
|
|
3760
|
+
|
|
3761
|
+
const lowerRight = Cartesian3.subtract(center, northOffset, horizonPoints[2]);
|
|
3762
|
+
Cartesian3.add(lowerRight, eastOffset, lowerRight);
|
|
3763
|
+
Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);
|
|
3764
|
+
|
|
3765
|
+
const upperRight = Cartesian3.add(center, northOffset, horizonPoints[3]);
|
|
3766
|
+
Cartesian3.add(upperRight, eastOffset, upperRight);
|
|
3767
|
+
Cartesian3.multiplyComponents(radii, upperRight, upperRight);
|
|
3768
|
+
|
|
3769
|
+
return horizonPoints;
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
const scratchPickCartesian2 = new Cartesian2();
|
|
3773
|
+
const scratchRectCartesian = new Cartesian3();
|
|
3774
|
+
const cartoArray = [
|
|
3775
|
+
new Cartographic(),
|
|
3776
|
+
new Cartographic(),
|
|
3777
|
+
new Cartographic(),
|
|
3778
|
+
new Cartographic(),
|
|
3779
|
+
];
|
|
3780
|
+
function addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) {
|
|
3781
|
+
scratchPickCartesian2.x = x;
|
|
3782
|
+
scratchPickCartesian2.y = y;
|
|
3783
|
+
const r = camera.pickEllipsoid(
|
|
3784
|
+
scratchPickCartesian2,
|
|
3785
|
+
ellipsoid,
|
|
3786
|
+
scratchRectCartesian,
|
|
3787
|
+
);
|
|
3788
|
+
if (defined(r)) {
|
|
3789
|
+
cartoArray[index] = ellipsoid.cartesianToCartographic(r, cartoArray[index]);
|
|
3790
|
+
return 1;
|
|
3791
|
+
}
|
|
3792
|
+
cartoArray[index] = ellipsoid.cartesianToCartographic(
|
|
3793
|
+
computedHorizonQuad[index],
|
|
3794
|
+
cartoArray[index],
|
|
3795
|
+
);
|
|
3796
|
+
return 0;
|
|
3797
|
+
}
|
|
3798
|
+
/**
|
|
3799
|
+
* Computes the approximate visible rectangle on the ellipsoid.
|
|
3800
|
+
*
|
|
3801
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid that you want to know the visible region.
|
|
3802
|
+
* @param {Rectangle} [result] The rectangle in which to store the result
|
|
3803
|
+
*
|
|
3804
|
+
* @returns {Rectangle|undefined} The visible rectangle or undefined if the ellipsoid isn't visible at all.
|
|
3805
|
+
*/
|
|
3806
|
+
Camera.prototype.computeViewRectangle = function (ellipsoid, result) {
|
|
3807
|
+
ellipsoid = ellipsoid ?? Ellipsoid.default;
|
|
3808
|
+
const cullingVolume = this.frustum.computeCullingVolume(
|
|
3809
|
+
this.positionWC,
|
|
3810
|
+
this.directionWC,
|
|
3811
|
+
this.upWC,
|
|
3812
|
+
);
|
|
3813
|
+
const boundingSphere = new BoundingSphere(
|
|
3814
|
+
Cartesian3.ZERO,
|
|
3815
|
+
ellipsoid.maximumRadius,
|
|
3816
|
+
);
|
|
3817
|
+
const visibility = cullingVolume.computeVisibility(boundingSphere);
|
|
3818
|
+
if (visibility === Intersect.OUTSIDE) {
|
|
3819
|
+
return undefined;
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
const canvas = this._scene.canvas;
|
|
3823
|
+
const width = canvas.clientWidth;
|
|
3824
|
+
const height = canvas.clientHeight;
|
|
3825
|
+
|
|
3826
|
+
let successfulPickCount = 0;
|
|
3827
|
+
|
|
3828
|
+
const computedHorizonQuad = computeHorizonQuad(this, ellipsoid);
|
|
3829
|
+
|
|
3830
|
+
successfulPickCount += addToResult(
|
|
3831
|
+
0,
|
|
3832
|
+
0,
|
|
3833
|
+
0,
|
|
3834
|
+
this,
|
|
3835
|
+
ellipsoid,
|
|
3836
|
+
computedHorizonQuad,
|
|
3837
|
+
);
|
|
3838
|
+
successfulPickCount += addToResult(
|
|
3839
|
+
0,
|
|
3840
|
+
height,
|
|
3841
|
+
1,
|
|
3842
|
+
this,
|
|
3843
|
+
ellipsoid,
|
|
3844
|
+
computedHorizonQuad,
|
|
3845
|
+
);
|
|
3846
|
+
successfulPickCount += addToResult(
|
|
3847
|
+
width,
|
|
3848
|
+
height,
|
|
3849
|
+
2,
|
|
3850
|
+
this,
|
|
3851
|
+
ellipsoid,
|
|
3852
|
+
computedHorizonQuad,
|
|
3853
|
+
);
|
|
3854
|
+
successfulPickCount += addToResult(
|
|
3855
|
+
width,
|
|
3856
|
+
0,
|
|
3857
|
+
3,
|
|
3858
|
+
this,
|
|
3859
|
+
ellipsoid,
|
|
3860
|
+
computedHorizonQuad,
|
|
3861
|
+
);
|
|
3862
|
+
|
|
3863
|
+
if (successfulPickCount < 2) {
|
|
3864
|
+
// If we have space non-globe in 3 or 4 corners then return the whole globe
|
|
3865
|
+
return Rectangle.MAX_VALUE;
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
result = Rectangle.fromCartographicArray(cartoArray, result);
|
|
3869
|
+
|
|
3870
|
+
// Detect if we go over the poles
|
|
3871
|
+
let distance = 0;
|
|
3872
|
+
let lastLon = cartoArray[3].longitude;
|
|
3873
|
+
for (let i = 0; i < 4; ++i) {
|
|
3874
|
+
const lon = cartoArray[i].longitude;
|
|
3875
|
+
const diff = Math.abs(lon - lastLon);
|
|
3876
|
+
if (diff > CesiumMath.PI) {
|
|
3877
|
+
// Crossed the dateline
|
|
3878
|
+
distance += CesiumMath.TWO_PI - diff;
|
|
3879
|
+
} else {
|
|
3880
|
+
distance += diff;
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
lastLon = lon;
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
// We are over one of the poles so adjust the rectangle accordingly
|
|
3887
|
+
if (
|
|
3888
|
+
CesiumMath.equalsEpsilon(
|
|
3889
|
+
Math.abs(distance),
|
|
3890
|
+
CesiumMath.TWO_PI,
|
|
3891
|
+
CesiumMath.EPSILON9,
|
|
3892
|
+
)
|
|
3893
|
+
) {
|
|
3894
|
+
result.west = -CesiumMath.PI;
|
|
3895
|
+
result.east = CesiumMath.PI;
|
|
3896
|
+
if (cartoArray[0].latitude >= 0.0) {
|
|
3897
|
+
result.north = CesiumMath.PI_OVER_TWO;
|
|
3898
|
+
} else {
|
|
3899
|
+
result.south = -CesiumMath.PI_OVER_TWO;
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
return result;
|
|
3904
|
+
};
|
|
3905
|
+
|
|
3906
|
+
/**
|
|
3907
|
+
* Switches the frustum/projection to perspective.
|
|
3908
|
+
*
|
|
3909
|
+
* This function is a no-op in 2D which must always be orthographic.
|
|
3910
|
+
*/
|
|
3911
|
+
Camera.prototype.switchToPerspectiveFrustum = function () {
|
|
3912
|
+
if (
|
|
3913
|
+
this._mode === SceneMode.SCENE2D ||
|
|
3914
|
+
this.frustum instanceof PerspectiveFrustum
|
|
3915
|
+
) {
|
|
3916
|
+
return;
|
|
3917
|
+
}
|
|
3918
|
+
|
|
3919
|
+
const scene = this._scene;
|
|
3920
|
+
this.frustum = new PerspectiveFrustum();
|
|
3921
|
+
this.frustum.aspectRatio =
|
|
3922
|
+
scene.drawingBufferWidth / scene.drawingBufferHeight;
|
|
3923
|
+
this.frustum.fov = CesiumMath.toRadians(60.0);
|
|
3924
|
+
};
|
|
3925
|
+
|
|
3926
|
+
/**
|
|
3927
|
+
* Switches the frustum/projection to orthographic.
|
|
3928
|
+
*
|
|
3929
|
+
* This function is a no-op in 2D which will always be orthographic.
|
|
3930
|
+
*/
|
|
3931
|
+
Camera.prototype.switchToOrthographicFrustum = function () {
|
|
3932
|
+
if (
|
|
3933
|
+
this._mode === SceneMode.SCENE2D ||
|
|
3934
|
+
this.frustum instanceof OrthographicFrustum
|
|
3935
|
+
) {
|
|
3936
|
+
return;
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
// This must be called before changing the frustum because it uses the previous
|
|
3940
|
+
// frustum to reconstruct the world space position from the depth buffer.
|
|
3941
|
+
const frustumWidth = calculateOrthographicFrustumWidth(this);
|
|
3942
|
+
|
|
3943
|
+
const scene = this._scene;
|
|
3944
|
+
this.frustum = new OrthographicFrustum();
|
|
3945
|
+
this.frustum.aspectRatio =
|
|
3946
|
+
scene.drawingBufferWidth / scene.drawingBufferHeight;
|
|
3947
|
+
this.frustum.width = frustumWidth;
|
|
3948
|
+
};
|
|
3949
|
+
|
|
3950
|
+
/**
|
|
3951
|
+
* @private
|
|
3952
|
+
*/
|
|
3953
|
+
Camera.clone = function (camera, result) {
|
|
3954
|
+
if (!defined(result)) {
|
|
3955
|
+
result = new Camera(camera._scene);
|
|
3956
|
+
}
|
|
3957
|
+
|
|
3958
|
+
Cartesian3.clone(camera.position, result.position);
|
|
3959
|
+
Cartesian3.clone(camera.direction, result.direction);
|
|
3960
|
+
Cartesian3.clone(camera.up, result.up);
|
|
3961
|
+
Cartesian3.clone(camera.right, result.right);
|
|
3962
|
+
Matrix4.clone(camera._transform, result.transform);
|
|
3963
|
+
result._transformChanged = true;
|
|
3964
|
+
result.frustum = camera.frustum.clone();
|
|
3965
|
+
|
|
3966
|
+
return result;
|
|
3967
|
+
};
|
|
3968
|
+
|
|
3969
|
+
/**
|
|
3970
|
+
* A function that will execute when a flight completes.
|
|
3971
|
+
* @callback Camera.FlightCompleteCallback
|
|
3972
|
+
*/
|
|
3973
|
+
|
|
3974
|
+
/**
|
|
3975
|
+
* A function that will execute when a flight is cancelled.
|
|
3976
|
+
* @callback Camera.FlightCancelledCallback
|
|
3977
|
+
*/
|
|
3978
|
+
export default Camera;
|