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,3098 @@
|
|
|
1
|
+
import Cartesian2 from "../Core/Cartesian2.js";
|
|
2
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
3
|
+
import Cartesian4 from "../Core/Cartesian4.js";
|
|
4
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
5
|
+
import defined from "../Core/defined.js";
|
|
6
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
7
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
8
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
9
|
+
import HeadingPitchRoll from "../Core/HeadingPitchRoll.js";
|
|
10
|
+
import IntersectionTests from "../Core/IntersectionTests.js";
|
|
11
|
+
import KeyboardEventModifier from "../Core/KeyboardEventModifier.js";
|
|
12
|
+
import CesiumMath from "../Core/Math.js";
|
|
13
|
+
import Matrix3 from "../Core/Matrix3.js";
|
|
14
|
+
import Matrix4 from "../Core/Matrix4.js";
|
|
15
|
+
import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
16
|
+
import Plane from "../Core/Plane.js";
|
|
17
|
+
import Quaternion from "../Core/Quaternion.js";
|
|
18
|
+
import Ray from "../Core/Ray.js";
|
|
19
|
+
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
20
|
+
import Transforms from "../Core/Transforms.js";
|
|
21
|
+
import CameraEventAggregator from "./CameraEventAggregator.js";
|
|
22
|
+
import CameraEventType from "./CameraEventType.js";
|
|
23
|
+
import MapMode2D from "./MapMode2D.js";
|
|
24
|
+
import SceneMode from "./SceneMode.js";
|
|
25
|
+
import SceneTransforms from "./SceneTransforms.js";
|
|
26
|
+
import TweenCollection from "./TweenCollection.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Modifies the camera position and orientation based on mouse input to a canvas.
|
|
30
|
+
* @alias ScreenSpaceCameraController
|
|
31
|
+
* @constructor
|
|
32
|
+
*
|
|
33
|
+
* @param {Scene} scene The scene.
|
|
34
|
+
*/
|
|
35
|
+
function ScreenSpaceCameraController(scene) {
|
|
36
|
+
//>>includeStart('debug', pragmas.debug);
|
|
37
|
+
if (!defined(scene)) {
|
|
38
|
+
throw new DeveloperError("scene is required.");
|
|
39
|
+
}
|
|
40
|
+
//>>includeEnd('debug');
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
|
|
44
|
+
* enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
|
|
45
|
+
*
|
|
46
|
+
* NOTE: This setting is for temporary use cases, such as camera flights and
|
|
47
|
+
* drag-selection of regions (see Picking demo). It is typically set to false at the
|
|
48
|
+
* start of such events, and set true on completion. To keep inputs disabled
|
|
49
|
+
* past the end of camera flights, you must use the other booleans (enableTranslate,
|
|
50
|
+
* enableZoom, enableRotate, enableTilt, and enableLook).
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
this.enableInputs = true;
|
|
55
|
+
/**
|
|
56
|
+
* If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
|
|
57
|
+
* This flag only applies in 2D and Columbus view modes.
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
this.enableTranslate = true;
|
|
62
|
+
/**
|
|
63
|
+
* If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
|
|
64
|
+
* @type {boolean}
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
this.enableZoom = true;
|
|
68
|
+
/**
|
|
69
|
+
* If true, allows the user to rotate the world which translates the user's position.
|
|
70
|
+
* This flag only applies in 2D and 3D.
|
|
71
|
+
* @type {boolean}
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
this.enableRotate = true;
|
|
75
|
+
/**
|
|
76
|
+
* If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
|
|
77
|
+
* This flag only applies in 3D and Columbus view.
|
|
78
|
+
* @type {boolean}
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
this.enableTilt = true;
|
|
82
|
+
/**
|
|
83
|
+
* If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
|
|
84
|
+
* or rotating. This flag only applies in 3D and Columbus view modes.
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
this.enableLook = true;
|
|
89
|
+
/**
|
|
90
|
+
* A parameter in the range <code>[0, 1)</code> used to determine how long
|
|
91
|
+
* the camera will continue to spin because of inertia.
|
|
92
|
+
* With value of zero, the camera will have no inertia.
|
|
93
|
+
* @type {number}
|
|
94
|
+
* @default 0.9
|
|
95
|
+
*/
|
|
96
|
+
this.inertiaSpin = 0.9;
|
|
97
|
+
/**
|
|
98
|
+
* A parameter in the range <code>[0, 1)</code> used to determine how long
|
|
99
|
+
* the camera will continue to translate because of inertia.
|
|
100
|
+
* With value of zero, the camera will have no inertia.
|
|
101
|
+
* @type {number}
|
|
102
|
+
* @default 0.9
|
|
103
|
+
*/
|
|
104
|
+
this.inertiaTranslate = 0.9;
|
|
105
|
+
/**
|
|
106
|
+
* A parameter in the range <code>[0, 1)</code> used to determine how long
|
|
107
|
+
* the camera will continue to zoom because of inertia.
|
|
108
|
+
* With value of zero, the camera will have no inertia.
|
|
109
|
+
* @type {number}
|
|
110
|
+
* @default 0.8
|
|
111
|
+
*/
|
|
112
|
+
this.inertiaZoom = 0.8;
|
|
113
|
+
/**
|
|
114
|
+
* A parameter in the range <code>[0, 1)</code> used to limit the range
|
|
115
|
+
* of various user inputs to a percentage of the window width/height per animation frame.
|
|
116
|
+
* This helps keep the camera under control in low-frame-rate situations.
|
|
117
|
+
* @type {number}
|
|
118
|
+
* @default 0.1
|
|
119
|
+
*/
|
|
120
|
+
this.maximumMovementRatio = 0.1;
|
|
121
|
+
/**
|
|
122
|
+
* Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
|
|
123
|
+
* @type {number}
|
|
124
|
+
* @default 3.0
|
|
125
|
+
*/
|
|
126
|
+
this.bounceAnimationTime = 3.0;
|
|
127
|
+
/**
|
|
128
|
+
* The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
|
|
129
|
+
* @type {number}
|
|
130
|
+
* @default 1.0
|
|
131
|
+
*/
|
|
132
|
+
this.minimumZoomDistance = 1.0;
|
|
133
|
+
/**
|
|
134
|
+
* The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
|
|
135
|
+
* @type {number}
|
|
136
|
+
* @default {@link Number.POSITIVE_INFINITY}
|
|
137
|
+
*/
|
|
138
|
+
this.maximumZoomDistance = Number.POSITIVE_INFINITY;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* A multiplier for the speed at which the camera will zoom.
|
|
142
|
+
* @type {number}
|
|
143
|
+
* @default 5.0
|
|
144
|
+
*/
|
|
145
|
+
this.zoomFactor = 5.0;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
|
|
149
|
+
* <p>
|
|
150
|
+
* The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
|
|
151
|
+
* and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
|
|
152
|
+
* or an array of any of the preceding.
|
|
153
|
+
* </p>
|
|
154
|
+
* @type {CameraEventType|Array|undefined}
|
|
155
|
+
* @default {@link CameraEventType.LEFT_DRAG}
|
|
156
|
+
*/
|
|
157
|
+
this.translateEventTypes = CameraEventType.LEFT_DRAG;
|
|
158
|
+
/**
|
|
159
|
+
* The input that allows the user to zoom in/out.
|
|
160
|
+
* <p>
|
|
161
|
+
* The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
|
|
162
|
+
* and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
|
|
163
|
+
* or an array of any of the preceding.
|
|
164
|
+
* </p>
|
|
165
|
+
* @type {CameraEventType|Array|undefined}
|
|
166
|
+
* @default [{@link CameraEventType.RIGHT_DRAG}, {@link CameraEventType.WHEEL}, {@link CameraEventType.PINCH}]
|
|
167
|
+
*/
|
|
168
|
+
this.zoomEventTypes = [
|
|
169
|
+
CameraEventType.RIGHT_DRAG,
|
|
170
|
+
CameraEventType.WHEEL,
|
|
171
|
+
CameraEventType.PINCH,
|
|
172
|
+
];
|
|
173
|
+
/**
|
|
174
|
+
* The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
|
|
175
|
+
* <p>
|
|
176
|
+
* The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
|
|
177
|
+
* and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
|
|
178
|
+
* or an array of any of the preceding.
|
|
179
|
+
* </p>
|
|
180
|
+
* @type {CameraEventType|Array|undefined}
|
|
181
|
+
* @default {@link CameraEventType.LEFT_DRAG}
|
|
182
|
+
*/
|
|
183
|
+
this.rotateEventTypes = CameraEventType.LEFT_DRAG;
|
|
184
|
+
/**
|
|
185
|
+
* The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
|
|
186
|
+
* <p>
|
|
187
|
+
* The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
|
|
188
|
+
* and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
|
|
189
|
+
* or an array of any of the preceding.
|
|
190
|
+
* </p>
|
|
191
|
+
* @type {CameraEventType|Array|undefined}
|
|
192
|
+
* @default [{@link CameraEventType.MIDDLE_DRAG}, {@link CameraEventType.PINCH}, {
|
|
193
|
+
* eventType : {@link CameraEventType.LEFT_DRAG},
|
|
194
|
+
* modifier : {@link KeyboardEventModifier.CTRL}
|
|
195
|
+
* }, {
|
|
196
|
+
* eventType : {@link CameraEventType.RIGHT_DRAG},
|
|
197
|
+
* modifier : {@link KeyboardEventModifier.CTRL}
|
|
198
|
+
* }]
|
|
199
|
+
*/
|
|
200
|
+
this.tiltEventTypes = [
|
|
201
|
+
CameraEventType.MIDDLE_DRAG,
|
|
202
|
+
CameraEventType.PINCH,
|
|
203
|
+
{
|
|
204
|
+
eventType: CameraEventType.LEFT_DRAG,
|
|
205
|
+
modifier: KeyboardEventModifier.CTRL,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
eventType: CameraEventType.RIGHT_DRAG,
|
|
209
|
+
modifier: KeyboardEventModifier.CTRL,
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
/**
|
|
213
|
+
* The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
|
|
214
|
+
* <p>
|
|
215
|
+
* The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
|
|
216
|
+
* and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
|
|
217
|
+
* or an array of any of the preceding.
|
|
218
|
+
* </p>
|
|
219
|
+
* @type {CameraEventType|Array|undefined}
|
|
220
|
+
* @default { eventType : {@link CameraEventType.LEFT_DRAG}, modifier : {@link KeyboardEventModifier.SHIFT} }
|
|
221
|
+
*/
|
|
222
|
+
this.lookEventTypes = {
|
|
223
|
+
eventType: CameraEventType.LEFT_DRAG,
|
|
224
|
+
modifier: KeyboardEventModifier.SHIFT,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const ellipsoid = scene.ellipsoid ?? Ellipsoid.default;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The minimum height the camera must be before picking the terrain or scene content instead of the ellipsoid. Defaults to scene.ellipsoid.minimumRadius * 0.025 when another ellipsoid than WGS84 is used.
|
|
231
|
+
* @type {number}
|
|
232
|
+
* @default 150000.0 or scene.ellipsoid.minimumRadius * 0.025
|
|
233
|
+
*/
|
|
234
|
+
this.minimumPickingTerrainHeight = Ellipsoid.WGS84.equals(ellipsoid)
|
|
235
|
+
? 150000.0
|
|
236
|
+
: ellipsoid.minimumRadius * 0.025;
|
|
237
|
+
this._minimumPickingTerrainHeight = this.minimumPickingTerrainHeight;
|
|
238
|
+
/**
|
|
239
|
+
* The minimum distance the camera must be before testing for collision with terrain when zoom with inertia. Default to scene.ellipsoid.minimumRadius * 0.00063 when another ellipsoid than WGS84 is used.
|
|
240
|
+
* @type {number}
|
|
241
|
+
* @default 4000.0 or scene.ellipsoid.minimumRadius * 0.00063
|
|
242
|
+
*/
|
|
243
|
+
this.minimumPickingTerrainDistanceWithInertia = Ellipsoid.WGS84.equals(
|
|
244
|
+
ellipsoid,
|
|
245
|
+
)
|
|
246
|
+
? 4000.0
|
|
247
|
+
: ellipsoid.minimumRadius * 0.00063;
|
|
248
|
+
/**
|
|
249
|
+
* The minimum height the camera must be before testing for collision with terrain. Default to scene.ellipsoid.minimumRadius * 0.0025 when another ellipsoid than WGS84 is used.
|
|
250
|
+
* @type {number}
|
|
251
|
+
* @default 15000.0 or scene.ellipsoid.minimumRadius * 0.0025.
|
|
252
|
+
*/
|
|
253
|
+
this.minimumCollisionTerrainHeight = Ellipsoid.WGS84.equals(ellipsoid)
|
|
254
|
+
? 15000.0
|
|
255
|
+
: ellipsoid.minimumRadius * 0.0025;
|
|
256
|
+
this._minimumCollisionTerrainHeight = this.minimumCollisionTerrainHeight;
|
|
257
|
+
/**
|
|
258
|
+
* The minimum height the camera must be before switching from rotating a track ball to
|
|
259
|
+
* free look when clicks originate on the sky or in space. Defaults to ellipsoid.minimumRadius * 1.175 when another ellipsoid than WGS84 is used.
|
|
260
|
+
* @type {number}
|
|
261
|
+
* @default 7500000.0 or scene.ellipsoid.minimumRadius * 1.175
|
|
262
|
+
*/
|
|
263
|
+
this.minimumTrackBallHeight = Ellipsoid.WGS84.equals(ellipsoid)
|
|
264
|
+
? 7500000.0
|
|
265
|
+
: ellipsoid.minimumRadius * 1.175;
|
|
266
|
+
this._minimumTrackBallHeight = this.minimumTrackBallHeight;
|
|
267
|
+
/**
|
|
268
|
+
* When disabled, the values of <code>maximumZoomDistance</code> and <code>minimumZoomDistance</code> are ignored.
|
|
269
|
+
* Also used in conjunction with {@link Cesium3DTileset#enableCollision} to prevent the camera from moving through or below a 3D Tileset surface.
|
|
270
|
+
* This may also affect clamping behavior when using {@link HeightReference.CLAMP_TO_GROUND} on 3D Tiles.
|
|
271
|
+
* @type {boolean}
|
|
272
|
+
* @default true
|
|
273
|
+
*/
|
|
274
|
+
this.enableCollisionDetection = true;
|
|
275
|
+
/**
|
|
276
|
+
* The angle, relative to the ellipsoid normal, restricting the maximum amount that the user can tilt the camera. If <code>undefined</code>, the angle of the camera tilt is unrestricted.
|
|
277
|
+
* @type {number|undefined}
|
|
278
|
+
* @default undefined
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* // Prevent the camera from tilting below the ellipsoid surface
|
|
282
|
+
* viewer.scene.screenSpaceCameraController.maximumTiltAngle = Math.PI / 2.0;
|
|
283
|
+
*/
|
|
284
|
+
this.maximumTiltAngle = undefined;
|
|
285
|
+
|
|
286
|
+
this._scene = scene;
|
|
287
|
+
this._globe = undefined;
|
|
288
|
+
this._ellipsoid = ellipsoid;
|
|
289
|
+
|
|
290
|
+
this._lastGlobeHeight = 0.0;
|
|
291
|
+
|
|
292
|
+
this._aggregator = new CameraEventAggregator(scene.canvas);
|
|
293
|
+
|
|
294
|
+
this._lastInertiaSpinMovement = undefined;
|
|
295
|
+
this._lastInertiaZoomMovement = undefined;
|
|
296
|
+
this._lastInertiaTranslateMovement = undefined;
|
|
297
|
+
this._lastInertiaTiltMovement = undefined;
|
|
298
|
+
|
|
299
|
+
// Zoom disables tilt, spin, and translate inertia
|
|
300
|
+
// Tilt disables spin and translate inertia
|
|
301
|
+
this._inertiaDisablers = {
|
|
302
|
+
_lastInertiaZoomMovement: [
|
|
303
|
+
"_lastInertiaSpinMovement",
|
|
304
|
+
"_lastInertiaTranslateMovement",
|
|
305
|
+
"_lastInertiaTiltMovement",
|
|
306
|
+
],
|
|
307
|
+
_lastInertiaTiltMovement: [
|
|
308
|
+
"_lastInertiaSpinMovement",
|
|
309
|
+
"_lastInertiaTranslateMovement",
|
|
310
|
+
],
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
this._tweens = new TweenCollection();
|
|
314
|
+
this._tween = undefined;
|
|
315
|
+
|
|
316
|
+
this._horizontalRotationAxis = undefined;
|
|
317
|
+
|
|
318
|
+
this._tiltCenterMousePosition = new Cartesian2(-1.0, -1.0);
|
|
319
|
+
this._tiltCenter = new Cartesian3();
|
|
320
|
+
this._rotateMousePosition = new Cartesian2(-1.0, -1.0);
|
|
321
|
+
this._rotateStartPosition = new Cartesian3();
|
|
322
|
+
this._strafeStartPosition = new Cartesian3();
|
|
323
|
+
this._strafeMousePosition = new Cartesian2();
|
|
324
|
+
this._strafeEndMousePosition = new Cartesian2();
|
|
325
|
+
this._zoomMouseStart = new Cartesian2(-1.0, -1.0);
|
|
326
|
+
this._zoomWorldPosition = new Cartesian3();
|
|
327
|
+
this._useZoomWorldPosition = false;
|
|
328
|
+
this._panLastMousePosition = new Cartesian2();
|
|
329
|
+
this._panLastWorldPosition = new Cartesian3();
|
|
330
|
+
this._tiltCVOffMap = false;
|
|
331
|
+
this._looking = false;
|
|
332
|
+
this._rotating = false;
|
|
333
|
+
this._strafing = false;
|
|
334
|
+
this._zoomingOnVector = false;
|
|
335
|
+
this._zoomingUnderground = false;
|
|
336
|
+
this._rotatingZoom = false;
|
|
337
|
+
this._adjustedHeightForTerrain = false;
|
|
338
|
+
this._cameraUnderground = false;
|
|
339
|
+
|
|
340
|
+
const projection = scene.mapProjection;
|
|
341
|
+
this._maxCoord = projection.project(
|
|
342
|
+
new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO),
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
// Constants, Make any of these public?
|
|
346
|
+
this._rotateFactor = undefined;
|
|
347
|
+
this._rotateRateRangeAdjustment = undefined;
|
|
348
|
+
this._maximumRotateRate = 1.77;
|
|
349
|
+
this._minimumRotateRate = 1.0 / 5000.0;
|
|
350
|
+
this._minimumZoomRate = 20.0;
|
|
351
|
+
this._maximumZoomRate = 5906376272000.0; // distance from the Sun to Pluto in meters.
|
|
352
|
+
this._minimumUndergroundPickDistance = 2000.0;
|
|
353
|
+
this._maximumUndergroundPickDistance = 10000.0;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function decay(time, coefficient) {
|
|
357
|
+
if (time < 0) {
|
|
358
|
+
return 0.0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const tau = (1.0 - coefficient) * 25.0;
|
|
362
|
+
return Math.exp(-tau * time);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function sameMousePosition(movement) {
|
|
366
|
+
return Cartesian2.equalsEpsilon(
|
|
367
|
+
movement.startPosition,
|
|
368
|
+
movement.endPosition,
|
|
369
|
+
CesiumMath.EPSILON14,
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// If the time between mouse down and mouse up is not between
|
|
374
|
+
// these thresholds, the camera will not move with inertia.
|
|
375
|
+
// This value is probably dependent on the browser and/or the
|
|
376
|
+
// hardware. Should be investigated further.
|
|
377
|
+
const inertiaMaxClickTimeThreshold = 0.4;
|
|
378
|
+
|
|
379
|
+
function maintainInertia(
|
|
380
|
+
aggregator,
|
|
381
|
+
type,
|
|
382
|
+
modifier,
|
|
383
|
+
decayCoef,
|
|
384
|
+
action,
|
|
385
|
+
object,
|
|
386
|
+
lastMovementName,
|
|
387
|
+
) {
|
|
388
|
+
let movementState = object[lastMovementName];
|
|
389
|
+
if (!defined(movementState)) {
|
|
390
|
+
movementState = object[lastMovementName] = {
|
|
391
|
+
startPosition: new Cartesian2(),
|
|
392
|
+
endPosition: new Cartesian2(),
|
|
393
|
+
motion: new Cartesian2(),
|
|
394
|
+
inertiaEnabled: true,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const ts = aggregator.getButtonPressTime(type, modifier);
|
|
399
|
+
const tr = aggregator.getButtonReleaseTime(type, modifier);
|
|
400
|
+
|
|
401
|
+
const threshold = ts && tr && (tr.getTime() - ts.getTime()) / 1000.0;
|
|
402
|
+
const now = new Date();
|
|
403
|
+
const fromNow = tr && (now.getTime() - tr.getTime()) / 1000.0;
|
|
404
|
+
|
|
405
|
+
if (ts && tr && threshold < inertiaMaxClickTimeThreshold) {
|
|
406
|
+
const d = decay(fromNow, decayCoef);
|
|
407
|
+
|
|
408
|
+
const lastMovement = aggregator.getLastMovement(type, modifier);
|
|
409
|
+
if (
|
|
410
|
+
!defined(lastMovement) ||
|
|
411
|
+
sameMousePosition(lastMovement) ||
|
|
412
|
+
!movementState.inertiaEnabled
|
|
413
|
+
) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
movementState.motion.x =
|
|
418
|
+
(lastMovement.endPosition.x - lastMovement.startPosition.x) * 0.5;
|
|
419
|
+
movementState.motion.y =
|
|
420
|
+
(lastMovement.endPosition.y - lastMovement.startPosition.y) * 0.5;
|
|
421
|
+
|
|
422
|
+
movementState.startPosition = Cartesian2.clone(
|
|
423
|
+
lastMovement.startPosition,
|
|
424
|
+
movementState.startPosition,
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
movementState.endPosition = Cartesian2.multiplyByScalar(
|
|
428
|
+
movementState.motion,
|
|
429
|
+
d,
|
|
430
|
+
movementState.endPosition,
|
|
431
|
+
);
|
|
432
|
+
movementState.endPosition = Cartesian2.add(
|
|
433
|
+
movementState.startPosition,
|
|
434
|
+
movementState.endPosition,
|
|
435
|
+
movementState.endPosition,
|
|
436
|
+
);
|
|
437
|
+
|
|
438
|
+
// If value from the decreasing exponential function is close to zero,
|
|
439
|
+
// the end coordinates may be NaN.
|
|
440
|
+
if (
|
|
441
|
+
isNaN(movementState.endPosition.x) ||
|
|
442
|
+
isNaN(movementState.endPosition.y) ||
|
|
443
|
+
Cartesian2.distance(
|
|
444
|
+
movementState.startPosition,
|
|
445
|
+
movementState.endPosition,
|
|
446
|
+
) < 0.5
|
|
447
|
+
) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (!aggregator.isButtonDown(type, modifier)) {
|
|
452
|
+
const startPosition = aggregator.getStartMousePosition(type, modifier);
|
|
453
|
+
action(object, startPosition, movementState);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function activateInertia(controller, inertiaStateName) {
|
|
459
|
+
if (defined(inertiaStateName)) {
|
|
460
|
+
// Re-enable inertia if it was disabled
|
|
461
|
+
let movementState = controller[inertiaStateName];
|
|
462
|
+
if (defined(movementState)) {
|
|
463
|
+
movementState.inertiaEnabled = true;
|
|
464
|
+
}
|
|
465
|
+
// Disable inertia on other movements
|
|
466
|
+
const inertiasToDisable = controller._inertiaDisablers[inertiaStateName];
|
|
467
|
+
if (defined(inertiasToDisable)) {
|
|
468
|
+
const length = inertiasToDisable.length;
|
|
469
|
+
for (let i = 0; i < length; ++i) {
|
|
470
|
+
movementState = controller[inertiasToDisable[i]];
|
|
471
|
+
if (defined(movementState)) {
|
|
472
|
+
movementState.inertiaEnabled = false;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const scratchEventTypeArray = [];
|
|
480
|
+
|
|
481
|
+
function reactToInput(
|
|
482
|
+
controller,
|
|
483
|
+
enabled,
|
|
484
|
+
eventTypes,
|
|
485
|
+
action,
|
|
486
|
+
inertiaConstant,
|
|
487
|
+
inertiaStateName,
|
|
488
|
+
) {
|
|
489
|
+
if (!defined(eventTypes)) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const aggregator = controller._aggregator;
|
|
494
|
+
|
|
495
|
+
if (!Array.isArray(eventTypes)) {
|
|
496
|
+
scratchEventTypeArray[0] = eventTypes;
|
|
497
|
+
eventTypes = scratchEventTypeArray;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const length = eventTypes.length;
|
|
501
|
+
for (let i = 0; i < length; ++i) {
|
|
502
|
+
const eventType = eventTypes[i];
|
|
503
|
+
const type = defined(eventType.eventType) ? eventType.eventType : eventType;
|
|
504
|
+
const modifier = eventType.modifier;
|
|
505
|
+
|
|
506
|
+
const movement =
|
|
507
|
+
aggregator.isMoving(type, modifier) &&
|
|
508
|
+
aggregator.getMovement(type, modifier);
|
|
509
|
+
const startPosition = aggregator.getStartMousePosition(type, modifier);
|
|
510
|
+
|
|
511
|
+
if (controller.enableInputs && enabled) {
|
|
512
|
+
if (movement) {
|
|
513
|
+
action(controller, startPosition, movement);
|
|
514
|
+
activateInertia(controller, inertiaStateName);
|
|
515
|
+
} else if (inertiaConstant < 1.0) {
|
|
516
|
+
maintainInertia(
|
|
517
|
+
aggregator,
|
|
518
|
+
type,
|
|
519
|
+
modifier,
|
|
520
|
+
inertiaConstant,
|
|
521
|
+
action,
|
|
522
|
+
controller,
|
|
523
|
+
inertiaStateName,
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
const scratchZoomPickRay = new Ray();
|
|
531
|
+
const scratchPickCartesian = new Cartesian3();
|
|
532
|
+
const scratchZoomOffset = new Cartesian2();
|
|
533
|
+
const scratchZoomDirection = new Cartesian3();
|
|
534
|
+
const scratchCenterPixel = new Cartesian2();
|
|
535
|
+
const scratchCenterPosition = new Cartesian3();
|
|
536
|
+
const scratchPositionNormal = new Cartesian3();
|
|
537
|
+
const scratchPickNormal = new Cartesian3();
|
|
538
|
+
const scratchZoomAxis = new Cartesian3();
|
|
539
|
+
const scratchCameraPositionNormal = new Cartesian3();
|
|
540
|
+
|
|
541
|
+
// Scratch variables used in zooming algorithm
|
|
542
|
+
const scratchTargetNormal = new Cartesian3();
|
|
543
|
+
const scratchCameraPosition = new Cartesian3();
|
|
544
|
+
const scratchCameraUpNormal = new Cartesian3();
|
|
545
|
+
const scratchCameraRightNormal = new Cartesian3();
|
|
546
|
+
const scratchForwardNormal = new Cartesian3();
|
|
547
|
+
const scratchPositionToTarget = new Cartesian3();
|
|
548
|
+
const scratchPositionToTargetNormal = new Cartesian3();
|
|
549
|
+
const scratchPan = new Cartesian3();
|
|
550
|
+
const scratchCenterMovement = new Cartesian3();
|
|
551
|
+
const scratchCenter = new Cartesian3();
|
|
552
|
+
const scratchCartesian = new Cartesian3();
|
|
553
|
+
const scratchCartesianTwo = new Cartesian3();
|
|
554
|
+
const scratchCartesianThree = new Cartesian3();
|
|
555
|
+
const scratchZoomViewOptions = {
|
|
556
|
+
orientation: new HeadingPitchRoll(),
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
function handleZoom(
|
|
560
|
+
object,
|
|
561
|
+
startPosition,
|
|
562
|
+
movement,
|
|
563
|
+
zoomFactor,
|
|
564
|
+
distanceMeasure,
|
|
565
|
+
unitPositionDotDirection,
|
|
566
|
+
) {
|
|
567
|
+
let percentage = 1.0;
|
|
568
|
+
if (defined(unitPositionDotDirection)) {
|
|
569
|
+
percentage = CesiumMath.clamp(
|
|
570
|
+
Math.abs(unitPositionDotDirection),
|
|
571
|
+
0.25,
|
|
572
|
+
1.0,
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const diff = movement.endPosition.y - movement.startPosition.y;
|
|
577
|
+
|
|
578
|
+
// distanceMeasure should be the height above the ellipsoid.
|
|
579
|
+
// When approaching the surface, the zoomRate slows and stops minimumZoomDistance above it.
|
|
580
|
+
const approachingSurface = diff > 0;
|
|
581
|
+
const minHeight = approachingSurface
|
|
582
|
+
? object.minimumZoomDistance * percentage
|
|
583
|
+
: 0;
|
|
584
|
+
const maxHeight = object.maximumZoomDistance;
|
|
585
|
+
|
|
586
|
+
const minDistance = distanceMeasure - minHeight;
|
|
587
|
+
let zoomRate = zoomFactor * minDistance;
|
|
588
|
+
zoomRate = CesiumMath.clamp(
|
|
589
|
+
zoomRate,
|
|
590
|
+
object._minimumZoomRate,
|
|
591
|
+
object._maximumZoomRate,
|
|
592
|
+
);
|
|
593
|
+
|
|
594
|
+
let rangeWindowRatio = diff / object._scene.canvas.clientHeight;
|
|
595
|
+
rangeWindowRatio = Math.min(rangeWindowRatio, object.maximumMovementRatio);
|
|
596
|
+
let distance = zoomRate * rangeWindowRatio;
|
|
597
|
+
|
|
598
|
+
if (
|
|
599
|
+
object.enableCollisionDetection ||
|
|
600
|
+
object.minimumZoomDistance === 0.0 ||
|
|
601
|
+
!defined(object._globe) // look-at mode
|
|
602
|
+
) {
|
|
603
|
+
if (distance > 0.0 && Math.abs(distanceMeasure - minHeight) < 1.0) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (distance < 0.0 && Math.abs(distanceMeasure - maxHeight) < 1.0) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (distanceMeasure - distance < minHeight) {
|
|
612
|
+
distance = distanceMeasure - minHeight - 1.0;
|
|
613
|
+
} else if (distanceMeasure - distance > maxHeight) {
|
|
614
|
+
distance = distanceMeasure - maxHeight;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const scene = object._scene;
|
|
619
|
+
const camera = scene.camera;
|
|
620
|
+
const mode = scene.mode;
|
|
621
|
+
|
|
622
|
+
const orientation = scratchZoomViewOptions.orientation;
|
|
623
|
+
orientation.heading = camera.heading;
|
|
624
|
+
orientation.pitch = camera.pitch;
|
|
625
|
+
orientation.roll = camera.roll;
|
|
626
|
+
|
|
627
|
+
const sameStartPosition =
|
|
628
|
+
movement.inertiaEnabled ??
|
|
629
|
+
Cartesian2.equals(startPosition, object._zoomMouseStart);
|
|
630
|
+
let zoomingOnVector = object._zoomingOnVector;
|
|
631
|
+
let rotatingZoom = object._rotatingZoom;
|
|
632
|
+
let pickedPosition;
|
|
633
|
+
|
|
634
|
+
if (!sameStartPosition) {
|
|
635
|
+
object._zoomMouseStart = Cartesian2.clone(
|
|
636
|
+
startPosition,
|
|
637
|
+
object._zoomMouseStart,
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
// When camera transform is set, such as tracking an entity, object._globe will be undefined, and no position should be picked
|
|
641
|
+
if (defined(object._globe) && mode === SceneMode.SCENE2D) {
|
|
642
|
+
pickedPosition = camera.getPickRay(
|
|
643
|
+
startPosition,
|
|
644
|
+
scratchZoomPickRay,
|
|
645
|
+
).origin;
|
|
646
|
+
pickedPosition = Cartesian3.fromElements(
|
|
647
|
+
pickedPosition.y,
|
|
648
|
+
pickedPosition.z,
|
|
649
|
+
pickedPosition.x,
|
|
650
|
+
);
|
|
651
|
+
} else if (defined(object._globe)) {
|
|
652
|
+
pickedPosition = pickPosition(
|
|
653
|
+
object,
|
|
654
|
+
startPosition,
|
|
655
|
+
scratchPickCartesian,
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (defined(pickedPosition)) {
|
|
660
|
+
object._useZoomWorldPosition = true;
|
|
661
|
+
object._zoomWorldPosition = Cartesian3.clone(
|
|
662
|
+
pickedPosition,
|
|
663
|
+
object._zoomWorldPosition,
|
|
664
|
+
);
|
|
665
|
+
} else {
|
|
666
|
+
object._useZoomWorldPosition = false;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
zoomingOnVector = object._zoomingOnVector = false;
|
|
670
|
+
rotatingZoom = object._rotatingZoom = false;
|
|
671
|
+
object._zoomingUnderground = object._cameraUnderground;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
if (!object._useZoomWorldPosition) {
|
|
675
|
+
camera.zoomIn(distance);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
let zoomOnVector = mode === SceneMode.COLUMBUS_VIEW;
|
|
680
|
+
|
|
681
|
+
if (camera.positionCartographic.height < 2000000) {
|
|
682
|
+
rotatingZoom = true;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (!sameStartPosition || rotatingZoom) {
|
|
686
|
+
if (mode === SceneMode.SCENE2D) {
|
|
687
|
+
const worldPosition = object._zoomWorldPosition;
|
|
688
|
+
const endPosition = camera.position;
|
|
689
|
+
|
|
690
|
+
if (
|
|
691
|
+
!Cartesian3.equals(worldPosition, endPosition) &&
|
|
692
|
+
camera.positionCartographic.height < object._maxCoord.x * 2.0
|
|
693
|
+
) {
|
|
694
|
+
const savedX = camera.position.x;
|
|
695
|
+
|
|
696
|
+
const direction = Cartesian3.subtract(
|
|
697
|
+
worldPosition,
|
|
698
|
+
endPosition,
|
|
699
|
+
scratchZoomDirection,
|
|
700
|
+
);
|
|
701
|
+
Cartesian3.normalize(direction, direction);
|
|
702
|
+
|
|
703
|
+
const d =
|
|
704
|
+
(Cartesian3.distance(worldPosition, endPosition) * distance) /
|
|
705
|
+
(camera.getMagnitude() * 0.5);
|
|
706
|
+
camera.move(direction, d * 0.5);
|
|
707
|
+
|
|
708
|
+
if (
|
|
709
|
+
(camera.position.x < 0.0 && savedX > 0.0) ||
|
|
710
|
+
(camera.position.x > 0.0 && savedX < 0.0)
|
|
711
|
+
) {
|
|
712
|
+
pickedPosition = camera.getPickRay(
|
|
713
|
+
startPosition,
|
|
714
|
+
scratchZoomPickRay,
|
|
715
|
+
).origin;
|
|
716
|
+
pickedPosition = Cartesian3.fromElements(
|
|
717
|
+
pickedPosition.y,
|
|
718
|
+
pickedPosition.z,
|
|
719
|
+
pickedPosition.x,
|
|
720
|
+
);
|
|
721
|
+
object._zoomWorldPosition = Cartesian3.clone(
|
|
722
|
+
pickedPosition,
|
|
723
|
+
object._zoomWorldPosition,
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
} else if (mode === SceneMode.SCENE3D) {
|
|
728
|
+
const cameraPositionNormal = Cartesian3.normalize(
|
|
729
|
+
camera.position,
|
|
730
|
+
scratchCameraPositionNormal,
|
|
731
|
+
);
|
|
732
|
+
if (
|
|
733
|
+
object._cameraUnderground ||
|
|
734
|
+
object._zoomingUnderground ||
|
|
735
|
+
(camera.positionCartographic.height < 3000.0 &&
|
|
736
|
+
Math.abs(Cartesian3.dot(camera.direction, cameraPositionNormal)) <
|
|
737
|
+
0.6)
|
|
738
|
+
) {
|
|
739
|
+
zoomOnVector = true;
|
|
740
|
+
} else {
|
|
741
|
+
const canvas = scene.canvas;
|
|
742
|
+
|
|
743
|
+
const centerPixel = scratchCenterPixel;
|
|
744
|
+
centerPixel.x = canvas.clientWidth / 2;
|
|
745
|
+
centerPixel.y = canvas.clientHeight / 2;
|
|
746
|
+
const centerPosition = pickPosition(
|
|
747
|
+
object,
|
|
748
|
+
centerPixel,
|
|
749
|
+
scratchCenterPosition,
|
|
750
|
+
);
|
|
751
|
+
// If centerPosition is not defined, it means the globe does not cover the center position of screen
|
|
752
|
+
|
|
753
|
+
if (!defined(centerPosition)) {
|
|
754
|
+
zoomOnVector = true;
|
|
755
|
+
} else if (camera.positionCartographic.height < 1000000) {
|
|
756
|
+
// The math in the else block assumes the camera
|
|
757
|
+
// points toward the earth surface, so we check it here.
|
|
758
|
+
// Theoretically, we should check for 90 degree, but it doesn't behave well when parallel
|
|
759
|
+
// to the earth surface
|
|
760
|
+
if (Cartesian3.dot(camera.direction, cameraPositionNormal) >= -0.5) {
|
|
761
|
+
zoomOnVector = true;
|
|
762
|
+
} else {
|
|
763
|
+
const cameraPosition = scratchCameraPosition;
|
|
764
|
+
Cartesian3.clone(camera.position, cameraPosition);
|
|
765
|
+
const target = object._zoomWorldPosition;
|
|
766
|
+
|
|
767
|
+
let targetNormal = scratchTargetNormal;
|
|
768
|
+
|
|
769
|
+
targetNormal = Cartesian3.normalize(target, targetNormal);
|
|
770
|
+
|
|
771
|
+
if (Cartesian3.dot(targetNormal, cameraPositionNormal) < 0.0) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
const center = scratchCenter;
|
|
776
|
+
const forward = scratchForwardNormal;
|
|
777
|
+
Cartesian3.clone(camera.direction, forward);
|
|
778
|
+
Cartesian3.add(
|
|
779
|
+
cameraPosition,
|
|
780
|
+
Cartesian3.multiplyByScalar(forward, 1000, scratchCartesian),
|
|
781
|
+
center,
|
|
782
|
+
);
|
|
783
|
+
|
|
784
|
+
const positionToTarget = scratchPositionToTarget;
|
|
785
|
+
const positionToTargetNormal = scratchPositionToTargetNormal;
|
|
786
|
+
Cartesian3.subtract(target, cameraPosition, positionToTarget);
|
|
787
|
+
|
|
788
|
+
Cartesian3.normalize(positionToTarget, positionToTargetNormal);
|
|
789
|
+
|
|
790
|
+
const alphaDot = Cartesian3.dot(
|
|
791
|
+
cameraPositionNormal,
|
|
792
|
+
positionToTargetNormal,
|
|
793
|
+
);
|
|
794
|
+
if (alphaDot >= 0.0) {
|
|
795
|
+
// We zoomed past the target, and this zoom is not valid anymore.
|
|
796
|
+
// This line causes the next zoom movement to pick a new starting point.
|
|
797
|
+
object._zoomMouseStart.x = -1;
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const alpha = Math.acos(-alphaDot);
|
|
801
|
+
const cameraDistance = Cartesian3.magnitude(cameraPosition);
|
|
802
|
+
const targetDistance = Cartesian3.magnitude(target);
|
|
803
|
+
const remainingDistance = cameraDistance - distance;
|
|
804
|
+
const positionToTargetDistance =
|
|
805
|
+
Cartesian3.magnitude(positionToTarget);
|
|
806
|
+
|
|
807
|
+
const gamma = Math.asin(
|
|
808
|
+
CesiumMath.clamp(
|
|
809
|
+
(positionToTargetDistance / targetDistance) * Math.sin(alpha),
|
|
810
|
+
-1.0,
|
|
811
|
+
1.0,
|
|
812
|
+
),
|
|
813
|
+
);
|
|
814
|
+
const delta = Math.asin(
|
|
815
|
+
CesiumMath.clamp(
|
|
816
|
+
(remainingDistance / targetDistance) * Math.sin(alpha),
|
|
817
|
+
-1.0,
|
|
818
|
+
1.0,
|
|
819
|
+
),
|
|
820
|
+
);
|
|
821
|
+
const beta = gamma - delta + alpha;
|
|
822
|
+
|
|
823
|
+
const up = scratchCameraUpNormal;
|
|
824
|
+
Cartesian3.normalize(cameraPosition, up);
|
|
825
|
+
let right = scratchCameraRightNormal;
|
|
826
|
+
right = Cartesian3.cross(positionToTargetNormal, up, right);
|
|
827
|
+
right = Cartesian3.normalize(right, right);
|
|
828
|
+
|
|
829
|
+
Cartesian3.normalize(
|
|
830
|
+
Cartesian3.cross(up, right, scratchCartesian),
|
|
831
|
+
forward,
|
|
832
|
+
);
|
|
833
|
+
|
|
834
|
+
// Calculate new position to move to
|
|
835
|
+
Cartesian3.multiplyByScalar(
|
|
836
|
+
Cartesian3.normalize(center, scratchCartesian),
|
|
837
|
+
Cartesian3.magnitude(center) - distance,
|
|
838
|
+
center,
|
|
839
|
+
);
|
|
840
|
+
Cartesian3.normalize(cameraPosition, cameraPosition);
|
|
841
|
+
Cartesian3.multiplyByScalar(
|
|
842
|
+
cameraPosition,
|
|
843
|
+
remainingDistance,
|
|
844
|
+
cameraPosition,
|
|
845
|
+
);
|
|
846
|
+
|
|
847
|
+
// Pan
|
|
848
|
+
const pMid = scratchPan;
|
|
849
|
+
Cartesian3.multiplyByScalar(
|
|
850
|
+
Cartesian3.add(
|
|
851
|
+
Cartesian3.multiplyByScalar(
|
|
852
|
+
up,
|
|
853
|
+
Math.cos(beta) - 1,
|
|
854
|
+
scratchCartesianTwo,
|
|
855
|
+
),
|
|
856
|
+
Cartesian3.multiplyByScalar(
|
|
857
|
+
forward,
|
|
858
|
+
Math.sin(beta),
|
|
859
|
+
scratchCartesianThree,
|
|
860
|
+
),
|
|
861
|
+
scratchCartesian,
|
|
862
|
+
),
|
|
863
|
+
remainingDistance,
|
|
864
|
+
pMid,
|
|
865
|
+
);
|
|
866
|
+
Cartesian3.add(cameraPosition, pMid, cameraPosition);
|
|
867
|
+
|
|
868
|
+
Cartesian3.normalize(center, up);
|
|
869
|
+
Cartesian3.normalize(
|
|
870
|
+
Cartesian3.cross(up, right, scratchCartesian),
|
|
871
|
+
forward,
|
|
872
|
+
);
|
|
873
|
+
|
|
874
|
+
const cMid = scratchCenterMovement;
|
|
875
|
+
Cartesian3.multiplyByScalar(
|
|
876
|
+
Cartesian3.add(
|
|
877
|
+
Cartesian3.multiplyByScalar(
|
|
878
|
+
up,
|
|
879
|
+
Math.cos(beta) - 1,
|
|
880
|
+
scratchCartesianTwo,
|
|
881
|
+
),
|
|
882
|
+
Cartesian3.multiplyByScalar(
|
|
883
|
+
forward,
|
|
884
|
+
Math.sin(beta),
|
|
885
|
+
scratchCartesianThree,
|
|
886
|
+
),
|
|
887
|
+
scratchCartesian,
|
|
888
|
+
),
|
|
889
|
+
Cartesian3.magnitude(center),
|
|
890
|
+
cMid,
|
|
891
|
+
);
|
|
892
|
+
Cartesian3.add(center, cMid, center);
|
|
893
|
+
|
|
894
|
+
// Update camera
|
|
895
|
+
|
|
896
|
+
// Set new position
|
|
897
|
+
Cartesian3.clone(cameraPosition, camera.position);
|
|
898
|
+
|
|
899
|
+
// Set new direction
|
|
900
|
+
Cartesian3.normalize(
|
|
901
|
+
Cartesian3.subtract(center, cameraPosition, scratchCartesian),
|
|
902
|
+
camera.direction,
|
|
903
|
+
);
|
|
904
|
+
Cartesian3.clone(camera.direction, camera.direction);
|
|
905
|
+
|
|
906
|
+
// Set new right & up vectors
|
|
907
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
908
|
+
Cartesian3.cross(camera.right, camera.direction, camera.up);
|
|
909
|
+
|
|
910
|
+
camera.setView(scratchZoomViewOptions);
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
} else {
|
|
914
|
+
const positionNormal = Cartesian3.normalize(
|
|
915
|
+
centerPosition,
|
|
916
|
+
scratchPositionNormal,
|
|
917
|
+
);
|
|
918
|
+
const pickedNormal = Cartesian3.normalize(
|
|
919
|
+
object._zoomWorldPosition,
|
|
920
|
+
scratchPickNormal,
|
|
921
|
+
);
|
|
922
|
+
const dotProduct = Cartesian3.dot(pickedNormal, positionNormal);
|
|
923
|
+
|
|
924
|
+
if (dotProduct > 0.0 && dotProduct < 1.0) {
|
|
925
|
+
const angle = CesiumMath.acosClamped(dotProduct);
|
|
926
|
+
const axis = Cartesian3.cross(
|
|
927
|
+
pickedNormal,
|
|
928
|
+
positionNormal,
|
|
929
|
+
scratchZoomAxis,
|
|
930
|
+
);
|
|
931
|
+
|
|
932
|
+
const denom =
|
|
933
|
+
Math.abs(angle) > CesiumMath.toRadians(20.0)
|
|
934
|
+
? camera.positionCartographic.height * 0.75
|
|
935
|
+
: camera.positionCartographic.height - distance;
|
|
936
|
+
const scalar = distance / denom;
|
|
937
|
+
camera.rotate(axis, angle * scalar);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
object._rotatingZoom = !zoomOnVector;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
if ((!sameStartPosition && zoomOnVector) || zoomingOnVector) {
|
|
947
|
+
let ray;
|
|
948
|
+
const zoomMouseStart = SceneTransforms.worldToWindowCoordinates(
|
|
949
|
+
scene,
|
|
950
|
+
object._zoomWorldPosition,
|
|
951
|
+
scratchZoomOffset,
|
|
952
|
+
);
|
|
953
|
+
if (
|
|
954
|
+
mode !== SceneMode.COLUMBUS_VIEW &&
|
|
955
|
+
Cartesian2.equals(startPosition, object._zoomMouseStart) &&
|
|
956
|
+
defined(zoomMouseStart)
|
|
957
|
+
) {
|
|
958
|
+
ray = camera.getPickRay(zoomMouseStart, scratchZoomPickRay);
|
|
959
|
+
} else {
|
|
960
|
+
ray = camera.getPickRay(startPosition, scratchZoomPickRay);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
const rayDirection = ray.direction;
|
|
964
|
+
if (mode === SceneMode.COLUMBUS_VIEW || mode === SceneMode.SCENE2D) {
|
|
965
|
+
Cartesian3.fromElements(
|
|
966
|
+
rayDirection.y,
|
|
967
|
+
rayDirection.z,
|
|
968
|
+
rayDirection.x,
|
|
969
|
+
rayDirection,
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
camera.move(rayDirection, distance);
|
|
974
|
+
|
|
975
|
+
object._zoomingOnVector = true;
|
|
976
|
+
} else {
|
|
977
|
+
camera.zoomIn(distance);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if (!object._cameraUnderground) {
|
|
981
|
+
camera.setView(scratchZoomViewOptions);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
const translate2DStart = new Ray();
|
|
986
|
+
const translate2DEnd = new Ray();
|
|
987
|
+
const scratchTranslateP0 = new Cartesian3();
|
|
988
|
+
|
|
989
|
+
function translate2D(controller, startPosition, movement) {
|
|
990
|
+
const scene = controller._scene;
|
|
991
|
+
const camera = scene.camera;
|
|
992
|
+
let start = camera.getPickRay(
|
|
993
|
+
movement.startPosition,
|
|
994
|
+
translate2DStart,
|
|
995
|
+
).origin;
|
|
996
|
+
let end = camera.getPickRay(movement.endPosition, translate2DEnd).origin;
|
|
997
|
+
|
|
998
|
+
start = Cartesian3.fromElements(start.y, start.z, start.x, start);
|
|
999
|
+
end = Cartesian3.fromElements(end.y, end.z, end.x, end);
|
|
1000
|
+
|
|
1001
|
+
const direction = Cartesian3.subtract(start, end, scratchTranslateP0);
|
|
1002
|
+
const distance = Cartesian3.magnitude(direction);
|
|
1003
|
+
|
|
1004
|
+
if (distance > 0.0) {
|
|
1005
|
+
Cartesian3.normalize(direction, direction);
|
|
1006
|
+
camera.move(direction, distance);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
function zoom2D(controller, startPosition, movement) {
|
|
1011
|
+
if (defined(movement.distance)) {
|
|
1012
|
+
movement = movement.distance;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
const scene = controller._scene;
|
|
1016
|
+
const camera = scene.camera;
|
|
1017
|
+
|
|
1018
|
+
handleZoom(
|
|
1019
|
+
controller,
|
|
1020
|
+
startPosition,
|
|
1021
|
+
movement,
|
|
1022
|
+
controller.zoomFactor,
|
|
1023
|
+
camera.getMagnitude(),
|
|
1024
|
+
);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
const twist2DStart = new Cartesian2();
|
|
1028
|
+
const twist2DEnd = new Cartesian2();
|
|
1029
|
+
|
|
1030
|
+
function twist2D(controller, startPosition, movement) {
|
|
1031
|
+
if (defined(movement.angleAndHeight)) {
|
|
1032
|
+
singleAxisTwist2D(controller, startPosition, movement.angleAndHeight);
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
const scene = controller._scene;
|
|
1037
|
+
const camera = scene.camera;
|
|
1038
|
+
const canvas = scene.canvas;
|
|
1039
|
+
const width = canvas.clientWidth;
|
|
1040
|
+
const height = canvas.clientHeight;
|
|
1041
|
+
|
|
1042
|
+
let start = twist2DStart;
|
|
1043
|
+
start.x = (2.0 / width) * movement.startPosition.x - 1.0;
|
|
1044
|
+
start.y = (2.0 / height) * (height - movement.startPosition.y) - 1.0;
|
|
1045
|
+
start = Cartesian2.normalize(start, start);
|
|
1046
|
+
|
|
1047
|
+
let end = twist2DEnd;
|
|
1048
|
+
end.x = (2.0 / width) * movement.endPosition.x - 1.0;
|
|
1049
|
+
end.y = (2.0 / height) * (height - movement.endPosition.y) - 1.0;
|
|
1050
|
+
end = Cartesian2.normalize(end, end);
|
|
1051
|
+
|
|
1052
|
+
let startTheta = CesiumMath.acosClamped(start.x);
|
|
1053
|
+
if (start.y < 0) {
|
|
1054
|
+
startTheta = CesiumMath.TWO_PI - startTheta;
|
|
1055
|
+
}
|
|
1056
|
+
let endTheta = CesiumMath.acosClamped(end.x);
|
|
1057
|
+
if (end.y < 0) {
|
|
1058
|
+
endTheta = CesiumMath.TWO_PI - endTheta;
|
|
1059
|
+
}
|
|
1060
|
+
const theta = endTheta - startTheta;
|
|
1061
|
+
|
|
1062
|
+
camera.twistRight(theta);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
function singleAxisTwist2D(controller, startPosition, movement) {
|
|
1066
|
+
let rotateRate =
|
|
1067
|
+
controller._rotateFactor * controller._rotateRateRangeAdjustment;
|
|
1068
|
+
|
|
1069
|
+
if (rotateRate > controller._maximumRotateRate) {
|
|
1070
|
+
rotateRate = controller._maximumRotateRate;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
if (rotateRate < controller._minimumRotateRate) {
|
|
1074
|
+
rotateRate = controller._minimumRotateRate;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
const scene = controller._scene;
|
|
1078
|
+
const camera = scene.camera;
|
|
1079
|
+
const canvas = scene.canvas;
|
|
1080
|
+
|
|
1081
|
+
let phiWindowRatio =
|
|
1082
|
+
(movement.endPosition.x - movement.startPosition.x) / canvas.clientWidth;
|
|
1083
|
+
phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);
|
|
1084
|
+
|
|
1085
|
+
const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 4.0;
|
|
1086
|
+
|
|
1087
|
+
camera.twistRight(deltaPhi);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
function update2D(controller) {
|
|
1091
|
+
const rotatable2D = controller._scene.mapMode2D === MapMode2D.ROTATE;
|
|
1092
|
+
if (!Matrix4.equals(Matrix4.IDENTITY, controller._scene.camera.transform)) {
|
|
1093
|
+
reactToInput(
|
|
1094
|
+
controller,
|
|
1095
|
+
controller.enableZoom,
|
|
1096
|
+
controller.zoomEventTypes,
|
|
1097
|
+
zoom2D,
|
|
1098
|
+
controller.inertiaZoom,
|
|
1099
|
+
"_lastInertiaZoomMovement",
|
|
1100
|
+
);
|
|
1101
|
+
if (rotatable2D) {
|
|
1102
|
+
reactToInput(
|
|
1103
|
+
controller,
|
|
1104
|
+
controller.enableRotate,
|
|
1105
|
+
controller.translateEventTypes,
|
|
1106
|
+
twist2D,
|
|
1107
|
+
controller.inertiaSpin,
|
|
1108
|
+
"_lastInertiaSpinMovement",
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
} else {
|
|
1112
|
+
reactToInput(
|
|
1113
|
+
controller,
|
|
1114
|
+
controller.enableTranslate,
|
|
1115
|
+
controller.translateEventTypes,
|
|
1116
|
+
translate2D,
|
|
1117
|
+
controller.inertiaTranslate,
|
|
1118
|
+
"_lastInertiaTranslateMovement",
|
|
1119
|
+
);
|
|
1120
|
+
reactToInput(
|
|
1121
|
+
controller,
|
|
1122
|
+
controller.enableZoom,
|
|
1123
|
+
controller.zoomEventTypes,
|
|
1124
|
+
zoom2D,
|
|
1125
|
+
controller.inertiaZoom,
|
|
1126
|
+
"_lastInertiaZoomMovement",
|
|
1127
|
+
);
|
|
1128
|
+
if (rotatable2D) {
|
|
1129
|
+
reactToInput(
|
|
1130
|
+
controller,
|
|
1131
|
+
controller.enableRotate,
|
|
1132
|
+
controller.tiltEventTypes,
|
|
1133
|
+
twist2D,
|
|
1134
|
+
controller.inertiaSpin,
|
|
1135
|
+
"_lastInertiaTiltMovement",
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
const pickGlobeScratchRay = new Ray();
|
|
1142
|
+
const scratchDepthIntersection = new Cartesian3();
|
|
1143
|
+
const scratchRayIntersection = new Cartesian3();
|
|
1144
|
+
|
|
1145
|
+
function pickPosition(controller, mousePosition, result) {
|
|
1146
|
+
const scene = controller._scene;
|
|
1147
|
+
const globe = controller._globe;
|
|
1148
|
+
const camera = scene.camera;
|
|
1149
|
+
|
|
1150
|
+
let depthIntersection;
|
|
1151
|
+
if (scene.pickPositionSupported) {
|
|
1152
|
+
depthIntersection = scene.pickPositionWorldCoordinates(
|
|
1153
|
+
mousePosition,
|
|
1154
|
+
scratchDepthIntersection,
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
if (!defined(globe)) {
|
|
1159
|
+
return Cartesian3.clone(depthIntersection, result);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
const cullBackFaces = !controller._cameraUnderground;
|
|
1163
|
+
const ray = camera.getPickRay(mousePosition, pickGlobeScratchRay);
|
|
1164
|
+
const rayIntersection = globe.pickWorldCoordinates(
|
|
1165
|
+
ray,
|
|
1166
|
+
scene,
|
|
1167
|
+
cullBackFaces,
|
|
1168
|
+
scratchRayIntersection,
|
|
1169
|
+
);
|
|
1170
|
+
|
|
1171
|
+
const pickDistance = defined(depthIntersection)
|
|
1172
|
+
? Cartesian3.distance(depthIntersection, camera.positionWC)
|
|
1173
|
+
: Number.POSITIVE_INFINITY;
|
|
1174
|
+
const rayDistance = defined(rayIntersection)
|
|
1175
|
+
? Cartesian3.distance(rayIntersection, camera.positionWC)
|
|
1176
|
+
: Number.POSITIVE_INFINITY;
|
|
1177
|
+
|
|
1178
|
+
if (pickDistance < rayDistance) {
|
|
1179
|
+
return Cartesian3.clone(depthIntersection, result);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
return Cartesian3.clone(rayIntersection, result);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
const scratchDistanceCartographic = new Cartographic();
|
|
1186
|
+
|
|
1187
|
+
function getDistanceFromSurface(controller) {
|
|
1188
|
+
const ellipsoid = controller._ellipsoid;
|
|
1189
|
+
const scene = controller._scene;
|
|
1190
|
+
const camera = scene.camera;
|
|
1191
|
+
const mode = scene.mode;
|
|
1192
|
+
|
|
1193
|
+
let height = 0.0;
|
|
1194
|
+
if (mode === SceneMode.SCENE3D) {
|
|
1195
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1196
|
+
camera.position,
|
|
1197
|
+
scratchDistanceCartographic,
|
|
1198
|
+
);
|
|
1199
|
+
if (defined(cartographic)) {
|
|
1200
|
+
height = cartographic.height;
|
|
1201
|
+
}
|
|
1202
|
+
} else {
|
|
1203
|
+
height = camera.position.z;
|
|
1204
|
+
}
|
|
1205
|
+
const globeHeight = controller._scene.globeHeight ?? 0.0;
|
|
1206
|
+
const distanceFromSurface = Math.abs(globeHeight - height);
|
|
1207
|
+
return distanceFromSurface;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
const scratchSurfaceNormal = new Cartesian3();
|
|
1211
|
+
|
|
1212
|
+
function getZoomDistanceUnderground(controller, ray) {
|
|
1213
|
+
const origin = ray.origin;
|
|
1214
|
+
const direction = ray.direction;
|
|
1215
|
+
const distanceFromSurface = getDistanceFromSurface(controller);
|
|
1216
|
+
|
|
1217
|
+
// Weight zoom distance based on how strongly the pick ray is pointing inward.
|
|
1218
|
+
// Geocentric normal is accurate enough for these purposes
|
|
1219
|
+
const surfaceNormal = Cartesian3.normalize(origin, scratchSurfaceNormal);
|
|
1220
|
+
let strength = Math.abs(Cartesian3.dot(surfaceNormal, direction));
|
|
1221
|
+
strength = Math.max(strength, 0.5) * 2.0;
|
|
1222
|
+
return distanceFromSurface * strength;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
function getTiltCenterUnderground(controller, ray, pickedPosition, result) {
|
|
1226
|
+
let distance = Cartesian3.distance(ray.origin, pickedPosition);
|
|
1227
|
+
const distanceFromSurface = getDistanceFromSurface(controller);
|
|
1228
|
+
|
|
1229
|
+
const maximumDistance = CesiumMath.clamp(
|
|
1230
|
+
distanceFromSurface * 5.0,
|
|
1231
|
+
controller._minimumUndergroundPickDistance,
|
|
1232
|
+
controller._maximumUndergroundPickDistance,
|
|
1233
|
+
);
|
|
1234
|
+
|
|
1235
|
+
if (distance > maximumDistance) {
|
|
1236
|
+
// Simulate look-at behavior by tilting around a small invisible sphere
|
|
1237
|
+
distance = Math.min(distance, distanceFromSurface / 5.0);
|
|
1238
|
+
distance = Math.max(distance, 100.0);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
return Ray.getPoint(ray, distance, result);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
function getStrafeStartPositionUnderground(
|
|
1245
|
+
controller,
|
|
1246
|
+
ray,
|
|
1247
|
+
pickedPosition,
|
|
1248
|
+
result,
|
|
1249
|
+
) {
|
|
1250
|
+
let distance;
|
|
1251
|
+
if (!defined(pickedPosition)) {
|
|
1252
|
+
distance = getDistanceFromSurface(controller);
|
|
1253
|
+
} else {
|
|
1254
|
+
distance = Cartesian3.distance(ray.origin, pickedPosition);
|
|
1255
|
+
if (distance > controller._maximumUndergroundPickDistance) {
|
|
1256
|
+
// If the picked position is too far away set the strafe speed based on the
|
|
1257
|
+
// camera's height from the globe surface
|
|
1258
|
+
distance = getDistanceFromSurface(controller);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
return Ray.getPoint(ray, distance, result);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
const scratchInertialDelta = new Cartesian2();
|
|
1266
|
+
|
|
1267
|
+
function continueStrafing(controller, movement) {
|
|
1268
|
+
// Update the end position continually based on the inertial delta
|
|
1269
|
+
const originalEndPosition = movement.endPosition;
|
|
1270
|
+
const inertialDelta = Cartesian2.subtract(
|
|
1271
|
+
movement.endPosition,
|
|
1272
|
+
movement.startPosition,
|
|
1273
|
+
scratchInertialDelta,
|
|
1274
|
+
);
|
|
1275
|
+
const endPosition = controller._strafeEndMousePosition;
|
|
1276
|
+
Cartesian2.add(endPosition, inertialDelta, endPosition);
|
|
1277
|
+
movement.endPosition = endPosition;
|
|
1278
|
+
strafe(controller, movement, controller._strafeStartPosition);
|
|
1279
|
+
movement.endPosition = originalEndPosition;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
const translateCVStartRay = new Ray();
|
|
1283
|
+
const translateCVEndRay = new Ray();
|
|
1284
|
+
const translateCVStartPos = new Cartesian3();
|
|
1285
|
+
const translateCVEndPos = new Cartesian3();
|
|
1286
|
+
const translateCVDifference = new Cartesian3();
|
|
1287
|
+
const translateCVOrigin = new Cartesian3();
|
|
1288
|
+
const translateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);
|
|
1289
|
+
const translateCVStartMouse = new Cartesian2();
|
|
1290
|
+
const translateCVEndMouse = new Cartesian2();
|
|
1291
|
+
|
|
1292
|
+
function translateCV(controller, startPosition, movement) {
|
|
1293
|
+
if (!Cartesian3.equals(startPosition, controller._translateMousePosition)) {
|
|
1294
|
+
controller._looking = false;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
if (!Cartesian3.equals(startPosition, controller._strafeMousePosition)) {
|
|
1298
|
+
controller._strafing = false;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
if (controller._looking) {
|
|
1302
|
+
look3D(controller, startPosition, movement);
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
if (controller._strafing) {
|
|
1307
|
+
continueStrafing(controller, movement);
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
const scene = controller._scene;
|
|
1312
|
+
const camera = scene.camera;
|
|
1313
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
1314
|
+
const startMouse = Cartesian2.clone(
|
|
1315
|
+
movement.startPosition,
|
|
1316
|
+
translateCVStartMouse,
|
|
1317
|
+
);
|
|
1318
|
+
const endMouse = Cartesian2.clone(movement.endPosition, translateCVEndMouse);
|
|
1319
|
+
let startRay = camera.getPickRay(startMouse, translateCVStartRay);
|
|
1320
|
+
|
|
1321
|
+
const origin = Cartesian3.clone(Cartesian3.ZERO, translateCVOrigin);
|
|
1322
|
+
const normal = Cartesian3.UNIT_X;
|
|
1323
|
+
|
|
1324
|
+
let globePos;
|
|
1325
|
+
if (camera.position.z < controller._minimumPickingTerrainHeight) {
|
|
1326
|
+
globePos = pickPosition(controller, startMouse, translateCVStartPos);
|
|
1327
|
+
|
|
1328
|
+
if (defined(globePos)) {
|
|
1329
|
+
origin.x = globePos.x;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
if (
|
|
1334
|
+
cameraUnderground ||
|
|
1335
|
+
(origin.x > camera.position.z && defined(globePos))
|
|
1336
|
+
) {
|
|
1337
|
+
let pickPosition = globePos;
|
|
1338
|
+
if (cameraUnderground) {
|
|
1339
|
+
pickPosition = getStrafeStartPositionUnderground(
|
|
1340
|
+
controller,
|
|
1341
|
+
startRay,
|
|
1342
|
+
globePos,
|
|
1343
|
+
translateCVStartPos,
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
Cartesian2.clone(startPosition, controller._strafeMousePosition);
|
|
1347
|
+
Cartesian2.clone(startPosition, controller._strafeEndMousePosition);
|
|
1348
|
+
Cartesian3.clone(pickPosition, controller._strafeStartPosition);
|
|
1349
|
+
controller._strafing = true;
|
|
1350
|
+
strafe(controller, movement, controller._strafeStartPosition);
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
const plane = Plane.fromPointNormal(origin, normal, translateCVPlane);
|
|
1355
|
+
|
|
1356
|
+
startRay = camera.getPickRay(startMouse, translateCVStartRay);
|
|
1357
|
+
const startPlanePos = IntersectionTests.rayPlane(
|
|
1358
|
+
startRay,
|
|
1359
|
+
plane,
|
|
1360
|
+
translateCVStartPos,
|
|
1361
|
+
);
|
|
1362
|
+
|
|
1363
|
+
const endRay = camera.getPickRay(endMouse, translateCVEndRay);
|
|
1364
|
+
const endPlanePos = IntersectionTests.rayPlane(
|
|
1365
|
+
endRay,
|
|
1366
|
+
plane,
|
|
1367
|
+
translateCVEndPos,
|
|
1368
|
+
);
|
|
1369
|
+
|
|
1370
|
+
if (!defined(startPlanePos) || !defined(endPlanePos)) {
|
|
1371
|
+
controller._looking = true;
|
|
1372
|
+
look3D(controller, startPosition, movement);
|
|
1373
|
+
Cartesian2.clone(startPosition, controller._translateMousePosition);
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
const diff = Cartesian3.subtract(
|
|
1378
|
+
startPlanePos,
|
|
1379
|
+
endPlanePos,
|
|
1380
|
+
translateCVDifference,
|
|
1381
|
+
);
|
|
1382
|
+
const temp = diff.x;
|
|
1383
|
+
diff.x = diff.y;
|
|
1384
|
+
diff.y = diff.z;
|
|
1385
|
+
diff.z = temp;
|
|
1386
|
+
const mag = Cartesian3.magnitude(diff);
|
|
1387
|
+
if (mag > CesiumMath.EPSILON6) {
|
|
1388
|
+
Cartesian3.normalize(diff, diff);
|
|
1389
|
+
camera.move(diff, mag);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
const rotateCVWindowPos = new Cartesian2();
|
|
1394
|
+
const rotateCVWindowRay = new Ray();
|
|
1395
|
+
const rotateCVCenter = new Cartesian3();
|
|
1396
|
+
const rotateCVVerticalCenter = new Cartesian3();
|
|
1397
|
+
const rotateCVTransform = new Matrix4();
|
|
1398
|
+
const rotateCVVerticalTransform = new Matrix4();
|
|
1399
|
+
const rotateCVOrigin = new Cartesian3();
|
|
1400
|
+
const rotateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);
|
|
1401
|
+
const rotateCVCartesian3 = new Cartesian3();
|
|
1402
|
+
const rotateCVCart = new Cartographic();
|
|
1403
|
+
const rotateCVOldTransform = new Matrix4();
|
|
1404
|
+
const rotateCVQuaternion = new Quaternion();
|
|
1405
|
+
const rotateCVMatrix = new Matrix3();
|
|
1406
|
+
const tilt3DCartesian3 = new Cartesian3();
|
|
1407
|
+
|
|
1408
|
+
function rotateCV(controller, startPosition, movement) {
|
|
1409
|
+
if (defined(movement.angleAndHeight)) {
|
|
1410
|
+
movement = movement.angleAndHeight;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {
|
|
1414
|
+
controller._tiltCVOffMap = false;
|
|
1415
|
+
controller._looking = false;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
if (controller._looking) {
|
|
1419
|
+
look3D(controller, startPosition, movement);
|
|
1420
|
+
return;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
const scene = controller._scene;
|
|
1424
|
+
const camera = scene.camera;
|
|
1425
|
+
|
|
1426
|
+
if (
|
|
1427
|
+
controller._tiltCVOffMap ||
|
|
1428
|
+
!controller.onMap() ||
|
|
1429
|
+
Math.abs(camera.position.z) > controller._minimumPickingTerrainHeight
|
|
1430
|
+
) {
|
|
1431
|
+
controller._tiltCVOffMap = true;
|
|
1432
|
+
rotateCVOnPlane(controller, startPosition, movement);
|
|
1433
|
+
} else {
|
|
1434
|
+
rotateCVOnTerrain(controller, startPosition, movement);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
function rotateCVOnPlane(controller, startPosition, movement) {
|
|
1439
|
+
const scene = controller._scene;
|
|
1440
|
+
const camera = scene.camera;
|
|
1441
|
+
const canvas = scene.canvas;
|
|
1442
|
+
|
|
1443
|
+
const windowPosition = rotateCVWindowPos;
|
|
1444
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
1445
|
+
windowPosition.y = canvas.clientHeight / 2;
|
|
1446
|
+
const ray = camera.getPickRay(windowPosition, rotateCVWindowRay);
|
|
1447
|
+
const normal = Cartesian3.UNIT_X;
|
|
1448
|
+
|
|
1449
|
+
const position = ray.origin;
|
|
1450
|
+
const direction = ray.direction;
|
|
1451
|
+
let scalar;
|
|
1452
|
+
const normalDotDirection = Cartesian3.dot(normal, direction);
|
|
1453
|
+
if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {
|
|
1454
|
+
scalar = -Cartesian3.dot(normal, position) / normalDotDirection;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
if (!defined(scalar) || scalar <= 0.0) {
|
|
1458
|
+
controller._looking = true;
|
|
1459
|
+
look3D(controller, startPosition, movement);
|
|
1460
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
const center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);
|
|
1465
|
+
Cartesian3.add(position, center, center);
|
|
1466
|
+
|
|
1467
|
+
const projection = scene.mapProjection;
|
|
1468
|
+
const ellipsoid = projection.ellipsoid;
|
|
1469
|
+
|
|
1470
|
+
Cartesian3.fromElements(center.y, center.z, center.x, center);
|
|
1471
|
+
const cart = projection.unproject(center, rotateCVCart);
|
|
1472
|
+
ellipsoid.cartographicToCartesian(cart, center);
|
|
1473
|
+
|
|
1474
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1475
|
+
center,
|
|
1476
|
+
ellipsoid,
|
|
1477
|
+
rotateCVTransform,
|
|
1478
|
+
);
|
|
1479
|
+
|
|
1480
|
+
const oldGlobe = controller._globe;
|
|
1481
|
+
const oldEllipsoid = controller._ellipsoid;
|
|
1482
|
+
controller._globe = undefined;
|
|
1483
|
+
controller._ellipsoid = Ellipsoid.UNIT_SPHERE;
|
|
1484
|
+
controller._rotateFactor = 1.0;
|
|
1485
|
+
controller._rotateRateRangeAdjustment = 1.0;
|
|
1486
|
+
|
|
1487
|
+
const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);
|
|
1488
|
+
camera._setTransform(transform);
|
|
1489
|
+
|
|
1490
|
+
rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);
|
|
1491
|
+
|
|
1492
|
+
camera._setTransform(oldTransform);
|
|
1493
|
+
controller._globe = oldGlobe;
|
|
1494
|
+
controller._ellipsoid = oldEllipsoid;
|
|
1495
|
+
|
|
1496
|
+
const radius = oldEllipsoid.maximumRadius;
|
|
1497
|
+
controller._rotateFactor = 1.0 / radius;
|
|
1498
|
+
controller._rotateRateRangeAdjustment = radius;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
function rotateCVOnTerrain(controller, startPosition, movement) {
|
|
1502
|
+
const scene = controller._scene;
|
|
1503
|
+
const camera = scene.camera;
|
|
1504
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
1505
|
+
|
|
1506
|
+
let center;
|
|
1507
|
+
let ray;
|
|
1508
|
+
const normal = Cartesian3.UNIT_X;
|
|
1509
|
+
|
|
1510
|
+
if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {
|
|
1511
|
+
center = Cartesian3.clone(controller._tiltCenter, rotateCVCenter);
|
|
1512
|
+
} else {
|
|
1513
|
+
if (camera.position.z < controller._minimumPickingTerrainHeight) {
|
|
1514
|
+
center = pickPosition(controller, startPosition, rotateCVCenter);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
if (!defined(center)) {
|
|
1518
|
+
ray = camera.getPickRay(startPosition, rotateCVWindowRay);
|
|
1519
|
+
const position = ray.origin;
|
|
1520
|
+
const direction = ray.direction;
|
|
1521
|
+
|
|
1522
|
+
let scalar;
|
|
1523
|
+
const normalDotDirection = Cartesian3.dot(normal, direction);
|
|
1524
|
+
if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {
|
|
1525
|
+
scalar = -Cartesian3.dot(normal, position) / normalDotDirection;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
if (!defined(scalar) || scalar <= 0.0) {
|
|
1529
|
+
controller._looking = true;
|
|
1530
|
+
look3D(controller, startPosition, movement);
|
|
1531
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);
|
|
1536
|
+
Cartesian3.add(position, center, center);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
if (cameraUnderground) {
|
|
1540
|
+
if (!defined(ray)) {
|
|
1541
|
+
ray = camera.getPickRay(startPosition, rotateCVWindowRay);
|
|
1542
|
+
}
|
|
1543
|
+
getTiltCenterUnderground(controller, ray, center, center);
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
1547
|
+
Cartesian3.clone(center, controller._tiltCenter);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
const canvas = scene.canvas;
|
|
1551
|
+
|
|
1552
|
+
const windowPosition = rotateCVWindowPos;
|
|
1553
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
1554
|
+
windowPosition.y = controller._tiltCenterMousePosition.y;
|
|
1555
|
+
ray = camera.getPickRay(windowPosition, rotateCVWindowRay);
|
|
1556
|
+
|
|
1557
|
+
const origin = Cartesian3.clone(Cartesian3.ZERO, rotateCVOrigin);
|
|
1558
|
+
origin.x = center.x;
|
|
1559
|
+
|
|
1560
|
+
const plane = Plane.fromPointNormal(origin, normal, rotateCVPlane);
|
|
1561
|
+
const verticalCenter = IntersectionTests.rayPlane(
|
|
1562
|
+
ray,
|
|
1563
|
+
plane,
|
|
1564
|
+
rotateCVVerticalCenter,
|
|
1565
|
+
);
|
|
1566
|
+
|
|
1567
|
+
const projection = camera._projection;
|
|
1568
|
+
const ellipsoid = projection.ellipsoid;
|
|
1569
|
+
|
|
1570
|
+
Cartesian3.fromElements(center.y, center.z, center.x, center);
|
|
1571
|
+
let cart = projection.unproject(center, rotateCVCart);
|
|
1572
|
+
ellipsoid.cartographicToCartesian(cart, center);
|
|
1573
|
+
|
|
1574
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
1575
|
+
center,
|
|
1576
|
+
ellipsoid,
|
|
1577
|
+
rotateCVTransform,
|
|
1578
|
+
);
|
|
1579
|
+
|
|
1580
|
+
let verticalTransform;
|
|
1581
|
+
if (defined(verticalCenter)) {
|
|
1582
|
+
Cartesian3.fromElements(
|
|
1583
|
+
verticalCenter.y,
|
|
1584
|
+
verticalCenter.z,
|
|
1585
|
+
verticalCenter.x,
|
|
1586
|
+
verticalCenter,
|
|
1587
|
+
);
|
|
1588
|
+
cart = projection.unproject(verticalCenter, rotateCVCart);
|
|
1589
|
+
ellipsoid.cartographicToCartesian(cart, verticalCenter);
|
|
1590
|
+
|
|
1591
|
+
verticalTransform = Transforms.eastNorthUpToFixedFrame(
|
|
1592
|
+
verticalCenter,
|
|
1593
|
+
ellipsoid,
|
|
1594
|
+
rotateCVVerticalTransform,
|
|
1595
|
+
);
|
|
1596
|
+
} else {
|
|
1597
|
+
verticalTransform = transform;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
const oldGlobe = controller._globe;
|
|
1601
|
+
const oldEllipsoid = controller._ellipsoid;
|
|
1602
|
+
controller._globe = undefined;
|
|
1603
|
+
controller._ellipsoid = Ellipsoid.UNIT_SPHERE;
|
|
1604
|
+
controller._rotateFactor = 1.0;
|
|
1605
|
+
controller._rotateRateRangeAdjustment = 1.0;
|
|
1606
|
+
|
|
1607
|
+
let constrainedAxis = Cartesian3.UNIT_Z;
|
|
1608
|
+
|
|
1609
|
+
const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);
|
|
1610
|
+
camera._setTransform(transform);
|
|
1611
|
+
|
|
1612
|
+
const tangent = Cartesian3.cross(
|
|
1613
|
+
Cartesian3.UNIT_Z,
|
|
1614
|
+
Cartesian3.normalize(camera.position, rotateCVCartesian3),
|
|
1615
|
+
rotateCVCartesian3,
|
|
1616
|
+
);
|
|
1617
|
+
const dot = Cartesian3.dot(camera.right, tangent);
|
|
1618
|
+
|
|
1619
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, false, true);
|
|
1620
|
+
|
|
1621
|
+
camera._setTransform(verticalTransform);
|
|
1622
|
+
if (dot < 0.0) {
|
|
1623
|
+
const movementDelta = movement.startPosition.y - movement.endPosition.y;
|
|
1624
|
+
if (
|
|
1625
|
+
(cameraUnderground && movementDelta < 0.0) ||
|
|
1626
|
+
(!cameraUnderground && movementDelta > 0.0)
|
|
1627
|
+
) {
|
|
1628
|
+
// Prevent camera from flipping past the up axis
|
|
1629
|
+
constrainedAxis = undefined;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
const oldConstrainedAxis = camera.constrainedAxis;
|
|
1633
|
+
camera.constrainedAxis = undefined;
|
|
1634
|
+
|
|
1635
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, true, false);
|
|
1636
|
+
|
|
1637
|
+
camera.constrainedAxis = oldConstrainedAxis;
|
|
1638
|
+
} else {
|
|
1639
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, true, false);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
if (defined(camera.constrainedAxis)) {
|
|
1643
|
+
const right = Cartesian3.cross(
|
|
1644
|
+
camera.direction,
|
|
1645
|
+
camera.constrainedAxis,
|
|
1646
|
+
tilt3DCartesian3,
|
|
1647
|
+
);
|
|
1648
|
+
if (
|
|
1649
|
+
!Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)
|
|
1650
|
+
) {
|
|
1651
|
+
if (Cartesian3.dot(right, camera.right) < 0.0) {
|
|
1652
|
+
Cartesian3.negate(right, right);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
Cartesian3.cross(right, camera.direction, camera.up);
|
|
1656
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
1657
|
+
|
|
1658
|
+
Cartesian3.normalize(camera.up, camera.up);
|
|
1659
|
+
Cartesian3.normalize(camera.right, camera.right);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
camera._setTransform(oldTransform);
|
|
1664
|
+
controller._globe = oldGlobe;
|
|
1665
|
+
controller._ellipsoid = oldEllipsoid;
|
|
1666
|
+
|
|
1667
|
+
const radius = oldEllipsoid.maximumRadius;
|
|
1668
|
+
controller._rotateFactor = 1.0 / radius;
|
|
1669
|
+
controller._rotateRateRangeAdjustment = radius;
|
|
1670
|
+
|
|
1671
|
+
const originalPosition = Cartesian3.clone(
|
|
1672
|
+
camera.positionWC,
|
|
1673
|
+
rotateCVCartesian3,
|
|
1674
|
+
);
|
|
1675
|
+
|
|
1676
|
+
if (controller.enableCollisionDetection) {
|
|
1677
|
+
adjustHeightForTerrain(controller, true);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
if (!Cartesian3.equals(camera.positionWC, originalPosition)) {
|
|
1681
|
+
camera._setTransform(verticalTransform);
|
|
1682
|
+
camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);
|
|
1683
|
+
|
|
1684
|
+
const magSqrd = Cartesian3.magnitudeSquared(originalPosition);
|
|
1685
|
+
if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {
|
|
1686
|
+
Cartesian3.normalize(camera.position, camera.position);
|
|
1687
|
+
Cartesian3.multiplyByScalar(
|
|
1688
|
+
camera.position,
|
|
1689
|
+
Math.sqrt(magSqrd),
|
|
1690
|
+
camera.position,
|
|
1691
|
+
);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
const angle = Cartesian3.angleBetween(originalPosition, camera.position);
|
|
1695
|
+
const axis = Cartesian3.cross(
|
|
1696
|
+
originalPosition,
|
|
1697
|
+
camera.position,
|
|
1698
|
+
originalPosition,
|
|
1699
|
+
);
|
|
1700
|
+
Cartesian3.normalize(axis, axis);
|
|
1701
|
+
|
|
1702
|
+
const quaternion = Quaternion.fromAxisAngle(
|
|
1703
|
+
axis,
|
|
1704
|
+
angle,
|
|
1705
|
+
rotateCVQuaternion,
|
|
1706
|
+
);
|
|
1707
|
+
const rotation = Matrix3.fromQuaternion(quaternion, rotateCVMatrix);
|
|
1708
|
+
Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);
|
|
1709
|
+
Matrix3.multiplyByVector(rotation, camera.up, camera.up);
|
|
1710
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
1711
|
+
Cartesian3.cross(camera.right, camera.direction, camera.up);
|
|
1712
|
+
|
|
1713
|
+
camera._setTransform(oldTransform);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
const zoomCVWindowPos = new Cartesian2();
|
|
1718
|
+
const zoomCVWindowRay = new Ray();
|
|
1719
|
+
const zoomCVIntersection = new Cartesian3();
|
|
1720
|
+
|
|
1721
|
+
function zoomCV(controller, startPosition, movement) {
|
|
1722
|
+
if (defined(movement.distance)) {
|
|
1723
|
+
movement = movement.distance;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
const scene = controller._scene;
|
|
1727
|
+
const camera = scene.camera;
|
|
1728
|
+
const canvas = scene.canvas;
|
|
1729
|
+
|
|
1730
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
1731
|
+
|
|
1732
|
+
let windowPosition;
|
|
1733
|
+
|
|
1734
|
+
if (cameraUnderground) {
|
|
1735
|
+
windowPosition = startPosition;
|
|
1736
|
+
} else {
|
|
1737
|
+
windowPosition = zoomCVWindowPos;
|
|
1738
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
1739
|
+
windowPosition.y = canvas.clientHeight / 2;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);
|
|
1743
|
+
const position = ray.origin;
|
|
1744
|
+
const direction = ray.direction;
|
|
1745
|
+
const height = camera.position.z;
|
|
1746
|
+
|
|
1747
|
+
let intersection;
|
|
1748
|
+
if (height < controller._minimumPickingTerrainHeight) {
|
|
1749
|
+
intersection = pickPosition(controller, windowPosition, zoomCVIntersection);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
let distance;
|
|
1753
|
+
if (defined(intersection)) {
|
|
1754
|
+
distance = Cartesian3.distance(position, intersection);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
if (cameraUnderground) {
|
|
1758
|
+
const distanceUnderground = getZoomDistanceUnderground(
|
|
1759
|
+
controller,
|
|
1760
|
+
ray,
|
|
1761
|
+
height,
|
|
1762
|
+
);
|
|
1763
|
+
if (defined(distance)) {
|
|
1764
|
+
distance = Math.min(distance, distanceUnderground);
|
|
1765
|
+
} else {
|
|
1766
|
+
distance = distanceUnderground;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
if (!defined(distance)) {
|
|
1771
|
+
const normal = Cartesian3.UNIT_X;
|
|
1772
|
+
distance =
|
|
1773
|
+
-Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
handleZoom(
|
|
1777
|
+
controller,
|
|
1778
|
+
startPosition,
|
|
1779
|
+
movement,
|
|
1780
|
+
controller.zoomFactor,
|
|
1781
|
+
distance,
|
|
1782
|
+
);
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
function updateCV(controller) {
|
|
1786
|
+
const scene = controller._scene;
|
|
1787
|
+
const camera = scene.camera;
|
|
1788
|
+
|
|
1789
|
+
if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {
|
|
1790
|
+
reactToInput(
|
|
1791
|
+
controller,
|
|
1792
|
+
controller.enableRotate,
|
|
1793
|
+
controller.rotateEventTypes,
|
|
1794
|
+
rotate3D,
|
|
1795
|
+
controller.inertiaSpin,
|
|
1796
|
+
"_lastInertiaSpinMovement",
|
|
1797
|
+
);
|
|
1798
|
+
reactToInput(
|
|
1799
|
+
controller,
|
|
1800
|
+
controller.enableZoom,
|
|
1801
|
+
controller.zoomEventTypes,
|
|
1802
|
+
zoom3D,
|
|
1803
|
+
controller.inertiaZoom,
|
|
1804
|
+
"_lastInertiaZoomMovement",
|
|
1805
|
+
);
|
|
1806
|
+
} else {
|
|
1807
|
+
const tweens = controller._tweens;
|
|
1808
|
+
|
|
1809
|
+
if (controller._aggregator.anyButtonDown) {
|
|
1810
|
+
tweens.removeAll();
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
reactToInput(
|
|
1814
|
+
controller,
|
|
1815
|
+
controller.enableTilt,
|
|
1816
|
+
controller.tiltEventTypes,
|
|
1817
|
+
rotateCV,
|
|
1818
|
+
controller.inertiaSpin,
|
|
1819
|
+
"_lastInertiaTiltMovement",
|
|
1820
|
+
);
|
|
1821
|
+
reactToInput(
|
|
1822
|
+
controller,
|
|
1823
|
+
controller.enableTranslate,
|
|
1824
|
+
controller.translateEventTypes,
|
|
1825
|
+
translateCV,
|
|
1826
|
+
controller.inertiaTranslate,
|
|
1827
|
+
"_lastInertiaTranslateMovement",
|
|
1828
|
+
);
|
|
1829
|
+
reactToInput(
|
|
1830
|
+
controller,
|
|
1831
|
+
controller.enableZoom,
|
|
1832
|
+
controller.zoomEventTypes,
|
|
1833
|
+
zoomCV,
|
|
1834
|
+
controller.inertiaZoom,
|
|
1835
|
+
"_lastInertiaZoomMovement",
|
|
1836
|
+
);
|
|
1837
|
+
reactToInput(
|
|
1838
|
+
controller,
|
|
1839
|
+
controller.enableLook,
|
|
1840
|
+
controller.lookEventTypes,
|
|
1841
|
+
look3D,
|
|
1842
|
+
);
|
|
1843
|
+
|
|
1844
|
+
if (
|
|
1845
|
+
!controller._aggregator.anyButtonDown &&
|
|
1846
|
+
!tweens.contains(controller._tween)
|
|
1847
|
+
) {
|
|
1848
|
+
const tween = camera.createCorrectPositionTween(
|
|
1849
|
+
controller.bounceAnimationTime,
|
|
1850
|
+
);
|
|
1851
|
+
if (defined(tween)) {
|
|
1852
|
+
controller._tween = tweens.add(tween);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
tweens.update();
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
const scratchStrafeRay = new Ray();
|
|
1861
|
+
const scratchStrafePlane = new Plane(Cartesian3.UNIT_X, 0.0);
|
|
1862
|
+
const scratchStrafeIntersection = new Cartesian3();
|
|
1863
|
+
const scratchStrafeDirection = new Cartesian3();
|
|
1864
|
+
|
|
1865
|
+
function strafe(controller, movement, strafeStartPosition) {
|
|
1866
|
+
const scene = controller._scene;
|
|
1867
|
+
const camera = scene.camera;
|
|
1868
|
+
|
|
1869
|
+
const ray = camera.getPickRay(movement.endPosition, scratchStrafeRay);
|
|
1870
|
+
|
|
1871
|
+
let direction = Cartesian3.clone(camera.direction, scratchStrafeDirection);
|
|
1872
|
+
if (scene.mode === SceneMode.COLUMBUS_VIEW) {
|
|
1873
|
+
Cartesian3.fromElements(direction.z, direction.x, direction.y, direction);
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
const plane = Plane.fromPointNormal(
|
|
1877
|
+
strafeStartPosition,
|
|
1878
|
+
direction,
|
|
1879
|
+
scratchStrafePlane,
|
|
1880
|
+
);
|
|
1881
|
+
const intersection = IntersectionTests.rayPlane(
|
|
1882
|
+
ray,
|
|
1883
|
+
plane,
|
|
1884
|
+
scratchStrafeIntersection,
|
|
1885
|
+
);
|
|
1886
|
+
if (!defined(intersection)) {
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
direction = Cartesian3.subtract(strafeStartPosition, intersection, direction);
|
|
1891
|
+
if (scene.mode === SceneMode.COLUMBUS_VIEW) {
|
|
1892
|
+
Cartesian3.fromElements(direction.y, direction.z, direction.x, direction);
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
Cartesian3.add(camera.position, direction, camera.position);
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
const spin3DPick = new Cartesian3();
|
|
1899
|
+
const scratchCartographic = new Cartographic();
|
|
1900
|
+
const scratchRadii = new Cartesian3();
|
|
1901
|
+
const scratchEllipsoid = new Ellipsoid();
|
|
1902
|
+
const scratchLookUp = new Cartesian3();
|
|
1903
|
+
const scratchNormal = new Cartesian3();
|
|
1904
|
+
const scratchMousePosition = new Cartesian3();
|
|
1905
|
+
|
|
1906
|
+
function spin3D(controller, startPosition, movement) {
|
|
1907
|
+
const scene = controller._scene;
|
|
1908
|
+
const camera = scene.camera;
|
|
1909
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
1910
|
+
let ellipsoid = controller._ellipsoid;
|
|
1911
|
+
|
|
1912
|
+
if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {
|
|
1913
|
+
rotate3D(controller, startPosition, movement);
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
let magnitude;
|
|
1918
|
+
let radii;
|
|
1919
|
+
|
|
1920
|
+
const up = ellipsoid.geodeticSurfaceNormal(camera.position, scratchLookUp);
|
|
1921
|
+
|
|
1922
|
+
if (Cartesian2.equals(startPosition, controller._rotateMousePosition)) {
|
|
1923
|
+
if (controller._looking) {
|
|
1924
|
+
look3D(controller, startPosition, movement, up);
|
|
1925
|
+
} else if (controller._rotating) {
|
|
1926
|
+
rotate3D(controller, startPosition, movement);
|
|
1927
|
+
} else if (controller._strafing) {
|
|
1928
|
+
continueStrafing(controller, movement);
|
|
1929
|
+
} else {
|
|
1930
|
+
if (
|
|
1931
|
+
Cartesian3.magnitude(camera.position) <
|
|
1932
|
+
Cartesian3.magnitude(controller._rotateStartPosition)
|
|
1933
|
+
) {
|
|
1934
|
+
// Pan action is no longer valid if camera moves below the pan ellipsoid
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
magnitude = Cartesian3.magnitude(controller._rotateStartPosition);
|
|
1938
|
+
radii = scratchRadii;
|
|
1939
|
+
radii.x = radii.y = radii.z = magnitude;
|
|
1940
|
+
ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);
|
|
1941
|
+
pan3D(controller, startPosition, movement, ellipsoid);
|
|
1942
|
+
}
|
|
1943
|
+
return;
|
|
1944
|
+
}
|
|
1945
|
+
controller._looking = false;
|
|
1946
|
+
controller._rotating = false;
|
|
1947
|
+
controller._strafing = false;
|
|
1948
|
+
|
|
1949
|
+
const height = ellipsoid.cartesianToCartographic(
|
|
1950
|
+
camera.positionWC,
|
|
1951
|
+
scratchCartographic,
|
|
1952
|
+
).height;
|
|
1953
|
+
const globe = controller._globe;
|
|
1954
|
+
|
|
1955
|
+
if (defined(globe) && height < controller._minimumPickingTerrainHeight) {
|
|
1956
|
+
const mousePos = pickPosition(
|
|
1957
|
+
controller,
|
|
1958
|
+
movement.startPosition,
|
|
1959
|
+
scratchMousePosition,
|
|
1960
|
+
);
|
|
1961
|
+
if (defined(mousePos)) {
|
|
1962
|
+
let strafing = false;
|
|
1963
|
+
const ray = camera.getPickRay(
|
|
1964
|
+
movement.startPosition,
|
|
1965
|
+
pickGlobeScratchRay,
|
|
1966
|
+
);
|
|
1967
|
+
|
|
1968
|
+
if (cameraUnderground) {
|
|
1969
|
+
strafing = true;
|
|
1970
|
+
getStrafeStartPositionUnderground(controller, ray, mousePos, mousePos);
|
|
1971
|
+
} else {
|
|
1972
|
+
const normal = ellipsoid.geodeticSurfaceNormal(mousePos, scratchNormal);
|
|
1973
|
+
const tangentPick =
|
|
1974
|
+
Math.abs(Cartesian3.dot(ray.direction, normal)) < 0.05;
|
|
1975
|
+
|
|
1976
|
+
if (tangentPick) {
|
|
1977
|
+
strafing = true;
|
|
1978
|
+
} else {
|
|
1979
|
+
strafing =
|
|
1980
|
+
Cartesian3.magnitude(camera.position) <
|
|
1981
|
+
Cartesian3.magnitude(mousePos);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
if (strafing) {
|
|
1986
|
+
Cartesian2.clone(startPosition, controller._strafeEndMousePosition);
|
|
1987
|
+
Cartesian3.clone(mousePos, controller._strafeStartPosition);
|
|
1988
|
+
controller._strafing = true;
|
|
1989
|
+
strafe(controller, movement, controller._strafeStartPosition);
|
|
1990
|
+
} else {
|
|
1991
|
+
magnitude = Cartesian3.magnitude(mousePos);
|
|
1992
|
+
radii = scratchRadii;
|
|
1993
|
+
radii.x = radii.y = radii.z = magnitude;
|
|
1994
|
+
ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);
|
|
1995
|
+
pan3D(controller, startPosition, movement, ellipsoid);
|
|
1996
|
+
|
|
1997
|
+
Cartesian3.clone(mousePos, controller._rotateStartPosition);
|
|
1998
|
+
}
|
|
1999
|
+
} else {
|
|
2000
|
+
controller._looking = true;
|
|
2001
|
+
look3D(controller, startPosition, movement, up);
|
|
2002
|
+
}
|
|
2003
|
+
} else if (
|
|
2004
|
+
defined(
|
|
2005
|
+
camera.pickEllipsoid(
|
|
2006
|
+
movement.startPosition,
|
|
2007
|
+
controller._ellipsoid,
|
|
2008
|
+
spin3DPick,
|
|
2009
|
+
),
|
|
2010
|
+
)
|
|
2011
|
+
) {
|
|
2012
|
+
pan3D(controller, startPosition, movement, controller._ellipsoid);
|
|
2013
|
+
Cartesian3.clone(spin3DPick, controller._rotateStartPosition);
|
|
2014
|
+
} else if (height > controller._minimumTrackBallHeight) {
|
|
2015
|
+
controller._rotating = true;
|
|
2016
|
+
rotate3D(controller, startPosition, movement);
|
|
2017
|
+
} else {
|
|
2018
|
+
controller._looking = true;
|
|
2019
|
+
look3D(controller, startPosition, movement, up);
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
Cartesian2.clone(startPosition, controller._rotateMousePosition);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
function rotate3D(
|
|
2026
|
+
controller,
|
|
2027
|
+
startPosition,
|
|
2028
|
+
movement,
|
|
2029
|
+
constrainedAxis,
|
|
2030
|
+
rotateOnlyVertical,
|
|
2031
|
+
rotateOnlyHorizontal,
|
|
2032
|
+
) {
|
|
2033
|
+
rotateOnlyVertical = rotateOnlyVertical ?? false;
|
|
2034
|
+
rotateOnlyHorizontal = rotateOnlyHorizontal ?? false;
|
|
2035
|
+
|
|
2036
|
+
const scene = controller._scene;
|
|
2037
|
+
const camera = scene.camera;
|
|
2038
|
+
const canvas = scene.canvas;
|
|
2039
|
+
|
|
2040
|
+
const oldAxis = camera.constrainedAxis;
|
|
2041
|
+
if (defined(constrainedAxis)) {
|
|
2042
|
+
camera.constrainedAxis = constrainedAxis;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
const rho = Cartesian3.magnitude(camera.position);
|
|
2046
|
+
let rotateRate =
|
|
2047
|
+
controller._rotateFactor * (rho - controller._rotateRateRangeAdjustment);
|
|
2048
|
+
|
|
2049
|
+
if (rotateRate > controller._maximumRotateRate) {
|
|
2050
|
+
rotateRate = controller._maximumRotateRate;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
if (rotateRate < controller._minimumRotateRate) {
|
|
2054
|
+
rotateRate = controller._minimumRotateRate;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
let phiWindowRatio =
|
|
2058
|
+
(movement.startPosition.x - movement.endPosition.x) / canvas.clientWidth;
|
|
2059
|
+
let thetaWindowRatio =
|
|
2060
|
+
(movement.startPosition.y - movement.endPosition.y) / canvas.clientHeight;
|
|
2061
|
+
phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);
|
|
2062
|
+
thetaWindowRatio = Math.min(
|
|
2063
|
+
thetaWindowRatio,
|
|
2064
|
+
controller.maximumMovementRatio,
|
|
2065
|
+
);
|
|
2066
|
+
|
|
2067
|
+
const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 2.0;
|
|
2068
|
+
let deltaTheta = rotateRate * thetaWindowRatio * Math.PI;
|
|
2069
|
+
|
|
2070
|
+
if (defined(constrainedAxis) && defined(controller.maximumTiltAngle)) {
|
|
2071
|
+
const maximumTiltAngle = controller.maximumTiltAngle;
|
|
2072
|
+
const dotProduct = Cartesian3.dot(camera.direction, constrainedAxis);
|
|
2073
|
+
const tilt = Math.PI - Math.acos(dotProduct) + deltaTheta;
|
|
2074
|
+
if (tilt > maximumTiltAngle) {
|
|
2075
|
+
deltaTheta -= tilt - maximumTiltAngle;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
if (!rotateOnlyVertical) {
|
|
2080
|
+
camera.rotateRight(deltaPhi);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
if (!rotateOnlyHorizontal) {
|
|
2084
|
+
camera.rotateUp(deltaTheta);
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
camera.constrainedAxis = oldAxis;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
const pan3DP0 = Cartesian4.clone(Cartesian4.UNIT_W);
|
|
2091
|
+
const pan3DP1 = Cartesian4.clone(Cartesian4.UNIT_W);
|
|
2092
|
+
const pan3DTemp0 = new Cartesian3();
|
|
2093
|
+
const pan3DTemp1 = new Cartesian3();
|
|
2094
|
+
const pan3DTemp2 = new Cartesian3();
|
|
2095
|
+
const pan3DTemp3 = new Cartesian3();
|
|
2096
|
+
const pan3DStartMousePosition = new Cartesian2();
|
|
2097
|
+
const pan3DEndMousePosition = new Cartesian2();
|
|
2098
|
+
const pan3DDiffMousePosition = new Cartesian2();
|
|
2099
|
+
const pan3DPixelDimensions = new Cartesian2();
|
|
2100
|
+
const panRay = new Ray();
|
|
2101
|
+
|
|
2102
|
+
function pan3D(controller, startPosition, movement, ellipsoid) {
|
|
2103
|
+
const scene = controller._scene;
|
|
2104
|
+
const camera = scene.camera;
|
|
2105
|
+
|
|
2106
|
+
const startMousePosition = Cartesian2.clone(
|
|
2107
|
+
movement.startPosition,
|
|
2108
|
+
pan3DStartMousePosition,
|
|
2109
|
+
);
|
|
2110
|
+
const endMousePosition = Cartesian2.clone(
|
|
2111
|
+
movement.endPosition,
|
|
2112
|
+
pan3DEndMousePosition,
|
|
2113
|
+
);
|
|
2114
|
+
const height = ellipsoid.cartesianToCartographic(
|
|
2115
|
+
camera.positionWC,
|
|
2116
|
+
scratchCartographic,
|
|
2117
|
+
).height;
|
|
2118
|
+
|
|
2119
|
+
let p0, p1;
|
|
2120
|
+
|
|
2121
|
+
if (
|
|
2122
|
+
!movement.inertiaEnabled &&
|
|
2123
|
+
height < controller._minimumPickingTerrainHeight
|
|
2124
|
+
) {
|
|
2125
|
+
p0 = Cartesian3.clone(controller._panLastWorldPosition, pan3DP0);
|
|
2126
|
+
|
|
2127
|
+
// Use the last picked world position unless we're starting a new drag
|
|
2128
|
+
if (
|
|
2129
|
+
!defined(controller._globe) &&
|
|
2130
|
+
!Cartesian2.equalsEpsilon(
|
|
2131
|
+
startMousePosition,
|
|
2132
|
+
controller._panLastMousePosition,
|
|
2133
|
+
)
|
|
2134
|
+
) {
|
|
2135
|
+
p0 = pickPosition(controller, startMousePosition, pan3DP0);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
if (!defined(controller._globe) && defined(p0)) {
|
|
2139
|
+
const toCenter = Cartesian3.subtract(p0, camera.positionWC, pan3DTemp1);
|
|
2140
|
+
const toCenterProj = Cartesian3.multiplyByScalar(
|
|
2141
|
+
camera.directionWC,
|
|
2142
|
+
Cartesian3.dot(camera.directionWC, toCenter),
|
|
2143
|
+
pan3DTemp1,
|
|
2144
|
+
);
|
|
2145
|
+
const distanceToNearPlane = Cartesian3.magnitude(toCenterProj);
|
|
2146
|
+
const pixelDimensions = camera.frustum.getPixelDimensions(
|
|
2147
|
+
scene.drawingBufferWidth,
|
|
2148
|
+
scene.drawingBufferHeight,
|
|
2149
|
+
distanceToNearPlane,
|
|
2150
|
+
scene.pixelRatio,
|
|
2151
|
+
pan3DPixelDimensions,
|
|
2152
|
+
);
|
|
2153
|
+
|
|
2154
|
+
const dragDelta = Cartesian2.subtract(
|
|
2155
|
+
endMousePosition,
|
|
2156
|
+
startMousePosition,
|
|
2157
|
+
pan3DDiffMousePosition,
|
|
2158
|
+
);
|
|
2159
|
+
|
|
2160
|
+
// Move the camera to the the distance the cursor moved in worldspace
|
|
2161
|
+
const right = Cartesian3.multiplyByScalar(
|
|
2162
|
+
camera.rightWC,
|
|
2163
|
+
dragDelta.x * pixelDimensions.x,
|
|
2164
|
+
pan3DTemp1,
|
|
2165
|
+
);
|
|
2166
|
+
|
|
2167
|
+
// Move the camera towards the picked position in worldspace as the camera is pointed towards a horizon view
|
|
2168
|
+
const cameraPositionNormal = Cartesian3.normalize(
|
|
2169
|
+
camera.positionWC,
|
|
2170
|
+
scratchCameraPositionNormal,
|
|
2171
|
+
);
|
|
2172
|
+
const endPickDirection = camera.getPickRay(
|
|
2173
|
+
endMousePosition,
|
|
2174
|
+
panRay,
|
|
2175
|
+
).direction;
|
|
2176
|
+
const endPickProj = Cartesian3.subtract(
|
|
2177
|
+
endPickDirection,
|
|
2178
|
+
Cartesian3.projectVector(endPickDirection, camera.rightWC, pan3DTemp2),
|
|
2179
|
+
pan3DTemp2,
|
|
2180
|
+
);
|
|
2181
|
+
const angle = Cartesian3.angleBetween(endPickProj, camera.directionWC);
|
|
2182
|
+
let forward = 1.0;
|
|
2183
|
+
if (defined(camera.frustum.fov)) {
|
|
2184
|
+
forward = Math.max(Math.tan(angle), 0.1); // Clamp so we don't make the magnitude infinitely large when the angle is small
|
|
2185
|
+
}
|
|
2186
|
+
let dot = Math.abs(
|
|
2187
|
+
Cartesian3.dot(camera.directionWC, cameraPositionNormal),
|
|
2188
|
+
);
|
|
2189
|
+
const magnitude =
|
|
2190
|
+
((-dragDelta.y * pixelDimensions.y * 2.0) / Math.sqrt(forward)) *
|
|
2191
|
+
(1.0 - dot);
|
|
2192
|
+
const direction = Cartesian3.multiplyByScalar(
|
|
2193
|
+
endPickDirection,
|
|
2194
|
+
magnitude,
|
|
2195
|
+
pan3DTemp2,
|
|
2196
|
+
);
|
|
2197
|
+
|
|
2198
|
+
// Move the camera up the distance the cursor moved in worldspace as the camera is pointed towards the center
|
|
2199
|
+
dot = Math.abs(Cartesian3.dot(camera.upWC, cameraPositionNormal));
|
|
2200
|
+
const up = Cartesian3.multiplyByScalar(
|
|
2201
|
+
camera.upWC,
|
|
2202
|
+
-dragDelta.y * (1.0 - dot) * pixelDimensions.y,
|
|
2203
|
+
pan3DTemp3,
|
|
2204
|
+
);
|
|
2205
|
+
|
|
2206
|
+
p1 = Cartesian3.add(p0, right, pan3DP1);
|
|
2207
|
+
p1 = Cartesian3.add(p1, direction, p1);
|
|
2208
|
+
p1 = Cartesian3.add(p1, up, p1);
|
|
2209
|
+
|
|
2210
|
+
Cartesian3.clone(p1, controller._panLastWorldPosition);
|
|
2211
|
+
Cartesian2.clone(endMousePosition, controller._panLastMousePosition);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
if (!defined(p0) || !defined(p1)) {
|
|
2216
|
+
p0 = camera.pickEllipsoid(startMousePosition, ellipsoid, pan3DP0);
|
|
2217
|
+
p1 = camera.pickEllipsoid(endMousePosition, ellipsoid, pan3DP1);
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
if (!defined(p0) || !defined(p1)) {
|
|
2221
|
+
controller._rotating = true;
|
|
2222
|
+
rotate3D(controller, startPosition, movement);
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
p0 = camera.worldToCameraCoordinates(p0, p0);
|
|
2227
|
+
p1 = camera.worldToCameraCoordinates(p1, p1);
|
|
2228
|
+
|
|
2229
|
+
if (!defined(camera.constrainedAxis)) {
|
|
2230
|
+
Cartesian3.normalize(p0, p0);
|
|
2231
|
+
Cartesian3.normalize(p1, p1);
|
|
2232
|
+
const dot = Cartesian3.dot(p0, p1);
|
|
2233
|
+
const axis = Cartesian3.cross(p0, p1, pan3DTemp0);
|
|
2234
|
+
|
|
2235
|
+
if (
|
|
2236
|
+
dot < 1.0 &&
|
|
2237
|
+
!Cartesian3.equalsEpsilon(axis, Cartesian3.ZERO, CesiumMath.EPSILON14)
|
|
2238
|
+
) {
|
|
2239
|
+
// dot is in [0, 1]
|
|
2240
|
+
const angle = Math.acos(dot);
|
|
2241
|
+
camera.rotate(axis, angle);
|
|
2242
|
+
}
|
|
2243
|
+
} else {
|
|
2244
|
+
const basis0 = camera.constrainedAxis;
|
|
2245
|
+
const basis1 = Cartesian3.mostOrthogonalAxis(basis0, pan3DTemp0);
|
|
2246
|
+
Cartesian3.cross(basis1, basis0, basis1);
|
|
2247
|
+
Cartesian3.normalize(basis1, basis1);
|
|
2248
|
+
const basis2 = Cartesian3.cross(basis0, basis1, pan3DTemp1);
|
|
2249
|
+
|
|
2250
|
+
const startRho = Cartesian3.magnitude(p0);
|
|
2251
|
+
const startDot = Cartesian3.dot(basis0, p0);
|
|
2252
|
+
const startTheta = Math.acos(startDot / startRho);
|
|
2253
|
+
const startRej = Cartesian3.multiplyByScalar(basis0, startDot, pan3DTemp2);
|
|
2254
|
+
Cartesian3.subtract(p0, startRej, startRej);
|
|
2255
|
+
Cartesian3.normalize(startRej, startRej);
|
|
2256
|
+
|
|
2257
|
+
const endRho = Cartesian3.magnitude(p1);
|
|
2258
|
+
const endDot = Cartesian3.dot(basis0, p1);
|
|
2259
|
+
const endTheta = Math.acos(endDot / endRho);
|
|
2260
|
+
const endRej = Cartesian3.multiplyByScalar(basis0, endDot, pan3DTemp3);
|
|
2261
|
+
Cartesian3.subtract(p1, endRej, endRej);
|
|
2262
|
+
Cartesian3.normalize(endRej, endRej);
|
|
2263
|
+
|
|
2264
|
+
let startPhi = Math.acos(Cartesian3.dot(startRej, basis1));
|
|
2265
|
+
if (Cartesian3.dot(startRej, basis2) < 0) {
|
|
2266
|
+
startPhi = CesiumMath.TWO_PI - startPhi;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
let endPhi = Math.acos(Cartesian3.dot(endRej, basis1));
|
|
2270
|
+
if (Cartesian3.dot(endRej, basis2) < 0) {
|
|
2271
|
+
endPhi = CesiumMath.TWO_PI - endPhi;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
const deltaPhi = startPhi - endPhi;
|
|
2275
|
+
|
|
2276
|
+
let east;
|
|
2277
|
+
if (
|
|
2278
|
+
Cartesian3.equalsEpsilon(basis0, camera.position, CesiumMath.EPSILON2)
|
|
2279
|
+
) {
|
|
2280
|
+
east = camera.right;
|
|
2281
|
+
} else {
|
|
2282
|
+
east = Cartesian3.cross(basis0, camera.position, pan3DTemp0);
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
const planeNormal = Cartesian3.cross(basis0, east, pan3DTemp0);
|
|
2286
|
+
const side0 = Cartesian3.dot(
|
|
2287
|
+
planeNormal,
|
|
2288
|
+
Cartesian3.subtract(p0, basis0, pan3DTemp1),
|
|
2289
|
+
);
|
|
2290
|
+
const side1 = Cartesian3.dot(
|
|
2291
|
+
planeNormal,
|
|
2292
|
+
Cartesian3.subtract(p1, basis0, pan3DTemp1),
|
|
2293
|
+
);
|
|
2294
|
+
|
|
2295
|
+
let deltaTheta;
|
|
2296
|
+
if (side0 > 0 && side1 > 0) {
|
|
2297
|
+
deltaTheta = endTheta - startTheta;
|
|
2298
|
+
} else if (side0 > 0 && side1 <= 0) {
|
|
2299
|
+
if (Cartesian3.dot(camera.position, basis0) > 0) {
|
|
2300
|
+
deltaTheta = -startTheta - endTheta;
|
|
2301
|
+
} else {
|
|
2302
|
+
deltaTheta = startTheta + endTheta;
|
|
2303
|
+
}
|
|
2304
|
+
} else {
|
|
2305
|
+
deltaTheta = startTheta - endTheta;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
camera.rotateRight(deltaPhi);
|
|
2309
|
+
camera.rotateUp(deltaTheta);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
const zoom3DUnitPosition = new Cartesian3();
|
|
2314
|
+
const zoom3DCartographic = new Cartographic();
|
|
2315
|
+
|
|
2316
|
+
let preIntersectionDistance = 0;
|
|
2317
|
+
|
|
2318
|
+
function zoom3D(controller, startPosition, movement) {
|
|
2319
|
+
if (defined(movement.distance)) {
|
|
2320
|
+
movement = movement.distance;
|
|
2321
|
+
}
|
|
2322
|
+
const inertiaMovement = movement.inertiaEnabled;
|
|
2323
|
+
|
|
2324
|
+
const ellipsoid = controller._ellipsoid;
|
|
2325
|
+
const scene = controller._scene;
|
|
2326
|
+
const camera = scene.camera;
|
|
2327
|
+
const canvas = scene.canvas;
|
|
2328
|
+
|
|
2329
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
2330
|
+
|
|
2331
|
+
let windowPosition;
|
|
2332
|
+
|
|
2333
|
+
if (cameraUnderground) {
|
|
2334
|
+
windowPosition = startPosition;
|
|
2335
|
+
} else {
|
|
2336
|
+
windowPosition = zoomCVWindowPos;
|
|
2337
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
2338
|
+
windowPosition.y = canvas.clientHeight / 2;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);
|
|
2342
|
+
|
|
2343
|
+
let intersection;
|
|
2344
|
+
const height = ellipsoid.cartesianToCartographic(
|
|
2345
|
+
camera.position,
|
|
2346
|
+
zoom3DCartographic,
|
|
2347
|
+
).height;
|
|
2348
|
+
|
|
2349
|
+
const approachingCollision =
|
|
2350
|
+
Math.abs(preIntersectionDistance) <
|
|
2351
|
+
controller.minimumPickingTerrainDistanceWithInertia;
|
|
2352
|
+
|
|
2353
|
+
const needPickGlobe = inertiaMovement
|
|
2354
|
+
? approachingCollision
|
|
2355
|
+
: height < controller._minimumPickingTerrainHeight;
|
|
2356
|
+
if (needPickGlobe) {
|
|
2357
|
+
intersection = pickPosition(controller, windowPosition, zoomCVIntersection);
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
let distance;
|
|
2361
|
+
if (defined(intersection)) {
|
|
2362
|
+
distance = Cartesian3.distance(ray.origin, intersection);
|
|
2363
|
+
preIntersectionDistance = distance;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
if (cameraUnderground) {
|
|
2367
|
+
const distanceUnderground = getZoomDistanceUnderground(
|
|
2368
|
+
controller,
|
|
2369
|
+
ray,
|
|
2370
|
+
height,
|
|
2371
|
+
);
|
|
2372
|
+
if (defined(distance)) {
|
|
2373
|
+
distance = Math.min(distance, distanceUnderground);
|
|
2374
|
+
} else {
|
|
2375
|
+
distance = distanceUnderground;
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
if (!defined(distance)) {
|
|
2380
|
+
distance = height;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
const unitPosition = Cartesian3.normalize(
|
|
2384
|
+
camera.position,
|
|
2385
|
+
zoom3DUnitPosition,
|
|
2386
|
+
);
|
|
2387
|
+
handleZoom(
|
|
2388
|
+
controller,
|
|
2389
|
+
startPosition,
|
|
2390
|
+
movement,
|
|
2391
|
+
controller.zoomFactor,
|
|
2392
|
+
distance,
|
|
2393
|
+
Cartesian3.dot(unitPosition, camera.direction),
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
const tilt3DWindowPos = new Cartesian2();
|
|
2398
|
+
const tilt3DRay = new Ray();
|
|
2399
|
+
const tilt3DCenter = new Cartesian3();
|
|
2400
|
+
const tilt3DVerticalCenter = new Cartesian3();
|
|
2401
|
+
const tilt3DTransform = new Matrix4();
|
|
2402
|
+
const tilt3DVerticalTransform = new Matrix4();
|
|
2403
|
+
const tilt3DOldTransform = new Matrix4();
|
|
2404
|
+
const tilt3DQuaternion = new Quaternion();
|
|
2405
|
+
const tilt3DMatrix = new Matrix3();
|
|
2406
|
+
const tilt3DCart = new Cartographic();
|
|
2407
|
+
const tilt3DLookUp = new Cartesian3();
|
|
2408
|
+
|
|
2409
|
+
function tilt3D(controller, startPosition, movement) {
|
|
2410
|
+
const scene = controller._scene;
|
|
2411
|
+
const camera = scene.camera;
|
|
2412
|
+
|
|
2413
|
+
if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {
|
|
2414
|
+
return;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
if (defined(movement.angleAndHeight)) {
|
|
2418
|
+
movement = movement.angleAndHeight;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {
|
|
2422
|
+
controller._tiltOnEllipsoid = false;
|
|
2423
|
+
controller._looking = false;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
if (controller._looking) {
|
|
2427
|
+
const up = controller._ellipsoid.geodeticSurfaceNormal(
|
|
2428
|
+
camera.position,
|
|
2429
|
+
tilt3DLookUp,
|
|
2430
|
+
);
|
|
2431
|
+
look3D(controller, startPosition, movement, up);
|
|
2432
|
+
return;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
const ellipsoid = controller._ellipsoid;
|
|
2436
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
2437
|
+
camera.position,
|
|
2438
|
+
tilt3DCart,
|
|
2439
|
+
);
|
|
2440
|
+
|
|
2441
|
+
if (
|
|
2442
|
+
controller._tiltOnEllipsoid ||
|
|
2443
|
+
cartographic.height > controller._minimumCollisionTerrainHeight
|
|
2444
|
+
) {
|
|
2445
|
+
controller._tiltOnEllipsoid = true;
|
|
2446
|
+
tilt3DOnEllipsoid(controller, startPosition, movement);
|
|
2447
|
+
} else {
|
|
2448
|
+
tilt3DOnTerrain(controller, startPosition, movement);
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
const tilt3DOnEllipsoidCartographic = new Cartographic();
|
|
2453
|
+
|
|
2454
|
+
function tilt3DOnEllipsoid(controller, startPosition, movement) {
|
|
2455
|
+
const ellipsoid = controller._ellipsoid;
|
|
2456
|
+
const scene = controller._scene;
|
|
2457
|
+
const camera = scene.camera;
|
|
2458
|
+
const minHeight = controller.minimumZoomDistance * 0.25;
|
|
2459
|
+
const height = ellipsoid.cartesianToCartographic(
|
|
2460
|
+
camera.positionWC,
|
|
2461
|
+
tilt3DOnEllipsoidCartographic,
|
|
2462
|
+
).height;
|
|
2463
|
+
if (
|
|
2464
|
+
height - minHeight - 1.0 < CesiumMath.EPSILON3 &&
|
|
2465
|
+
movement.endPosition.y - movement.startPosition.y < 0
|
|
2466
|
+
) {
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
const canvas = scene.canvas;
|
|
2471
|
+
|
|
2472
|
+
const windowPosition = tilt3DWindowPos;
|
|
2473
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
2474
|
+
windowPosition.y = canvas.clientHeight / 2;
|
|
2475
|
+
const ray = camera.getPickRay(windowPosition, tilt3DRay);
|
|
2476
|
+
|
|
2477
|
+
let center;
|
|
2478
|
+
const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
|
|
2479
|
+
if (defined(intersection)) {
|
|
2480
|
+
center = Ray.getPoint(ray, intersection.start, tilt3DCenter);
|
|
2481
|
+
} else if (height > controller._minimumTrackBallHeight) {
|
|
2482
|
+
const grazingAltitudeLocation = IntersectionTests.grazingAltitudeLocation(
|
|
2483
|
+
ray,
|
|
2484
|
+
ellipsoid,
|
|
2485
|
+
);
|
|
2486
|
+
if (!defined(grazingAltitudeLocation)) {
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
const grazingAltitudeCart = ellipsoid.cartesianToCartographic(
|
|
2490
|
+
grazingAltitudeLocation,
|
|
2491
|
+
tilt3DCart,
|
|
2492
|
+
);
|
|
2493
|
+
grazingAltitudeCart.height = 0.0;
|
|
2494
|
+
center = ellipsoid.cartographicToCartesian(
|
|
2495
|
+
grazingAltitudeCart,
|
|
2496
|
+
tilt3DCenter,
|
|
2497
|
+
);
|
|
2498
|
+
} else {
|
|
2499
|
+
controller._looking = true;
|
|
2500
|
+
const up = controller._ellipsoid.geodeticSurfaceNormal(
|
|
2501
|
+
camera.position,
|
|
2502
|
+
tilt3DLookUp,
|
|
2503
|
+
);
|
|
2504
|
+
look3D(controller, startPosition, movement, up);
|
|
2505
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
2506
|
+
return;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
2510
|
+
center,
|
|
2511
|
+
ellipsoid,
|
|
2512
|
+
tilt3DTransform,
|
|
2513
|
+
);
|
|
2514
|
+
|
|
2515
|
+
const oldGlobe = controller._globe;
|
|
2516
|
+
const oldEllipsoid = controller._ellipsoid;
|
|
2517
|
+
controller._globe = undefined;
|
|
2518
|
+
controller._ellipsoid = Ellipsoid.UNIT_SPHERE;
|
|
2519
|
+
controller._rotateFactor = 1.0;
|
|
2520
|
+
controller._rotateRateRangeAdjustment = 1.0;
|
|
2521
|
+
|
|
2522
|
+
const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);
|
|
2523
|
+
camera._setTransform(transform);
|
|
2524
|
+
|
|
2525
|
+
rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);
|
|
2526
|
+
|
|
2527
|
+
camera._setTransform(oldTransform);
|
|
2528
|
+
controller._globe = oldGlobe;
|
|
2529
|
+
controller._ellipsoid = oldEllipsoid;
|
|
2530
|
+
|
|
2531
|
+
const radius = oldEllipsoid.maximumRadius;
|
|
2532
|
+
controller._rotateFactor = 1.0 / radius;
|
|
2533
|
+
controller._rotateRateRangeAdjustment = radius;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
function tilt3DOnTerrain(controller, startPosition, movement) {
|
|
2537
|
+
const ellipsoid = controller._ellipsoid;
|
|
2538
|
+
const scene = controller._scene;
|
|
2539
|
+
const camera = scene.camera;
|
|
2540
|
+
const cameraUnderground = controller._cameraUnderground;
|
|
2541
|
+
|
|
2542
|
+
let center;
|
|
2543
|
+
let ray;
|
|
2544
|
+
let intersection;
|
|
2545
|
+
|
|
2546
|
+
if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {
|
|
2547
|
+
center = Cartesian3.clone(controller._tiltCenter, tilt3DCenter);
|
|
2548
|
+
} else {
|
|
2549
|
+
center = pickPosition(controller, startPosition, tilt3DCenter);
|
|
2550
|
+
|
|
2551
|
+
if (!defined(center)) {
|
|
2552
|
+
ray = camera.getPickRay(startPosition, tilt3DRay);
|
|
2553
|
+
intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
|
|
2554
|
+
if (!defined(intersection)) {
|
|
2555
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
2556
|
+
camera.position,
|
|
2557
|
+
tilt3DCart,
|
|
2558
|
+
);
|
|
2559
|
+
if (cartographic.height <= controller._minimumTrackBallHeight) {
|
|
2560
|
+
controller._looking = true;
|
|
2561
|
+
const up = controller._ellipsoid.geodeticSurfaceNormal(
|
|
2562
|
+
camera.position,
|
|
2563
|
+
tilt3DLookUp,
|
|
2564
|
+
);
|
|
2565
|
+
look3D(controller, startPosition, movement, up);
|
|
2566
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
2567
|
+
}
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2570
|
+
center = Ray.getPoint(ray, intersection.start, tilt3DCenter);
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
if (cameraUnderground) {
|
|
2574
|
+
if (!defined(ray)) {
|
|
2575
|
+
ray = camera.getPickRay(startPosition, tilt3DRay);
|
|
2576
|
+
}
|
|
2577
|
+
getTiltCenterUnderground(controller, ray, center, center);
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);
|
|
2581
|
+
Cartesian3.clone(center, controller._tiltCenter);
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
const canvas = scene.canvas;
|
|
2585
|
+
|
|
2586
|
+
const windowPosition = tilt3DWindowPos;
|
|
2587
|
+
windowPosition.x = canvas.clientWidth / 2;
|
|
2588
|
+
windowPosition.y = controller._tiltCenterMousePosition.y;
|
|
2589
|
+
ray = camera.getPickRay(windowPosition, tilt3DRay);
|
|
2590
|
+
|
|
2591
|
+
const mag = Cartesian3.magnitude(center);
|
|
2592
|
+
const radii = Cartesian3.fromElements(mag, mag, mag, scratchRadii);
|
|
2593
|
+
const newEllipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);
|
|
2594
|
+
|
|
2595
|
+
intersection = IntersectionTests.rayEllipsoid(ray, newEllipsoid);
|
|
2596
|
+
if (!defined(intersection)) {
|
|
2597
|
+
return;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
const t =
|
|
2601
|
+
Cartesian3.magnitude(ray.origin) > mag
|
|
2602
|
+
? intersection.start
|
|
2603
|
+
: intersection.stop;
|
|
2604
|
+
const verticalCenter = Ray.getPoint(ray, t, tilt3DVerticalCenter);
|
|
2605
|
+
|
|
2606
|
+
const transform = Transforms.eastNorthUpToFixedFrame(
|
|
2607
|
+
center,
|
|
2608
|
+
ellipsoid,
|
|
2609
|
+
tilt3DTransform,
|
|
2610
|
+
);
|
|
2611
|
+
const verticalTransform = Transforms.eastNorthUpToFixedFrame(
|
|
2612
|
+
verticalCenter,
|
|
2613
|
+
newEllipsoid,
|
|
2614
|
+
tilt3DVerticalTransform,
|
|
2615
|
+
);
|
|
2616
|
+
|
|
2617
|
+
const oldGlobe = controller._globe;
|
|
2618
|
+
const oldEllipsoid = controller._ellipsoid;
|
|
2619
|
+
controller._globe = undefined;
|
|
2620
|
+
controller._ellipsoid = Ellipsoid.UNIT_SPHERE;
|
|
2621
|
+
controller._rotateFactor = 1.0;
|
|
2622
|
+
controller._rotateRateRangeAdjustment = 1.0;
|
|
2623
|
+
|
|
2624
|
+
let constrainedAxis = Cartesian3.UNIT_Z;
|
|
2625
|
+
|
|
2626
|
+
const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);
|
|
2627
|
+
camera._setTransform(verticalTransform);
|
|
2628
|
+
|
|
2629
|
+
const tangent = Cartesian3.cross(
|
|
2630
|
+
verticalCenter,
|
|
2631
|
+
camera.positionWC,
|
|
2632
|
+
tilt3DCartesian3,
|
|
2633
|
+
);
|
|
2634
|
+
const dot = Cartesian3.dot(camera.rightWC, tangent);
|
|
2635
|
+
|
|
2636
|
+
if (dot < 0.0) {
|
|
2637
|
+
const movementDelta = movement.startPosition.y - movement.endPosition.y;
|
|
2638
|
+
if (
|
|
2639
|
+
(cameraUnderground && movementDelta < 0.0) ||
|
|
2640
|
+
(!cameraUnderground && movementDelta > 0.0)
|
|
2641
|
+
) {
|
|
2642
|
+
// Prevent camera from flipping past the up axis
|
|
2643
|
+
constrainedAxis = undefined;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
const oldConstrainedAxis = camera.constrainedAxis;
|
|
2647
|
+
camera.constrainedAxis = undefined;
|
|
2648
|
+
|
|
2649
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, true, false);
|
|
2650
|
+
|
|
2651
|
+
camera.constrainedAxis = oldConstrainedAxis;
|
|
2652
|
+
} else {
|
|
2653
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, true, false);
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
camera._setTransform(transform);
|
|
2657
|
+
rotate3D(controller, startPosition, movement, constrainedAxis, false, true);
|
|
2658
|
+
|
|
2659
|
+
if (defined(camera.constrainedAxis)) {
|
|
2660
|
+
const right = Cartesian3.cross(
|
|
2661
|
+
camera.direction,
|
|
2662
|
+
camera.constrainedAxis,
|
|
2663
|
+
tilt3DCartesian3,
|
|
2664
|
+
);
|
|
2665
|
+
if (
|
|
2666
|
+
!Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)
|
|
2667
|
+
) {
|
|
2668
|
+
if (Cartesian3.dot(right, camera.right) < 0.0) {
|
|
2669
|
+
Cartesian3.negate(right, right);
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
Cartesian3.cross(right, camera.direction, camera.up);
|
|
2673
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
2674
|
+
|
|
2675
|
+
Cartesian3.normalize(camera.up, camera.up);
|
|
2676
|
+
Cartesian3.normalize(camera.right, camera.right);
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
camera._setTransform(oldTransform);
|
|
2681
|
+
controller._globe = oldGlobe;
|
|
2682
|
+
controller._ellipsoid = oldEllipsoid;
|
|
2683
|
+
|
|
2684
|
+
const radius = oldEllipsoid.maximumRadius;
|
|
2685
|
+
controller._rotateFactor = 1.0 / radius;
|
|
2686
|
+
controller._rotateRateRangeAdjustment = radius;
|
|
2687
|
+
|
|
2688
|
+
const originalPosition = Cartesian3.clone(
|
|
2689
|
+
camera.positionWC,
|
|
2690
|
+
tilt3DCartesian3,
|
|
2691
|
+
);
|
|
2692
|
+
|
|
2693
|
+
if (controller.enableCollisionDetection) {
|
|
2694
|
+
adjustHeightForTerrain(controller, true);
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
if (!Cartesian3.equals(camera.positionWC, originalPosition)) {
|
|
2698
|
+
camera._setTransform(verticalTransform);
|
|
2699
|
+
camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);
|
|
2700
|
+
|
|
2701
|
+
const magSqrd = Cartesian3.magnitudeSquared(originalPosition);
|
|
2702
|
+
if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {
|
|
2703
|
+
Cartesian3.normalize(camera.position, camera.position);
|
|
2704
|
+
Cartesian3.multiplyByScalar(
|
|
2705
|
+
camera.position,
|
|
2706
|
+
Math.sqrt(magSqrd),
|
|
2707
|
+
camera.position,
|
|
2708
|
+
);
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
const angle = Cartesian3.angleBetween(originalPosition, camera.position);
|
|
2712
|
+
const axis = Cartesian3.cross(
|
|
2713
|
+
originalPosition,
|
|
2714
|
+
camera.position,
|
|
2715
|
+
originalPosition,
|
|
2716
|
+
);
|
|
2717
|
+
Cartesian3.normalize(axis, axis);
|
|
2718
|
+
|
|
2719
|
+
const quaternion = Quaternion.fromAxisAngle(axis, angle, tilt3DQuaternion);
|
|
2720
|
+
const rotation = Matrix3.fromQuaternion(quaternion, tilt3DMatrix);
|
|
2721
|
+
Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);
|
|
2722
|
+
Matrix3.multiplyByVector(rotation, camera.up, camera.up);
|
|
2723
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
2724
|
+
Cartesian3.cross(camera.right, camera.direction, camera.up);
|
|
2725
|
+
|
|
2726
|
+
camera._setTransform(oldTransform);
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
const look3DStartPos = new Cartesian2();
|
|
2731
|
+
const look3DEndPos = new Cartesian2();
|
|
2732
|
+
const look3DStartRay = new Ray();
|
|
2733
|
+
const look3DEndRay = new Ray();
|
|
2734
|
+
const look3DNegativeRot = new Cartesian3();
|
|
2735
|
+
const look3DTan = new Cartesian3();
|
|
2736
|
+
|
|
2737
|
+
function look3D(controller, startPosition, movement, rotationAxis) {
|
|
2738
|
+
const scene = controller._scene;
|
|
2739
|
+
const camera = scene.camera;
|
|
2740
|
+
|
|
2741
|
+
const startPos = look3DStartPos;
|
|
2742
|
+
startPos.x = movement.startPosition.x;
|
|
2743
|
+
startPos.y = 0.0;
|
|
2744
|
+
const endPos = look3DEndPos;
|
|
2745
|
+
endPos.x = movement.endPosition.x;
|
|
2746
|
+
endPos.y = 0.0;
|
|
2747
|
+
|
|
2748
|
+
let startRay = camera.getPickRay(startPos, look3DStartRay);
|
|
2749
|
+
let endRay = camera.getPickRay(endPos, look3DEndRay);
|
|
2750
|
+
let angle = 0.0;
|
|
2751
|
+
let start;
|
|
2752
|
+
let end;
|
|
2753
|
+
|
|
2754
|
+
if (camera.frustum instanceof OrthographicFrustum) {
|
|
2755
|
+
start = startRay.origin;
|
|
2756
|
+
end = endRay.origin;
|
|
2757
|
+
|
|
2758
|
+
Cartesian3.add(camera.direction, start, start);
|
|
2759
|
+
Cartesian3.add(camera.direction, end, end);
|
|
2760
|
+
|
|
2761
|
+
Cartesian3.subtract(start, camera.position, start);
|
|
2762
|
+
Cartesian3.subtract(end, camera.position, end);
|
|
2763
|
+
|
|
2764
|
+
Cartesian3.normalize(start, start);
|
|
2765
|
+
Cartesian3.normalize(end, end);
|
|
2766
|
+
} else {
|
|
2767
|
+
start = startRay.direction;
|
|
2768
|
+
end = endRay.direction;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
let dot = Cartesian3.dot(start, end);
|
|
2772
|
+
if (dot < 1.0) {
|
|
2773
|
+
// dot is in [0, 1]
|
|
2774
|
+
angle = Math.acos(dot);
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
angle = movement.startPosition.x > movement.endPosition.x ? -angle : angle;
|
|
2778
|
+
|
|
2779
|
+
const horizontalRotationAxis = controller._horizontalRotationAxis;
|
|
2780
|
+
if (defined(rotationAxis)) {
|
|
2781
|
+
camera.look(rotationAxis, -angle);
|
|
2782
|
+
} else if (defined(horizontalRotationAxis)) {
|
|
2783
|
+
camera.look(horizontalRotationAxis, -angle);
|
|
2784
|
+
} else {
|
|
2785
|
+
camera.lookLeft(angle);
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
startPos.x = 0.0;
|
|
2789
|
+
startPos.y = movement.startPosition.y;
|
|
2790
|
+
endPos.x = 0.0;
|
|
2791
|
+
endPos.y = movement.endPosition.y;
|
|
2792
|
+
|
|
2793
|
+
startRay = camera.getPickRay(startPos, look3DStartRay);
|
|
2794
|
+
endRay = camera.getPickRay(endPos, look3DEndRay);
|
|
2795
|
+
angle = 0.0;
|
|
2796
|
+
|
|
2797
|
+
if (camera.frustum instanceof OrthographicFrustum) {
|
|
2798
|
+
start = startRay.origin;
|
|
2799
|
+
end = endRay.origin;
|
|
2800
|
+
|
|
2801
|
+
Cartesian3.add(camera.direction, start, start);
|
|
2802
|
+
Cartesian3.add(camera.direction, end, end);
|
|
2803
|
+
|
|
2804
|
+
Cartesian3.subtract(start, camera.position, start);
|
|
2805
|
+
Cartesian3.subtract(end, camera.position, end);
|
|
2806
|
+
|
|
2807
|
+
Cartesian3.normalize(start, start);
|
|
2808
|
+
Cartesian3.normalize(end, end);
|
|
2809
|
+
} else {
|
|
2810
|
+
start = startRay.direction;
|
|
2811
|
+
end = endRay.direction;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
dot = Cartesian3.dot(start, end);
|
|
2815
|
+
if (dot < 1.0) {
|
|
2816
|
+
// dot is in [0, 1]
|
|
2817
|
+
angle = Math.acos(dot);
|
|
2818
|
+
}
|
|
2819
|
+
angle = movement.startPosition.y > movement.endPosition.y ? -angle : angle;
|
|
2820
|
+
|
|
2821
|
+
rotationAxis = rotationAxis ?? horizontalRotationAxis;
|
|
2822
|
+
if (defined(rotationAxis)) {
|
|
2823
|
+
const direction = camera.direction;
|
|
2824
|
+
const negativeRotationAxis = Cartesian3.negate(
|
|
2825
|
+
rotationAxis,
|
|
2826
|
+
look3DNegativeRot,
|
|
2827
|
+
);
|
|
2828
|
+
const northParallel = Cartesian3.equalsEpsilon(
|
|
2829
|
+
direction,
|
|
2830
|
+
rotationAxis,
|
|
2831
|
+
CesiumMath.EPSILON2,
|
|
2832
|
+
);
|
|
2833
|
+
const southParallel = Cartesian3.equalsEpsilon(
|
|
2834
|
+
direction,
|
|
2835
|
+
negativeRotationAxis,
|
|
2836
|
+
CesiumMath.EPSILON2,
|
|
2837
|
+
);
|
|
2838
|
+
if (!northParallel && !southParallel) {
|
|
2839
|
+
dot = Cartesian3.dot(direction, rotationAxis);
|
|
2840
|
+
let angleToAxis = CesiumMath.acosClamped(dot);
|
|
2841
|
+
if (angle > 0 && angle > angleToAxis) {
|
|
2842
|
+
angle = angleToAxis - CesiumMath.EPSILON4;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
dot = Cartesian3.dot(direction, negativeRotationAxis);
|
|
2846
|
+
angleToAxis = CesiumMath.acosClamped(dot);
|
|
2847
|
+
if (angle < 0 && -angle > angleToAxis) {
|
|
2848
|
+
angle = -angleToAxis + CesiumMath.EPSILON4;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
const tangent = Cartesian3.cross(rotationAxis, direction, look3DTan);
|
|
2852
|
+
camera.look(tangent, angle);
|
|
2853
|
+
} else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {
|
|
2854
|
+
camera.look(camera.right, -angle);
|
|
2855
|
+
}
|
|
2856
|
+
} else {
|
|
2857
|
+
camera.lookUp(angle);
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
function update3D(controller) {
|
|
2862
|
+
reactToInput(
|
|
2863
|
+
controller,
|
|
2864
|
+
controller.enableRotate,
|
|
2865
|
+
controller.rotateEventTypes,
|
|
2866
|
+
spin3D,
|
|
2867
|
+
controller.inertiaSpin,
|
|
2868
|
+
"_lastInertiaSpinMovement",
|
|
2869
|
+
);
|
|
2870
|
+
reactToInput(
|
|
2871
|
+
controller,
|
|
2872
|
+
controller.enableZoom,
|
|
2873
|
+
controller.zoomEventTypes,
|
|
2874
|
+
zoom3D,
|
|
2875
|
+
controller.inertiaZoom,
|
|
2876
|
+
"_lastInertiaZoomMovement",
|
|
2877
|
+
);
|
|
2878
|
+
reactToInput(
|
|
2879
|
+
controller,
|
|
2880
|
+
controller.enableTilt,
|
|
2881
|
+
controller.tiltEventTypes,
|
|
2882
|
+
tilt3D,
|
|
2883
|
+
controller.inertiaSpin,
|
|
2884
|
+
"_lastInertiaTiltMovement",
|
|
2885
|
+
);
|
|
2886
|
+
reactToInput(
|
|
2887
|
+
controller,
|
|
2888
|
+
controller.enableLook,
|
|
2889
|
+
controller.lookEventTypes,
|
|
2890
|
+
look3D,
|
|
2891
|
+
);
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
const scratchAdjustHeightTransform = new Matrix4();
|
|
2895
|
+
const scratchAdjustHeightCartographic = new Cartographic();
|
|
2896
|
+
|
|
2897
|
+
function adjustHeightForTerrain(controller, cameraChanged) {
|
|
2898
|
+
controller._adjustedHeightForTerrain = true;
|
|
2899
|
+
|
|
2900
|
+
const scene = controller._scene;
|
|
2901
|
+
const mode = scene.mode;
|
|
2902
|
+
|
|
2903
|
+
if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
const camera = scene.camera;
|
|
2908
|
+
const ellipsoid = scene.ellipsoid ?? Ellipsoid.WGS84;
|
|
2909
|
+
const projection = scene.mapProjection;
|
|
2910
|
+
|
|
2911
|
+
let transform;
|
|
2912
|
+
let mag;
|
|
2913
|
+
if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {
|
|
2914
|
+
transform = Matrix4.clone(camera.transform, scratchAdjustHeightTransform);
|
|
2915
|
+
mag = Cartesian3.magnitude(camera.position);
|
|
2916
|
+
camera._setTransform(Matrix4.IDENTITY);
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
const cartographic = scratchAdjustHeightCartographic;
|
|
2920
|
+
if (mode === SceneMode.SCENE3D) {
|
|
2921
|
+
ellipsoid.cartesianToCartographic(camera.position, cartographic);
|
|
2922
|
+
} else {
|
|
2923
|
+
projection.unproject(camera.position, cartographic);
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
let heightUpdated = false;
|
|
2927
|
+
if (cartographic.height < controller._minimumCollisionTerrainHeight) {
|
|
2928
|
+
const globeHeight = controller._scene.globeHeight;
|
|
2929
|
+
if (defined(globeHeight)) {
|
|
2930
|
+
const height = globeHeight + controller.minimumZoomDistance;
|
|
2931
|
+
const difference = globeHeight - controller._lastGlobeHeight;
|
|
2932
|
+
const percentDifference = difference / controller._lastGlobeHeight;
|
|
2933
|
+
|
|
2934
|
+
// Unless the camera has been moved by user input, to avoid big jumps during tile loads
|
|
2935
|
+
// only make height updates when the globe height has been fairly stable across several frames
|
|
2936
|
+
if (
|
|
2937
|
+
cartographic.height < height &&
|
|
2938
|
+
(cameraChanged || Math.abs(percentDifference) <= 0.1)
|
|
2939
|
+
) {
|
|
2940
|
+
cartographic.height = height;
|
|
2941
|
+
if (mode === SceneMode.SCENE3D) {
|
|
2942
|
+
ellipsoid.cartographicToCartesian(cartographic, camera.position);
|
|
2943
|
+
} else {
|
|
2944
|
+
projection.project(cartographic, camera.position);
|
|
2945
|
+
}
|
|
2946
|
+
heightUpdated = true;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
if (cameraChanged || Math.abs(percentDifference) <= 0.1) {
|
|
2950
|
+
controller._lastGlobeHeight = globeHeight;
|
|
2951
|
+
} else {
|
|
2952
|
+
controller._lastGlobeHeight += difference * 0.1;
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
if (defined(transform)) {
|
|
2958
|
+
camera._setTransform(transform);
|
|
2959
|
+
if (heightUpdated) {
|
|
2960
|
+
Cartesian3.normalize(camera.position, camera.position);
|
|
2961
|
+
Cartesian3.negate(camera.position, camera.direction);
|
|
2962
|
+
Cartesian3.multiplyByScalar(
|
|
2963
|
+
camera.position,
|
|
2964
|
+
Math.max(mag, controller.minimumZoomDistance),
|
|
2965
|
+
camera.position,
|
|
2966
|
+
);
|
|
2967
|
+
Cartesian3.normalize(camera.direction, camera.direction);
|
|
2968
|
+
Cartesian3.cross(camera.direction, camera.up, camera.right);
|
|
2969
|
+
Cartesian3.cross(camera.right, camera.direction, camera.up);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
/**
|
|
2975
|
+
* @private
|
|
2976
|
+
*/
|
|
2977
|
+
ScreenSpaceCameraController.prototype.onMap = function () {
|
|
2978
|
+
const scene = this._scene;
|
|
2979
|
+
const mode = scene.mode;
|
|
2980
|
+
const camera = scene.camera;
|
|
2981
|
+
|
|
2982
|
+
if (mode === SceneMode.COLUMBUS_VIEW) {
|
|
2983
|
+
return (
|
|
2984
|
+
Math.abs(camera.position.x) - this._maxCoord.x < 0 &&
|
|
2985
|
+
Math.abs(camera.position.y) - this._maxCoord.y < 0
|
|
2986
|
+
);
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
return true;
|
|
2990
|
+
};
|
|
2991
|
+
|
|
2992
|
+
const scratchPreviousPosition = new Cartesian3();
|
|
2993
|
+
const scratchPreviousDirection = new Cartesian3();
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* @private
|
|
2997
|
+
*/
|
|
2998
|
+
ScreenSpaceCameraController.prototype.update = function () {
|
|
2999
|
+
const scene = this._scene;
|
|
3000
|
+
const { camera, globe, mode } = scene;
|
|
3001
|
+
|
|
3002
|
+
if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {
|
|
3003
|
+
this._globe = undefined;
|
|
3004
|
+
this._ellipsoid = Ellipsoid.UNIT_SPHERE;
|
|
3005
|
+
} else {
|
|
3006
|
+
this._globe = globe;
|
|
3007
|
+
this._ellipsoid = scene.ellipsoid ?? Ellipsoid.default;
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
const { verticalExaggeration, verticalExaggerationRelativeHeight } = scene;
|
|
3011
|
+
this._minimumCollisionTerrainHeight = VerticalExaggeration.getHeight(
|
|
3012
|
+
this.minimumCollisionTerrainHeight,
|
|
3013
|
+
verticalExaggeration,
|
|
3014
|
+
verticalExaggerationRelativeHeight,
|
|
3015
|
+
);
|
|
3016
|
+
this._minimumPickingTerrainHeight = VerticalExaggeration.getHeight(
|
|
3017
|
+
this.minimumPickingTerrainHeight,
|
|
3018
|
+
verticalExaggeration,
|
|
3019
|
+
verticalExaggerationRelativeHeight,
|
|
3020
|
+
);
|
|
3021
|
+
this._minimumTrackBallHeight = VerticalExaggeration.getHeight(
|
|
3022
|
+
this.minimumTrackBallHeight,
|
|
3023
|
+
verticalExaggeration,
|
|
3024
|
+
verticalExaggerationRelativeHeight,
|
|
3025
|
+
);
|
|
3026
|
+
|
|
3027
|
+
this._cameraUnderground = scene.cameraUnderground && defined(this._globe);
|
|
3028
|
+
|
|
3029
|
+
const radius = this._ellipsoid.maximumRadius;
|
|
3030
|
+
this._rotateFactor = 1.0 / radius;
|
|
3031
|
+
this._rotateRateRangeAdjustment = radius;
|
|
3032
|
+
|
|
3033
|
+
this._adjustedHeightForTerrain = false;
|
|
3034
|
+
const previousPosition = Cartesian3.clone(
|
|
3035
|
+
camera.positionWC,
|
|
3036
|
+
scratchPreviousPosition,
|
|
3037
|
+
);
|
|
3038
|
+
const previousDirection = Cartesian3.clone(
|
|
3039
|
+
camera.directionWC,
|
|
3040
|
+
scratchPreviousDirection,
|
|
3041
|
+
);
|
|
3042
|
+
|
|
3043
|
+
if (mode === SceneMode.SCENE2D) {
|
|
3044
|
+
update2D(this);
|
|
3045
|
+
} else if (mode === SceneMode.COLUMBUS_VIEW) {
|
|
3046
|
+
this._horizontalRotationAxis = Cartesian3.UNIT_Z;
|
|
3047
|
+
updateCV(this);
|
|
3048
|
+
} else if (mode === SceneMode.SCENE3D) {
|
|
3049
|
+
this._horizontalRotationAxis = undefined;
|
|
3050
|
+
update3D(this);
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
if (this.enableCollisionDetection && !this._adjustedHeightForTerrain) {
|
|
3054
|
+
// Adjust the camera height if the camera moved at all (user input or inertia) and an action didn't already adjust the camera height
|
|
3055
|
+
const cameraChanged =
|
|
3056
|
+
!Cartesian3.equals(previousPosition, camera.positionWC) ||
|
|
3057
|
+
!Cartesian3.equals(previousDirection, camera.directionWC);
|
|
3058
|
+
adjustHeightForTerrain(this, cameraChanged);
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3061
|
+
this._aggregator.reset();
|
|
3062
|
+
};
|
|
3063
|
+
|
|
3064
|
+
/**
|
|
3065
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
3066
|
+
* <br /><br />
|
|
3067
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
3068
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
3069
|
+
*
|
|
3070
|
+
* @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
|
|
3071
|
+
*
|
|
3072
|
+
* @see ScreenSpaceCameraController#destroy
|
|
3073
|
+
*/
|
|
3074
|
+
ScreenSpaceCameraController.prototype.isDestroyed = function () {
|
|
3075
|
+
return false;
|
|
3076
|
+
};
|
|
3077
|
+
|
|
3078
|
+
/**
|
|
3079
|
+
* Removes mouse listeners held by this object.
|
|
3080
|
+
* <br /><br />
|
|
3081
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
3082
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
3083
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
3084
|
+
*
|
|
3085
|
+
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
|
|
3086
|
+
*
|
|
3087
|
+
*
|
|
3088
|
+
* @example
|
|
3089
|
+
* controller = controller && controller.destroy();
|
|
3090
|
+
*
|
|
3091
|
+
* @see ScreenSpaceCameraController#isDestroyed
|
|
3092
|
+
*/
|
|
3093
|
+
ScreenSpaceCameraController.prototype.destroy = function () {
|
|
3094
|
+
this._tweens.removeAll();
|
|
3095
|
+
this._aggregator = this._aggregator && this._aggregator.destroy();
|
|
3096
|
+
return destroyObject(this);
|
|
3097
|
+
};
|
|
3098
|
+
export default ScreenSpaceCameraController;
|