@pggis/pg-sdk 3.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -0
- package/dist/index.cjs +43 -0
- package/dist/pggis.min.css +1 -0
- package/dist/pggis.min.js +42 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/resources/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/resources/Assets/Images/cesium_credit.png +0 -0
- package/dist/resources/Assets/Images/google_earth_credit.png +0 -0
- package/dist/resources/Assets/Images/ion-credit.png +0 -0
- package/dist/resources/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/resources/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/resources/Assets/Textures/maki/airfield.png +0 -0
- package/dist/resources/Assets/Textures/maki/airport.png +0 -0
- package/dist/resources/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/resources/Assets/Textures/maki/america-football.png +0 -0
- package/dist/resources/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/resources/Assets/Textures/maki/bakery.png +0 -0
- package/dist/resources/Assets/Textures/maki/bank.png +0 -0
- package/dist/resources/Assets/Textures/maki/bar.png +0 -0
- package/dist/resources/Assets/Textures/maki/baseball.png +0 -0
- package/dist/resources/Assets/Textures/maki/basketball.png +0 -0
- package/dist/resources/Assets/Textures/maki/beer.png +0 -0
- package/dist/resources/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/resources/Assets/Textures/maki/building.png +0 -0
- package/dist/resources/Assets/Textures/maki/bus.png +0 -0
- package/dist/resources/Assets/Textures/maki/cafe.png +0 -0
- package/dist/resources/Assets/Textures/maki/camera.png +0 -0
- package/dist/resources/Assets/Textures/maki/campsite.png +0 -0
- package/dist/resources/Assets/Textures/maki/car.png +0 -0
- package/dist/resources/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/resources/Assets/Textures/maki/cesium.png +0 -0
- package/dist/resources/Assets/Textures/maki/chemist.png +0 -0
- package/dist/resources/Assets/Textures/maki/cinema.png +0 -0
- package/dist/resources/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/circle.png +0 -0
- package/dist/resources/Assets/Textures/maki/city.png +0 -0
- package/dist/resources/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/resources/Assets/Textures/maki/college.png +0 -0
- package/dist/resources/Assets/Textures/maki/commercial.png +0 -0
- package/dist/resources/Assets/Textures/maki/cricket.png +0 -0
- package/dist/resources/Assets/Textures/maki/cross.png +0 -0
- package/dist/resources/Assets/Textures/maki/dam.png +0 -0
- package/dist/resources/Assets/Textures/maki/danger.png +0 -0
- package/dist/resources/Assets/Textures/maki/disability.png +0 -0
- package/dist/resources/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/resources/Assets/Textures/maki/embassy.png +0 -0
- package/dist/resources/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/entrance.png +0 -0
- package/dist/resources/Assets/Textures/maki/farm.png +0 -0
- package/dist/resources/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/resources/Assets/Textures/maki/ferry.png +0 -0
- package/dist/resources/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/resources/Assets/Textures/maki/fuel.png +0 -0
- package/dist/resources/Assets/Textures/maki/garden.png +0 -0
- package/dist/resources/Assets/Textures/maki/gift.png +0 -0
- package/dist/resources/Assets/Textures/maki/golf.png +0 -0
- package/dist/resources/Assets/Textures/maki/grocery.png +0 -0
- package/dist/resources/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/resources/Assets/Textures/maki/harbor.png +0 -0
- package/dist/resources/Assets/Textures/maki/heart.png +0 -0
- package/dist/resources/Assets/Textures/maki/heliport.png +0 -0
- package/dist/resources/Assets/Textures/maki/hospital.png +0 -0
- package/dist/resources/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/resources/Assets/Textures/maki/industrial.png +0 -0
- package/dist/resources/Assets/Textures/maki/land-use.png +0 -0
- package/dist/resources/Assets/Textures/maki/laundry.png +0 -0
- package/dist/resources/Assets/Textures/maki/library.png +0 -0
- package/dist/resources/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/lodging.png +0 -0
- package/dist/resources/Assets/Textures/maki/logging.png +0 -0
- package/dist/resources/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/resources/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/marker.png +0 -0
- package/dist/resources/Assets/Textures/maki/minefield.png +0 -0
- package/dist/resources/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/monument.png +0 -0
- package/dist/resources/Assets/Textures/maki/museum.png +0 -0
- package/dist/resources/Assets/Textures/maki/music.png +0 -0
- package/dist/resources/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/resources/Assets/Textures/maki/park.png +0 -0
- package/dist/resources/Assets/Textures/maki/park2.png +0 -0
- package/dist/resources/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/resources/Assets/Textures/maki/parking.png +0 -0
- package/dist/resources/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/resources/Assets/Textures/maki/pitch.png +0 -0
- package/dist/resources/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/resources/Assets/Textures/maki/playground.png +0 -0
- package/dist/resources/Assets/Textures/maki/police.png +0 -0
- package/dist/resources/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/resources/Assets/Textures/maki/post.png +0 -0
- package/dist/resources/Assets/Textures/maki/prison.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/resources/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/resources/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/resources/Assets/Textures/maki/rocket.png +0 -0
- package/dist/resources/Assets/Textures/maki/school.png +0 -0
- package/dist/resources/Assets/Textures/maki/scooter.png +0 -0
- package/dist/resources/Assets/Textures/maki/shop.png +0 -0
- package/dist/resources/Assets/Textures/maki/skiing.png +0 -0
- package/dist/resources/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/soccer.png +0 -0
- package/dist/resources/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/square.png +0 -0
- package/dist/resources/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/star.png +0 -0
- package/dist/resources/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/resources/Assets/Textures/maki/swimming.png +0 -0
- package/dist/resources/Assets/Textures/maki/telephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/tennis.png +0 -0
- package/dist/resources/Assets/Textures/maki/theatre.png +0 -0
- package/dist/resources/Assets/Textures/maki/toilets.png +0 -0
- package/dist/resources/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/resources/Assets/Textures/maki/town.png +0 -0
- package/dist/resources/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/triangle.png +0 -0
- package/dist/resources/Assets/Textures/maki/village.png +0 -0
- package/dist/resources/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/resources/Assets/Textures/maki/water.png +0 -0
- package/dist/resources/Assets/Textures/maki/wetland.png +0 -0
- package/dist/resources/Assets/Textures/maki/zoo.png +0 -0
- package/dist/resources/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/resources/Assets/Textures/pin.svg +1 -0
- package/dist/resources/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/resources/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/resources/Assets/approximateTerrainHeights.json +1 -0
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/dist/resources/ThirdParty/Workers/package.json +1 -0
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/resources/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/resources/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/dist/resources/Workers/chunk-3PW6ZBN4.js +2977 -0
- package/dist/resources/Workers/chunk-434ZTTFX.js +73 -0
- package/dist/resources/Workers/chunk-4KP73B43.js +73 -0
- package/dist/resources/Workers/chunk-52VSIKEA.js +2716 -0
- package/dist/resources/Workers/chunk-5GDBZTHX.js +1075 -0
- package/dist/resources/Workers/chunk-5HLGKKG3.js +163 -0
- package/dist/resources/Workers/chunk-5IRLXUTA.js +1258 -0
- package/dist/resources/Workers/chunk-5SK36PU4.js +430 -0
- package/dist/resources/Workers/chunk-ARPTYYKS.js +258 -0
- package/dist/resources/Workers/chunk-ATB2I7OS.js +55 -0
- package/dist/resources/Workers/chunk-AXFRNOVC.js +368 -0
- package/dist/resources/Workers/chunk-BP467WX3.js +501 -0
- package/dist/resources/Workers/chunk-BUZDZBUH.js +1007 -0
- package/dist/resources/Workers/chunk-CDGHUKQ4.js +1477 -0
- package/dist/resources/Workers/chunk-CSIZ3BGT.js +398 -0
- package/dist/resources/Workers/chunk-CWJQGBWT.js +39 -0
- package/dist/resources/Workers/chunk-DMCSY5BU.js +100 -0
- package/dist/resources/Workers/chunk-DR5XZ6K5.js +390 -0
- package/dist/resources/Workers/chunk-FWGNCYP6.js +476 -0
- package/dist/resources/Workers/chunk-GF5TNNKP.js +353 -0
- package/dist/resources/Workers/chunk-GVL5I7TC.js +1052 -0
- package/dist/resources/Workers/chunk-H5DUXHCV.js +421 -0
- package/dist/resources/Workers/chunk-HFKSAB5K.js +511 -0
- package/dist/resources/Workers/chunk-HOT2SNXP.js +8639 -0
- package/dist/resources/Workers/chunk-HPH5HSFE.js +1860 -0
- package/dist/resources/Workers/chunk-HPP4JLNH.js +218 -0
- package/dist/resources/Workers/chunk-HUPNRBWW.js +196 -0
- package/dist/resources/Workers/chunk-JGG36SQV.js +102 -0
- package/dist/resources/Workers/chunk-LGJUI2CE.js +2361 -0
- package/dist/resources/Workers/chunk-LGL4P5KL.js +171 -0
- package/dist/resources/Workers/chunk-LX6XV4DK.js +138 -0
- package/dist/resources/Workers/chunk-MN34FIF5.js +37 -0
- package/dist/resources/Workers/chunk-MW3CJYLX.js +101 -0
- package/dist/resources/Workers/chunk-NE4JNU6H.js +767 -0
- package/dist/resources/Workers/chunk-O43GWBSF.js +55 -0
- package/dist/resources/Workers/chunk-PIXK6KHB.js +44 -0
- package/dist/resources/Workers/chunk-PZ2WJWUG.js +634 -0
- package/dist/resources/Workers/chunk-QRBRVGZC.js +305 -0
- package/dist/resources/Workers/chunk-QTZQZY2C.js +669 -0
- package/dist/resources/Workers/chunk-R3HUGXBH.js +302 -0
- package/dist/resources/Workers/chunk-R4OZKBXH.js +456 -0
- package/dist/resources/Workers/chunk-RH4N2ONY.js +236 -0
- package/dist/resources/Workers/chunk-RIDPF7PO.js +58 -0
- package/dist/resources/Workers/chunk-SNN7WOC2.js +781 -0
- package/dist/resources/Workers/chunk-SQVTYRZY.js +122 -0
- package/dist/resources/Workers/chunk-SV7DDPAC.js +629 -0
- package/dist/resources/Workers/chunk-TIXXVKUY.js +834 -0
- package/dist/resources/Workers/chunk-TMPVBFJQ.js +289 -0
- package/dist/resources/Workers/chunk-XUTVA4K5.js +684 -0
- package/dist/resources/Workers/chunk-Y4OJ4B23.js +59 -0
- package/dist/resources/Workers/chunk-YBKFS53K.js +77 -0
- package/dist/resources/Workers/chunk-Z2SIPUKB.js +117 -0
- package/dist/resources/Workers/chunk-Z4JUBRHP.js +157 -0
- package/dist/resources/Workers/chunk-ZQRZBHYI.js +138 -0
- package/dist/resources/Workers/combineGeometry.js +67 -0
- package/dist/resources/Workers/createBoxGeometry.js +57 -0
- package/dist/resources/Workers/createBoxOutlineGeometry.js +234 -0
- package/dist/resources/Workers/createCircleGeometry.js +196 -0
- package/dist/resources/Workers/createCircleOutlineGeometry.js +146 -0
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +505 -0
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +224 -0
- package/dist/resources/Workers/createCorridorGeometry.js +1263 -0
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +568 -0
- package/dist/resources/Workers/createCylinderGeometry.js +59 -0
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +230 -0
- package/dist/resources/Workers/createEllipseGeometry.js +70 -0
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +63 -0
- package/dist/resources/Workers/createEllipsoidGeometry.js +58 -0
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +60 -0
- package/dist/resources/Workers/createFrustumGeometry.js +57 -0
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +234 -0
- package/dist/resources/Workers/createGeometry.js +150 -0
- package/dist/resources/Workers/createGroundPolylineGeometry.js +1607 -0
- package/dist/resources/Workers/createPlaneGeometry.js +223 -0
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +123 -0
- package/dist/resources/Workers/createPolygonGeometry.js +1545 -0
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +542 -0
- package/dist/resources/Workers/createPolylineGeometry.js +495 -0
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +380 -0
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +277 -0
- package/dist/resources/Workers/createRectangleGeometry.js +1273 -0
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +478 -0
- package/dist/resources/Workers/createSimplePolylineGeometry.js +399 -0
- package/dist/resources/Workers/createSphereGeometry.js +117 -0
- package/dist/resources/Workers/createSphereOutlineGeometry.js +117 -0
- package/dist/resources/Workers/createTaskProcessorWorker.js +32 -0
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +492 -0
- package/dist/resources/Workers/createVectorTileGeometries.js +386 -0
- package/dist/resources/Workers/createVectorTilePoints.js +112 -0
- package/dist/resources/Workers/createVectorTilePolygons.js +384 -0
- package/dist/resources/Workers/createVectorTilePolylines.js +262 -0
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -0
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2277 -0
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -0
- package/dist/resources/Workers/createWallGeometry.js +489 -0
- package/dist/resources/Workers/createWallOutlineGeometry.js +337 -0
- package/dist/resources/Workers/decodeDraco.js +369 -0
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -0
- package/dist/resources/Workers/decodeI3S.js +835 -0
- package/dist/resources/Workers/transcodeKTX2.js +3425 -0
- package/dist/resources/Workers/transferTypedArrayTest.js +41 -0
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +818 -0
- package/package.json +81 -0
|
@@ -0,0 +1,1545 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.113
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
BoundingRectangle_default
|
|
28
|
+
} from "./chunk-HPP4JLNH.js";
|
|
29
|
+
import {
|
|
30
|
+
PolygonGeometryLibrary_default
|
|
31
|
+
} from "./chunk-GVL5I7TC.js";
|
|
32
|
+
import {
|
|
33
|
+
ArcType_default
|
|
34
|
+
} from "./chunk-O43GWBSF.js";
|
|
35
|
+
import {
|
|
36
|
+
GeometryInstance_default
|
|
37
|
+
} from "./chunk-Y4OJ4B23.js";
|
|
38
|
+
import {
|
|
39
|
+
GeometryPipeline_default
|
|
40
|
+
} from "./chunk-52VSIKEA.js";
|
|
41
|
+
import "./chunk-5SK36PU4.js";
|
|
42
|
+
import "./chunk-JGG36SQV.js";
|
|
43
|
+
import {
|
|
44
|
+
oneTimeWarning_default
|
|
45
|
+
} from "./chunk-ATB2I7OS.js";
|
|
46
|
+
import {
|
|
47
|
+
EllipsoidGeodesic_default
|
|
48
|
+
} from "./chunk-GF5TNNKP.js";
|
|
49
|
+
import {
|
|
50
|
+
GeometryOffsetAttribute_default
|
|
51
|
+
} from "./chunk-MN34FIF5.js";
|
|
52
|
+
import {
|
|
53
|
+
VertexFormat_default
|
|
54
|
+
} from "./chunk-ZQRZBHYI.js";
|
|
55
|
+
import {
|
|
56
|
+
EllipsoidTangentPlane_default
|
|
57
|
+
} from "./chunk-TMPVBFJQ.js";
|
|
58
|
+
import "./chunk-Z4JUBRHP.js";
|
|
59
|
+
import {
|
|
60
|
+
PolygonPipeline_default,
|
|
61
|
+
WindingOrder_default
|
|
62
|
+
} from "./chunk-BUZDZBUH.js";
|
|
63
|
+
import "./chunk-DMCSY5BU.js";
|
|
64
|
+
import "./chunk-R4OZKBXH.js";
|
|
65
|
+
import {
|
|
66
|
+
IntersectionTests_default,
|
|
67
|
+
Ray_default
|
|
68
|
+
} from "./chunk-5IRLXUTA.js";
|
|
69
|
+
import "./chunk-LGL4P5KL.js";
|
|
70
|
+
import {
|
|
71
|
+
IndexDatatype_default
|
|
72
|
+
} from "./chunk-LX6XV4DK.js";
|
|
73
|
+
import "./chunk-PIXK6KHB.js";
|
|
74
|
+
import {
|
|
75
|
+
GeometryAttribute_default,
|
|
76
|
+
Geometry_default
|
|
77
|
+
} from "./chunk-R3HUGXBH.js";
|
|
78
|
+
import {
|
|
79
|
+
BoundingSphere_default,
|
|
80
|
+
Quaternion_default
|
|
81
|
+
} from "./chunk-HOT2SNXP.js";
|
|
82
|
+
import "./chunk-4KP73B43.js";
|
|
83
|
+
import {
|
|
84
|
+
Rectangle_default
|
|
85
|
+
} from "./chunk-3PW6ZBN4.js";
|
|
86
|
+
import {
|
|
87
|
+
ComponentDatatype_default
|
|
88
|
+
} from "./chunk-ARPTYYKS.js";
|
|
89
|
+
import {
|
|
90
|
+
Cartesian2_default,
|
|
91
|
+
Cartesian3_default,
|
|
92
|
+
Cartographic_default,
|
|
93
|
+
Ellipsoid_default,
|
|
94
|
+
Matrix3_default
|
|
95
|
+
} from "./chunk-LGJUI2CE.js";
|
|
96
|
+
import {
|
|
97
|
+
Math_default
|
|
98
|
+
} from "./chunk-BP467WX3.js";
|
|
99
|
+
import "./chunk-SV7DDPAC.js";
|
|
100
|
+
import "./chunk-RIDPF7PO.js";
|
|
101
|
+
import {
|
|
102
|
+
defaultValue_default
|
|
103
|
+
} from "./chunk-CWJQGBWT.js";
|
|
104
|
+
import {
|
|
105
|
+
Check_default,
|
|
106
|
+
DeveloperError_default
|
|
107
|
+
} from "./chunk-5HLGKKG3.js";
|
|
108
|
+
import {
|
|
109
|
+
defined_default
|
|
110
|
+
} from "./chunk-YBKFS53K.js";
|
|
111
|
+
|
|
112
|
+
// packages/engine/Source/Core/deprecationWarning.js
|
|
113
|
+
function deprecationWarning(identifier, message) {
|
|
114
|
+
if (!defined_default(identifier) || !defined_default(message)) {
|
|
115
|
+
throw new DeveloperError_default("identifier and message are required.");
|
|
116
|
+
}
|
|
117
|
+
oneTimeWarning_default(identifier, message);
|
|
118
|
+
}
|
|
119
|
+
var deprecationWarning_default = deprecationWarning;
|
|
120
|
+
|
|
121
|
+
// packages/engine/Source/Core/Stereographic.js
|
|
122
|
+
function Stereographic(position, tangentPlane) {
|
|
123
|
+
this.position = position;
|
|
124
|
+
if (!defined_default(this.position)) {
|
|
125
|
+
this.position = new Cartesian2_default();
|
|
126
|
+
}
|
|
127
|
+
this.tangentPlane = tangentPlane;
|
|
128
|
+
if (!defined_default(this.tangentPlane)) {
|
|
129
|
+
this.tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
Object.defineProperties(Stereographic.prototype, {
|
|
133
|
+
/**
|
|
134
|
+
* Gets the ellipsoid.
|
|
135
|
+
* @memberof Stereographic.prototype
|
|
136
|
+
* @type {Ellipsoid}
|
|
137
|
+
*/
|
|
138
|
+
ellipsoid: {
|
|
139
|
+
get: function() {
|
|
140
|
+
return this.tangentPlane.ellipsoid;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Gets the x coordinate
|
|
145
|
+
* @memberof Stereographic.prototype
|
|
146
|
+
* @type {number}
|
|
147
|
+
*/
|
|
148
|
+
x: {
|
|
149
|
+
get: function() {
|
|
150
|
+
return this.position.x;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
* Gets the y coordinate
|
|
155
|
+
* @memberof Stereographic.prototype
|
|
156
|
+
* @type {number}
|
|
157
|
+
*/
|
|
158
|
+
y: {
|
|
159
|
+
get: function() {
|
|
160
|
+
return this.position.y;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* Computes the conformal latitude, or the ellipsoidal latitude projected onto an arbitrary sphere.
|
|
165
|
+
* @memberof Stereographic.prototype
|
|
166
|
+
* @type {number}
|
|
167
|
+
*/
|
|
168
|
+
conformalLatitude: {
|
|
169
|
+
get: function() {
|
|
170
|
+
const r = Cartesian2_default.magnitude(this.position);
|
|
171
|
+
const d = 2 * this.ellipsoid.maximumRadius;
|
|
172
|
+
const sign = this.tangentPlane.plane.normal.z;
|
|
173
|
+
return sign * (Math_default.PI_OVER_TWO - 2 * Math.atan2(r, d));
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* Computes the longitude
|
|
178
|
+
* @memberof Stereographic.prototype
|
|
179
|
+
* @type {number}
|
|
180
|
+
*/
|
|
181
|
+
longitude: {
|
|
182
|
+
get: function() {
|
|
183
|
+
let longitude = Math_default.PI_OVER_TWO + Math.atan2(this.y, this.x);
|
|
184
|
+
if (longitude > Math.PI) {
|
|
185
|
+
longitude -= Math_default.TWO_PI;
|
|
186
|
+
}
|
|
187
|
+
return longitude;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
var scratchCartographic = new Cartographic_default();
|
|
192
|
+
var scratchCartesian = new Cartesian3_default();
|
|
193
|
+
Stereographic.prototype.getLatitude = function(ellipsoid) {
|
|
194
|
+
if (!defined_default(ellipsoid)) {
|
|
195
|
+
ellipsoid = Ellipsoid_default.WGS84;
|
|
196
|
+
}
|
|
197
|
+
scratchCartographic.latitude = this.conformalLatitude;
|
|
198
|
+
scratchCartographic.longitude = this.longitude;
|
|
199
|
+
scratchCartographic.height = 0;
|
|
200
|
+
const cartesian = this.ellipsoid.cartographicToCartesian(
|
|
201
|
+
scratchCartographic,
|
|
202
|
+
scratchCartesian
|
|
203
|
+
);
|
|
204
|
+
ellipsoid.cartesianToCartographic(cartesian, scratchCartographic);
|
|
205
|
+
return scratchCartographic.latitude;
|
|
206
|
+
};
|
|
207
|
+
var scratchProjectPointOntoPlaneRay = new Ray_default();
|
|
208
|
+
var scratchProjectPointOntoPlaneRayDirection = new Cartesian3_default();
|
|
209
|
+
var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
|
|
210
|
+
Stereographic.fromCartesian = function(cartesian, result) {
|
|
211
|
+
Check_default.defined("cartesian", cartesian);
|
|
212
|
+
const sign = Math_default.signNotZero(cartesian.z);
|
|
213
|
+
let tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;
|
|
214
|
+
let origin = Stereographic.SOUTH_POLE;
|
|
215
|
+
if (sign < 0) {
|
|
216
|
+
tangentPlane = Stereographic.SOUTH_POLE_TANGENT_PLANE;
|
|
217
|
+
origin = Stereographic.NORTH_POLE;
|
|
218
|
+
}
|
|
219
|
+
const ray = scratchProjectPointOntoPlaneRay;
|
|
220
|
+
ray.origin = tangentPlane.ellipsoid.scaleToGeocentricSurface(
|
|
221
|
+
cartesian,
|
|
222
|
+
ray.origin
|
|
223
|
+
);
|
|
224
|
+
ray.direction = Cartesian3_default.subtract(
|
|
225
|
+
ray.origin,
|
|
226
|
+
origin,
|
|
227
|
+
scratchProjectPointOntoPlaneRayDirection
|
|
228
|
+
);
|
|
229
|
+
Cartesian3_default.normalize(ray.direction, ray.direction);
|
|
230
|
+
const intersectionPoint = IntersectionTests_default.rayPlane(
|
|
231
|
+
ray,
|
|
232
|
+
tangentPlane.plane,
|
|
233
|
+
scratchProjectPointOntoPlaneCartesian3
|
|
234
|
+
);
|
|
235
|
+
const v = Cartesian3_default.subtract(intersectionPoint, origin, intersectionPoint);
|
|
236
|
+
const x = Cartesian3_default.dot(tangentPlane.xAxis, v);
|
|
237
|
+
const y = sign * Cartesian3_default.dot(tangentPlane.yAxis, v);
|
|
238
|
+
if (!defined_default(result)) {
|
|
239
|
+
return new Stereographic(new Cartesian2_default(x, y), tangentPlane);
|
|
240
|
+
}
|
|
241
|
+
result.position = new Cartesian2_default(x, y);
|
|
242
|
+
result.tangentPlane = tangentPlane;
|
|
243
|
+
return result;
|
|
244
|
+
};
|
|
245
|
+
Stereographic.fromCartesianArray = function(cartesians, result) {
|
|
246
|
+
Check_default.defined("cartesians", cartesians);
|
|
247
|
+
const length = cartesians.length;
|
|
248
|
+
if (!defined_default(result)) {
|
|
249
|
+
result = new Array(length);
|
|
250
|
+
} else {
|
|
251
|
+
result.length = length;
|
|
252
|
+
}
|
|
253
|
+
for (let i = 0; i < length; i++) {
|
|
254
|
+
result[i] = Stereographic.fromCartesian(cartesians[i], result[i]);
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
};
|
|
258
|
+
Stereographic.clone = function(stereographic, result) {
|
|
259
|
+
if (!defined_default(stereographic)) {
|
|
260
|
+
return void 0;
|
|
261
|
+
}
|
|
262
|
+
if (!defined_default(result)) {
|
|
263
|
+
return new Stereographic(
|
|
264
|
+
stereographic.position,
|
|
265
|
+
stereographic.tangentPlane
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
result.position = stereographic.position;
|
|
269
|
+
result.tangentPlane = stereographic.tangentPlane;
|
|
270
|
+
return result;
|
|
271
|
+
};
|
|
272
|
+
Stereographic.HALF_UNIT_SPHERE = Object.freeze(new Ellipsoid_default(0.5, 0.5, 0.5));
|
|
273
|
+
Stereographic.NORTH_POLE = Object.freeze(new Cartesian3_default(0, 0, 0.5));
|
|
274
|
+
Stereographic.SOUTH_POLE = Object.freeze(new Cartesian3_default(0, 0, -0.5));
|
|
275
|
+
Stereographic.NORTH_POLE_TANGENT_PLANE = Object.freeze(
|
|
276
|
+
new EllipsoidTangentPlane_default(
|
|
277
|
+
Stereographic.NORTH_POLE,
|
|
278
|
+
Stereographic.HALF_UNIT_SPHERE
|
|
279
|
+
)
|
|
280
|
+
);
|
|
281
|
+
Stereographic.SOUTH_POLE_TANGENT_PLANE = Object.freeze(
|
|
282
|
+
new EllipsoidTangentPlane_default(
|
|
283
|
+
Stereographic.SOUTH_POLE,
|
|
284
|
+
Stereographic.HALF_UNIT_SPHERE
|
|
285
|
+
)
|
|
286
|
+
);
|
|
287
|
+
var Stereographic_default = Stereographic;
|
|
288
|
+
|
|
289
|
+
// packages/engine/Source/Core/PolygonGeometry.js
|
|
290
|
+
var scratchCarto1 = new Cartographic_default();
|
|
291
|
+
var scratchCarto2 = new Cartographic_default();
|
|
292
|
+
function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
|
|
293
|
+
const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
|
|
294
|
+
const height = carto1.height;
|
|
295
|
+
const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
|
|
296
|
+
p1Carto.height = height;
|
|
297
|
+
ellipsoid.cartographicToCartesian(p1Carto, p1);
|
|
298
|
+
const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
|
|
299
|
+
p2Carto.height = height - 100;
|
|
300
|
+
ellipsoid.cartographicToCartesian(p2Carto, p2);
|
|
301
|
+
}
|
|
302
|
+
var scratchBoundingRectangle = new BoundingRectangle_default();
|
|
303
|
+
var scratchPosition = new Cartesian3_default();
|
|
304
|
+
var scratchNormal = new Cartesian3_default();
|
|
305
|
+
var scratchTangent = new Cartesian3_default();
|
|
306
|
+
var scratchBitangent = new Cartesian3_default();
|
|
307
|
+
var p1Scratch = new Cartesian3_default();
|
|
308
|
+
var p2Scratch = new Cartesian3_default();
|
|
309
|
+
var scratchPerPosNormal = new Cartesian3_default();
|
|
310
|
+
var scratchPerPosTangent = new Cartesian3_default();
|
|
311
|
+
var scratchPerPosBitangent = new Cartesian3_default();
|
|
312
|
+
var appendTextureCoordinatesOrigin = new Cartesian2_default();
|
|
313
|
+
var appendTextureCoordinatesCartesian2 = new Cartesian2_default();
|
|
314
|
+
var appendTextureCoordinatesCartesian3 = new Cartesian3_default();
|
|
315
|
+
var appendTextureCoordinatesQuaternion = new Quaternion_default();
|
|
316
|
+
var appendTextureCoordinatesMatrix3 = new Matrix3_default();
|
|
317
|
+
var tangentMatrixScratch = new Matrix3_default();
|
|
318
|
+
function computeAttributes(options) {
|
|
319
|
+
const vertexFormat = options.vertexFormat;
|
|
320
|
+
const geometry = options.geometry;
|
|
321
|
+
const shadowVolume = options.shadowVolume;
|
|
322
|
+
const flatPositions = geometry.attributes.position.values;
|
|
323
|
+
const flatTexcoords = defined_default(geometry.attributes.st) ? geometry.attributes.st.values : void 0;
|
|
324
|
+
let length = flatPositions.length;
|
|
325
|
+
const wall = options.wall;
|
|
326
|
+
const top = options.top || wall;
|
|
327
|
+
const bottom = options.bottom || wall;
|
|
328
|
+
if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
|
|
329
|
+
const boundingRectangle = options.boundingRectangle;
|
|
330
|
+
const rotationAxis = options.rotationAxis;
|
|
331
|
+
const projectTo2d = options.projectTo2d;
|
|
332
|
+
const ellipsoid = options.ellipsoid;
|
|
333
|
+
const stRotation = options.stRotation;
|
|
334
|
+
const perPositionHeight = options.perPositionHeight;
|
|
335
|
+
const origin = appendTextureCoordinatesOrigin;
|
|
336
|
+
origin.x = boundingRectangle.x;
|
|
337
|
+
origin.y = boundingRectangle.y;
|
|
338
|
+
const textureCoordinates = vertexFormat.st ? new Float32Array(2 * (length / 3)) : void 0;
|
|
339
|
+
let normals;
|
|
340
|
+
if (vertexFormat.normal) {
|
|
341
|
+
if (perPositionHeight && top && !wall) {
|
|
342
|
+
normals = geometry.attributes.normal.values;
|
|
343
|
+
} else {
|
|
344
|
+
normals = new Float32Array(length);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const tangents = vertexFormat.tangent ? new Float32Array(length) : void 0;
|
|
348
|
+
const bitangents = vertexFormat.bitangent ? new Float32Array(length) : void 0;
|
|
349
|
+
const extrudeNormals = shadowVolume ? new Float32Array(length) : void 0;
|
|
350
|
+
let textureCoordIndex = 0;
|
|
351
|
+
let attrIndex = 0;
|
|
352
|
+
let normal = scratchNormal;
|
|
353
|
+
let tangent = scratchTangent;
|
|
354
|
+
let bitangent = scratchBitangent;
|
|
355
|
+
let recomputeNormal = true;
|
|
356
|
+
let textureMatrix = appendTextureCoordinatesMatrix3;
|
|
357
|
+
let tangentRotationMatrix = tangentMatrixScratch;
|
|
358
|
+
if (stRotation !== 0) {
|
|
359
|
+
let rotation = Quaternion_default.fromAxisAngle(
|
|
360
|
+
rotationAxis,
|
|
361
|
+
stRotation,
|
|
362
|
+
appendTextureCoordinatesQuaternion
|
|
363
|
+
);
|
|
364
|
+
textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
|
|
365
|
+
rotation = Quaternion_default.fromAxisAngle(
|
|
366
|
+
rotationAxis,
|
|
367
|
+
-stRotation,
|
|
368
|
+
appendTextureCoordinatesQuaternion
|
|
369
|
+
);
|
|
370
|
+
tangentRotationMatrix = Matrix3_default.fromQuaternion(
|
|
371
|
+
rotation,
|
|
372
|
+
tangentRotationMatrix
|
|
373
|
+
);
|
|
374
|
+
} else {
|
|
375
|
+
textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
|
|
376
|
+
tangentRotationMatrix = Matrix3_default.clone(
|
|
377
|
+
Matrix3_default.IDENTITY,
|
|
378
|
+
tangentRotationMatrix
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
let bottomOffset = 0;
|
|
382
|
+
let bottomOffset2 = 0;
|
|
383
|
+
if (top && bottom) {
|
|
384
|
+
bottomOffset = length / 2;
|
|
385
|
+
bottomOffset2 = length / 3;
|
|
386
|
+
length /= 2;
|
|
387
|
+
}
|
|
388
|
+
for (let i = 0; i < length; i += 3) {
|
|
389
|
+
const position = Cartesian3_default.fromArray(
|
|
390
|
+
flatPositions,
|
|
391
|
+
i,
|
|
392
|
+
appendTextureCoordinatesCartesian3
|
|
393
|
+
);
|
|
394
|
+
if (vertexFormat.st) {
|
|
395
|
+
if (!defined_default(flatTexcoords)) {
|
|
396
|
+
let p = Matrix3_default.multiplyByVector(
|
|
397
|
+
textureMatrix,
|
|
398
|
+
position,
|
|
399
|
+
scratchPosition
|
|
400
|
+
);
|
|
401
|
+
p = ellipsoid.scaleToGeodeticSurface(p, p);
|
|
402
|
+
const st = projectTo2d(p, appendTextureCoordinatesCartesian2);
|
|
403
|
+
Cartesian2_default.subtract(st, origin, st);
|
|
404
|
+
const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
|
|
405
|
+
const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
|
|
406
|
+
if (bottom) {
|
|
407
|
+
textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
|
|
408
|
+
textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
|
|
409
|
+
}
|
|
410
|
+
if (top) {
|
|
411
|
+
textureCoordinates[textureCoordIndex] = stx;
|
|
412
|
+
textureCoordinates[textureCoordIndex + 1] = sty;
|
|
413
|
+
}
|
|
414
|
+
textureCoordIndex += 2;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
|
|
418
|
+
const attrIndex1 = attrIndex + 1;
|
|
419
|
+
const attrIndex2 = attrIndex + 2;
|
|
420
|
+
if (wall) {
|
|
421
|
+
if (i + 3 < length) {
|
|
422
|
+
const p1 = Cartesian3_default.fromArray(flatPositions, i + 3, p1Scratch);
|
|
423
|
+
if (recomputeNormal) {
|
|
424
|
+
const p2 = Cartesian3_default.fromArray(
|
|
425
|
+
flatPositions,
|
|
426
|
+
i + length,
|
|
427
|
+
p2Scratch
|
|
428
|
+
);
|
|
429
|
+
if (perPositionHeight) {
|
|
430
|
+
adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
|
|
431
|
+
}
|
|
432
|
+
Cartesian3_default.subtract(p1, position, p1);
|
|
433
|
+
Cartesian3_default.subtract(p2, position, p2);
|
|
434
|
+
normal = Cartesian3_default.normalize(
|
|
435
|
+
Cartesian3_default.cross(p2, p1, normal),
|
|
436
|
+
normal
|
|
437
|
+
);
|
|
438
|
+
recomputeNormal = false;
|
|
439
|
+
}
|
|
440
|
+
if (Cartesian3_default.equalsEpsilon(p1, position, Math_default.EPSILON10)) {
|
|
441
|
+
recomputeNormal = true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
|
445
|
+
bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
|
|
446
|
+
if (vertexFormat.tangent) {
|
|
447
|
+
tangent = Cartesian3_default.normalize(
|
|
448
|
+
Cartesian3_default.cross(bitangent, normal, tangent),
|
|
449
|
+
tangent
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
} else {
|
|
454
|
+
normal = ellipsoid.geodeticSurfaceNormal(position, normal);
|
|
455
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
|
456
|
+
if (perPositionHeight) {
|
|
457
|
+
scratchPerPosNormal = Cartesian3_default.fromArray(
|
|
458
|
+
normals,
|
|
459
|
+
attrIndex,
|
|
460
|
+
scratchPerPosNormal
|
|
461
|
+
);
|
|
462
|
+
scratchPerPosTangent = Cartesian3_default.cross(
|
|
463
|
+
Cartesian3_default.UNIT_Z,
|
|
464
|
+
scratchPerPosNormal,
|
|
465
|
+
scratchPerPosTangent
|
|
466
|
+
);
|
|
467
|
+
scratchPerPosTangent = Cartesian3_default.normalize(
|
|
468
|
+
Matrix3_default.multiplyByVector(
|
|
469
|
+
tangentRotationMatrix,
|
|
470
|
+
scratchPerPosTangent,
|
|
471
|
+
scratchPerPosTangent
|
|
472
|
+
),
|
|
473
|
+
scratchPerPosTangent
|
|
474
|
+
);
|
|
475
|
+
if (vertexFormat.bitangent) {
|
|
476
|
+
scratchPerPosBitangent = Cartesian3_default.normalize(
|
|
477
|
+
Cartesian3_default.cross(
|
|
478
|
+
scratchPerPosNormal,
|
|
479
|
+
scratchPerPosTangent,
|
|
480
|
+
scratchPerPosBitangent
|
|
481
|
+
),
|
|
482
|
+
scratchPerPosBitangent
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
tangent = Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent);
|
|
487
|
+
tangent = Cartesian3_default.normalize(
|
|
488
|
+
Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent),
|
|
489
|
+
tangent
|
|
490
|
+
);
|
|
491
|
+
if (vertexFormat.bitangent) {
|
|
492
|
+
bitangent = Cartesian3_default.normalize(
|
|
493
|
+
Cartesian3_default.cross(normal, tangent, bitangent),
|
|
494
|
+
bitangent
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (vertexFormat.normal) {
|
|
500
|
+
if (options.wall) {
|
|
501
|
+
normals[attrIndex + bottomOffset] = normal.x;
|
|
502
|
+
normals[attrIndex1 + bottomOffset] = normal.y;
|
|
503
|
+
normals[attrIndex2 + bottomOffset] = normal.z;
|
|
504
|
+
} else if (bottom) {
|
|
505
|
+
normals[attrIndex + bottomOffset] = -normal.x;
|
|
506
|
+
normals[attrIndex1 + bottomOffset] = -normal.y;
|
|
507
|
+
normals[attrIndex2 + bottomOffset] = -normal.z;
|
|
508
|
+
}
|
|
509
|
+
if (top && !perPositionHeight || wall) {
|
|
510
|
+
normals[attrIndex] = normal.x;
|
|
511
|
+
normals[attrIndex1] = normal.y;
|
|
512
|
+
normals[attrIndex2] = normal.z;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (shadowVolume) {
|
|
516
|
+
if (wall) {
|
|
517
|
+
normal = ellipsoid.geodeticSurfaceNormal(position, normal);
|
|
518
|
+
}
|
|
519
|
+
extrudeNormals[attrIndex + bottomOffset] = -normal.x;
|
|
520
|
+
extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
|
|
521
|
+
extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
|
|
522
|
+
}
|
|
523
|
+
if (vertexFormat.tangent) {
|
|
524
|
+
if (options.wall) {
|
|
525
|
+
tangents[attrIndex + bottomOffset] = tangent.x;
|
|
526
|
+
tangents[attrIndex1 + bottomOffset] = tangent.y;
|
|
527
|
+
tangents[attrIndex2 + bottomOffset] = tangent.z;
|
|
528
|
+
} else if (bottom) {
|
|
529
|
+
tangents[attrIndex + bottomOffset] = -tangent.x;
|
|
530
|
+
tangents[attrIndex1 + bottomOffset] = -tangent.y;
|
|
531
|
+
tangents[attrIndex2 + bottomOffset] = -tangent.z;
|
|
532
|
+
}
|
|
533
|
+
if (top) {
|
|
534
|
+
if (perPositionHeight) {
|
|
535
|
+
tangents[attrIndex] = scratchPerPosTangent.x;
|
|
536
|
+
tangents[attrIndex1] = scratchPerPosTangent.y;
|
|
537
|
+
tangents[attrIndex2] = scratchPerPosTangent.z;
|
|
538
|
+
} else {
|
|
539
|
+
tangents[attrIndex] = tangent.x;
|
|
540
|
+
tangents[attrIndex1] = tangent.y;
|
|
541
|
+
tangents[attrIndex2] = tangent.z;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (vertexFormat.bitangent) {
|
|
546
|
+
if (bottom) {
|
|
547
|
+
bitangents[attrIndex + bottomOffset] = bitangent.x;
|
|
548
|
+
bitangents[attrIndex1 + bottomOffset] = bitangent.y;
|
|
549
|
+
bitangents[attrIndex2 + bottomOffset] = bitangent.z;
|
|
550
|
+
}
|
|
551
|
+
if (top) {
|
|
552
|
+
if (perPositionHeight) {
|
|
553
|
+
bitangents[attrIndex] = scratchPerPosBitangent.x;
|
|
554
|
+
bitangents[attrIndex1] = scratchPerPosBitangent.y;
|
|
555
|
+
bitangents[attrIndex2] = scratchPerPosBitangent.z;
|
|
556
|
+
} else {
|
|
557
|
+
bitangents[attrIndex] = bitangent.x;
|
|
558
|
+
bitangents[attrIndex1] = bitangent.y;
|
|
559
|
+
bitangents[attrIndex2] = bitangent.z;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
attrIndex += 3;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (vertexFormat.st && !defined_default(flatTexcoords)) {
|
|
567
|
+
geometry.attributes.st = new GeometryAttribute_default({
|
|
568
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
569
|
+
componentsPerAttribute: 2,
|
|
570
|
+
values: textureCoordinates
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
if (vertexFormat.normal) {
|
|
574
|
+
geometry.attributes.normal = new GeometryAttribute_default({
|
|
575
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
576
|
+
componentsPerAttribute: 3,
|
|
577
|
+
values: normals
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
if (vertexFormat.tangent) {
|
|
581
|
+
geometry.attributes.tangent = new GeometryAttribute_default({
|
|
582
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
583
|
+
componentsPerAttribute: 3,
|
|
584
|
+
values: tangents
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
if (vertexFormat.bitangent) {
|
|
588
|
+
geometry.attributes.bitangent = new GeometryAttribute_default({
|
|
589
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
590
|
+
componentsPerAttribute: 3,
|
|
591
|
+
values: bitangents
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
if (shadowVolume) {
|
|
595
|
+
geometry.attributes.extrudeDirection = new GeometryAttribute_default({
|
|
596
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
597
|
+
componentsPerAttribute: 3,
|
|
598
|
+
values: extrudeNormals
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (options.extrude && defined_default(options.offsetAttribute)) {
|
|
603
|
+
const size = flatPositions.length / 3;
|
|
604
|
+
let offsetAttribute = new Uint8Array(size);
|
|
605
|
+
if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
|
|
606
|
+
if (top && bottom || wall) {
|
|
607
|
+
offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
|
|
608
|
+
} else if (top) {
|
|
609
|
+
offsetAttribute = offsetAttribute.fill(1);
|
|
610
|
+
}
|
|
611
|
+
} else {
|
|
612
|
+
const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
613
|
+
offsetAttribute = offsetAttribute.fill(offsetValue);
|
|
614
|
+
}
|
|
615
|
+
geometry.attributes.applyOffset = new GeometryAttribute_default({
|
|
616
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
617
|
+
componentsPerAttribute: 1,
|
|
618
|
+
values: offsetAttribute
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
return geometry;
|
|
622
|
+
}
|
|
623
|
+
var startCartographicScratch = new Cartographic_default();
|
|
624
|
+
var endCartographicScratch = new Cartographic_default();
|
|
625
|
+
var idlCross = {
|
|
626
|
+
westOverIDL: 0,
|
|
627
|
+
eastOverIDL: 0
|
|
628
|
+
};
|
|
629
|
+
var ellipsoidGeodesic = new EllipsoidGeodesic_default();
|
|
630
|
+
function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
|
|
631
|
+
result = defaultValue_default(result, new Rectangle_default());
|
|
632
|
+
if (!defined_default(positions) || positions.length < 3) {
|
|
633
|
+
result.west = 0;
|
|
634
|
+
result.north = 0;
|
|
635
|
+
result.south = 0;
|
|
636
|
+
result.east = 0;
|
|
637
|
+
return result;
|
|
638
|
+
}
|
|
639
|
+
if (arcType === ArcType_default.RHUMB) {
|
|
640
|
+
return Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
|
|
641
|
+
}
|
|
642
|
+
if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
|
|
643
|
+
ellipsoidGeodesic = new EllipsoidGeodesic_default(void 0, void 0, ellipsoid);
|
|
644
|
+
}
|
|
645
|
+
result.west = Number.POSITIVE_INFINITY;
|
|
646
|
+
result.east = Number.NEGATIVE_INFINITY;
|
|
647
|
+
result.south = Number.POSITIVE_INFINITY;
|
|
648
|
+
result.north = Number.NEGATIVE_INFINITY;
|
|
649
|
+
idlCross.westOverIDL = Number.POSITIVE_INFINITY;
|
|
650
|
+
idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
|
|
651
|
+
const inverseChordLength = 1 / Math_default.chordLength(granularity, ellipsoid.maximumRadius);
|
|
652
|
+
const positionsLength = positions.length;
|
|
653
|
+
let endCartographic = ellipsoid.cartesianToCartographic(
|
|
654
|
+
positions[0],
|
|
655
|
+
endCartographicScratch
|
|
656
|
+
);
|
|
657
|
+
let startCartographic = startCartographicScratch;
|
|
658
|
+
let swap;
|
|
659
|
+
for (let i = 1; i < positionsLength; i++) {
|
|
660
|
+
swap = startCartographic;
|
|
661
|
+
startCartographic = endCartographic;
|
|
662
|
+
endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
|
|
663
|
+
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
|
664
|
+
interpolateAndGrowRectangle(
|
|
665
|
+
ellipsoidGeodesic,
|
|
666
|
+
inverseChordLength,
|
|
667
|
+
result,
|
|
668
|
+
idlCross
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
swap = startCartographic;
|
|
672
|
+
startCartographic = endCartographic;
|
|
673
|
+
endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
|
|
674
|
+
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
|
675
|
+
interpolateAndGrowRectangle(
|
|
676
|
+
ellipsoidGeodesic,
|
|
677
|
+
inverseChordLength,
|
|
678
|
+
result,
|
|
679
|
+
idlCross
|
|
680
|
+
);
|
|
681
|
+
if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
|
|
682
|
+
result.west = idlCross.westOverIDL;
|
|
683
|
+
result.east = idlCross.eastOverIDL;
|
|
684
|
+
if (result.east > Math_default.PI) {
|
|
685
|
+
result.east = result.east - Math_default.TWO_PI;
|
|
686
|
+
}
|
|
687
|
+
if (result.west > Math_default.PI) {
|
|
688
|
+
result.west = result.west - Math_default.TWO_PI;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return result;
|
|
692
|
+
}
|
|
693
|
+
var interpolatedCartographicScratch = new Cartographic_default();
|
|
694
|
+
function interpolateAndGrowRectangle(ellipsoidGeodesic2, inverseChordLength, result, idlCross2) {
|
|
695
|
+
const segmentLength = ellipsoidGeodesic2.surfaceDistance;
|
|
696
|
+
const numPoints = Math.ceil(segmentLength * inverseChordLength);
|
|
697
|
+
const subsegmentDistance = numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
|
|
698
|
+
let interpolationDistance = 0;
|
|
699
|
+
for (let i = 0; i < numPoints; i++) {
|
|
700
|
+
const interpolatedCartographic = ellipsoidGeodesic2.interpolateUsingSurfaceDistance(
|
|
701
|
+
interpolationDistance,
|
|
702
|
+
interpolatedCartographicScratch
|
|
703
|
+
);
|
|
704
|
+
interpolationDistance += subsegmentDistance;
|
|
705
|
+
const longitude = interpolatedCartographic.longitude;
|
|
706
|
+
const latitude = interpolatedCartographic.latitude;
|
|
707
|
+
result.west = Math.min(result.west, longitude);
|
|
708
|
+
result.east = Math.max(result.east, longitude);
|
|
709
|
+
result.south = Math.min(result.south, latitude);
|
|
710
|
+
result.north = Math.max(result.north, latitude);
|
|
711
|
+
const lonAdjusted = longitude >= 0 ? longitude : longitude + Math_default.TWO_PI;
|
|
712
|
+
idlCross2.westOverIDL = Math.min(idlCross2.westOverIDL, lonAdjusted);
|
|
713
|
+
idlCross2.eastOverIDL = Math.max(idlCross2.eastOverIDL, lonAdjusted);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
var createGeometryFromPositionsExtrudedPositions = [];
|
|
717
|
+
function createGeometryFromPositionsExtruded(ellipsoid, polygon2, textureCoordinates, granularity, hierarchy, perPositionHeight, closeTop, closeBottom, vertexFormat, arcType) {
|
|
718
|
+
const geos = {
|
|
719
|
+
walls: []
|
|
720
|
+
};
|
|
721
|
+
let i;
|
|
722
|
+
if (closeTop || closeBottom) {
|
|
723
|
+
const topGeo = PolygonGeometryLibrary_default.createGeometryFromPositions(
|
|
724
|
+
ellipsoid,
|
|
725
|
+
polygon2,
|
|
726
|
+
textureCoordinates,
|
|
727
|
+
granularity,
|
|
728
|
+
perPositionHeight,
|
|
729
|
+
vertexFormat,
|
|
730
|
+
arcType
|
|
731
|
+
);
|
|
732
|
+
const edgePoints = topGeo.attributes.position.values;
|
|
733
|
+
const indices = topGeo.indices;
|
|
734
|
+
let numPositions;
|
|
735
|
+
let newIndices;
|
|
736
|
+
if (closeTop && closeBottom) {
|
|
737
|
+
const topBottomPositions = edgePoints.concat(edgePoints);
|
|
738
|
+
numPositions = topBottomPositions.length / 3;
|
|
739
|
+
newIndices = IndexDatatype_default.createTypedArray(
|
|
740
|
+
numPositions,
|
|
741
|
+
indices.length * 2
|
|
742
|
+
);
|
|
743
|
+
newIndices.set(indices);
|
|
744
|
+
const ilength = indices.length;
|
|
745
|
+
const length = numPositions / 2;
|
|
746
|
+
for (i = 0; i < ilength; i += 3) {
|
|
747
|
+
const i0 = newIndices[i] + length;
|
|
748
|
+
const i1 = newIndices[i + 1] + length;
|
|
749
|
+
const i2 = newIndices[i + 2] + length;
|
|
750
|
+
newIndices[i + ilength] = i2;
|
|
751
|
+
newIndices[i + 1 + ilength] = i1;
|
|
752
|
+
newIndices[i + 2 + ilength] = i0;
|
|
753
|
+
}
|
|
754
|
+
topGeo.attributes.position.values = topBottomPositions;
|
|
755
|
+
if (perPositionHeight && vertexFormat.normal) {
|
|
756
|
+
const normals = topGeo.attributes.normal.values;
|
|
757
|
+
topGeo.attributes.normal.values = new Float32Array(
|
|
758
|
+
topBottomPositions.length
|
|
759
|
+
);
|
|
760
|
+
topGeo.attributes.normal.values.set(normals);
|
|
761
|
+
}
|
|
762
|
+
if (vertexFormat.st && defined_default(textureCoordinates)) {
|
|
763
|
+
const texcoords = topGeo.attributes.st.values;
|
|
764
|
+
topGeo.attributes.st.values = new Float32Array(numPositions * 2);
|
|
765
|
+
topGeo.attributes.st.values = texcoords.concat(texcoords);
|
|
766
|
+
}
|
|
767
|
+
topGeo.indices = newIndices;
|
|
768
|
+
} else if (closeBottom) {
|
|
769
|
+
numPositions = edgePoints.length / 3;
|
|
770
|
+
newIndices = IndexDatatype_default.createTypedArray(numPositions, indices.length);
|
|
771
|
+
for (i = 0; i < indices.length; i += 3) {
|
|
772
|
+
newIndices[i] = indices[i + 2];
|
|
773
|
+
newIndices[i + 1] = indices[i + 1];
|
|
774
|
+
newIndices[i + 2] = indices[i];
|
|
775
|
+
}
|
|
776
|
+
topGeo.indices = newIndices;
|
|
777
|
+
}
|
|
778
|
+
geos.topAndBottom = new GeometryInstance_default({
|
|
779
|
+
geometry: topGeo
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
let outerRing = hierarchy.outerRing;
|
|
783
|
+
const tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
|
|
784
|
+
let positions2D = tangentPlane.projectPointsOntoPlane(
|
|
785
|
+
outerRing,
|
|
786
|
+
createGeometryFromPositionsExtrudedPositions
|
|
787
|
+
);
|
|
788
|
+
let windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
|
|
789
|
+
if (windingOrder === WindingOrder_default.CLOCKWISE) {
|
|
790
|
+
outerRing = outerRing.slice().reverse();
|
|
791
|
+
}
|
|
792
|
+
let wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
|
|
793
|
+
outerRing,
|
|
794
|
+
textureCoordinates,
|
|
795
|
+
ellipsoid,
|
|
796
|
+
granularity,
|
|
797
|
+
perPositionHeight,
|
|
798
|
+
arcType
|
|
799
|
+
);
|
|
800
|
+
geos.walls.push(
|
|
801
|
+
new GeometryInstance_default({
|
|
802
|
+
geometry: wallGeo
|
|
803
|
+
})
|
|
804
|
+
);
|
|
805
|
+
const holes = hierarchy.holes;
|
|
806
|
+
for (i = 0; i < holes.length; i++) {
|
|
807
|
+
let hole = holes[i];
|
|
808
|
+
positions2D = tangentPlane.projectPointsOntoPlane(
|
|
809
|
+
hole,
|
|
810
|
+
createGeometryFromPositionsExtrudedPositions
|
|
811
|
+
);
|
|
812
|
+
windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
|
|
813
|
+
if (windingOrder === WindingOrder_default.COUNTER_CLOCKWISE) {
|
|
814
|
+
hole = hole.slice().reverse();
|
|
815
|
+
}
|
|
816
|
+
wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
|
|
817
|
+
hole,
|
|
818
|
+
textureCoordinates,
|
|
819
|
+
ellipsoid,
|
|
820
|
+
granularity,
|
|
821
|
+
perPositionHeight,
|
|
822
|
+
arcType
|
|
823
|
+
);
|
|
824
|
+
geos.walls.push(
|
|
825
|
+
new GeometryInstance_default({
|
|
826
|
+
geometry: wallGeo
|
|
827
|
+
})
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
return geos;
|
|
831
|
+
}
|
|
832
|
+
function PolygonGeometry(options) {
|
|
833
|
+
Check_default.typeOf.object("options", options);
|
|
834
|
+
Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
|
835
|
+
if (defined_default(options.perPositionHeight) && options.perPositionHeight && defined_default(options.height)) {
|
|
836
|
+
throw new DeveloperError_default(
|
|
837
|
+
"Cannot use both options.perPositionHeight and options.height"
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
|
|
841
|
+
throw new DeveloperError_default(
|
|
842
|
+
"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
const polygonHierarchy = options.polygonHierarchy;
|
|
846
|
+
const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
|
|
847
|
+
const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
|
|
848
|
+
const granularity = defaultValue_default(
|
|
849
|
+
options.granularity,
|
|
850
|
+
Math_default.RADIANS_PER_DEGREE
|
|
851
|
+
);
|
|
852
|
+
const stRotation = defaultValue_default(options.stRotation, 0);
|
|
853
|
+
const textureCoordinates = options.textureCoordinates;
|
|
854
|
+
const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
|
|
855
|
+
const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
|
|
856
|
+
let height = defaultValue_default(options.height, 0);
|
|
857
|
+
let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
|
|
858
|
+
if (!perPositionHeightExtrude) {
|
|
859
|
+
const h = Math.max(height, extrudedHeight);
|
|
860
|
+
extrudedHeight = Math.min(height, extrudedHeight);
|
|
861
|
+
height = h;
|
|
862
|
+
}
|
|
863
|
+
this._vertexFormat = VertexFormat_default.clone(vertexFormat);
|
|
864
|
+
this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
|
|
865
|
+
this._granularity = granularity;
|
|
866
|
+
this._stRotation = stRotation;
|
|
867
|
+
this._height = height;
|
|
868
|
+
this._extrudedHeight = extrudedHeight;
|
|
869
|
+
this._closeTop = defaultValue_default(options.closeTop, true);
|
|
870
|
+
this._closeBottom = defaultValue_default(options.closeBottom, true);
|
|
871
|
+
this._polygonHierarchy = polygonHierarchy;
|
|
872
|
+
this._perPositionHeight = perPositionHeight;
|
|
873
|
+
this._perPositionHeightExtrude = perPositionHeightExtrude;
|
|
874
|
+
this._shadowVolume = defaultValue_default(options.shadowVolume, false);
|
|
875
|
+
this._workerName = "createPolygonGeometry";
|
|
876
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
877
|
+
this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
|
|
878
|
+
this._rectangle = void 0;
|
|
879
|
+
this._textureCoordinateRotationPoints = void 0;
|
|
880
|
+
this._textureCoordinates = textureCoordinates;
|
|
881
|
+
this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
|
|
882
|
+
polygonHierarchy,
|
|
883
|
+
Cartesian3_default
|
|
884
|
+
) + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + (textureCoordinates ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
|
|
885
|
+
textureCoordinates,
|
|
886
|
+
Cartesian2_default
|
|
887
|
+
) : 1) + 12;
|
|
888
|
+
}
|
|
889
|
+
PolygonGeometry.fromPositions = function(options) {
|
|
890
|
+
options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
|
|
891
|
+
Check_default.defined("options.positions", options.positions);
|
|
892
|
+
const newOptions = {
|
|
893
|
+
polygonHierarchy: {
|
|
894
|
+
positions: options.positions
|
|
895
|
+
},
|
|
896
|
+
height: options.height,
|
|
897
|
+
extrudedHeight: options.extrudedHeight,
|
|
898
|
+
vertexFormat: options.vertexFormat,
|
|
899
|
+
stRotation: options.stRotation,
|
|
900
|
+
ellipsoid: options.ellipsoid,
|
|
901
|
+
granularity: options.granularity,
|
|
902
|
+
perPositionHeight: options.perPositionHeight,
|
|
903
|
+
closeTop: options.closeTop,
|
|
904
|
+
closeBottom: options.closeBottom,
|
|
905
|
+
offsetAttribute: options.offsetAttribute,
|
|
906
|
+
arcType: options.arcType,
|
|
907
|
+
textureCoordinates: options.textureCoordinates
|
|
908
|
+
};
|
|
909
|
+
return new PolygonGeometry(newOptions);
|
|
910
|
+
};
|
|
911
|
+
PolygonGeometry.pack = function(value, array, startingIndex) {
|
|
912
|
+
Check_default.typeOf.object("value", value);
|
|
913
|
+
Check_default.defined("array", array);
|
|
914
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
915
|
+
startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
|
|
916
|
+
value._polygonHierarchy,
|
|
917
|
+
array,
|
|
918
|
+
startingIndex,
|
|
919
|
+
Cartesian3_default
|
|
920
|
+
);
|
|
921
|
+
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
922
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
923
|
+
VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
|
|
924
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
925
|
+
array[startingIndex++] = value._height;
|
|
926
|
+
array[startingIndex++] = value._extrudedHeight;
|
|
927
|
+
array[startingIndex++] = value._granularity;
|
|
928
|
+
array[startingIndex++] = value._stRotation;
|
|
929
|
+
array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
|
|
930
|
+
array[startingIndex++] = value._perPositionHeight ? 1 : 0;
|
|
931
|
+
array[startingIndex++] = value._closeTop ? 1 : 0;
|
|
932
|
+
array[startingIndex++] = value._closeBottom ? 1 : 0;
|
|
933
|
+
array[startingIndex++] = value._shadowVolume ? 1 : 0;
|
|
934
|
+
array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
|
|
935
|
+
array[startingIndex++] = value._arcType;
|
|
936
|
+
if (defined_default(value._textureCoordinates)) {
|
|
937
|
+
startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
|
|
938
|
+
value._textureCoordinates,
|
|
939
|
+
array,
|
|
940
|
+
startingIndex,
|
|
941
|
+
Cartesian2_default
|
|
942
|
+
);
|
|
943
|
+
} else {
|
|
944
|
+
array[startingIndex++] = -1;
|
|
945
|
+
}
|
|
946
|
+
array[startingIndex++] = value.packedLength;
|
|
947
|
+
return array;
|
|
948
|
+
};
|
|
949
|
+
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
950
|
+
var scratchVertexFormat = new VertexFormat_default();
|
|
951
|
+
var dummyOptions = {
|
|
952
|
+
polygonHierarchy: {}
|
|
953
|
+
};
|
|
954
|
+
PolygonGeometry.unpack = function(array, startingIndex, result) {
|
|
955
|
+
Check_default.defined("array", array);
|
|
956
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
957
|
+
const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
|
|
958
|
+
array,
|
|
959
|
+
startingIndex,
|
|
960
|
+
Cartesian3_default
|
|
961
|
+
);
|
|
962
|
+
startingIndex = polygonHierarchy.startingIndex;
|
|
963
|
+
delete polygonHierarchy.startingIndex;
|
|
964
|
+
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
965
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
966
|
+
const vertexFormat = VertexFormat_default.unpack(
|
|
967
|
+
array,
|
|
968
|
+
startingIndex,
|
|
969
|
+
scratchVertexFormat
|
|
970
|
+
);
|
|
971
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
972
|
+
const height = array[startingIndex++];
|
|
973
|
+
const extrudedHeight = array[startingIndex++];
|
|
974
|
+
const granularity = array[startingIndex++];
|
|
975
|
+
const stRotation = array[startingIndex++];
|
|
976
|
+
const perPositionHeightExtrude = array[startingIndex++] === 1;
|
|
977
|
+
const perPositionHeight = array[startingIndex++] === 1;
|
|
978
|
+
const closeTop = array[startingIndex++] === 1;
|
|
979
|
+
const closeBottom = array[startingIndex++] === 1;
|
|
980
|
+
const shadowVolume = array[startingIndex++] === 1;
|
|
981
|
+
const offsetAttribute = array[startingIndex++];
|
|
982
|
+
const arcType = array[startingIndex++];
|
|
983
|
+
const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
|
|
984
|
+
array,
|
|
985
|
+
startingIndex,
|
|
986
|
+
Cartesian2_default
|
|
987
|
+
);
|
|
988
|
+
if (defined_default(textureCoordinates)) {
|
|
989
|
+
startingIndex = textureCoordinates.startingIndex;
|
|
990
|
+
delete textureCoordinates.startingIndex;
|
|
991
|
+
} else {
|
|
992
|
+
startingIndex++;
|
|
993
|
+
}
|
|
994
|
+
const packedLength = array[startingIndex++];
|
|
995
|
+
if (!defined_default(result)) {
|
|
996
|
+
result = new PolygonGeometry(dummyOptions);
|
|
997
|
+
}
|
|
998
|
+
result._polygonHierarchy = polygonHierarchy;
|
|
999
|
+
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
1000
|
+
result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
|
|
1001
|
+
result._height = height;
|
|
1002
|
+
result._extrudedHeight = extrudedHeight;
|
|
1003
|
+
result._granularity = granularity;
|
|
1004
|
+
result._stRotation = stRotation;
|
|
1005
|
+
result._perPositionHeightExtrude = perPositionHeightExtrude;
|
|
1006
|
+
result._perPositionHeight = perPositionHeight;
|
|
1007
|
+
result._closeTop = closeTop;
|
|
1008
|
+
result._closeBottom = closeBottom;
|
|
1009
|
+
result._shadowVolume = shadowVolume;
|
|
1010
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
1011
|
+
result._arcType = arcType;
|
|
1012
|
+
result._textureCoordinates = textureCoordinates;
|
|
1013
|
+
result.packedLength = packedLength;
|
|
1014
|
+
return result;
|
|
1015
|
+
};
|
|
1016
|
+
var scratchCartesian0 = new Cartesian2_default();
|
|
1017
|
+
var scratchCartesian1 = new Cartesian2_default();
|
|
1018
|
+
var scratchPolarClosest = new Stereographic_default();
|
|
1019
|
+
function expandRectangle(polar, lastPolar, ellipsoid, arcType, polygon2, result) {
|
|
1020
|
+
const longitude = polar.longitude;
|
|
1021
|
+
const lonAdjusted = longitude >= 0 ? longitude : longitude + Math_default.TWO_PI;
|
|
1022
|
+
polygon2.westOverIdl = Math.min(polygon2.westOverIdl, lonAdjusted);
|
|
1023
|
+
polygon2.eastOverIdl = Math.max(polygon2.eastOverIdl, lonAdjusted);
|
|
1024
|
+
result.west = Math.min(result.west, longitude);
|
|
1025
|
+
result.east = Math.max(result.east, longitude);
|
|
1026
|
+
const latitude = polar.getLatitude(ellipsoid);
|
|
1027
|
+
let segmentLatitude = latitude;
|
|
1028
|
+
result.south = Math.min(result.south, latitude);
|
|
1029
|
+
result.north = Math.max(result.north, latitude);
|
|
1030
|
+
if (arcType !== ArcType_default.RHUMB) {
|
|
1031
|
+
const segment = Cartesian2_default.subtract(
|
|
1032
|
+
lastPolar.position,
|
|
1033
|
+
polar.position,
|
|
1034
|
+
scratchCartesian0
|
|
1035
|
+
);
|
|
1036
|
+
const t = Cartesian2_default.dot(lastPolar.position, segment) / Cartesian2_default.dot(segment, segment);
|
|
1037
|
+
if (t > 0 && t < 1) {
|
|
1038
|
+
const projected = Cartesian2_default.add(
|
|
1039
|
+
lastPolar.position,
|
|
1040
|
+
Cartesian2_default.multiplyByScalar(segment, -t, segment),
|
|
1041
|
+
scratchCartesian1
|
|
1042
|
+
);
|
|
1043
|
+
const closestPolar = Stereographic_default.clone(lastPolar, scratchPolarClosest);
|
|
1044
|
+
closestPolar.position = projected;
|
|
1045
|
+
const adjustedLatitude = closestPolar.getLatitude(ellipsoid);
|
|
1046
|
+
result.south = Math.min(result.south, adjustedLatitude);
|
|
1047
|
+
result.north = Math.max(result.north, adjustedLatitude);
|
|
1048
|
+
if (Math.abs(latitude) > Math.abs(adjustedLatitude)) {
|
|
1049
|
+
segmentLatitude = adjustedLatitude;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
const direction = lastPolar.x * polar.y - polar.x * lastPolar.y;
|
|
1054
|
+
let angle = Math.sign(direction);
|
|
1055
|
+
if (angle !== 0) {
|
|
1056
|
+
angle *= Cartesian2_default.angleBetween(lastPolar.position, polar.position);
|
|
1057
|
+
}
|
|
1058
|
+
if (segmentLatitude >= 0) {
|
|
1059
|
+
polygon2.northAngle += angle;
|
|
1060
|
+
}
|
|
1061
|
+
if (segmentLatitude <= 0) {
|
|
1062
|
+
polygon2.southAngle += angle;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
var scratchPolar = new Stereographic_default();
|
|
1066
|
+
var scratchPolarPrevious = new Stereographic_default();
|
|
1067
|
+
var polygon = {
|
|
1068
|
+
northAngle: 0,
|
|
1069
|
+
southAngle: 0,
|
|
1070
|
+
westOverIdl: 0,
|
|
1071
|
+
eastOverIdl: 0
|
|
1072
|
+
};
|
|
1073
|
+
PolygonGeometry.computeRectangleFromPositions = function(positions, ellipsoid, arcType, result) {
|
|
1074
|
+
Check_default.defined("positions", positions);
|
|
1075
|
+
if (!defined_default(result)) {
|
|
1076
|
+
result = new Rectangle_default();
|
|
1077
|
+
}
|
|
1078
|
+
if (positions.length < 3) {
|
|
1079
|
+
return result;
|
|
1080
|
+
}
|
|
1081
|
+
result.west = Number.POSITIVE_INFINITY;
|
|
1082
|
+
result.east = Number.NEGATIVE_INFINITY;
|
|
1083
|
+
result.south = Number.POSITIVE_INFINITY;
|
|
1084
|
+
result.north = Number.NEGATIVE_INFINITY;
|
|
1085
|
+
polygon.northAngle = 0;
|
|
1086
|
+
polygon.southAngle = 0;
|
|
1087
|
+
polygon.westOverIdl = Number.POSITIVE_INFINITY;
|
|
1088
|
+
polygon.eastOverIdl = Number.NEGATIVE_INFINITY;
|
|
1089
|
+
const positionsLength = positions.length;
|
|
1090
|
+
let lastPolarPosition = Stereographic_default.fromCartesian(
|
|
1091
|
+
positions[0],
|
|
1092
|
+
scratchPolarPrevious
|
|
1093
|
+
);
|
|
1094
|
+
for (let i = 1; i < positionsLength; i++) {
|
|
1095
|
+
const polarPosition = Stereographic_default.fromCartesian(
|
|
1096
|
+
positions[i],
|
|
1097
|
+
scratchPolar
|
|
1098
|
+
);
|
|
1099
|
+
expandRectangle(
|
|
1100
|
+
polarPosition,
|
|
1101
|
+
lastPolarPosition,
|
|
1102
|
+
ellipsoid,
|
|
1103
|
+
arcType,
|
|
1104
|
+
polygon,
|
|
1105
|
+
result
|
|
1106
|
+
);
|
|
1107
|
+
lastPolarPosition = Stereographic_default.clone(polarPosition, lastPolarPosition);
|
|
1108
|
+
}
|
|
1109
|
+
expandRectangle(
|
|
1110
|
+
Stereographic_default.fromCartesian(positions[0], scratchPolar),
|
|
1111
|
+
lastPolarPosition,
|
|
1112
|
+
ellipsoid,
|
|
1113
|
+
arcType,
|
|
1114
|
+
polygon,
|
|
1115
|
+
result
|
|
1116
|
+
);
|
|
1117
|
+
if (result.east - result.west > polygon.eastOverIdl - polygon.westOverIdl) {
|
|
1118
|
+
result.west = polygon.westOverIdl;
|
|
1119
|
+
result.east = polygon.eastOverIdl;
|
|
1120
|
+
if (result.east > Math_default.PI) {
|
|
1121
|
+
result.east = result.east - Math_default.TWO_PI;
|
|
1122
|
+
}
|
|
1123
|
+
if (result.west > Math_default.PI) {
|
|
1124
|
+
result.west = result.west - Math_default.TWO_PI;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
if (Math_default.equalsEpsilon(
|
|
1128
|
+
Math.abs(polygon.northAngle),
|
|
1129
|
+
Math_default.TWO_PI,
|
|
1130
|
+
Math_default.EPSILON10
|
|
1131
|
+
)) {
|
|
1132
|
+
result.north = Math_default.PI_OVER_TWO;
|
|
1133
|
+
result.east = Math_default.PI;
|
|
1134
|
+
result.west = -Math_default.PI;
|
|
1135
|
+
}
|
|
1136
|
+
if (Math_default.equalsEpsilon(
|
|
1137
|
+
Math.abs(polygon.southAngle),
|
|
1138
|
+
Math_default.TWO_PI,
|
|
1139
|
+
Math_default.EPSILON10
|
|
1140
|
+
)) {
|
|
1141
|
+
result.south = -Math_default.PI_OVER_TWO;
|
|
1142
|
+
result.east = Math_default.PI;
|
|
1143
|
+
result.west = -Math_default.PI;
|
|
1144
|
+
}
|
|
1145
|
+
return result;
|
|
1146
|
+
};
|
|
1147
|
+
PolygonGeometry.computeRectangle = function(options, result) {
|
|
1148
|
+
Check_default.typeOf.object("options", options);
|
|
1149
|
+
Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
|
1150
|
+
deprecationWarning_default(
|
|
1151
|
+
"PolygonGeometry.computeRectangle",
|
|
1152
|
+
"PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110. It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead."
|
|
1153
|
+
);
|
|
1154
|
+
const granularity = defaultValue_default(
|
|
1155
|
+
options.granularity,
|
|
1156
|
+
Math_default.RADIANS_PER_DEGREE
|
|
1157
|
+
);
|
|
1158
|
+
const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
|
|
1159
|
+
if (arcType !== ArcType_default.GEODESIC && arcType !== ArcType_default.RHUMB) {
|
|
1160
|
+
throw new DeveloperError_default(
|
|
1161
|
+
"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
const polygonHierarchy = options.polygonHierarchy;
|
|
1165
|
+
const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
|
|
1166
|
+
return computeRectangle(
|
|
1167
|
+
polygonHierarchy.positions,
|
|
1168
|
+
ellipsoid,
|
|
1169
|
+
arcType,
|
|
1170
|
+
granularity,
|
|
1171
|
+
result
|
|
1172
|
+
);
|
|
1173
|
+
};
|
|
1174
|
+
var scratchPolarForPlane = new Stereographic_default();
|
|
1175
|
+
function getTangentPlane(rectangle, positions, ellipsoid) {
|
|
1176
|
+
if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
|
|
1177
|
+
const polar = Stereographic_default.fromCartesian(
|
|
1178
|
+
positions[0],
|
|
1179
|
+
scratchPolarForPlane
|
|
1180
|
+
);
|
|
1181
|
+
return polar.tangentPlane;
|
|
1182
|
+
}
|
|
1183
|
+
return EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
|
|
1184
|
+
}
|
|
1185
|
+
var scratchCartographicCyllindrical = new Cartographic_default();
|
|
1186
|
+
function createProjectTo2d(rectangle, outerPositions, ellipsoid) {
|
|
1187
|
+
return (positions, results) => {
|
|
1188
|
+
if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
|
|
1189
|
+
if (rectangle.south < 0 && rectangle.north > 0) {
|
|
1190
|
+
if (!defined_default(results)) {
|
|
1191
|
+
results = [];
|
|
1192
|
+
}
|
|
1193
|
+
for (let i = 0; i < positions.length; ++i) {
|
|
1194
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1195
|
+
positions[i],
|
|
1196
|
+
scratchCartographicCyllindrical
|
|
1197
|
+
);
|
|
1198
|
+
results[i] = new Cartesian2_default(
|
|
1199
|
+
cartographic.longitude / Math_default.PI,
|
|
1200
|
+
cartographic.latitude / Math_default.PI_OVER_TWO
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
results.length = positions.length;
|
|
1204
|
+
return results;
|
|
1205
|
+
}
|
|
1206
|
+
return Stereographic_default.fromCartesianArray(positions, results);
|
|
1207
|
+
}
|
|
1208
|
+
const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
|
|
1209
|
+
outerPositions,
|
|
1210
|
+
ellipsoid
|
|
1211
|
+
);
|
|
1212
|
+
return tangentPlane.projectPointsOntoPlane(positions, results);
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function createProjectPositionTo2d(rectangle, outerRing, ellipsoid) {
|
|
1216
|
+
if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
|
|
1217
|
+
return (position, result) => {
|
|
1218
|
+
if (rectangle.south < 0 && rectangle.north > 0) {
|
|
1219
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1220
|
+
position,
|
|
1221
|
+
scratchCartographicCyllindrical
|
|
1222
|
+
);
|
|
1223
|
+
if (!defined_default(result)) {
|
|
1224
|
+
result = new Cartesian2_default();
|
|
1225
|
+
}
|
|
1226
|
+
result.x = cartographic.longitude / Math_default.PI;
|
|
1227
|
+
result.y = cartographic.latitude / Math_default.PI_OVER_TWO;
|
|
1228
|
+
return result;
|
|
1229
|
+
}
|
|
1230
|
+
return Stereographic_default.fromCartesian(position, result);
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
const tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
|
|
1234
|
+
return (position, result) => {
|
|
1235
|
+
return tangentPlane.projectPointsOntoPlane(position, result);
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) {
|
|
1239
|
+
return (polygons, results) => {
|
|
1240
|
+
if (!perPositionHeight && (rectangle.height >= Math_default.PI_OVER_TWO || rectangle.width >= 2 * Math_default.PI_OVER_THREE)) {
|
|
1241
|
+
return PolygonGeometryLibrary_default.splitPolygonsOnEquator(
|
|
1242
|
+
polygons,
|
|
1243
|
+
ellipsoid,
|
|
1244
|
+
arcType,
|
|
1245
|
+
results
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
return polygons;
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function computeBoundingRectangle(outerRing, rectangle, ellipsoid, stRotation) {
|
|
1252
|
+
if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
|
|
1253
|
+
return BoundingRectangle_default.fromRectangle(
|
|
1254
|
+
rectangle,
|
|
1255
|
+
void 0,
|
|
1256
|
+
scratchBoundingRectangle
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
const outerPositions = outerRing;
|
|
1260
|
+
const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
|
|
1261
|
+
outerPositions,
|
|
1262
|
+
ellipsoid
|
|
1263
|
+
);
|
|
1264
|
+
return PolygonGeometryLibrary_default.computeBoundingRectangle(
|
|
1265
|
+
tangentPlane.plane.normal,
|
|
1266
|
+
tangentPlane.projectPointOntoPlane.bind(tangentPlane),
|
|
1267
|
+
outerPositions,
|
|
1268
|
+
stRotation,
|
|
1269
|
+
scratchBoundingRectangle
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
PolygonGeometry.createGeometry = function(polygonGeometry) {
|
|
1273
|
+
const vertexFormat = polygonGeometry._vertexFormat;
|
|
1274
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
|
1275
|
+
const granularity = polygonGeometry._granularity;
|
|
1276
|
+
const stRotation = polygonGeometry._stRotation;
|
|
1277
|
+
const polygonHierarchy = polygonGeometry._polygonHierarchy;
|
|
1278
|
+
const perPositionHeight = polygonGeometry._perPositionHeight;
|
|
1279
|
+
const closeTop = polygonGeometry._closeTop;
|
|
1280
|
+
const closeBottom = polygonGeometry._closeBottom;
|
|
1281
|
+
const arcType = polygonGeometry._arcType;
|
|
1282
|
+
const textureCoordinates = polygonGeometry._textureCoordinates;
|
|
1283
|
+
const hasTextureCoordinates = defined_default(textureCoordinates);
|
|
1284
|
+
const outerPositions = polygonHierarchy.positions;
|
|
1285
|
+
if (outerPositions.length < 3) {
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
1288
|
+
const rectangle = polygonGeometry.rectangle;
|
|
1289
|
+
const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
|
|
1290
|
+
polygonHierarchy,
|
|
1291
|
+
hasTextureCoordinates,
|
|
1292
|
+
createProjectTo2d(rectangle, outerPositions, ellipsoid),
|
|
1293
|
+
!perPositionHeight,
|
|
1294
|
+
ellipsoid,
|
|
1295
|
+
createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight)
|
|
1296
|
+
);
|
|
1297
|
+
const hierarchy = results.hierarchy;
|
|
1298
|
+
const polygons = results.polygons;
|
|
1299
|
+
const dummyFunction = function(identity) {
|
|
1300
|
+
return identity;
|
|
1301
|
+
};
|
|
1302
|
+
const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
|
|
1303
|
+
textureCoordinates,
|
|
1304
|
+
true,
|
|
1305
|
+
dummyFunction,
|
|
1306
|
+
false,
|
|
1307
|
+
ellipsoid
|
|
1308
|
+
).polygons : void 0;
|
|
1309
|
+
if (hierarchy.length === 0) {
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
const outerRing = hierarchy[0].outerRing;
|
|
1313
|
+
const boundingRectangle = computeBoundingRectangle(
|
|
1314
|
+
outerRing,
|
|
1315
|
+
rectangle,
|
|
1316
|
+
ellipsoid,
|
|
1317
|
+
stRotation
|
|
1318
|
+
);
|
|
1319
|
+
const geometries = [];
|
|
1320
|
+
const height = polygonGeometry._height;
|
|
1321
|
+
const extrudedHeight = polygonGeometry._extrudedHeight;
|
|
1322
|
+
const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
|
|
1323
|
+
const options = {
|
|
1324
|
+
perPositionHeight,
|
|
1325
|
+
vertexFormat,
|
|
1326
|
+
geometry: void 0,
|
|
1327
|
+
rotationAxis: getTangentPlane(rectangle, outerRing, ellipsoid).plane.normal,
|
|
1328
|
+
projectTo2d: createProjectPositionTo2d(rectangle, outerRing, ellipsoid),
|
|
1329
|
+
boundingRectangle,
|
|
1330
|
+
ellipsoid,
|
|
1331
|
+
stRotation,
|
|
1332
|
+
textureCoordinates: void 0,
|
|
1333
|
+
bottom: false,
|
|
1334
|
+
top: true,
|
|
1335
|
+
wall: false,
|
|
1336
|
+
extrude: false,
|
|
1337
|
+
arcType
|
|
1338
|
+
};
|
|
1339
|
+
let i;
|
|
1340
|
+
if (extrude) {
|
|
1341
|
+
options.extrude = true;
|
|
1342
|
+
options.top = closeTop;
|
|
1343
|
+
options.bottom = closeBottom;
|
|
1344
|
+
options.shadowVolume = polygonGeometry._shadowVolume;
|
|
1345
|
+
options.offsetAttribute = polygonGeometry._offsetAttribute;
|
|
1346
|
+
for (i = 0; i < polygons.length; i++) {
|
|
1347
|
+
const splitGeometry = createGeometryFromPositionsExtruded(
|
|
1348
|
+
ellipsoid,
|
|
1349
|
+
polygons[i],
|
|
1350
|
+
hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
|
|
1351
|
+
granularity,
|
|
1352
|
+
hierarchy[i],
|
|
1353
|
+
perPositionHeight,
|
|
1354
|
+
closeTop,
|
|
1355
|
+
closeBottom,
|
|
1356
|
+
vertexFormat,
|
|
1357
|
+
arcType
|
|
1358
|
+
);
|
|
1359
|
+
let topAndBottom;
|
|
1360
|
+
if (closeTop && closeBottom) {
|
|
1361
|
+
topAndBottom = splitGeometry.topAndBottom;
|
|
1362
|
+
options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
|
|
1363
|
+
topAndBottom.geometry,
|
|
1364
|
+
height,
|
|
1365
|
+
extrudedHeight,
|
|
1366
|
+
ellipsoid,
|
|
1367
|
+
perPositionHeight
|
|
1368
|
+
);
|
|
1369
|
+
} else if (closeTop) {
|
|
1370
|
+
topAndBottom = splitGeometry.topAndBottom;
|
|
1371
|
+
topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
1372
|
+
topAndBottom.geometry.attributes.position.values,
|
|
1373
|
+
height,
|
|
1374
|
+
ellipsoid,
|
|
1375
|
+
!perPositionHeight
|
|
1376
|
+
);
|
|
1377
|
+
options.geometry = topAndBottom.geometry;
|
|
1378
|
+
} else if (closeBottom) {
|
|
1379
|
+
topAndBottom = splitGeometry.topAndBottom;
|
|
1380
|
+
topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
1381
|
+
topAndBottom.geometry.attributes.position.values,
|
|
1382
|
+
extrudedHeight,
|
|
1383
|
+
ellipsoid,
|
|
1384
|
+
true
|
|
1385
|
+
);
|
|
1386
|
+
options.geometry = topAndBottom.geometry;
|
|
1387
|
+
}
|
|
1388
|
+
if (closeTop || closeBottom) {
|
|
1389
|
+
options.wall = false;
|
|
1390
|
+
topAndBottom.geometry = computeAttributes(options);
|
|
1391
|
+
geometries.push(topAndBottom);
|
|
1392
|
+
}
|
|
1393
|
+
const walls = splitGeometry.walls;
|
|
1394
|
+
options.wall = true;
|
|
1395
|
+
for (let k = 0; k < walls.length; k++) {
|
|
1396
|
+
const wall = walls[k];
|
|
1397
|
+
options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
|
|
1398
|
+
wall.geometry,
|
|
1399
|
+
height,
|
|
1400
|
+
extrudedHeight,
|
|
1401
|
+
ellipsoid,
|
|
1402
|
+
perPositionHeight
|
|
1403
|
+
);
|
|
1404
|
+
wall.geometry = computeAttributes(options);
|
|
1405
|
+
geometries.push(wall);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
} else {
|
|
1409
|
+
for (i = 0; i < polygons.length; i++) {
|
|
1410
|
+
const geometryInstance = new GeometryInstance_default({
|
|
1411
|
+
geometry: PolygonGeometryLibrary_default.createGeometryFromPositions(
|
|
1412
|
+
ellipsoid,
|
|
1413
|
+
polygons[i],
|
|
1414
|
+
hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
|
|
1415
|
+
granularity,
|
|
1416
|
+
perPositionHeight,
|
|
1417
|
+
vertexFormat,
|
|
1418
|
+
arcType
|
|
1419
|
+
)
|
|
1420
|
+
});
|
|
1421
|
+
geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
1422
|
+
geometryInstance.geometry.attributes.position.values,
|
|
1423
|
+
height,
|
|
1424
|
+
ellipsoid,
|
|
1425
|
+
!perPositionHeight
|
|
1426
|
+
);
|
|
1427
|
+
options.geometry = geometryInstance.geometry;
|
|
1428
|
+
geometryInstance.geometry = computeAttributes(options);
|
|
1429
|
+
if (defined_default(polygonGeometry._offsetAttribute)) {
|
|
1430
|
+
const length = geometryInstance.geometry.attributes.position.values.length;
|
|
1431
|
+
const offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
1432
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
1433
|
+
geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
|
|
1434
|
+
{
|
|
1435
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
1436
|
+
componentsPerAttribute: 1,
|
|
1437
|
+
values: applyOffset
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
}
|
|
1441
|
+
geometries.push(geometryInstance);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
|
|
1445
|
+
geometry.attributes.position.values = new Float64Array(
|
|
1446
|
+
geometry.attributes.position.values
|
|
1447
|
+
);
|
|
1448
|
+
geometry.indices = IndexDatatype_default.createTypedArray(
|
|
1449
|
+
geometry.attributes.position.values.length / 3,
|
|
1450
|
+
geometry.indices
|
|
1451
|
+
);
|
|
1452
|
+
const attributes = geometry.attributes;
|
|
1453
|
+
const boundingSphere = BoundingSphere_default.fromVertices(
|
|
1454
|
+
attributes.position.values
|
|
1455
|
+
);
|
|
1456
|
+
if (!vertexFormat.position) {
|
|
1457
|
+
delete attributes.position;
|
|
1458
|
+
}
|
|
1459
|
+
return new Geometry_default({
|
|
1460
|
+
attributes,
|
|
1461
|
+
indices: geometry.indices,
|
|
1462
|
+
primitiveType: geometry.primitiveType,
|
|
1463
|
+
boundingSphere,
|
|
1464
|
+
offsetAttribute: polygonGeometry._offsetAttribute
|
|
1465
|
+
});
|
|
1466
|
+
};
|
|
1467
|
+
PolygonGeometry.createShadowVolume = function(polygonGeometry, minHeightFunc, maxHeightFunc) {
|
|
1468
|
+
const granularity = polygonGeometry._granularity;
|
|
1469
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
|
1470
|
+
const minHeight = minHeightFunc(granularity, ellipsoid);
|
|
1471
|
+
const maxHeight = maxHeightFunc(granularity, ellipsoid);
|
|
1472
|
+
return new PolygonGeometry({
|
|
1473
|
+
polygonHierarchy: polygonGeometry._polygonHierarchy,
|
|
1474
|
+
ellipsoid,
|
|
1475
|
+
stRotation: polygonGeometry._stRotation,
|
|
1476
|
+
granularity,
|
|
1477
|
+
perPositionHeight: false,
|
|
1478
|
+
extrudedHeight: minHeight,
|
|
1479
|
+
height: maxHeight,
|
|
1480
|
+
vertexFormat: VertexFormat_default.POSITION_ONLY,
|
|
1481
|
+
shadowVolume: true,
|
|
1482
|
+
arcType: polygonGeometry._arcType
|
|
1483
|
+
});
|
|
1484
|
+
};
|
|
1485
|
+
function textureCoordinateRotationPoints(polygonGeometry) {
|
|
1486
|
+
const stRotation = -polygonGeometry._stRotation;
|
|
1487
|
+
if (stRotation === 0) {
|
|
1488
|
+
return [0, 0, 0, 1, 1, 0];
|
|
1489
|
+
}
|
|
1490
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
|
1491
|
+
const positions = polygonGeometry._polygonHierarchy.positions;
|
|
1492
|
+
const boundingRectangle = polygonGeometry.rectangle;
|
|
1493
|
+
return Geometry_default._textureCoordinateRotationPoints(
|
|
1494
|
+
positions,
|
|
1495
|
+
stRotation,
|
|
1496
|
+
ellipsoid,
|
|
1497
|
+
boundingRectangle
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
Object.defineProperties(PolygonGeometry.prototype, {
|
|
1501
|
+
/**
|
|
1502
|
+
* @private
|
|
1503
|
+
*/
|
|
1504
|
+
rectangle: {
|
|
1505
|
+
get: function() {
|
|
1506
|
+
if (!defined_default(this._rectangle)) {
|
|
1507
|
+
const positions = this._polygonHierarchy.positions;
|
|
1508
|
+
this._rectangle = PolygonGeometry.computeRectangleFromPositions(
|
|
1509
|
+
positions,
|
|
1510
|
+
this._ellipsoid,
|
|
1511
|
+
this._arcType
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
return this._rectangle;
|
|
1515
|
+
}
|
|
1516
|
+
},
|
|
1517
|
+
/**
|
|
1518
|
+
* For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
|
|
1519
|
+
* @private
|
|
1520
|
+
*/
|
|
1521
|
+
textureCoordinateRotationPoints: {
|
|
1522
|
+
get: function() {
|
|
1523
|
+
if (!defined_default(this._textureCoordinateRotationPoints)) {
|
|
1524
|
+
this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
|
|
1525
|
+
this
|
|
1526
|
+
);
|
|
1527
|
+
}
|
|
1528
|
+
return this._textureCoordinateRotationPoints;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
var PolygonGeometry_default = PolygonGeometry;
|
|
1533
|
+
|
|
1534
|
+
// packages/engine/Source/Workers/createPolygonGeometry.js
|
|
1535
|
+
function createPolygonGeometry(polygonGeometry, offset) {
|
|
1536
|
+
if (defined_default(offset)) {
|
|
1537
|
+
polygonGeometry = PolygonGeometry_default.unpack(polygonGeometry, offset);
|
|
1538
|
+
}
|
|
1539
|
+
polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
|
|
1540
|
+
return PolygonGeometry_default.createGeometry(polygonGeometry);
|
|
1541
|
+
}
|
|
1542
|
+
var createPolygonGeometry_default = createPolygonGeometry;
|
|
1543
|
+
export {
|
|
1544
|
+
createPolygonGeometry_default as default
|
|
1545
|
+
};
|