@vcmap/ui 5.0.0-rc.6 → 5.0.0-rc.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 +72 -22
- package/build/build.js +0 -3
- package/build/buildHelpers.js +0 -1
- package/build/commonViteConfig.js +1 -1
- package/config/aerowest.config.json +2 -1
- package/config/base.config.json +7 -7
- package/config/dev.config.json +4 -4
- package/dist/assets/cesium/Workers/{AttributeCompression-27507afe.js → AttributeCompression-80665726.js} +1 -1
- package/dist/assets/cesium/Workers/{AxisAlignedBoundingBox-7565c1e8.js → AxisAlignedBoundingBox-a655a4bc.js} +1 -1
- package/dist/assets/cesium/Workers/{BoundingRectangle-9d707275.js → BoundingRectangle-c3b79029.js} +1 -1
- package/dist/assets/cesium/Workers/{BoxGeometry-fb31d3b5.js → BoxGeometry-f8f9c981.js} +1 -1
- package/dist/assets/cesium/Workers/{Color-56bb5728.js → Color-de06a177.js} +1 -1
- package/dist/assets/cesium/Workers/{CoplanarPolygonGeometryLibrary-72143c19.js → CoplanarPolygonGeometryLibrary-48cdc26d.js} +1 -1
- package/dist/assets/cesium/Workers/{CorridorGeometryLibrary-7bae1712.js → CorridorGeometryLibrary-ddc027d3.js} +1 -1
- package/dist/assets/cesium/Workers/{CylinderGeometry-331891fe.js → CylinderGeometry-82a8cbe6.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseGeometry-5e3f67b6.js → EllipseGeometry-32d55454.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseGeometryLibrary-dbc15162.js → EllipseGeometryLibrary-b2ae188a.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipseOutlineGeometry-21191fce.js → EllipseOutlineGeometry-f05a5a27.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidGeodesic-cc3bace8.js → EllipsoidGeodesic-19e75e11.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidGeometry-8bfa24a9.js → EllipsoidGeometry-7c99fc81.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidOutlineGeometry-48d9c023.js → EllipsoidOutlineGeometry-21c243df.js} +1 -1
- package/dist/assets/cesium/Workers/{EllipsoidRhumbLine-125a8b72.js → EllipsoidRhumbLine-6145377b.js} +1 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +1 -0
- package/dist/assets/cesium/Workers/{EncodedCartesian3-96fdc0ef.js → EncodedCartesian3-d9f5c4a4.js} +1 -1
- package/dist/assets/cesium/Workers/{FrustumGeometry-9ab86004.js → FrustumGeometry-17776af8.js} +1 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +1 -0
- package/dist/assets/cesium/Workers/{GeometryInstance-13e4ff38.js → GeometryInstance-4fbf16ba.js} +1 -1
- package/dist/assets/cesium/Workers/{GeometryPipeline-e0eb4567.js → GeometryPipeline-309fad76.js} +1 -1
- package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +1 -0
- package/dist/assets/cesium/Workers/{Matrix2-37e55508.js → Matrix2-47e98d76.js} +0 -0
- package/dist/assets/cesium/Workers/{OrientedBoundingBox-e9c07538.js → OrientedBoundingBox-fcb5b750.js} +1 -1
- package/dist/assets/cesium/Workers/{Plane-6ee42cab.js → Plane-3f01019d.js} +1 -1
- package/dist/assets/cesium/Workers/{PolygonGeometryLibrary-b408c688.js → PolygonGeometryLibrary-0b29eb16.js} +1 -1
- package/dist/assets/cesium/Workers/{PolygonPipeline-7b8e4643.js → PolygonPipeline-a934c4dd.js} +1 -1
- package/dist/assets/cesium/Workers/{PolylinePipeline-6757400c.js → PolylinePipeline-8095c9bc.js} +1 -1
- package/dist/assets/cesium/Workers/{PolylineVolumeGeometryLibrary-eb972210.js → PolylineVolumeGeometryLibrary-67d12fff.js} +1 -1
- package/dist/assets/cesium/Workers/{PrimitivePipeline-f244975e.js → PrimitivePipeline-980e44c5.js} +1 -1
- package/dist/assets/cesium/Workers/{RectangleGeometryLibrary-1bd6152a.js → RectangleGeometryLibrary-621c6de8.js} +1 -1
- package/dist/assets/cesium/Workers/{TerrainEncoding-5a21a97f.js → TerrainEncoding-f96552d5.js} +1 -1
- package/dist/assets/cesium/Workers/{Transforms-eb5c1a84.js → Transforms-c8cb8f43.js} +3 -3
- package/dist/assets/cesium/Workers/{WallGeometryLibrary-a6b6a368.js → WallGeometryLibrary-c03d8479.js} +1 -1
- package/dist/assets/cesium/Workers/{WebMercatorProjection-2839e524.js → WebMercatorProjection-79b3214e.js} +1 -1
- package/dist/assets/cesium/Workers/combineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createBoxGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCircleGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSphereGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +1 -1
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +1 -1
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
- package/dist/assets/cesium/Workers/createWallGeometry.js +1 -1
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +1 -1
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/dist/assets/{cesium.fba8ca.js → cesium.4e40f4.js} +955 -968
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/core.edcf5e.js +4 -0
- package/dist/assets/core.js +1 -1
- package/dist/assets/{index.6a83278e.js → index.889d0f3a.js} +1 -1
- package/dist/assets/{ol.abea3a.js → ol.246fd4.js} +0 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.df4f6d.css +1 -0
- package/dist/assets/ui.df4f6d.js +43 -0
- package/dist/assets/ui.js +1 -1
- package/dist/assets/{vue-composition-api.7051d7.js → vue-composition-api.a520f3.js} +1 -1
- package/dist/assets/vue-composition-api.js +2 -2
- package/dist/assets/{vue.9fd7f6.js → vue.2cee44.js} +0 -0
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify.33dafc.css → vuetify.cc817b.css} +1 -1
- package/dist/assets/{vuetify.33dafc.js → vuetify.cc817b.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +96 -6
- package/package.json +3 -4
- package/plugins/@vcmap/pluginExample/index.js +5 -5
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +1 -1
- package/plugins/@vcmap/project-selector/ContextsListComponent.vue +1 -1
- package/plugins/@vcmap/project-selector/index.js +5 -5
- package/plugins/@vcmap/project-selector/package.json +1 -2
- package/plugins/@vcmap/theme-changer/index.js +6 -6
- package/plugins/buttonExamples/ButtonExamples.vue +1 -1
- package/plugins/buttonExamples/index.js +5 -4
- package/plugins/categoryTest/Categories.vue +1 -1
- package/plugins/categoryTest/Category.vue +1 -1
- package/plugins/categoryTest/index.js +5 -5
- package/plugins/example/index.js +33 -14
- package/plugins/test/allIconsComponent.vue +34 -0
- package/plugins/test/editor.vue +1 -1
- package/plugins/test/index.js +40 -17
- package/plugins/test/toolbox-data.js +106 -26
- package/plugins/test/windowManagerExample.vue +1 -2
- package/src/actions/actionHelper.js +41 -1
- package/src/actions/styleSelector.vue +1 -1
- package/src/application/Navbar.vue +47 -6
- package/src/application/VcsApp.vue +37 -29
- package/src/application/VcsMap.vue +1 -20
- package/src/assets/logo-mobile.svg +9 -0
- package/src/assets/logo.svg +23 -23
- package/src/components/buttons/VcsActionButtonList.vue +99 -0
- package/src/components/buttons/VcsButton.vue +201 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +73 -0
- package/src/components/form-inputs-controls/VcsColorPicker.vue +81 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +46 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +38 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +97 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +130 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +129 -0
- package/src/components/form-output/VcsFormattedNumber.vue +103 -0
- package/src/components/lists/VcsActionList.vue +100 -0
- package/src/components/lists/VcsTreeview.vue +109 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +105 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +156 -0
- package/src/components/notification/VcsBadge.vue +27 -0
- package/src/components/notification/VcsTooltip.vue +154 -0
- package/src/components/notification/validation.js +19 -0
- package/src/contentTree/LayerTree.vue +1 -1
- package/src/contentTree/contentTreeCollection.js +6 -2
- package/src/icons/+all.js +359 -0
- package/src/icons/2DAreaIcon.vue +21 -0
- package/src/icons/2DDistanceIcon.vue +18 -0
- package/src/icons/3DAreaIcon.vue +21 -0
- package/src/icons/3DDistanceIcon.vue +18 -0
- package/src/icons/3DHeightIcon.vue +18 -0
- package/src/icons/AngleIcon.vue +8 -0
- package/src/icons/AssociationsIcon.vue +34 -0
- package/src/icons/AxisIcon.vue +10 -0
- package/src/icons/BoundingBoxIcon.vue +15 -0
- package/src/icons/CheckboxCheckedIcon.vue +16 -0
- package/src/icons/CheckboxIcon.vue +23 -0
- package/src/icons/CheckboxIndeterminateIcon.vue +24 -0
- package/src/icons/CircleIcon.vue +10 -0
- package/src/icons/ColorSwatchIcon.vue +17 -0
- package/src/icons/CommentIcon.vue +19 -0
- package/src/icons/CompassIcon.vue +8 -0
- package/src/icons/ComponentsIcon.vue +7 -0
- package/src/icons/ConeIcon.vue +11 -0
- package/src/icons/DimensionsHouseIcon.vue +14 -0
- package/src/icons/ElevationProfileIcon.vue +111 -0
- package/src/icons/ExportAreaIcon.vue +7 -0
- package/src/icons/ExportFlightIcon.vue +7 -0
- package/src/icons/ExportIcon.vue +8 -0
- package/src/icons/ExternalLinkIcon.vue +10 -0
- package/src/icons/EyeIcon.vue +7 -0
- package/src/icons/FastForwardIcon.vue +7 -0
- package/src/icons/FilterIcon.vue +8 -0
- package/src/icons/GlobeNatureIcon.vue +14 -0
- package/src/icons/HealthCareIndustriesIcon.vue +118 -0
- package/src/icons/HelpIcon.vue +7 -0
- package/src/icons/HomePointIcon.vue +8 -0
- package/src/icons/HospitalsIcon.vue +237 -0
- package/src/icons/HouseIcon.vue +25 -0
- package/src/icons/ImportIcon.vue +8 -0
- package/src/icons/InfoIcon.vue +10 -0
- package/src/icons/KebabIcon.vue +36 -0
- package/src/icons/LabelIcon.vue +7 -0
- package/src/icons/LayersIcon.vue +26 -0
- package/src/icons/LegendIcon.vue +65 -0
- package/src/icons/LineIcon.vue +7 -0
- package/src/icons/LinkIcon.vue +7 -0
- package/src/icons/MapIcon.vue +8 -0
- package/src/icons/MenuIcon.vue +34 -0
- package/src/icons/MinusIcon.vue +8 -0
- package/src/icons/ObjectAttributeIcon.vue +18 -0
- package/src/icons/ObjectSelectIcon.vue +8 -0
- package/src/icons/ObliqueViewIcon.vue +13 -0
- package/src/icons/PdfIcon.vue +10 -0
- package/src/icons/PedestrianIcon.vue +8 -0
- package/src/icons/PenIcon.vue +14 -0
- package/src/icons/PlayCircleIcon.vue +10 -0
- package/src/icons/PlusIcon.vue +9 -0
- package/src/icons/PoiIcon.vue +7 -0
- package/src/icons/PointSelectIcon.vue +7 -0
- package/src/icons/PolygonIcon.vue +38 -0
- package/src/icons/PresentationModeIcon.vue +7 -0
- package/src/icons/ProgressIcon.vue +24 -0
- package/src/icons/QueryIcon.vue +15 -0
- package/src/icons/RectangleIcon.vue +9 -0
- package/src/icons/ReturnIcon.vue +7 -0
- package/src/icons/RewindIcon.vue +6 -0
- package/src/icons/SearchIcon.vue +8 -0
- package/src/icons/ShadowIcon.vue +9 -0
- package/src/icons/ShapesIcon.vue +28 -0
- package/src/icons/ShareIcon.vue +22 -0
- package/src/icons/SimpleCircleFilledIcon.vue +15 -0
- package/src/icons/SimpleCircleHalfFilledIcon.vue +12 -0
- package/src/icons/SimpleCircleOutlinedIcon.vue +15 -0
- package/src/icons/SkipNextIcon.vue +7 -0
- package/src/icons/SkipPreviousIcon.vue +9 -0
- package/src/icons/SplitViewIcon.vue +19 -0
- package/src/icons/TextStyleIcon.vue +14 -0
- package/src/icons/ThreeDimensionsIcon.vue +7 -0
- package/src/icons/ToolsIcon.vue +35 -0
- package/src/icons/TouchIcon.vue +8 -0
- package/src/icons/TrashCanIcon.vue +7 -0
- package/src/icons/TriangleIcon.vue +15 -0
- package/src/icons/TwoDimensionsIcon.vue +8 -0
- package/src/icons/UploadIcon.vue +14 -0
- package/src/icons/VideoRecorderIcon.vue +14 -0
- package/src/icons/WalkingIcon.vue +7 -0
- package/src/icons/WallIcon.vue +14 -0
- package/src/manager/buttonManager.js +5 -52
- package/src/manager/navbarManager.js +81 -0
- package/src/manager/toolbox/ToolboxGroupComponent.vue +128 -0
- package/src/manager/toolbox/ToolboxManager.vue +119 -76
- package/src/manager/toolbox/toolboxManager.js +204 -0
- package/src/manager/window/WindowComponent.vue +27 -20
- package/src/manager/window/WindowComponentHeader.vue +13 -6
- package/src/manager/window/WindowManager.vue +18 -1
- package/src/manager/window/windowManager.js +3 -5
- package/src/navigation/mapNavigation.vue +34 -5
- package/src/navigation/orientationToolsButton.vue +1 -1
- package/src/navigation/overviewMap.js +616 -0
- package/src/navigation/overviewMapClickedInteraction.js +38 -0
- package/src/navigation/tiltSlider.vue +1 -1
- package/src/styles/_theming.scss +10 -0
- package/src/styles/main.scss +3 -0
- package/src/styles/variables.scss +70 -0
- package/src/styles/vcsFont.scss +5 -0
- package/src/styles/vcsGrid.scss +4 -0
- package/src/vcsUiApp.js +18 -3
- package/src/vuePlugins/vuetify.js +1 -1
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-678e34e4.js +0 -1
- package/dist/assets/cesium/Workers/GeometryAttribute-3915ea0b.js +0 -1
- package/dist/assets/cesium/Workers/IntersectionTests-ac2459de.js +0 -1
- package/dist/assets/core.d5ed0f.js +0 -4
- package/dist/assets/ui.ad1ec9.css +0 -1
- package/dist/assets/ui.ad1ec9.js +0 -39
- package/dist/assets/uicomponents.161461.css +0 -1
- package/dist/assets/uicomponents.161461.js +0 -31
- package/dist/assets/uicomponents.js +0 -1
- package/lib/uicomponents.js +0 -1
- package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
- package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
- package/src/manager/toolbox/toolbox-manager.js +0 -203
package/dist/assets/cesium/Workers/{EllipsoidGeodesic-cc3bace8.js → EllipsoidGeodesic-19e75e11.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Matrix2-
|
1
|
+
define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19"],(function(t,a,i,n,e){"use strict";function s(t,a,i,n,e,s,o){const r=function(t,a){return t*a*(4+t*(4-3*a))/16}(t,i);return(1-r)*t*a*(n+r*e*(o+r*s*(2*o*o-1)))}const o=new a.Cartesian3,r=new a.Cartesian3;function h(t,i,n,h){a.Cartesian3.normalize(h.cartographicToCartesian(i,r),o),a.Cartesian3.normalize(h.cartographicToCartesian(n,r),r),function(t,a,i,n,o,r,h){const c=(a-i)/a,d=r-n,u=Math.atan((1-c)*Math.tan(o)),l=Math.atan((1-c)*Math.tan(h)),M=Math.cos(u),g=Math.sin(u),p=Math.cos(l),_=Math.sin(l),f=M*p,m=M*_,C=g*_,H=g*p;let v,O,S,q,U,A=d,R=e.CesiumMath.TWO_PI,w=Math.cos(A),b=Math.sin(A);do{w=Math.cos(A),b=Math.sin(A);const t=m-H*w;let a;S=Math.sqrt(p*p*b*b+t*t),O=C+f*w,v=Math.atan2(S,O),0===S?(a=0,q=1):(a=f*b/S,q=1-a*a),R=A,U=O-2*C/q,isFinite(U)||(U=0),A=d+s(c,a,q,v,S,O,U)}while(Math.abs(A-R)>e.CesiumMath.EPSILON12);const y=q*(a*a-i*i)/(i*i),E=y*(256+y*(y*(74-47*y)-128))/1024,x=U*U,D=i*(1+y*(4096+y*(y*(320-175*y)-768))/16384)*(v-E*S*(U+E*(O*(2*x-1)-E*U*(4*S*S-3)*(4*x-3)/6)/4)),P=Math.atan2(p*b,m-H*w),T=Math.atan2(M*b,m*w-H);t._distance=D,t._startHeading=P,t._endHeading=T,t._uSquared=y}(t,h.maximumRadius,h.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),t._start=a.Cartographic.clone(i,t._start),t._end=a.Cartographic.clone(n,t._end),t._start.height=0,t._end.height=0,function(t){const a=t._uSquared,i=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,e=(i-n)/i,s=Math.cos(t._startHeading),o=Math.sin(t._startHeading),r=(1-e)*Math.tan(t._start.latitude),h=1/Math.sqrt(1+r*r),c=h*r,d=Math.atan2(r,s),u=h*o,l=u*u,M=1-l,g=Math.sqrt(M),p=a/4,_=p*p,f=_*p,m=_*_,C=1+p-3*_/4+5*f/4-175*m/64,H=1-p+15*_/8-35*f/8,v=1-3*p+35*_/4,O=1-5*p,S=C*d-H*Math.sin(2*d)*p/2-v*Math.sin(4*d)*_/16-O*Math.sin(6*d)*f/48-5*Math.sin(8*d)*m/512,q=t._constants;q.a=i,q.b=n,q.f=e,q.cosineHeading=s,q.sineHeading=o,q.tanU=r,q.cosineU=h,q.sineU=c,q.sigma=d,q.sineAlpha=u,q.sineSquaredAlpha=l,q.cosineSquaredAlpha=M,q.cosineAlpha=g,q.u2Over4=p,q.u4Over16=_,q.u6Over64=f,q.u8Over256=m,q.a0=C,q.a1=H,q.a2=v,q.a3=O,q.distanceRatio=S}(t)}function c(t,i,e){const s=n.defaultValue(e,a.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new a.Cartographic,this._end=new a.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n.defined(t)&&n.defined(i)&&h(this,t,i,s)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),c.prototype.setEndPoints=function(t,a){h(this,t,a,this._ellipsoid)},c.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},c.prototype.interpolateUsingSurfaceDistance=function(t,i){const e=this._constants,o=e.distanceRatio+t/e.b,r=Math.cos(2*o),h=Math.cos(4*o),c=Math.cos(6*o),d=Math.sin(2*o),u=Math.sin(4*o),l=Math.sin(6*o),M=Math.sin(8*o),g=o*o,p=o*g,_=e.u8Over256,f=e.u2Over4,m=e.u6Over64,C=e.u4Over16;let H=2*p*_*r/3+o*(1-f+7*C/4-15*m/4+579*_/64-(C-15*m/4+187*_/16)*r-(5*m/4-115*_/16)*h-29*_*c/16)+(f/2-C+71*m/32-85*_/16)*d+(5*C/16-5*m/4+383*_/96)*u-g*((m-11*_/2)*d+5*_*u/2)+(29*m/96-29*_/16)*l+539*_*M/1536;const v=Math.asin(Math.sin(H)*e.cosineAlpha),O=Math.atan(e.a/e.b*Math.tan(v));H-=e.sigma;const S=Math.cos(2*e.sigma+H),q=Math.sin(H),U=Math.cos(H),A=e.cosineU*U,R=e.sineU*q,w=Math.atan2(q*e.sineHeading,A-R*e.cosineHeading)-s(e.f,e.sineAlpha,e.cosineSquaredAlpha,H,q,U,S);return n.defined(i)?(i.longitude=this._start.longitude+w,i.latitude=O,i.height=0,i):new a.Cartographic(this._start.longitude+w,O,0)},t.EllipsoidGeodesic=c}));
|
package/dist/assets/cesium/Workers/{EllipsoidGeometry-8bfa24a9.js → EllipsoidGeometry-7c99fc81.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./GeometryOffsetAttribute-8c5e10db","./Transforms-
|
1
|
+
define(["exports","./GeometryOffsetAttribute-8c5e10db","./Transforms-c8cb8f43","./Matrix2-47e98d76","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./RuntimeError-8952249c","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./IndexDatatype-f1dcdf35","./VertexFormat-a0b706b0"],(function(t,e,a,n,i,r,o,s,m,u,c){"use strict";const l=new n.Cartesian3,f=new n.Cartesian3,d=new n.Cartesian3,C=new n.Cartesian3,p=new n.Cartesian3,y=new n.Cartesian3(1,1,1),_=Math.cos,h=Math.sin;function x(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT);const e=r.defaultValue(t.radii,y),a=r.defaultValue(t.innerRadii,e),o=r.defaultValue(t.minimumClock,0),s=r.defaultValue(t.maximumClock,i.CesiumMath.TWO_PI),m=r.defaultValue(t.minimumCone,0),u=r.defaultValue(t.maximumCone,i.CesiumMath.PI),l=Math.round(r.defaultValue(t.stackPartitions,64)),f=Math.round(r.defaultValue(t.slicePartitions,64)),d=r.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._radii=n.Cartesian3.clone(e),this._innerRadii=n.Cartesian3.clone(a),this._minimumClock=o,this._maximumClock=s,this._minimumCone=m,this._maximumCone=u,this._stackPartitions=l,this._slicePartitions=f,this._vertexFormat=c.VertexFormat.clone(d),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*n.Cartesian3.packedLength+c.VertexFormat.packedLength+7,x.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._radii,e,a),a+=n.Cartesian3.packedLength,n.Cartesian3.pack(t._innerRadii,e,a),a+=n.Cartesian3.packedLength,c.VertexFormat.pack(t._vertexFormat,e,a),a+=c.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=r.defaultValue(t._offsetAttribute,-1),e};const A=new n.Cartesian3,b=new n.Cartesian3,k=new c.VertexFormat,w={radii:A,innerRadii:b,vertexFormat:k,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let F;x.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,A);e+=n.Cartesian3.packedLength;const o=n.Cartesian3.unpack(t,e,b);e+=n.Cartesian3.packedLength;const s=c.VertexFormat.unpack(t,e,k);e+=c.VertexFormat.packedLength;const m=t[e++],u=t[e++],l=t[e++],f=t[e++],d=t[e++],C=t[e++],p=t[e];return r.defined(a)?(a._radii=n.Cartesian3.clone(i,a._radii),a._innerRadii=n.Cartesian3.clone(o,a._innerRadii),a._vertexFormat=c.VertexFormat.clone(s,a._vertexFormat),a._minimumClock=m,a._maximumClock=u,a._minimumCone=l,a._maximumCone=f,a._stackPartitions=d,a._slicePartitions=C,a._offsetAttribute=-1===p?void 0:p,a):(w.minimumClock=m,w.maximumClock=u,w.minimumCone=l,w.maximumCone=f,w.stackPartitions=d,w.slicePartitions=C,w.offsetAttribute=-1===p?void 0:p,new x(w))},x.createGeometry=function(t){const o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;const c=t._innerRadii;if(c.x<=0||c.y<=0||c.z<=0)return;const y=t._minimumClock,x=t._maximumClock,A=t._minimumCone,b=t._maximumCone,k=t._vertexFormat;let w,F,P=t._slicePartitions+1,g=t._stackPartitions+1;P=Math.round(P*Math.abs(x-y)/i.CesiumMath.TWO_PI),g=Math.round(g*Math.abs(b-A)/i.CesiumMath.PI),P<2&&(P=2),g<2&&(g=2);let v=0;const V=[A],M=[y];for(w=0;w<g;w++)V.push(A+w*(b-A)/(g-1));for(V.push(b),F=0;F<P;F++)M.push(y+F*(x-y)/(P-1));M.push(x);const T=V.length,D=M.length;let G=0,L=1;const O=c.x!==o.x||c.y!==o.y||c.z!==o.z;let I=!1,E=!1,z=!1;O&&(L=2,A>0&&(I=!0,G+=P-1),b<Math.PI&&(E=!0,G+=P-1),(x-y)%i.CesiumMath.TWO_PI?(z=!0,G+=2*(g-1)+1):G+=1);const N=D*T*L,R=new Float64Array(3*N),U=e.arrayFill(new Array(N),!1),S=e.arrayFill(new Array(N),!1),B=P*g*L,W=6*(B+G+1-(P+g)*L),Y=u.IndexDatatype.createTypedArray(B,W),J=k.normal?new Float32Array(3*N):void 0,X=k.tangent?new Float32Array(3*N):void 0,Z=k.bitangent?new Float32Array(3*N):void 0,j=k.st?new Float32Array(2*N):void 0,q=new Array(T),H=new Array(T);for(w=0;w<T;w++)q[w]=h(V[w]),H[w]=_(V[w]);const K=new Array(D),Q=new Array(D);for(F=0;F<D;F++)Q[F]=_(M[F]),K[F]=h(M[F]);for(w=0;w<T;w++)for(F=0;F<D;F++)R[v++]=o.x*q[w]*Q[F],R[v++]=o.y*q[w]*K[F],R[v++]=o.z*H[w];let $,tt,et,at,nt=N/2;if(O)for(w=0;w<T;w++)for(F=0;F<D;F++)R[v++]=c.x*q[w]*Q[F],R[v++]=c.y*q[w]*K[F],R[v++]=c.z*H[w],U[nt]=!0,w>0&&w!==T-1&&0!==F&&F!==D-1&&(S[nt]=!0),nt++;for(v=0,w=1;w<T-2;w++)for($=w*D,tt=(w+1)*D,F=1;F<D-2;F++)Y[v++]=tt+F,Y[v++]=tt+F+1,Y[v++]=$+F+1,Y[v++]=tt+F,Y[v++]=$+F+1,Y[v++]=$+F;if(O){const t=T*D;for(w=1;w<T-2;w++)for($=t+w*D,tt=t+(w+1)*D,F=1;F<D-2;F++)Y[v++]=tt+F,Y[v++]=$+F,Y[v++]=$+F+1,Y[v++]=tt+F,Y[v++]=$+F+1,Y[v++]=tt+F+1}if(O){if(I)for(at=T*D,w=1;w<D-2;w++)Y[v++]=w,Y[v++]=w+1,Y[v++]=at+w+1,Y[v++]=w,Y[v++]=at+w+1,Y[v++]=at+w;if(E)for(et=T*D-D,at=T*D*L-D,w=1;w<D-2;w++)Y[v++]=et+w+1,Y[v++]=et+w,Y[v++]=at+w,Y[v++]=et+w+1,Y[v++]=at+w,Y[v++]=at+w+1}if(z){for(w=1;w<T-2;w++)at=D*T+D*w,et=D*w,Y[v++]=at,Y[v++]=et+D,Y[v++]=et,Y[v++]=at,Y[v++]=at+D,Y[v++]=et+D;for(w=1;w<T-2;w++)at=D*T+D*(w+1)-1,et=D*(w+1)-1,Y[v++]=et+D,Y[v++]=at,Y[v++]=et,Y[v++]=et+D,Y[v++]=at+D,Y[v++]=at}const it=new m.GeometryAttributes;k.position&&(it.position=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:R}));let rt=0,ot=0,st=0,mt=0;const ut=N/2;let ct;const lt=n.Ellipsoid.fromCartesian3(o),ft=n.Ellipsoid.fromCartesian3(c);if(k.st||k.normal||k.tangent||k.bitangent){for(w=0;w<N;w++){ct=U[w]?ft:lt;const t=n.Cartesian3.fromArray(R,3*w,l),e=ct.geodeticSurfaceNormal(t,f);if(S[w]&&n.Cartesian3.negate(e,e),k.st){const t=n.Cartesian2.negate(e,p);j[rt++]=Math.atan2(t.y,t.x)/i.CesiumMath.TWO_PI+.5,j[rt++]=Math.asin(e.z)/Math.PI+.5}if(k.normal&&(J[ot++]=e.x,J[ot++]=e.y,J[ot++]=e.z),k.tangent||k.bitangent){const t=d;let a,i=0;if(U[w]&&(i=ut),a=!I&&w>=i&&w<i+2*D?n.Cartesian3.UNIT_X:n.Cartesian3.UNIT_Z,n.Cartesian3.cross(a,e,t),n.Cartesian3.normalize(t,t),k.tangent&&(X[st++]=t.x,X[st++]=t.y,X[st++]=t.z),k.bitangent){const a=n.Cartesian3.cross(e,t,C);n.Cartesian3.normalize(a,a),Z[mt++]=a.x,Z[mt++]=a.y,Z[mt++]=a.z}}}k.st&&(it.st=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:j})),k.normal&&(it.normal=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:J})),k.tangent&&(it.tangent=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:X})),k.bitangent&&(it.bitangent=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:Z}))}if(r.defined(t._offsetAttribute)){const a=R.length,n=new Uint8Array(a/3),r=t._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(n,r),it.applyOffset=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new s.Geometry({attributes:it,indices:Y,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:a.BoundingSphere.fromEllipsoid(lt),offsetAttribute:t._offsetAttribute})},x.getUnitEllipsoid=function(){return r.defined(F)||(F=x.createGeometry(new x({radii:new n.Cartesian3(1,1,1),vertexFormat:c.VertexFormat.POSITION_ONLY}))),F},t.EllipsoidGeometry=x}));
|
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./GeometryOffsetAttribute-8c5e10db","./Transforms-
|
1
|
+
define(["exports","./GeometryOffsetAttribute-8c5e10db","./Transforms-c8cb8f43","./Matrix2-47e98d76","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./RuntimeError-8952249c","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./IndexDatatype-f1dcdf35"],(function(t,i,e,n,a,o,r,s,u,m){"use strict";const f=new n.Cartesian3(1,1,1),c=Math.cos,l=Math.sin;function d(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT);const i=o.defaultValue(t.radii,f),e=o.defaultValue(t.innerRadii,i),r=o.defaultValue(t.minimumClock,0),s=o.defaultValue(t.maximumClock,a.CesiumMath.TWO_PI),u=o.defaultValue(t.minimumCone,0),m=o.defaultValue(t.maximumCone,a.CesiumMath.PI),c=Math.round(o.defaultValue(t.stackPartitions,10)),l=Math.round(o.defaultValue(t.slicePartitions,8)),d=Math.round(o.defaultValue(t.subdivisions,128));this._radii=n.Cartesian3.clone(i),this._innerRadii=n.Cartesian3.clone(e),this._minimumClock=r,this._maximumClock=s,this._minimumCone=u,this._maximumCone=m,this._stackPartitions=c,this._slicePartitions=l,this._subdivisions=d,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}d.packedLength=2*n.Cartesian3.packedLength+8,d.pack=function(t,i,e){return e=o.defaultValue(e,0),n.Cartesian3.pack(t._radii,i,e),e+=n.Cartesian3.packedLength,n.Cartesian3.pack(t._innerRadii,i,e),e+=n.Cartesian3.packedLength,i[e++]=t._minimumClock,i[e++]=t._maximumClock,i[e++]=t._minimumCone,i[e++]=t._maximumCone,i[e++]=t._stackPartitions,i[e++]=t._slicePartitions,i[e++]=t._subdivisions,i[e]=o.defaultValue(t._offsetAttribute,-1),i};const C=new n.Cartesian3,_=new n.Cartesian3,p={radii:C,innerRadii:_,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};d.unpack=function(t,i,e){i=o.defaultValue(i,0);const a=n.Cartesian3.unpack(t,i,C);i+=n.Cartesian3.packedLength;const r=n.Cartesian3.unpack(t,i,_);i+=n.Cartesian3.packedLength;const s=t[i++],u=t[i++],m=t[i++],f=t[i++],c=t[i++],l=t[i++],h=t[i++],y=t[i];return o.defined(e)?(e._radii=n.Cartesian3.clone(a,e._radii),e._innerRadii=n.Cartesian3.clone(r,e._innerRadii),e._minimumClock=s,e._maximumClock=u,e._minimumCone=m,e._maximumCone=f,e._stackPartitions=c,e._slicePartitions=l,e._subdivisions=h,e._offsetAttribute=-1===y?void 0:y,e):(p.minimumClock=s,p.maximumClock=u,p.minimumCone=m,p.maximumCone=f,p.stackPartitions=c,p.slicePartitions=l,p.subdivisions=h,p.offsetAttribute=-1===y?void 0:y,new d(p))},d.createGeometry=function(t){const r=t._radii;if(r.x<=0||r.y<=0||r.z<=0)return;const f=t._innerRadii;if(f.x<=0||f.y<=0||f.z<=0)return;const d=t._minimumClock,C=t._maximumClock,_=t._minimumCone,p=t._maximumCone,h=t._subdivisions,y=n.Ellipsoid.fromCartesian3(r);let b=t._slicePartitions+1,k=t._stackPartitions+1;b=Math.round(b*Math.abs(C-d)/a.CesiumMath.TWO_PI),k=Math.round(k*Math.abs(p-_)/a.CesiumMath.PI),b<2&&(b=2),k<2&&(k=2);let x=0,A=1;const P=f.x!==r.x||f.y!==r.y||f.z!==r.z;let v=!1,M=!1;P&&(A=2,_>0&&(v=!0,x+=b),p<Math.PI&&(M=!0,x+=b));const w=h*A*(k+b),V=new Float64Array(3*w),g=2*(w+x-(b+k)*A),E=m.IndexDatatype.createTypedArray(w,g);let G,O,D,I,T=0;const z=new Array(k),L=new Array(k);for(G=0;G<k;G++)I=_+G*(p-_)/(k-1),z[G]=l(I),L[G]=c(I);const R=new Array(h),N=new Array(h);for(G=0;G<h;G++)D=d+G*(C-d)/(h-1),R[G]=l(D),N[G]=c(D);for(G=0;G<k;G++)for(O=0;O<h;O++)V[T++]=r.x*z[G]*N[O],V[T++]=r.y*z[G]*R[O],V[T++]=r.z*L[G];if(P)for(G=0;G<k;G++)for(O=0;O<h;O++)V[T++]=f.x*z[G]*N[O],V[T++]=f.y*z[G]*R[O],V[T++]=f.z*L[G];for(z.length=h,L.length=h,G=0;G<h;G++)I=_+G*(p-_)/(h-1),z[G]=l(I),L[G]=c(I);for(R.length=b,N.length=b,G=0;G<b;G++)D=d+G*(C-d)/(b-1),R[G]=l(D),N[G]=c(D);for(G=0;G<h;G++)for(O=0;O<b;O++)V[T++]=r.x*z[G]*N[O],V[T++]=r.y*z[G]*R[O],V[T++]=r.z*L[G];if(P)for(G=0;G<h;G++)for(O=0;O<b;O++)V[T++]=f.x*z[G]*N[O],V[T++]=f.y*z[G]*R[O],V[T++]=f.z*L[G];for(T=0,G=0;G<k*A;G++){const t=G*h;for(O=0;O<h-1;O++)E[T++]=t+O,E[T++]=t+O+1}let B=k*h*A;for(G=0;G<b;G++)for(O=0;O<h-1;O++)E[T++]=B+G+O*b,E[T++]=B+G+(O+1)*b;if(P)for(B=k*h*A+b*h,G=0;G<b;G++)for(O=0;O<h-1;O++)E[T++]=B+G+O*b,E[T++]=B+G+(O+1)*b;if(P){let t=k*h*A,i=t+h*b;if(v)for(G=0;G<b;G++)E[T++]=t+G,E[T++]=i+G;if(M)for(t+=h*b-b,i+=h*b-b,G=0;G<b;G++)E[T++]=t+G,E[T++]=i+G}const S=new u.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:V})});if(o.defined(t._offsetAttribute)){const e=V.length,n=new Uint8Array(e/3),o=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1;i.arrayFill(n,o),S.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new s.Geometry({attributes:S,indices:E,primitiveType:s.PrimitiveType.LINES,boundingSphere:e.BoundingSphere.fromEllipsoid(y),offsetAttribute:t._offsetAttribute})},t.EllipsoidOutlineGeometry=d}));
|
package/dist/assets/cesium/Workers/{EllipsoidRhumbLine-125a8b72.js → EllipsoidRhumbLine-6145377b.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Matrix2-
|
1
|
+
define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19"],(function(t,i,e,a,n){"use strict";function s(t,i,e){if(0===t)return i*e;const a=t*t,n=a*a,s=n*a,u=s*a,h=u*a,o=h*a,l=e;return i*((1-a/4-3*n/64-5*s/256-175*u/16384-441*h/65536-4851*o/1048576)*l-(3*a/8+3*n/32+45*s/1024+105*u/4096+2205*h/131072+6237*o/524288)*Math.sin(2*l)+(15*n/256+45*s/1024+525*u/16384+1575*h/65536+155925*o/8388608)*Math.sin(4*l)-(35*s/3072+175*u/12288+3675*h/262144+13475*o/1048576)*Math.sin(6*l)+(315*u/131072+2205*h/524288+43659*o/8388608)*Math.sin(8*l)-(693*h/1310720+6237*o/5242880)*Math.sin(10*l)+1001*o/8388608*Math.sin(12*l))}function u(t,i){if(0===t)return Math.log(Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+i)));const e=t*Math.sin(i);return Math.log(Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+e)/(1-e))}const h=new i.Cartesian3,o=new i.Cartesian3;function l(t,e,a,l){i.Cartesian3.normalize(l.cartographicToCartesian(e,o),h),i.Cartesian3.normalize(l.cartographicToCartesian(a,o),o);const r=l.maximumRadius,d=l.minimumRadius,c=r*r,M=d*d;t._ellipticitySquared=(c-M)/c,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=i.Cartographic.clone(e,t._start),t._start.height=0,t._end=i.Cartographic.clone(a,t._end),t._end.height=0,t._heading=function(t,i,e,a,s){const h=u(t._ellipticity,e),o=u(t._ellipticity,s);return Math.atan2(n.CesiumMath.negativePiToPi(a-i),o-h)}(t,e.longitude,e.latitude,a.longitude,a.latitude),t._distance=function(t,i,e,a,u,h,o){const l=t._heading,r=h-a;let d=0;if(n.CesiumMath.equalsEpsilon(Math.abs(l),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8))if(i===e)d=i*Math.cos(u)*n.CesiumMath.negativePiToPi(r);else{const e=Math.sin(u);d=i*Math.cos(u)*n.CesiumMath.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*e*e)}else{const e=s(t._ellipticity,i,u);d=(s(t._ellipticity,i,o)-e)/Math.cos(l)}return Math.abs(d)}(t,l.maximumRadius,l.minimumRadius,e.longitude,e.latitude,a.longitude,a.latitude)}function r(t,e,h,o,l,r){if(0===h)return i.Cartographic.clone(t,r);const d=l*l;let c,M,m;if(Math.abs(n.CesiumMath.PI_OVER_TWO-Math.abs(e))>n.CesiumMath.EPSILON8){M=function(t,i,e){const a=t/e;if(0===i)return a;const n=a*a,s=n*a,u=s*a,h=i*i,o=h*h,l=o*h,r=l*h,d=r*h,c=d*h,M=Math.sin(2*a),m=Math.cos(2*a),g=Math.sin(4*a),_=Math.cos(4*a),p=Math.sin(6*a),C=Math.cos(6*a),f=Math.sin(8*a),P=Math.cos(8*a),O=Math.sin(10*a);return a+a*h/4+7*a*o/64+15*a*l/256+579*a*r/16384+1515*a*d/65536+16837*a*c/1048576+(3*a*o/16+45*a*l/256-a*(32*n-561)*r/4096-a*(232*n-1677)*d/16384+a*(399985-90560*n+512*u)*c/5242880)*m+(21*a*l/256+483*a*r/4096-a*(224*n-1969)*d/16384-a*(33152*n-112599)*c/1048576)*_+(151*a*r/4096+4681*a*d/65536+1479*a*c/16384-453*s*c/32768)*C+(1097*a*d/65536+42783*a*c/1048576)*P+8011*a*c/1048576*Math.cos(10*a)+(3*h/8+3*o/16+213*l/2048-3*n*l/64+255*r/4096-33*n*r/512+20861*d/524288-33*n*d/512+u*d/1024+28273*c/1048576-471*n*c/8192+9*u*c/4096)*M+(21*o/256+21*l/256+533*r/8192-21*n*r/512+197*d/4096-315*n*d/4096+584039*c/16777216-12517*n*c/131072+7*u*c/2048)*g+(151*l/6144+151*r/4096+5019*d/131072-453*n*d/16384+26965*c/786432-8607*n*c/131072)*p+(1097*r/131072+1097*d/65536+225797*c/10485760-1097*n*c/65536)*f+(8011*d/2621440+8011*c/1048576)*O+293393*c/251658240*Math.sin(12*a)}(s(l,o,t.latitude)+h*Math.cos(e),l,o);const i=u(l,t.latitude),a=u(l,M);m=Math.tan(e)*(a-i),c=n.CesiumMath.negativePiToPi(t.longitude+m)}else{let i;if(M=t.latitude,0===l)i=o*Math.cos(t.latitude);else{const e=Math.sin(t.latitude);i=o*Math.cos(t.latitude)/Math.sqrt(1-d*e*e)}m=h/i,c=e>0?n.CesiumMath.negativePiToPi(t.longitude+m):n.CesiumMath.negativePiToPi(t.longitude-m)}return a.defined(r)?(r.longitude=c,r.latitude=M,r.height=0,r):new i.Cartographic(c,M,0)}function d(t,e,n){const s=a.defaultValue(n,i.Ellipsoid.WGS84);this._ellipsoid=s,this._start=new i.Cartographic,this._end=new i.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,a.defined(t)&&a.defined(e)&&l(this,t,e,s)}Object.defineProperties(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}}),d.fromStartHeadingDistance=function(t,e,s,u,h){const o=a.defaultValue(u,i.Ellipsoid.WGS84),l=o.maximumRadius,c=o.minimumRadius,M=l*l,m=c*c,g=Math.sqrt((M-m)/M),_=r(t,e=n.CesiumMath.negativePiToPi(e),s,o.maximumRadius,g);return!a.defined(h)||a.defined(u)&&!u.equals(h.ellipsoid)?new d(t,_,o):(h.setEndPoints(t,_),h)},d.prototype.setEndPoints=function(t,i){l(this,t,i,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},d.prototype.interpolateUsingSurfaceDistance=function(t,i){return r(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},d.prototype.findIntersectionWithLongitude=function(t,e){const s=this._ellipticity,u=this._heading,h=Math.abs(u),o=this._start;if(t=n.CesiumMath.negativePiToPi(t),n.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,n.CesiumMath.EPSILON14)&&(t=n.CesiumMath.sign(o.longitude)*Math.PI),a.defined(e)||(e=new i.Cartographic),Math.abs(n.CesiumMath.PI_OVER_TWO-h)<=n.CesiumMath.EPSILON8)return e.longitude=t,e.latitude=o.latitude,e.height=0,e;if(n.CesiumMath.equalsEpsilon(Math.abs(n.CesiumMath.PI_OVER_TWO-h),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8)){if(n.CesiumMath.equalsEpsilon(t,o.longitude,n.CesiumMath.EPSILON12))return;return e.longitude=t,e.latitude=n.CesiumMath.PI_OVER_TWO*n.CesiumMath.sign(n.CesiumMath.PI_OVER_TWO-u),e.height=0,e}const l=o.latitude,r=s*Math.sin(l),d=Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+l))*Math.exp((t-o.longitude)/Math.tan(u)),c=(1+r)/(1-r);let M,m=o.latitude;do{M=m;const t=s*Math.sin(M),i=(1+t)/(1-t);m=2*Math.atan(d*Math.pow(i/c,s/2))-n.CesiumMath.PI_OVER_TWO}while(!n.CesiumMath.equalsEpsilon(m,M,n.CesiumMath.EPSILON12));return e.longitude=t,e.latitude=m,e.height=0,e},d.prototype.findIntersectionWithLatitude=function(t,e){const s=this._ellipticity,h=this._heading,o=this._start;if(n.CesiumMath.equalsEpsilon(Math.abs(h),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8))return;const l=u(s,o.latitude),r=u(s,t),d=Math.tan(h)*(r-l),c=n.CesiumMath.negativePiToPi(o.longitude+d);return a.defined(e)?(e.longitude=c,e.latitude=t,e.height=0,e):new i.Cartographic(c,t,0)},t.EllipsoidRhumbLine=d}));
|
@@ -0,0 +1 @@
|
|
1
|
+
define(["exports","./AxisAlignedBoundingBox-a655a4bc","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./IntersectionTests-58aa8f80","./Plane-3f01019d","./Transforms-c8cb8f43"],(function(t,n,e,i,o,r,s,a){"use strict";const l=new e.Cartesian4;function c(t,n){t=(n=o.defaultValue(n,e.Ellipsoid.WGS84)).scaleToGeodeticSurface(t);const i=a.Transforms.eastNorthUpToFixedFrame(t,n);this._ellipsoid=n,this._origin=t,this._xAxis=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(i,0,l)),this._yAxis=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(i,1,l));const r=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(i,2,l));this._plane=s.Plane.fromPointNormal(t,r)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const d=new n.AxisAlignedBoundingBox;c.fromPoints=function(t,e){return new c(n.AxisAlignedBoundingBox.fromPoints(t,d).center,e)};const f=new r.Ray,p=new e.Cartesian3;c.prototype.projectPointOntoPlane=function(t,n){const i=f;i.origin=t,e.Cartesian3.normalize(t,i.direction);let s=r.IntersectionTests.rayPlane(i,this._plane,p);if(o.defined(s)||(e.Cartesian3.negate(i.direction,i.direction),s=r.IntersectionTests.rayPlane(i,this._plane,p)),o.defined(s)){const t=e.Cartesian3.subtract(s,this._origin,s),i=e.Cartesian3.dot(this._xAxis,t),r=e.Cartesian3.dot(this._yAxis,t);return o.defined(n)?(n.x=i,n.y=r,n):new e.Cartesian2(i,r)}},c.prototype.projectPointsOntoPlane=function(t,n){o.defined(n)||(n=[]);let e=0;const i=t.length;for(let r=0;r<i;r++){const i=this.projectPointOntoPlane(t[r],n[e]);o.defined(i)&&(n[e]=i,e++)}return n.length=e,n},c.prototype.projectPointToNearestOnPlane=function(t,n){o.defined(n)||(n=new e.Cartesian2);const i=f;i.origin=t,e.Cartesian3.clone(this._plane.normal,i.direction);let s=r.IntersectionTests.rayPlane(i,this._plane,p);o.defined(s)||(e.Cartesian3.negate(i.direction,i.direction),s=r.IntersectionTests.rayPlane(i,this._plane,p));const a=e.Cartesian3.subtract(s,this._origin,s),l=e.Cartesian3.dot(this._xAxis,a),c=e.Cartesian3.dot(this._yAxis,a);return n.x=l,n.y=c,n},c.prototype.projectPointsToNearestOnPlane=function(t,n){o.defined(n)||(n=[]);const e=t.length;n.length=e;for(let i=0;i<e;i++)n[i]=this.projectPointToNearestOnPlane(t[i],n[i]);return n};const u=new e.Cartesian3;c.prototype.projectPointOntoEllipsoid=function(t,n){o.defined(n)||(n=new e.Cartesian3);const i=this._ellipsoid,r=this._origin,s=this._xAxis,a=this._yAxis,l=u;return e.Cartesian3.multiplyByScalar(s,t.x,l),n=e.Cartesian3.add(r,l,n),e.Cartesian3.multiplyByScalar(a,t.y,l),e.Cartesian3.add(n,l,n),i.scaleToGeocentricSurface(n,n),n},c.prototype.projectPointsOntoEllipsoid=function(t,n){const e=t.length;o.defined(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.projectPointOntoEllipsoid(t[i],n[i]);return n},t.EllipsoidTangentPlane=c}));
|
package/dist/assets/cesium/Workers/{EncodedCartesian3-96fdc0ef.js → EncodedCartesian3-d9f5c4a4.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Matrix2-
|
1
|
+
define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed"],(function(e,n,o,i){"use strict";function t(){this.high=n.Cartesian3.clone(n.Cartesian3.ZERO),this.low=n.Cartesian3.clone(n.Cartesian3.ZERO)}t.encode=function(e,n){let o;return i.defined(n)||(n={high:0,low:0}),e>=0?(o=65536*Math.floor(e/65536),n.high=o,n.low=e-o):(o=65536*Math.floor(-e/65536),n.high=-o,n.low=e+o),n};const h={high:0,low:0};t.fromCartesian=function(e,n){i.defined(n)||(n=new t);const o=n.high,r=n.low;return t.encode(e.x,h),o.x=h.high,r.x=h.low,t.encode(e.y,h),o.y=h.high,r.y=h.low,t.encode(e.z,h),o.z=h.high,r.z=h.low,n};const r=new t;t.writeElements=function(e,n,o){t.fromCartesian(e,r);const i=r.high,h=r.low;n[o]=i.x,n[o+1]=i.y,n[o+2]=i.z,n[o+3]=h.x,n[o+4]=h.y,n[o+5]=h.z},e.EncodedCartesian3=t}));
|
package/dist/assets/cesium/Workers/{FrustumGeometry-9ab86004.js → FrustumGeometry-17776af8.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Transforms-eb5c1a84","./Matrix2-37e55508","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./GeometryAttribute-3915ea0b","./GeometryAttributes-32b29525","./Plane-6ee42cab","./VertexFormat-a0b706b0"],(function(t,e,a,n,i,r,o,s,f,u){"use strict";function l(t){this.planes=r.defaultValue(t,[])}const c=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,c[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,c[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,c[2]);const h=new a.Cartesian3,p=new a.Cartesian3,d=new f.Plane(new a.Cartesian3(1,0,0),0);function m(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._orthographicMatrix=new a.Matrix4}function C(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}l.fromBoundingSphere=function(t,e){r.defined(e)||(e=new l);const n=c.length,i=e.planes;i.length=2*n;const o=t.center,s=t.radius;let f=0;for(let t=0;t<n;++t){const e=c[t];let n=i[f],u=i[f+1];r.defined(n)||(n=i[f]=new a.Cartesian4),r.defined(u)||(u=i[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(e,-s,h),a.Cartesian3.add(o,h,h),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,h),a.Cartesian3.multiplyByScalar(e,s,h),a.Cartesian3.add(o,h,h),u.x=-e.x,u.y=-e.y,u.z=-e.z,u.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,p),h),f+=2}return e},l.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(f.Plane.fromCartesian4(a[i],d));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},l.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===l.MASK_OUTSIDE||a===l.MASK_INSIDE)return a;let n=l.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(f.Plane.fromCartesian4(i[r],d));if(s===e.Intersect.OUTSIDE)return l.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},l.MASK_OUTSIDE=4294967295,l.MASK_INSIDE=0,l.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){return C(this),this._orthographicMatrix}}});const _=new a.Cartesian3,y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3;function x(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new m,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function v(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function M(t){const e=t.top,n=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&n===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=n,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(r,i,n,e,o,s,t._perspectiveMatrix),t._infinitePerspective=a.Matrix4.computeInfinitePerspectiveOffCenter(r,i,n,e,o,t._infinitePerspective))}m.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,_);a.Cartesian3.normalize(h,h);const p=y;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=g;a.Cartesian3.multiplyByScalar(h,u,d),a.Cartesian3.add(p,d,d);let m=i[0];return r.defined(m)||(m=i[0]=new a.Cartesian4),m.x=h.x,m.y=h.y,m.z=h.z,m.w=-a.Cartesian3.dot(h,d),a.Cartesian3.multiplyByScalar(h,f,d),a.Cartesian3.add(p,d,d),m=i[1],r.defined(m)||(m=i[1]=new a.Cartesian4),m.x=-h.x,m.y=-h.y,m.z=-h.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,w),d),a.Cartesian3.multiplyByScalar(n,s,d),a.Cartesian3.add(p,d,d),m=i[2],r.defined(m)||(m=i[2]=new a.Cartesian4),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-a.Cartesian3.dot(n,d),a.Cartesian3.multiplyByScalar(n,o,d),a.Cartesian3.add(p,d,d),m=i[3],r.defined(m)||(m=i[3]=new a.Cartesian4),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(n,w),d),m=i[4],r.defined(m)||(m=i[4]=new a.Cartesian4),m.x=e.x,m.y=e.y,m.z=e.z,m.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d),m=i[5],r.defined(m)||(m=i[5]=new a.Cartesian4),m.x=-e.x,m.y=-e.y,m.z=-e.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,w),d),this._cullingVolume},m.prototype.getPixelDimensions=function(t,e,a,n,i){C(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},m.prototype.clone=function(t){return r.defined(t)||(t=new m),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},m.prototype.equals=function(t){return r.defined(t)&&t instanceof m&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},m.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof m&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},x.packedLength=4,x.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},x.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new x),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return v(this),this._offCenterFrustum.projectionMatrix}}}),x.prototype.computeCullingVolume=function(t,e,a){return v(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},x.prototype.getPixelDimensions=function(t,e,a,n,i){return v(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},x.prototype.clone=function(t){return r.defined(t)||(t=new x),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},x.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},x.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return M(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return M(this),this._infinitePerspective}}});const V=new a.Cartesian3,F=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3;function P(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function z(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,V),p=F;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(h,u,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.normalize(m,m),a.Cartesian3.cross(m,n,m),a.Cartesian3.normalize(m,m);let C=i[0];return r.defined(C)||(C=i[0]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(n,m,m),a.Cartesian3.normalize(m,m),C=i[1],r.defined(C)||(C=i[1]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,s,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(h,m,m),a.Cartesian3.normalize(m,m),C=i[2],r.defined(C)||(C=i[2]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,o,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(m,h,m),a.Cartesian3.normalize(m,m),C=i[3],r.defined(C)||(C=i[3]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),C=i[4],r.defined(C)||(C=i[4]=new a.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,p),a.Cartesian3.negate(e,m),C=i[5],r.defined(C)||(C=i[5]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,d),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){M(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},P.packedLength=6,P.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},P.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new P),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(P.prototype,{projectionMatrix:{get:function(){return z(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return z(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return z(this),this._fovy}},sseDenominator:{get:function(){return z(this),this._sseDenominator}}}),P.prototype.computeCullingVolume=function(t,e,a){return z(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},P.prototype.getPixelDimensions=function(t,e,a,n,i){return z(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},P.prototype.clone=function(t){return r.defined(t)||(t=new P),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},P.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},P.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function R(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let l,c;n instanceof P?(l=0,c=P.packedLength):n instanceof x&&(l=1,c=x.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+u.VertexFormat.packedLength}R.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,0===o?(P.pack(s,n,i),i+=P.packedLength):(x.pack(s,n,i),i+=x.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,n,i),n[i+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const S=new P,T=new x,k=new e.Quaternion,A=new a.Cartesian3,D=new u.VertexFormat;function I(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}R.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;0===o?(s=P.unpack(t,n,S),n+=P.packedLength):(s=x.unpack(t,n,T),n+=x.packedLength);const f=a.Cartesian3.unpack(t,n,A);n+=a.Cartesian3.packedLength;const l=e.Quaternion.unpack(t,n,k);n+=e.Quaternion.packedLength;const c=u.VertexFormat.unpack(t,n,D),h=1===t[n+=u.VertexFormat.packedLength];if(!r.defined(i))return new R({frustum:s,origin:f,orientation:l,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(l,i._orientation),i._vertexFormat=u.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const q=new a.Matrix3,B=new a.Matrix4,L=new a.Matrix4,N=new a.Cartesian3,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new Array(3),J=new Array(4);J[0]=new a.Cartesian4(-1,-1,1,1),J[1]=new a.Cartesian4(1,-1,1,1),J[2]=new a.Cartesian4(1,1,1,1),J[3]=new a.Cartesian4(-1,1,1,1);const W=new Array(4);for(let t=0;t<4;++t)W[t]=new a.Cartesian4;R._computeNearFarPlanes=function(t,e,n,i,o,s,f,u){const l=a.Matrix3.fromQuaternion(e,q);let c=r.defaultValue(s,N),h=r.defaultValue(f,G),p=r.defaultValue(u,j);c=a.Matrix3.getColumn(l,0,c),h=a.Matrix3.getColumn(l,1,h),p=a.Matrix3.getColumn(l,2,p),a.Cartesian3.normalize(c,c),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.negate(c,c);const d=a.Matrix4.computeView(t,p,h,c,B);let m,C;if(0===n){const t=i.projectionMatrix,e=a.Matrix4.multiply(t,d,L);C=a.Matrix4.inverse(e,L)}else m=a.Matrix4.inverseTransformation(d,L);r.defined(C)?(Y[0]=i.near,Y[1]=i.far):(Y[0]=0,Y[1]=i.near,Y[2]=i.far);for(let e=0;e<2;++e)for(let n=0;n<4;++n){let s=a.Cartesian4.clone(J[n],W[n]);if(r.defined(C)){s=a.Matrix4.multiplyByVector(C,s,s);const n=1/s.w;a.Cartesian3.multiplyByScalar(s,n,s),a.Cartesian3.subtract(s,t,s),a.Cartesian3.normalize(s,s);const i=a.Cartesian3.dot(p,s);a.Cartesian3.multiplyByScalar(s,Y[e]/i,s),a.Cartesian3.add(s,t,s)}else{r.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum);const t=Y[e],n=Y[e+1];s.x=.5*(s.x*(i.right-i.left)+i.left+i.right),s.y=.5*(s.y*(i.top-i.bottom)+i.bottom+i.top),s.z=.5*(s.z*(t-n)-t-n),s.w=1,a.Matrix4.multiplyByVector(m,s,s)}o[12*e+3*n]=s.x,o[12*e+3*n+1]=s.y,o[12*e+3*n+2]=s.z}},R.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);R._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=N,u=G,l=j,d=a.Cartesian3.negate(f,U),_=a.Cartesian3.negate(u,Q),y=a.Cartesian3.negate(l,K);m=0,c&&(I(m,t,e,n,s,y,f,u),m+=12),I(m,t,e,n,s,l,d,u),m+=12,I(m,t,e,n,s,d,y,u),m+=12,I(m,t,e,n,s,_,y,d),m+=12,I(m,t,e,n,s,f,l,u),m+=12,I(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=R,t.OrthographicFrustum=x,t.PerspectiveFrustum=P}));
|
1
|
+
define(["exports","./Transforms-c8cb8f43","./Matrix2-47e98d76","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./Plane-3f01019d","./VertexFormat-a0b706b0"],(function(t,e,a,n,i,r,o,s,f,u){"use strict";function l(t){this.planes=r.defaultValue(t,[])}const c=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,c[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,c[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,c[2]);const h=new a.Cartesian3,p=new a.Cartesian3,d=new f.Plane(new a.Cartesian3(1,0,0),0);function m(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._orthographicMatrix=new a.Matrix4}function C(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}l.fromBoundingSphere=function(t,e){r.defined(e)||(e=new l);const n=c.length,i=e.planes;i.length=2*n;const o=t.center,s=t.radius;let f=0;for(let t=0;t<n;++t){const e=c[t];let n=i[f],u=i[f+1];r.defined(n)||(n=i[f]=new a.Cartesian4),r.defined(u)||(u=i[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(e,-s,h),a.Cartesian3.add(o,h,h),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,h),a.Cartesian3.multiplyByScalar(e,s,h),a.Cartesian3.add(o,h,h),u.x=-e.x,u.y=-e.y,u.z=-e.z,u.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,p),h),f+=2}return e},l.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(f.Plane.fromCartesian4(a[i],d));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},l.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===l.MASK_OUTSIDE||a===l.MASK_INSIDE)return a;let n=l.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(f.Plane.fromCartesian4(i[r],d));if(s===e.Intersect.OUTSIDE)return l.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},l.MASK_OUTSIDE=4294967295,l.MASK_INSIDE=0,l.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){return C(this),this._orthographicMatrix}}});const _=new a.Cartesian3,y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3;function x(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new m,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function v(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function M(t){const e=t.top,n=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&n===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=n,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(r,i,n,e,o,s,t._perspectiveMatrix),t._infinitePerspective=a.Matrix4.computeInfinitePerspectiveOffCenter(r,i,n,e,o,t._infinitePerspective))}m.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,_);a.Cartesian3.normalize(h,h);const p=y;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=g;a.Cartesian3.multiplyByScalar(h,u,d),a.Cartesian3.add(p,d,d);let m=i[0];return r.defined(m)||(m=i[0]=new a.Cartesian4),m.x=h.x,m.y=h.y,m.z=h.z,m.w=-a.Cartesian3.dot(h,d),a.Cartesian3.multiplyByScalar(h,f,d),a.Cartesian3.add(p,d,d),m=i[1],r.defined(m)||(m=i[1]=new a.Cartesian4),m.x=-h.x,m.y=-h.y,m.z=-h.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,w),d),a.Cartesian3.multiplyByScalar(n,s,d),a.Cartesian3.add(p,d,d),m=i[2],r.defined(m)||(m=i[2]=new a.Cartesian4),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-a.Cartesian3.dot(n,d),a.Cartesian3.multiplyByScalar(n,o,d),a.Cartesian3.add(p,d,d),m=i[3],r.defined(m)||(m=i[3]=new a.Cartesian4),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(n,w),d),m=i[4],r.defined(m)||(m=i[4]=new a.Cartesian4),m.x=e.x,m.y=e.y,m.z=e.z,m.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d),m=i[5],r.defined(m)||(m=i[5]=new a.Cartesian4),m.x=-e.x,m.y=-e.y,m.z=-e.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,w),d),this._cullingVolume},m.prototype.getPixelDimensions=function(t,e,a,n,i){C(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},m.prototype.clone=function(t){return r.defined(t)||(t=new m),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},m.prototype.equals=function(t){return r.defined(t)&&t instanceof m&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},m.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof m&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},x.packedLength=4,x.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},x.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new x),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return v(this),this._offCenterFrustum.projectionMatrix}}}),x.prototype.computeCullingVolume=function(t,e,a){return v(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},x.prototype.getPixelDimensions=function(t,e,a,n,i){return v(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},x.prototype.clone=function(t){return r.defined(t)||(t=new x),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},x.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},x.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return M(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return M(this),this._infinitePerspective}}});const V=new a.Cartesian3,F=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3;function P(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function z(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,V),p=F;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(h,u,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.normalize(m,m),a.Cartesian3.cross(m,n,m),a.Cartesian3.normalize(m,m);let C=i[0];return r.defined(C)||(C=i[0]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(n,m,m),a.Cartesian3.normalize(m,m),C=i[1],r.defined(C)||(C=i[1]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,s,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(h,m,m),a.Cartesian3.normalize(m,m),C=i[2],r.defined(C)||(C=i[2]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,o,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(m,h,m),a.Cartesian3.normalize(m,m),C=i[3],r.defined(C)||(C=i[3]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),C=i[4],r.defined(C)||(C=i[4]=new a.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,p),a.Cartesian3.negate(e,m),C=i[5],r.defined(C)||(C=i[5]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,d),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){M(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},P.packedLength=6,P.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},P.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new P),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(P.prototype,{projectionMatrix:{get:function(){return z(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return z(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return z(this),this._fovy}},sseDenominator:{get:function(){return z(this),this._sseDenominator}}}),P.prototype.computeCullingVolume=function(t,e,a){return z(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},P.prototype.getPixelDimensions=function(t,e,a,n,i){return z(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},P.prototype.clone=function(t){return r.defined(t)||(t=new P),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},P.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},P.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function R(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let l,c;n instanceof P?(l=0,c=P.packedLength):n instanceof x&&(l=1,c=x.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+u.VertexFormat.packedLength}R.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,0===o?(P.pack(s,n,i),i+=P.packedLength):(x.pack(s,n,i),i+=x.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,n,i),n[i+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const S=new P,T=new x,k=new e.Quaternion,A=new a.Cartesian3,D=new u.VertexFormat;function I(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}R.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;0===o?(s=P.unpack(t,n,S),n+=P.packedLength):(s=x.unpack(t,n,T),n+=x.packedLength);const f=a.Cartesian3.unpack(t,n,A);n+=a.Cartesian3.packedLength;const l=e.Quaternion.unpack(t,n,k);n+=e.Quaternion.packedLength;const c=u.VertexFormat.unpack(t,n,D),h=1===t[n+=u.VertexFormat.packedLength];if(!r.defined(i))return new R({frustum:s,origin:f,orientation:l,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(l,i._orientation),i._vertexFormat=u.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const q=new a.Matrix3,B=new a.Matrix4,L=new a.Matrix4,N=new a.Cartesian3,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new Array(3),J=new Array(4);J[0]=new a.Cartesian4(-1,-1,1,1),J[1]=new a.Cartesian4(1,-1,1,1),J[2]=new a.Cartesian4(1,1,1,1),J[3]=new a.Cartesian4(-1,1,1,1);const W=new Array(4);for(let t=0;t<4;++t)W[t]=new a.Cartesian4;R._computeNearFarPlanes=function(t,e,n,i,o,s,f,u){const l=a.Matrix3.fromQuaternion(e,q);let c=r.defaultValue(s,N),h=r.defaultValue(f,G),p=r.defaultValue(u,j);c=a.Matrix3.getColumn(l,0,c),h=a.Matrix3.getColumn(l,1,h),p=a.Matrix3.getColumn(l,2,p),a.Cartesian3.normalize(c,c),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.negate(c,c);const d=a.Matrix4.computeView(t,p,h,c,B);let m,C;if(0===n){const t=i.projectionMatrix,e=a.Matrix4.multiply(t,d,L);C=a.Matrix4.inverse(e,L)}else m=a.Matrix4.inverseTransformation(d,L);r.defined(C)?(Y[0]=i.near,Y[1]=i.far):(Y[0]=0,Y[1]=i.near,Y[2]=i.far);for(let e=0;e<2;++e)for(let n=0;n<4;++n){let s=a.Cartesian4.clone(J[n],W[n]);if(r.defined(C)){s=a.Matrix4.multiplyByVector(C,s,s);const n=1/s.w;a.Cartesian3.multiplyByScalar(s,n,s),a.Cartesian3.subtract(s,t,s),a.Cartesian3.normalize(s,s);const i=a.Cartesian3.dot(p,s);a.Cartesian3.multiplyByScalar(s,Y[e]/i,s),a.Cartesian3.add(s,t,s)}else{r.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum);const t=Y[e],n=Y[e+1];s.x=.5*(s.x*(i.right-i.left)+i.left+i.right),s.y=.5*(s.y*(i.top-i.bottom)+i.bottom+i.top),s.z=.5*(s.z*(t-n)-t-n),s.w=1,a.Matrix4.multiplyByVector(m,s,s)}o[12*e+3*n]=s.x,o[12*e+3*n+1]=s.y,o[12*e+3*n+2]=s.z}},R.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);R._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=N,u=G,l=j,d=a.Cartesian3.negate(f,U),_=a.Cartesian3.negate(u,Q),y=a.Cartesian3.negate(l,K);m=0,c&&(I(m,t,e,n,s,y,f,u),m+=12),I(m,t,e,n,s,l,d,u),m+=12,I(m,t,e,n,s,d,y,u),m+=12,I(m,t,e,n,s,_,y,d),m+=12,I(m,t,e,n,s,f,l,u),m+=12,I(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=R,t.OrthographicFrustum=x,t.PerspectiveFrustum=P}));
|
@@ -0,0 +1 @@
|
|
1
|
+
define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./WebGLConstants-508b9636","./Transforms-c8cb8f43"],(function(t,e,n,a,r,i){"use strict";var o=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const s={POINTS:r.WebGLConstants.POINTS,LINES:r.WebGLConstants.LINES,LINE_LOOP:r.WebGLConstants.LINE_LOOP,LINE_STRIP:r.WebGLConstants.LINE_STRIP,TRIANGLES:r.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:r.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:r.WebGLConstants.TRIANGLE_FAN,isLines:function(t){return t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP},isTriangles:function(t){return t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN},validate:function(t){return t===s.POINTS||t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP||t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN}};var u=Object.freeze(s);function I(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,u.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,o.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}I.computeNumberOfVertices=function(t){let e=-1;for(const n in t.attributes)if(t.attributes.hasOwnProperty(n)&&a.defined(t.attributes[n])&&a.defined(t.attributes[n].values)){const a=t.attributes[n];e=a.values.length/a.componentsPerAttribute}return e};const N=new e.Cartographic,c=new e.Cartesian3,T=new e.Matrix4,l=[new e.Cartographic,new e.Cartographic,new e.Cartographic],L=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],f=new e.Cartesian3,m=new i.Quaternion,p=new e.Matrix4,y=new e.Matrix2;I._textureCoordinateRotationPoints=function(t,n,a,r){let o;const s=e.Rectangle.center(r,N),u=e.Cartographic.toCartesian(s,a,c),I=i.Transforms.eastNorthUpToFixedFrame(u,a,T),b=e.Matrix4.inverse(I,T),C=L,h=l;h[0].longitude=r.west,h[0].latitude=r.south,h[1].longitude=r.west,h[1].latitude=r.north,h[2].longitude=r.east,h[2].latitude=r.south;let A=f;for(o=0;o<3;o++)e.Cartographic.toCartesian(h[o],a,A),A=e.Matrix4.multiplyByPointAsVector(b,A,A),C[o].x=A.x,C[o].y=A.y;const d=i.Quaternion.fromAxisAngle(e.Cartesian3.UNIT_Z,-n,m),x=e.Matrix3.fromQuaternion(d,p),S=t.length;let P=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(o=0;o<S;o++)A=e.Matrix4.multiplyByPointAsVector(b,t[o],A),A=e.Matrix3.multiplyByVector(x,A,A),P=Math.min(P,A.x),G=Math.min(G,A.y),R=Math.max(R,A.x),_=Math.max(_,A.y);const O=e.Matrix2.fromRotation(n,y),g=E;g[0].x=P,g[0].y=G,g[1].x=P,g[1].y=_,g[2].x=R,g[2].y=G;const w=C[0],V=C[2].x-w.x,M=C[1].y-w.y;for(o=0;o<3;o++){const t=g[o];e.Matrix2.multiplyByVector(O,t,t),t.x=(t.x-w.x)/V,t.y=(t.y-w.y)/M}const v=g[0],F=g[1],W=g[2],Y=new Array(6);return e.Cartesian2.pack(v,Y),e.Cartesian2.pack(F,Y,2),e.Cartesian2.pack(W,Y,4),Y},t.Geometry=I,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=o,t.PrimitiveType=u}));
|
package/dist/assets/cesium/Workers/{GeometryInstance-13e4ff38.js → GeometryInstance-4fbf16ba.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Matrix2-
|
1
|
+
define(["exports","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Matrix2-47e98d76"],(function(e,t,i,r){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}}));
|
package/dist/assets/cesium/Workers/{GeometryPipeline-e0eb4567.js → GeometryPipeline-309fad76.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./AttributeCompression-27507afe","./Matrix2-37e55508","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19","./Transforms-eb5c1a84","./EncodedCartesian3-96fdc0ef","./GeometryAttribute-3915ea0b","./IndexDatatype-f1dcdf35","./IntersectionTests-ac2459de","./Plane-6ee42cab"],(function(e,t,n,i,r,a,s,o,u,c,l,p){"use strict";const d=new n.Cartesian3,f=new n.Cartesian3,y=new n.Cartesian3;const m={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};m.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let f;for(f=0;f<u;f++)d[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let y=0;for(;c<p;)d[t[c]].vertexTriangles.push(y),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(y),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(y),++d[t[c+2]].numLiveTriangles,++y,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(f=0;f<x;f++)P[f]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(y=g.vertexTriangles[e],!P[y]){P[y]=!0,c=y+y+y;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};const C={};function h(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function v(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function b(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}C.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case u.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=c.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)h(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case u.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=c.IndexDatatype.createTypedArray(t,n);h(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)h(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case u.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=c.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)h(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=u.PrimitiveType.LINES}return e},C.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,c=i.length,l=new Float64Array(2*c);let p,d=0;for(let e=0;e<c;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+o[e]*n,l[d++]=i[e+1]+o[e+1]*n,l[d++]=i[e+2]+o[e+2]*n;const f=e.boundingSphere;return r.defined(f)&&(p=new s.BoundingSphere(f.center,f.radius+n)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:u.PrimitiveType.LINES,boundingSphere:p})},C.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},C.reorderForPreVertexCache=function(e){const t=u.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const s=n,o=s.length,u=c.IndexDatatype.createTypedArray(t,o);let l,p=0,d=0,f=0;for(;p<o;)l=i[s[p]],-1!==l?u[d]=l:(l=s[p],i[l]=f,u[d]=f,++f),++p,++d;e.indices=u;const y=e.attributes;for(const e in y)if(y.hasOwnProperty(e)&&r.defined(y[e])&&r.defined(y[e].values)){const n=y[e],r=n.values;let s=0;const o=n.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(n.componentDatatype,f*o);for(;s<t;){const e=i[s];if(-1!==e)for(let t=0;t<o;t++)u[o*e+t]=r[o*s+t];++s}n.values=u}}return e},C.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=m.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},C.fitToUnsignedShortIndices=function(e){const t=[],n=u.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=v(e.attributes);const c=e.indices,l=c.length;let p;e.primitiveType===u.PrimitiveType.TRIANGLES?p=3:e.primitiveType===u.PrimitiveType.LINES?p=2:e.primitiveType===u.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=c[d+t];let u=n[a];r.defined(u)||(u=s++,n[a]=u,b(o,e.attributes,a)),i.push(u)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const g=new n.Cartesian3,A=new n.Cartographic;C.projectTo2D=function(e,t,i,o,c){const l=e.attributes[t],p=(c=r.defined(c)?c:new s.GeographicProjection).ellipsoid,d=l.values,f=new Float64Array(d.length);let y=0;for(let e=0;e<d.length;e+=3){const t=n.Cartesian3.fromArray(d,e,g),i=p.cartesianToCartographic(t,A),r=c.project(i,g);f[y++]=r.x,f[y++]=r.y,f[y++]=r.z}return e.attributes[i]=l,e.attributes[o]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};const T={high:0,low:0};C.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],s=r.values,c=s.length,l=new Float32Array(c),p=new Float32Array(c);for(let e=0;e<c;++e)o.EncodedCartesian3.encode(s[e],T),l[e]=T.high,p[e]=T.low;const d=r.componentsPerAttribute;return e.attributes[n]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let x=new n.Cartesian3;function P(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix4.multiplyByPoint(e,x,x),n.Cartesian3.pack(x,i,t)}}function w(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix3.multiplyByVector(e,x,x),x=n.Cartesian3.normalize(x,x),n.Cartesian3.pack(x,i,t)}}const S=new n.Matrix4,I=new n.Matrix3;C.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;P(t,i.position),P(t,i.prevPosition),P(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,S),n.Matrix4.transpose(S,S),n.Matrix4.getMatrix3(S,I),w(I,i.normal),w(I,i.tangent),w(I,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const O=new n.Cartesian3;function E(e,t){const i=e.length;let o,l,p,d;e[0].modelMatrix;const f=r.defined(e[0][t].indices),y=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},s=e[0][t].attributes;let o;for(o in s)if(s.hasOwnProperty(o)&&r.defined(s[o])&&r.defined(s[o].values)){const c=s[o];let l=c.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[o];if(!r.defined(n)||c.componentDatatype!==n.componentDatatype||c.componentsPerAttribute!==n.componentsPerAttribute||c.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[o]=new u.GeometryAttribute({componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:a.ComponentDatatype.createTypedArray(c.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(o in m)if(m.hasOwnProperty(o))for(C=m[o].values,d=0,l=0;l<i;++l)for(h=e[l][t].attributes[o].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(f){let n=0;for(l=0;l<i;++l)n+=e[l][t].indices.length;const r=u.Geometry.computeNumberOfVertices(new u.Geometry({attributes:m,primitiveType:u.PrimitiveType.POINTS})),a=c.IndexDatatype.createTypedArray(r,n);let s=0,o=0;for(l=0;l<i;++l){const n=e[l][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=u.Geometry.computeNumberOfVertices(e[l][t])}b=a}let g,A=new n.Cartesian3,T=0;for(l=0;l<i;++l){if(g=e[l][t].boundingSphere,!r.defined(g)){A=void 0;break}n.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(n.Cartesian3.divideByScalar(A,i,A),l=0;l<i;++l){g=e[l][t].boundingSphere;const i=n.Cartesian3.magnitude(n.Cartesian3.subtract(g.center,A,O))+g.radius;i>T&&(T=i)}return new u.Geometry({attributes:m,indices:b,primitiveType:y,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}C.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(E(t,"geometry")),n.length>0&&(a.push(E(n,"westHemisphereGeometry")),a.push(E(n,"eastHemisphereGeometry"))),a};const N=new n.Cartesian3,L=new n.Cartesian3,z=new n.Cartesian3,D=new n.Cartesian3;C.computeNormal=function(e){const t=e.indices,i=e.attributes,r=i.position.values,s=i.position.values.length/3,o=t.length,c=new Array(s),l=new Array(o/3),p=new Array(o);let d;for(d=0;d<s;d++)c[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<o;d+=3){const e=t[d],i=t[d+1],a=t[d+2],s=3*e,o=3*i,u=3*a;L.x=r[s],L.y=r[s+1],L.z=r[s+2],z.x=r[o],z.y=r[o+1],z.z=r[o+2],D.x=r[u],D.y=r[u+1],D.z=r[u+2],c[e].count++,c[i].count++,c[a].count++,n.Cartesian3.subtract(z,L,z),n.Cartesian3.subtract(D,L,D),l[f]=n.Cartesian3.cross(z,D,new n.Cartesian3),f++}let y,m=0;for(d=0;d<s;d++)c[d].indexOffset+=m,m+=c[d].count;for(f=0,d=0;d<o;d+=3){y=c[t[d]];let e=y.indexOffset+y.currentCount;p[e]=f,y.currentCount++,y=c[t[d+1]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,y=c[t[d+2]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,f++}const C=new Float32Array(3*s);for(d=0;d<s;d++){const e=3*d;if(y=c[d],n.Cartesian3.clone(n.Cartesian3.ZERO,N),y.count>0){for(f=0;f<y.count;f++)n.Cartesian3.add(N,l[p[y.indexOffset+f]],N);n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&n.Cartesian3.clone(l[p[y.indexOffset]],N)}n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&(N.z=1),n.Cartesian3.normalize(N,N),C[e]=N.x,C[e+1]=N.y,C[e+2]=N.z}return e.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const M=new n.Cartesian3,G=new n.Cartesian3,R=new n.Cartesian3;C.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,s=e.attributes.st.values,o=e.attributes.position.values.length/3,c=t.length,l=new Array(3*o);let p,d,f,y;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<c;p+=3){const e=t[p],n=t[p+1],r=t[p+2];d=3*e,f=3*n,y=3*r;const a=2*e,o=2*n,u=2*r,c=i[d],m=i[d+1],C=i[d+2],h=s[a],v=s[a+1],b=s[o+1]-v,g=s[u+1]-v,A=1/((s[o]-h)*g-(s[u]-h)*b),T=(g*(i[f]-c)-b*(i[y]-c))*A,x=(g*(i[f+1]-m)-b*(i[y+1]-m))*A,P=(g*(i[f+2]-C)-b*(i[y+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P}const m=new Float32Array(3*o),C=new Float32Array(3*o);for(p=0;p<o;p++){d=3*p,f=d+1,y=d+2;const e=n.Cartesian3.fromArray(r,d,M),t=n.Cartesian3.fromArray(l,d,R),i=n.Cartesian3.dot(e,t);n.Cartesian3.multiplyByScalar(e,i,G),n.Cartesian3.normalize(n.Cartesian3.subtract(t,G,t),t),m[d]=t.x,m[f]=t.y,m[y]=t.z,n.Cartesian3.normalize(n.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[f]=t.y,C[y]=t.z}return e.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const V=new n.Cartesian2,F=new n.Cartesian3,B=new n.Cartesian3,_=new n.Cartesian3;let k=new n.Cartesian2;function q(e){switch(e.primitiveType){case u.PrimitiveType.TRIANGLE_FAN:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case u.PrimitiveType.LINE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINE_LOOP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function U(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}C.compressVertices=function(e){const i=e.attributes.extrudeDirection;let s,o;if(r.defined(i)){const r=i.values;o=r.length/3;const c=new Float32Array(2*o);let l=0;for(s=0;s<o;++s)n.Cartesian3.fromArray(r,3*s,F),n.Cartesian3.equals(F,n.Cartesian3.ZERO)?l+=2:(k=t.AttributeCompression.octEncodeInRange(F,65535,k),c[l++]=k.x,c[l++]=k.y);return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}),delete e.attributes.extrudeDirection,e}const c=e.attributes.normal,l=e.attributes.st,p=r.defined(c),d=r.defined(l);if(!p&&!d)return e;const f=e.attributes.tangent,y=e.attributes.bitangent,m=r.defined(f),C=r.defined(y);let h,v,b,g;p&&(h=c.values),d&&(v=l.values),m&&(b=f.values),C&&(g=y.values);o=(p?h.length:v.length)/(p?3:2);let A=o,T=d&&p?2:1;T+=m||C?1:0,A*=T;const x=new Float32Array(A);let P=0;for(s=0;s<o;++s){d&&(n.Cartesian2.fromArray(v,2*s,V),x[P++]=t.AttributeCompression.compressTextureCoordinates(V));const e=3*s;p&&r.defined(b)&&r.defined(g)?(n.Cartesian3.fromArray(h,e,F),n.Cartesian3.fromArray(b,e,B),n.Cartesian3.fromArray(g,e,_),t.AttributeCompression.octPack(F,B,_,V),x[P++]=V.x,x[P++]=V.y):(p&&(n.Cartesian3.fromArray(h,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),m&&(n.Cartesian3.fromArray(b,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),C&&(n.Cartesian3.fromArray(g,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)))}return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:T,values:x}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};const Y=new n.Cartesian3;function Z(e,t,i,r){n.Cartesian3.add(e,n.Cartesian3.multiplyByScalar(n.Cartesian3.subtract(t,e,Y),e.y/(e.y-t.y),Y),i),n.Cartesian3.clone(i,r),U(i,!0),U(r,!1)}const H=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,j=new n.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return U(e,e.y<0),U(t,t.y<0),void U(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;U(e,u),U(t,u),U(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=J.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(Z(e,t,H,X),Z(e,n,W,j),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(Z(t,n,H,X),Z(t,e,W,j),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(Z(n,e,H,X),Z(n,t,W,j),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(Z(n,e,H,X),Z(n,t,W,j),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Z(t,n,H,X),Z(t,e,W,j),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Z(e,t,H,X),Z(e,n,W,j),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=J.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=H,c[4]=W,c[5]=X,c[6]=j,c.length=7),J}function Q(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=a.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=u.Geometry.computeNumberOfVertices(e);return e.indices=c.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function $(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new u.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=Q(t,i),n=Q(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function te(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const f=e.fromArray(c,a*t,n),y=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(y,u.y,y),e.multiplyByScalar(m,u.z,m);const C=e.add(f,y,f);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const ne=te(n.Cartesian4,4),ie=te(n.Cartesian3,3),re=te(n.Cartesian2,2),ae=new n.Cartesian3,se=new n.Cartesian3,oe=new n.Cartesian3,ue=new n.Cartesian3;function ce(e,t,i,s,o,u,c,l,p,m,C,h,v,b,g,A){if(!(r.defined(u)||r.defined(c)||r.defined(l)||r.defined(p)||r.defined(m)||0!==b))return;const T=function(e,t,i,s,o){let u,c,l,p,m,C,h,v;if(r.defined(o)||(o=new n.Cartesian3),r.defined(t.z)){if(n.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian3.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian3.subtract(i,t,d),c=n.Cartesian3.subtract(s,t,f),l=n.Cartesian3.subtract(e,t,y),p=n.Cartesian3.dot(u,u),m=n.Cartesian3.dot(u,c),C=n.Cartesian3.dot(u,l),h=n.Cartesian3.dot(c,c),v=n.Cartesian3.dot(c,l)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian2.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian2.subtract(i,t,d),c=n.Cartesian2.subtract(s,t,f),l=n.Cartesian2.subtract(e,t,y),p=n.Cartesian2.dot(u,u),m=n.Cartesian2.dot(u,c),C=n.Cartesian2.dot(u,l),h=n.Cartesian2.dot(c,c),v=n.Cartesian2.dot(c,l)}o.y=h*C-m*v,o.z=p*v-m*C;const b=p*h-m*m;if(0!==b)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}(s,n.Cartesian3.fromArray(o,3*e,ae),n.Cartesian3.fromArray(o,3*t,se),n.Cartesian3.fromArray(o,3*i,oe),ue);if(r.defined(T)){if(r.defined(u)&&ie(e,t,i,T,u,h.normal.values,A,!0),r.defined(m)){const r=n.Cartesian3.fromArray(m,3*e,ae),a=n.Cartesian3.fromArray(m,3*t,se),s=n.Cartesian3.fromArray(m,3*i,oe);let o;n.Cartesian3.multiplyByScalar(r,T.x,r),n.Cartesian3.multiplyByScalar(a,T.y,a),n.Cartesian3.multiplyByScalar(s,T.z,s),n.Cartesian3.equals(r,n.Cartesian3.ZERO)&&n.Cartesian3.equals(a,n.Cartesian3.ZERO)&&n.Cartesian3.equals(s,n.Cartesian3.ZERO)?(o=ae,o.x=0,o.y=0,o.z=0):(o=n.Cartesian3.add(r,a,r),n.Cartesian3.add(o,s,o),n.Cartesian3.normalize(o,o)),n.Cartesian3.pack(o,h.extrudeDirection.values,3*A)}if(r.defined(C)&&function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0}(e,t,i,T,C,h.applyOffset.values,A),r.defined(c)&&ie(e,t,i,T,c,h.tangent.values,A,!0),r.defined(l)&&ie(e,t,i,T,l,h.bitangent.values,A,!0),r.defined(p)&&re(e,t,i,T,p,h.st.values,A),b>0)for(let n=0;n<b;n++){const r=v[n];le(e,t,i,T,A,g[r],h[r])}}}function le(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:ne(e,t,n,i,u,c,r,!1);break;case 3:ie(e,t,n,i,u,c,r,!1);break;case 2:re(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function pe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const de={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){const t=e.geometry,i=t.attributes,a=i.position.values,s=r.defined(i.normal)?i.normal.values:void 0,o=r.defined(i.bitangent)?i.bitangent.values:void 0,u=r.defined(i.tangent)?i.tangent.values:void 0,c=r.defined(i.st)?i.st.values:void 0,l=r.defined(i.extrudeDirection)?i.extrudeDirection.values:void 0,p=r.defined(i.applyOffset)?i.applyOffset.values:void 0,d=t.indices,f=[];for(const e in i)i.hasOwnProperty(e)&&!de[e]&&r.defined(i[e])&&f.push(e);const y=f.length,m=$(t),C=$(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=n.Cartesian3.fromArray(a,3*e),S=n.Cartesian3.fromArray(a,3*t),I=n.Cartesian3.fromArray(a,3*P);const O=K(w,S,I);if(r.defined(O)&&O.positions.length>3){const n=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=n[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,w<3?A+w:-1,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,A,w),ce(e,t,P,w,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+1,S),ce(e,t,P,S,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+2,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}ee(e,C,m)}const ye=p.Plane.fromPointNormal(n.Cartesian3.ZERO,n.Cartesian3.UNIT_Y),me=new n.Cartesian3,Ce=new n.Cartesian3;function he(e,t,i,s,o,u,c){if(!r.defined(c))return;const l=n.Cartesian3.fromArray(s,3*e,ae);n.Cartesian3.equalsEpsilon(l,i,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function ve(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=r.defined(i.applyOffset)?i.applyOffset.values:void 0,u=t.indices,c=$(t),p=$(t);let d;const f=u.length,y=[];y.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<y.length;++d)y[d]=-1,m[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],i=n.Cartesian3.fromArray(s,3*e,ae),f=n.Cartesian3.fromArray(s,3*t,se);let C;Math.abs(i.y)<a.CesiumMath.EPSILON6&&(i.y<0?i.y=-a.CesiumMath.EPSILON6:i.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=p.attributes,A=p.indices,T=y;const x=l.IntersectionTests.lineSegmentPlane(i,f,ye,oe);if(r.defined(x)){const r=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,me);i.y<0&&(n.Cartesian3.negate(r,r),h=p.attributes,v=p.indices,b=y,g=c.attributes,A=c.indices,T=m);const l=n.Cartesian3.add(x,r,Ce);C=pe(h,v,b,u,d,i),he(e,t,i,s,C,h,o),C=pe(h,v,b,u,-1,l),he(e,t,l,s,C,h,o),n.Cartesian3.negate(r,r),n.Cartesian3.add(x,r,l),C=pe(g,A,T,u,-1,l),he(e,t,l,s,C,g,o),C=pe(g,A,T,u,d+1,f),he(e,t,f,s,C,g,o)}else{let n,r,a;i.y<0?(n=p.attributes,r=p.indices,a=y):(n=c.attributes,r=c.indices,a=m),C=pe(n,r,a,u,d,i),he(e,t,i,s,C,n,o),C=pe(n,r,a,u,d+1,f),he(e,t,f,s,C,n,o)}}ee(e,p,c)}const be=new n.Cartesian2,ge=new n.Cartesian2,Ae=new n.Cartesian3,Te=new n.Cartesian3,xe=new n.Cartesian3,Pe=new n.Cartesian3,we=new n.Cartesian3,Se=new n.Cartesian3,Ie=new n.Cartesian4;function Oe(e){const t=e.attributes,i=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=i.length;for(let e=0;e<s;e+=3){const t=n.Cartesian3.unpack(i,e,Ae);if(t.x>0)continue;const o=n.Cartesian3.unpack(r,e,Te);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=i[e-3],r[e+1]=i[e-2],r[e+2]=i[e-1]):n.Cartesian3.pack(t,r,e));const u=n.Cartesian3.unpack(a,e,xe);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=i[e+3],a[e+1]=i[e+4],a[e+2]=i[e+5]):n.Cartesian3.pack(t,a,e))}}const Ee=5*a.CesiumMath.EPSILON9,Ne=a.CesiumMath.EPSILON6;C.splitLongitude=function(e){const t=e.geometry,i=t.boundingSphere;if(r.defined(i)){if(i.center.x-i.radius>0||s.BoundingSphere.intersectPlane(i,p.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){case u.GeometryType.POLYLINES:!function(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=i.prevPosition.values,u=i.nextPosition.values,c=i.expandAndWidth.values,p=r.defined(i.st)?i.st.values:void 0,d=r.defined(i.color)?i.color.values:void 0,f=$(t),y=$(t);let m,C,h,v=!1;const b=s.length/3;for(m=0;m<b;m+=4){const e=m,t=m+2,i=n.Cartesian3.fromArray(s,3*e,Ae),b=n.Cartesian3.fromArray(s,3*t,Te);if(Math.abs(i.y)<Ne)for(i.y=Ne*(b.y<0?-1:1),s[3*m+1]=i.y,s[3*(m+1)+1]=i.y,C=3*e;C<3*e+12;C+=3)o[C]=s[3*m],o[C+1]=s[3*m+1],o[C+2]=s[3*m+2];if(Math.abs(b.y)<Ne)for(b.y=Ne*(i.y<0?-1:1),s[3*(m+2)+1]=b.y,s[3*(m+3)+1]=b.y,C=3*e;C<3*e+12;C+=3)u[C]=s[3*(m+2)],u[C+1]=s[3*(m+2)+1],u[C+2]=s[3*(m+2)+2];let g=f.attributes,A=f.indices,T=y.attributes,x=y.indices;const P=l.IntersectionTests.lineSegmentPlane(i,b,ye,Pe);if(r.defined(P)){v=!0;const s=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,Ee,we);i.y<0&&(n.Cartesian3.negate(s,s),g=y.attributes,A=y.indices,T=f.attributes,x=f.indices);const l=n.Cartesian3.add(P,s,Se);g.position.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.position.values.push(l.x,l.y,l.z),g.position.values.push(l.x,l.y,l.z),g.prevPosition.values.push(o[3*e],o[3*e+1],o[3*e+2]),g.prevPosition.values.push(o[3*e+3],o[3*e+4],o[3*e+5]),g.prevPosition.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),n.Cartesian3.negate(s,s),n.Cartesian3.add(P,s,l),T.position.values.push(l.x,l.y,l.z),T.position.values.push(l.x,l.y,l.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const w=n.Cartesian2.fromArray(c,2*e,be),S=Math.abs(w.y);g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S),T.expandAndWidth.values.push(-1,S,1,S),T.expandAndWidth.values.push(-1,-S,1,-S);let I=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(P,i,xe));if(I/=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(b,i,xe)),r.defined(d)){const i=n.Cartesian4.fromArray(d,4*e,Ie),r=n.Cartesian4.fromArray(d,4*t,Ie),s=a.CesiumMath.lerp(i.x,r.x,I),o=a.CesiumMath.lerp(i.y,r.y,I),u=a.CesiumMath.lerp(i.z,r.z,I),c=a.CesiumMath.lerp(i.w,r.w,I);for(C=4*e;C<4*e+8;++C)g.color.values.push(d[C]);for(g.color.values.push(s,o,u,c),g.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),C=4*t;C<4*t+8;++C)T.color.values.push(d[C])}if(r.defined(p)){const i=n.Cartesian2.fromArray(p,2*e,be),r=n.Cartesian2.fromArray(p,2*(m+3),ge),s=a.CesiumMath.lerp(i.x,r.x,I);for(C=2*e;C<2*e+4;++C)g.st.values.push(p[C]);for(g.st.values.push(s,i.y),g.st.values.push(s,r.y),T.st.values.push(s,i.y),T.st.values.push(s,r.y),C=2*t;C<2*t+4;++C)T.st.values.push(p[C])}h=g.position.values.length/3-4,A.push(h,h+2,h+1),A.push(h+1,h+2,h+3),h=T.position.values.length/3-4,x.push(h,h+2,h+1),x.push(h+1,h+2,h+3)}else{let e,t;for(i.y<0?(e=y.attributes,t=y.indices):(e=f.attributes,t=f.indices),e.position.values.push(i.x,i.y,i.z),e.position.values.push(i.x,i.y,i.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),C=3*m;C<3*m+12;++C)e.prevPosition.values.push(o[C]),e.nextPosition.values.push(u[C]);for(C=2*m;C<2*m+8;++C)e.expandAndWidth.values.push(c[C]),r.defined(p)&&e.st.values.push(p[C]);if(r.defined(d))for(C=4*m;C<4*m+16;++C)e.color.values.push(d[C]);h=e.position.values.length/3-4,t.push(h,h+2,h+1),t.push(h+1,h+2,h+3)}}v&&(Oe(y),Oe(f)),ee(e,y,f)}(e);break;case u.GeometryType.TRIANGLES:fe(e);break;case u.GeometryType.LINES:ve(e)}else q(t),t.primitiveType===u.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===u.PrimitiveType.LINES&&ve(e);return e},e.GeometryPipeline=C}));
|
1
|
+
define(["exports","./AttributeCompression-80665726","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19","./Transforms-c8cb8f43","./EncodedCartesian3-d9f5c4a4","./GeometryAttribute-89a520b9","./IndexDatatype-f1dcdf35","./IntersectionTests-58aa8f80","./Plane-3f01019d"],(function(e,t,n,i,r,a,s,o,u,c,l,p){"use strict";const d=new n.Cartesian3,f=new n.Cartesian3,y=new n.Cartesian3;const m={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};m.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let f;for(f=0;f<u;f++)d[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let y=0;for(;c<p;)d[t[c]].vertexTriangles.push(y),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(y),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(y),++d[t[c+2]].numLiveTriangles,++y,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(f=0;f<x;f++)P[f]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(y=g.vertexTriangles[e],!P[y]){P[y]=!0,c=y+y+y;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};const C={};function h(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function v(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function b(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}C.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case u.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=c.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)h(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case u.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=c.IndexDatatype.createTypedArray(t,n);h(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)h(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case u.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=c.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)h(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=u.PrimitiveType.LINES}return e},C.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,c=i.length,l=new Float64Array(2*c);let p,d=0;for(let e=0;e<c;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+o[e]*n,l[d++]=i[e+1]+o[e+1]*n,l[d++]=i[e+2]+o[e+2]*n;const f=e.boundingSphere;return r.defined(f)&&(p=new s.BoundingSphere(f.center,f.radius+n)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:u.PrimitiveType.LINES,boundingSphere:p})},C.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},C.reorderForPreVertexCache=function(e){const t=u.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const s=n,o=s.length,u=c.IndexDatatype.createTypedArray(t,o);let l,p=0,d=0,f=0;for(;p<o;)l=i[s[p]],-1!==l?u[d]=l:(l=s[p],i[l]=f,u[d]=f,++f),++p,++d;e.indices=u;const y=e.attributes;for(const e in y)if(y.hasOwnProperty(e)&&r.defined(y[e])&&r.defined(y[e].values)){const n=y[e],r=n.values;let s=0;const o=n.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(n.componentDatatype,f*o);for(;s<t;){const e=i[s];if(-1!==e)for(let t=0;t<o;t++)u[o*e+t]=r[o*s+t];++s}n.values=u}}return e},C.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=m.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},C.fitToUnsignedShortIndices=function(e){const t=[],n=u.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=v(e.attributes);const c=e.indices,l=c.length;let p;e.primitiveType===u.PrimitiveType.TRIANGLES?p=3:e.primitiveType===u.PrimitiveType.LINES?p=2:e.primitiveType===u.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=c[d+t];let u=n[a];r.defined(u)||(u=s++,n[a]=u,b(o,e.attributes,a)),i.push(u)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const g=new n.Cartesian3,A=new n.Cartographic;C.projectTo2D=function(e,t,i,o,c){const l=e.attributes[t],p=(c=r.defined(c)?c:new s.GeographicProjection).ellipsoid,d=l.values,f=new Float64Array(d.length);let y=0;for(let e=0;e<d.length;e+=3){const t=n.Cartesian3.fromArray(d,e,g),i=p.cartesianToCartographic(t,A),r=c.project(i,g);f[y++]=r.x,f[y++]=r.y,f[y++]=r.z}return e.attributes[i]=l,e.attributes[o]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};const T={high:0,low:0};C.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],s=r.values,c=s.length,l=new Float32Array(c),p=new Float32Array(c);for(let e=0;e<c;++e)o.EncodedCartesian3.encode(s[e],T),l[e]=T.high,p[e]=T.low;const d=r.componentsPerAttribute;return e.attributes[n]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let x=new n.Cartesian3;function P(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix4.multiplyByPoint(e,x,x),n.Cartesian3.pack(x,i,t)}}function w(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix3.multiplyByVector(e,x,x),x=n.Cartesian3.normalize(x,x),n.Cartesian3.pack(x,i,t)}}const S=new n.Matrix4,I=new n.Matrix3;C.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;P(t,i.position),P(t,i.prevPosition),P(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,S),n.Matrix4.transpose(S,S),n.Matrix4.getMatrix3(S,I),w(I,i.normal),w(I,i.tangent),w(I,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const O=new n.Cartesian3;function E(e,t){const i=e.length;let o,l,p,d;e[0].modelMatrix;const f=r.defined(e[0][t].indices),y=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},s=e[0][t].attributes;let o;for(o in s)if(s.hasOwnProperty(o)&&r.defined(s[o])&&r.defined(s[o].values)){const c=s[o];let l=c.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[o];if(!r.defined(n)||c.componentDatatype!==n.componentDatatype||c.componentsPerAttribute!==n.componentsPerAttribute||c.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[o]=new u.GeometryAttribute({componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:a.ComponentDatatype.createTypedArray(c.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(o in m)if(m.hasOwnProperty(o))for(C=m[o].values,d=0,l=0;l<i;++l)for(h=e[l][t].attributes[o].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(f){let n=0;for(l=0;l<i;++l)n+=e[l][t].indices.length;const r=u.Geometry.computeNumberOfVertices(new u.Geometry({attributes:m,primitiveType:u.PrimitiveType.POINTS})),a=c.IndexDatatype.createTypedArray(r,n);let s=0,o=0;for(l=0;l<i;++l){const n=e[l][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=u.Geometry.computeNumberOfVertices(e[l][t])}b=a}let g,A=new n.Cartesian3,T=0;for(l=0;l<i;++l){if(g=e[l][t].boundingSphere,!r.defined(g)){A=void 0;break}n.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(n.Cartesian3.divideByScalar(A,i,A),l=0;l<i;++l){g=e[l][t].boundingSphere;const i=n.Cartesian3.magnitude(n.Cartesian3.subtract(g.center,A,O))+g.radius;i>T&&(T=i)}return new u.Geometry({attributes:m,indices:b,primitiveType:y,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}C.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(E(t,"geometry")),n.length>0&&(a.push(E(n,"westHemisphereGeometry")),a.push(E(n,"eastHemisphereGeometry"))),a};const N=new n.Cartesian3,L=new n.Cartesian3,z=new n.Cartesian3,D=new n.Cartesian3;C.computeNormal=function(e){const t=e.indices,i=e.attributes,r=i.position.values,s=i.position.values.length/3,o=t.length,c=new Array(s),l=new Array(o/3),p=new Array(o);let d;for(d=0;d<s;d++)c[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<o;d+=3){const e=t[d],i=t[d+1],a=t[d+2],s=3*e,o=3*i,u=3*a;L.x=r[s],L.y=r[s+1],L.z=r[s+2],z.x=r[o],z.y=r[o+1],z.z=r[o+2],D.x=r[u],D.y=r[u+1],D.z=r[u+2],c[e].count++,c[i].count++,c[a].count++,n.Cartesian3.subtract(z,L,z),n.Cartesian3.subtract(D,L,D),l[f]=n.Cartesian3.cross(z,D,new n.Cartesian3),f++}let y,m=0;for(d=0;d<s;d++)c[d].indexOffset+=m,m+=c[d].count;for(f=0,d=0;d<o;d+=3){y=c[t[d]];let e=y.indexOffset+y.currentCount;p[e]=f,y.currentCount++,y=c[t[d+1]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,y=c[t[d+2]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,f++}const C=new Float32Array(3*s);for(d=0;d<s;d++){const e=3*d;if(y=c[d],n.Cartesian3.clone(n.Cartesian3.ZERO,N),y.count>0){for(f=0;f<y.count;f++)n.Cartesian3.add(N,l[p[y.indexOffset+f]],N);n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&n.Cartesian3.clone(l[p[y.indexOffset]],N)}n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&(N.z=1),n.Cartesian3.normalize(N,N),C[e]=N.x,C[e+1]=N.y,C[e+2]=N.z}return e.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const M=new n.Cartesian3,G=new n.Cartesian3,R=new n.Cartesian3;C.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,s=e.attributes.st.values,o=e.attributes.position.values.length/3,c=t.length,l=new Array(3*o);let p,d,f,y;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<c;p+=3){const e=t[p],n=t[p+1],r=t[p+2];d=3*e,f=3*n,y=3*r;const a=2*e,o=2*n,u=2*r,c=i[d],m=i[d+1],C=i[d+2],h=s[a],v=s[a+1],b=s[o+1]-v,g=s[u+1]-v,A=1/((s[o]-h)*g-(s[u]-h)*b),T=(g*(i[f]-c)-b*(i[y]-c))*A,x=(g*(i[f+1]-m)-b*(i[y+1]-m))*A,P=(g*(i[f+2]-C)-b*(i[y+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P}const m=new Float32Array(3*o),C=new Float32Array(3*o);for(p=0;p<o;p++){d=3*p,f=d+1,y=d+2;const e=n.Cartesian3.fromArray(r,d,M),t=n.Cartesian3.fromArray(l,d,R),i=n.Cartesian3.dot(e,t);n.Cartesian3.multiplyByScalar(e,i,G),n.Cartesian3.normalize(n.Cartesian3.subtract(t,G,t),t),m[d]=t.x,m[f]=t.y,m[y]=t.z,n.Cartesian3.normalize(n.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[f]=t.y,C[y]=t.z}return e.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const V=new n.Cartesian2,F=new n.Cartesian3,B=new n.Cartesian3,_=new n.Cartesian3;let k=new n.Cartesian2;function q(e){switch(e.primitiveType){case u.PrimitiveType.TRIANGLE_FAN:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case u.PrimitiveType.LINE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINE_LOOP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function U(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}C.compressVertices=function(e){const i=e.attributes.extrudeDirection;let s,o;if(r.defined(i)){const r=i.values;o=r.length/3;const c=new Float32Array(2*o);let l=0;for(s=0;s<o;++s)n.Cartesian3.fromArray(r,3*s,F),n.Cartesian3.equals(F,n.Cartesian3.ZERO)?l+=2:(k=t.AttributeCompression.octEncodeInRange(F,65535,k),c[l++]=k.x,c[l++]=k.y);return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}),delete e.attributes.extrudeDirection,e}const c=e.attributes.normal,l=e.attributes.st,p=r.defined(c),d=r.defined(l);if(!p&&!d)return e;const f=e.attributes.tangent,y=e.attributes.bitangent,m=r.defined(f),C=r.defined(y);let h,v,b,g;p&&(h=c.values),d&&(v=l.values),m&&(b=f.values),C&&(g=y.values);o=(p?h.length:v.length)/(p?3:2);let A=o,T=d&&p?2:1;T+=m||C?1:0,A*=T;const x=new Float32Array(A);let P=0;for(s=0;s<o;++s){d&&(n.Cartesian2.fromArray(v,2*s,V),x[P++]=t.AttributeCompression.compressTextureCoordinates(V));const e=3*s;p&&r.defined(b)&&r.defined(g)?(n.Cartesian3.fromArray(h,e,F),n.Cartesian3.fromArray(b,e,B),n.Cartesian3.fromArray(g,e,_),t.AttributeCompression.octPack(F,B,_,V),x[P++]=V.x,x[P++]=V.y):(p&&(n.Cartesian3.fromArray(h,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),m&&(n.Cartesian3.fromArray(b,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),C&&(n.Cartesian3.fromArray(g,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)))}return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:T,values:x}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};const Y=new n.Cartesian3;function Z(e,t,i,r){n.Cartesian3.add(e,n.Cartesian3.multiplyByScalar(n.Cartesian3.subtract(t,e,Y),e.y/(e.y-t.y),Y),i),n.Cartesian3.clone(i,r),U(i,!0),U(r,!1)}const H=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,j=new n.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return U(e,e.y<0),U(t,t.y<0),void U(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;U(e,u),U(t,u),U(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=J.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(Z(e,t,H,X),Z(e,n,W,j),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(Z(t,n,H,X),Z(t,e,W,j),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(Z(n,e,H,X),Z(n,t,W,j),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(Z(n,e,H,X),Z(n,t,W,j),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Z(t,n,H,X),Z(t,e,W,j),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Z(e,t,H,X),Z(e,n,W,j),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=J.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=H,c[4]=W,c[5]=X,c[6]=j,c.length=7),J}function Q(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=a.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=u.Geometry.computeNumberOfVertices(e);return e.indices=c.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function $(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new u.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=Q(t,i),n=Q(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function te(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const f=e.fromArray(c,a*t,n),y=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(y,u.y,y),e.multiplyByScalar(m,u.z,m);const C=e.add(f,y,f);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const ne=te(n.Cartesian4,4),ie=te(n.Cartesian3,3),re=te(n.Cartesian2,2),ae=new n.Cartesian3,se=new n.Cartesian3,oe=new n.Cartesian3,ue=new n.Cartesian3;function ce(e,t,i,s,o,u,c,l,p,m,C,h,v,b,g,A){if(!(r.defined(u)||r.defined(c)||r.defined(l)||r.defined(p)||r.defined(m)||0!==b))return;const T=function(e,t,i,s,o){let u,c,l,p,m,C,h,v;if(r.defined(o)||(o=new n.Cartesian3),r.defined(t.z)){if(n.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian3.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian3.subtract(i,t,d),c=n.Cartesian3.subtract(s,t,f),l=n.Cartesian3.subtract(e,t,y),p=n.Cartesian3.dot(u,u),m=n.Cartesian3.dot(u,c),C=n.Cartesian3.dot(u,l),h=n.Cartesian3.dot(c,c),v=n.Cartesian3.dot(c,l)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian2.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian2.subtract(i,t,d),c=n.Cartesian2.subtract(s,t,f),l=n.Cartesian2.subtract(e,t,y),p=n.Cartesian2.dot(u,u),m=n.Cartesian2.dot(u,c),C=n.Cartesian2.dot(u,l),h=n.Cartesian2.dot(c,c),v=n.Cartesian2.dot(c,l)}o.y=h*C-m*v,o.z=p*v-m*C;const b=p*h-m*m;if(0!==b)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}(s,n.Cartesian3.fromArray(o,3*e,ae),n.Cartesian3.fromArray(o,3*t,se),n.Cartesian3.fromArray(o,3*i,oe),ue);if(r.defined(T)){if(r.defined(u)&&ie(e,t,i,T,u,h.normal.values,A,!0),r.defined(m)){const r=n.Cartesian3.fromArray(m,3*e,ae),a=n.Cartesian3.fromArray(m,3*t,se),s=n.Cartesian3.fromArray(m,3*i,oe);let o;n.Cartesian3.multiplyByScalar(r,T.x,r),n.Cartesian3.multiplyByScalar(a,T.y,a),n.Cartesian3.multiplyByScalar(s,T.z,s),n.Cartesian3.equals(r,n.Cartesian3.ZERO)&&n.Cartesian3.equals(a,n.Cartesian3.ZERO)&&n.Cartesian3.equals(s,n.Cartesian3.ZERO)?(o=ae,o.x=0,o.y=0,o.z=0):(o=n.Cartesian3.add(r,a,r),n.Cartesian3.add(o,s,o),n.Cartesian3.normalize(o,o)),n.Cartesian3.pack(o,h.extrudeDirection.values,3*A)}if(r.defined(C)&&function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0}(e,t,i,T,C,h.applyOffset.values,A),r.defined(c)&&ie(e,t,i,T,c,h.tangent.values,A,!0),r.defined(l)&&ie(e,t,i,T,l,h.bitangent.values,A,!0),r.defined(p)&&re(e,t,i,T,p,h.st.values,A),b>0)for(let n=0;n<b;n++){const r=v[n];le(e,t,i,T,A,g[r],h[r])}}}function le(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:ne(e,t,n,i,u,c,r,!1);break;case 3:ie(e,t,n,i,u,c,r,!1);break;case 2:re(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function pe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const de={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){const t=e.geometry,i=t.attributes,a=i.position.values,s=r.defined(i.normal)?i.normal.values:void 0,o=r.defined(i.bitangent)?i.bitangent.values:void 0,u=r.defined(i.tangent)?i.tangent.values:void 0,c=r.defined(i.st)?i.st.values:void 0,l=r.defined(i.extrudeDirection)?i.extrudeDirection.values:void 0,p=r.defined(i.applyOffset)?i.applyOffset.values:void 0,d=t.indices,f=[];for(const e in i)i.hasOwnProperty(e)&&!de[e]&&r.defined(i[e])&&f.push(e);const y=f.length,m=$(t),C=$(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=n.Cartesian3.fromArray(a,3*e),S=n.Cartesian3.fromArray(a,3*t),I=n.Cartesian3.fromArray(a,3*P);const O=K(w,S,I);if(r.defined(O)&&O.positions.length>3){const n=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=n[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,w<3?A+w:-1,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,A,w),ce(e,t,P,w,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+1,S),ce(e,t,P,S,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+2,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}ee(e,C,m)}const ye=p.Plane.fromPointNormal(n.Cartesian3.ZERO,n.Cartesian3.UNIT_Y),me=new n.Cartesian3,Ce=new n.Cartesian3;function he(e,t,i,s,o,u,c){if(!r.defined(c))return;const l=n.Cartesian3.fromArray(s,3*e,ae);n.Cartesian3.equalsEpsilon(l,i,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function ve(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=r.defined(i.applyOffset)?i.applyOffset.values:void 0,u=t.indices,c=$(t),p=$(t);let d;const f=u.length,y=[];y.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<y.length;++d)y[d]=-1,m[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],i=n.Cartesian3.fromArray(s,3*e,ae),f=n.Cartesian3.fromArray(s,3*t,se);let C;Math.abs(i.y)<a.CesiumMath.EPSILON6&&(i.y<0?i.y=-a.CesiumMath.EPSILON6:i.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=p.attributes,A=p.indices,T=y;const x=l.IntersectionTests.lineSegmentPlane(i,f,ye,oe);if(r.defined(x)){const r=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,me);i.y<0&&(n.Cartesian3.negate(r,r),h=p.attributes,v=p.indices,b=y,g=c.attributes,A=c.indices,T=m);const l=n.Cartesian3.add(x,r,Ce);C=pe(h,v,b,u,d,i),he(e,t,i,s,C,h,o),C=pe(h,v,b,u,-1,l),he(e,t,l,s,C,h,o),n.Cartesian3.negate(r,r),n.Cartesian3.add(x,r,l),C=pe(g,A,T,u,-1,l),he(e,t,l,s,C,g,o),C=pe(g,A,T,u,d+1,f),he(e,t,f,s,C,g,o)}else{let n,r,a;i.y<0?(n=p.attributes,r=p.indices,a=y):(n=c.attributes,r=c.indices,a=m),C=pe(n,r,a,u,d,i),he(e,t,i,s,C,n,o),C=pe(n,r,a,u,d+1,f),he(e,t,f,s,C,n,o)}}ee(e,p,c)}const be=new n.Cartesian2,ge=new n.Cartesian2,Ae=new n.Cartesian3,Te=new n.Cartesian3,xe=new n.Cartesian3,Pe=new n.Cartesian3,we=new n.Cartesian3,Se=new n.Cartesian3,Ie=new n.Cartesian4;function Oe(e){const t=e.attributes,i=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=i.length;for(let e=0;e<s;e+=3){const t=n.Cartesian3.unpack(i,e,Ae);if(t.x>0)continue;const o=n.Cartesian3.unpack(r,e,Te);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=i[e-3],r[e+1]=i[e-2],r[e+2]=i[e-1]):n.Cartesian3.pack(t,r,e));const u=n.Cartesian3.unpack(a,e,xe);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=i[e+3],a[e+1]=i[e+4],a[e+2]=i[e+5]):n.Cartesian3.pack(t,a,e))}}const Ee=5*a.CesiumMath.EPSILON9,Ne=a.CesiumMath.EPSILON6;C.splitLongitude=function(e){const t=e.geometry,i=t.boundingSphere;if(r.defined(i)){if(i.center.x-i.radius>0||s.BoundingSphere.intersectPlane(i,p.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){case u.GeometryType.POLYLINES:!function(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=i.prevPosition.values,u=i.nextPosition.values,c=i.expandAndWidth.values,p=r.defined(i.st)?i.st.values:void 0,d=r.defined(i.color)?i.color.values:void 0,f=$(t),y=$(t);let m,C,h,v=!1;const b=s.length/3;for(m=0;m<b;m+=4){const e=m,t=m+2,i=n.Cartesian3.fromArray(s,3*e,Ae),b=n.Cartesian3.fromArray(s,3*t,Te);if(Math.abs(i.y)<Ne)for(i.y=Ne*(b.y<0?-1:1),s[3*m+1]=i.y,s[3*(m+1)+1]=i.y,C=3*e;C<3*e+12;C+=3)o[C]=s[3*m],o[C+1]=s[3*m+1],o[C+2]=s[3*m+2];if(Math.abs(b.y)<Ne)for(b.y=Ne*(i.y<0?-1:1),s[3*(m+2)+1]=b.y,s[3*(m+3)+1]=b.y,C=3*e;C<3*e+12;C+=3)u[C]=s[3*(m+2)],u[C+1]=s[3*(m+2)+1],u[C+2]=s[3*(m+2)+2];let g=f.attributes,A=f.indices,T=y.attributes,x=y.indices;const P=l.IntersectionTests.lineSegmentPlane(i,b,ye,Pe);if(r.defined(P)){v=!0;const s=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,Ee,we);i.y<0&&(n.Cartesian3.negate(s,s),g=y.attributes,A=y.indices,T=f.attributes,x=f.indices);const l=n.Cartesian3.add(P,s,Se);g.position.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.position.values.push(l.x,l.y,l.z),g.position.values.push(l.x,l.y,l.z),g.prevPosition.values.push(o[3*e],o[3*e+1],o[3*e+2]),g.prevPosition.values.push(o[3*e+3],o[3*e+4],o[3*e+5]),g.prevPosition.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),n.Cartesian3.negate(s,s),n.Cartesian3.add(P,s,l),T.position.values.push(l.x,l.y,l.z),T.position.values.push(l.x,l.y,l.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const w=n.Cartesian2.fromArray(c,2*e,be),S=Math.abs(w.y);g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S),T.expandAndWidth.values.push(-1,S,1,S),T.expandAndWidth.values.push(-1,-S,1,-S);let I=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(P,i,xe));if(I/=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(b,i,xe)),r.defined(d)){const i=n.Cartesian4.fromArray(d,4*e,Ie),r=n.Cartesian4.fromArray(d,4*t,Ie),s=a.CesiumMath.lerp(i.x,r.x,I),o=a.CesiumMath.lerp(i.y,r.y,I),u=a.CesiumMath.lerp(i.z,r.z,I),c=a.CesiumMath.lerp(i.w,r.w,I);for(C=4*e;C<4*e+8;++C)g.color.values.push(d[C]);for(g.color.values.push(s,o,u,c),g.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),C=4*t;C<4*t+8;++C)T.color.values.push(d[C])}if(r.defined(p)){const i=n.Cartesian2.fromArray(p,2*e,be),r=n.Cartesian2.fromArray(p,2*(m+3),ge),s=a.CesiumMath.lerp(i.x,r.x,I);for(C=2*e;C<2*e+4;++C)g.st.values.push(p[C]);for(g.st.values.push(s,i.y),g.st.values.push(s,r.y),T.st.values.push(s,i.y),T.st.values.push(s,r.y),C=2*t;C<2*t+4;++C)T.st.values.push(p[C])}h=g.position.values.length/3-4,A.push(h,h+2,h+1),A.push(h+1,h+2,h+3),h=T.position.values.length/3-4,x.push(h,h+2,h+1),x.push(h+1,h+2,h+3)}else{let e,t;for(i.y<0?(e=y.attributes,t=y.indices):(e=f.attributes,t=f.indices),e.position.values.push(i.x,i.y,i.z),e.position.values.push(i.x,i.y,i.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),C=3*m;C<3*m+12;++C)e.prevPosition.values.push(o[C]),e.nextPosition.values.push(u[C]);for(C=2*m;C<2*m+8;++C)e.expandAndWidth.values.push(c[C]),r.defined(p)&&e.st.values.push(p[C]);if(r.defined(d))for(C=4*m;C<4*m+16;++C)e.color.values.push(d[C]);h=e.position.values.length/3-4,t.push(h,h+2,h+1),t.push(h+1,h+2,h+3)}}v&&(Oe(y),Oe(f)),ee(e,y,f)}(e);break;case u.GeometryType.TRIANGLES:fe(e);break;case u.GeometryType.LINES:ve(e)}else q(t),t.primitiveType===u.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===u.PrimitiveType.LINES&&ve(e);return e},e.GeometryPipeline=C}));
|
@@ -0,0 +1 @@
|
|
1
|
+
define(["exports","./Matrix2-47e98d76","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Transforms-c8cb8f43","./ComponentDatatype-a15c9a19"],(function(t,n,e,a,i,r){"use strict";const s={};function o(t,n,e){const a=t+n;return r.CesiumMath.sign(t)!==r.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}s.computeDiscriminant=function(t,n,e){return n*n-4*t*e},s.computeRealRoots=function(t,n,e){let a;if(0===t)return 0===n?[]:[-e/n];if(0===n){if(0===e)return[0,0];const n=Math.abs(e),i=Math.abs(t);if(n<i&&n/i<r.CesiumMath.EPSILON14)return[0,0];if(n>i&&i/n<r.CesiumMath.EPSILON14)return[];if(a=-e/t,a<0)return[];const s=Math.sqrt(a);return[-s,s]}if(0===e)return a=-n/t,a<0?[a,0]:[0,a];const i=o(n*n,-(4*t*e),r.CesiumMath.EPSILON14);if(i<0)return[];const s=-.5*o(n,r.CesiumMath.sign(n)*Math.sqrt(i),r.CesiumMath.EPSILON14);return n>0?[s/t,e/s]:[e/s,s/t]};const c={};function u(t,n,e,a){const i=t,r=n/3,s=e/3,o=a,c=i*s,u=r*o,l=r*r,C=s*s,M=i*s-l,h=i*o-r*s,m=r*o-C,f=4*M*m-h*h;let d,g;if(f<0){let t,n,e;l*u>=c*C?(t=i,n=M,e=-2*r*M+i*h):(t=o,n=m,e=-o*h+2*s*m);const a=-(e<0?-1:1)*Math.abs(t)*Math.sqrt(-f);g=-e+a;const p=g/2,w=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),R=g===a?-w:-n/w;return d=n<=0?w+R:-e/(w*w+R*R+n),l*u>=c*C?[(d-r)/i]:[-o/(d+s)]}const p=M,w=-2*r*M+i*h,R=m,S=-o*h+2*s*m,O=Math.sqrt(f),x=Math.sqrt(3)/2;let y=Math.abs(Math.atan2(i*O,-w)/3);d=2*Math.sqrt(-p);let P=Math.cos(y);g=d*P;let N=d*(-P/2-x*Math.sin(y));const b=g+N>2*r?g-r:N-r,q=i,L=b/q;y=Math.abs(Math.atan2(o*O,-S)/3),d=2*Math.sqrt(-R),P=Math.cos(y),g=d*P,N=d*(-P/2-x*Math.sin(y));const I=-o,E=g+N<2*s?g+s:N+s,z=I/E,T=-b*E-q*I,v=(s*T-r*(b*I))/(-r*T+s*(q*E));return L<=v?L<=z?v<=z?[L,v,z]:[L,z,v]:[z,L,v]:L<=z?[v,L,z]:v<=z?[v,z,L]:[z,v,L]}c.computeDiscriminant=function(t,n,e,a){const i=n*n,r=e*e;return 18*t*n*e*a+i*r-27*(t*t)*(a*a)-4*(t*r*e+i*n*a)},c.computeRealRoots=function(t,n,e,a){let i,r;if(0===t)return s.computeRealRoots(n,e,a);if(0===n){if(0===e){if(0===a)return[0,0,0];r=-a/t;const n=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[n,n,n]}return 0===a?(i=s.computeRealRoots(t,0,e),0===i.Length?[0]:[i[0],0,i[1]]):u(t,0,e,a)}return 0===e?0===a?(r=-n/t,r<0?[r,0,0]:[0,0,r]):u(t,n,0,a):0===a?(i=s.computeRealRoots(t,n,e),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):u(t,n,e,a)};const l={};function C(t,n,e,a){const i=t*t,o=n-3*i/8,u=e-n*t/2+i*t/8,l=a-e*t/4+n*i/16-3*i*i/256,C=c.computeRealRoots(1,2*o,o*o-4*l,-u*u);if(C.length>0){const n=-t/4,e=C[C.length-1];if(Math.abs(e)<r.CesiumMath.EPSILON14){const t=s.computeRealRoots(1,o,l);if(2===t.length){const e=t[0],a=t[1];let i;if(e>=0&&a>=0){const t=Math.sqrt(e),i=Math.sqrt(a);return[n-i,n-t,n+t,n+i]}if(e>=0&&a<0)return i=Math.sqrt(e),[n-i,n+i];if(e<0&&a>=0)return i=Math.sqrt(a),[n-i,n+i]}return[]}if(e>0){const t=Math.sqrt(e),a=(o+e-u/t)/2,i=(o+e+u/t)/2,r=s.computeRealRoots(1,t,a),c=s.computeRealRoots(1,-t,i);return 0!==r.length?(r[0]+=n,r[1]+=n,0!==c.length?(c[0]+=n,c[1]+=n,r[1]<=c[0]?[r[0],r[1],c[0],c[1]]:c[1]<=r[0]?[c[0],c[1],r[0],r[1]]:r[0]>=c[0]&&r[1]<=c[1]?[c[0],r[0],r[1],c[1]]:c[0]>=r[0]&&c[1]<=r[1]?[r[0],c[0],c[1],r[1]]:r[0]>c[0]&&r[0]<c[1]?[c[0],r[0],c[1],r[1]]:[r[0],c[0],r[1],c[1]]):r):0!==c.length?(c[0]+=n,c[1]+=n,c):[]}}return[]}function M(t,n,e,a){const i=t*t,o=-2*n,u=e*t+n*n-4*a,l=i*a-e*n*t+e*e,C=c.computeRealRoots(1,o,u,l);if(C.length>0){const o=C[0],c=n-o,u=c*c,l=t/2,M=c/2,h=u-4*a,m=u+4*Math.abs(a),f=i-4*o,d=i+4*Math.abs(o);let g,p,w,R,S,O;if(o<0||h*d<f*m){const n=Math.sqrt(f);g=n/2,p=0===n?0:(t*M-e)/n}else{const n=Math.sqrt(h);g=0===n?0:(t*M-e)/n,p=n/2}0===l&&0===g?(w=0,R=0):r.CesiumMath.sign(l)===r.CesiumMath.sign(g)?(w=l+g,R=o/w):(R=l-g,w=o/R),0===M&&0===p?(S=0,O=0):r.CesiumMath.sign(M)===r.CesiumMath.sign(p)?(S=M+p,O=a/S):(O=M-p,S=a/O);const x=s.computeRealRoots(1,w,S),y=s.computeRealRoots(1,R,O);if(0!==x.length)return 0!==y.length?x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>y[0]&&x[0]<y[1]?[y[0],x[0],y[1],x[1]]:[x[0],y[0],x[1],y[1]]:x;if(0!==y.length)return y}return[]}function h(t,a){a=n.Cartesian3.clone(e.defaultValue(a,n.Cartesian3.ZERO)),n.Cartesian3.equals(a,n.Cartesian3.ZERO)||n.Cartesian3.normalize(a,a),this.origin=n.Cartesian3.clone(e.defaultValue(t,n.Cartesian3.ZERO)),this.direction=a}l.computeDiscriminant=function(t,n,e,a,i){const r=t*t,s=n*n,o=s*n,c=e*e,u=c*e,l=a*a,C=l*a,M=i*i;return s*c*l-4*o*C-4*t*u*l+18*t*n*e*C-27*r*l*l+256*(r*t)*(M*i)+i*(18*o*e*a-4*s*u+16*t*c*c-80*t*n*c*a-6*t*s*l+144*r*e*l)+M*(144*t*s*e-27*s*s-128*r*c-192*r*n*a)},l.computeRealRoots=function(t,n,e,a,i){if(Math.abs(t)<r.CesiumMath.EPSILON15)return c.computeRealRoots(n,e,a,i);const s=n/t,o=e/t,u=a/t,l=i/t;let h=s<0?1:0;switch(h+=o<0?h+1:h,h+=u<0?h+1:h,h+=l<0?h+1:h,h){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return C(s,o,u,l);case 1:case 2:case 5:case 8:case 11:return M(s,o,u,l);default:return}},h.clone=function(t,a){if(e.defined(t))return e.defined(a)?(a.origin=n.Cartesian3.clone(t.origin),a.direction=n.Cartesian3.clone(t.direction),a):new h(t.origin,t.direction)},h.getPoint=function(t,a,i){return e.defined(i)||(i=new n.Cartesian3),i=n.Cartesian3.multiplyByScalar(t.direction,a,i),n.Cartesian3.add(t.origin,i,i)};const m={rayPlane:function(t,a,i){e.defined(i)||(i=new n.Cartesian3);const s=t.origin,o=t.direction,c=a.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<r.CesiumMath.EPSILON15)return;const l=(-a.distance-n.Cartesian3.dot(c,s))/u;return l<0?void 0:(i=n.Cartesian3.multiplyByScalar(o,l,i),n.Cartesian3.add(s,i,i))}},f=new n.Cartesian3,d=new n.Cartesian3,g=new n.Cartesian3,p=new n.Cartesian3,w=new n.Cartesian3;m.rayTriangleParametric=function(t,a,i,s,o){o=e.defaultValue(o,!1);const c=t.origin,u=t.direction,l=n.Cartesian3.subtract(i,a,f),C=n.Cartesian3.subtract(s,a,d),M=n.Cartesian3.cross(u,C,g),h=n.Cartesian3.dot(l,M);let m,R,S,O,x;if(o){if(h<r.CesiumMath.EPSILON6)return;if(m=n.Cartesian3.subtract(c,a,p),S=n.Cartesian3.dot(m,M),S<0||S>h)return;if(R=n.Cartesian3.cross(m,l,w),O=n.Cartesian3.dot(u,R),O<0||S+O>h)return;x=n.Cartesian3.dot(C,R)/h}else{if(Math.abs(h)<r.CesiumMath.EPSILON6)return;const t=1/h;if(m=n.Cartesian3.subtract(c,a,p),S=n.Cartesian3.dot(m,M)*t,S<0||S>1)return;if(R=n.Cartesian3.cross(m,l,w),O=n.Cartesian3.dot(u,R)*t,O<0||S+O>1)return;x=n.Cartesian3.dot(C,R)*t}return x},m.rayTriangle=function(t,a,i,r,s,o){const c=m.rayTriangleParametric(t,a,i,r,s);if(e.defined(c)&&!(c<0))return e.defined(o)||(o=new n.Cartesian3),n.Cartesian3.multiplyByScalar(t.direction,c,o),n.Cartesian3.add(t.origin,o,o)};const R=new h;m.lineSegmentTriangle=function(t,a,i,r,s,o,c){const u=R;n.Cartesian3.clone(t,u.origin),n.Cartesian3.subtract(a,t,u.direction),n.Cartesian3.normalize(u.direction,u.direction);const l=m.rayTriangleParametric(u,i,r,s,o);if(!(!e.defined(l)||l<0||l>n.Cartesian3.distance(t,a)))return e.defined(c)||(c=new n.Cartesian3),n.Cartesian3.multiplyByScalar(u.direction,l,c),n.Cartesian3.add(u.origin,c,c)};const S={root0:0,root1:0};function O(t,a,r){e.defined(r)||(r=new i.Interval);const s=t.origin,o=t.direction,c=a.center,u=a.radius*a.radius,l=n.Cartesian3.subtract(s,c,g),C=function(t,n,e,a){const i=n*n-4*t*e;if(i<0)return;if(i>0){const e=1/(2*t),r=Math.sqrt(i),s=(-n+r)*e,o=(-n-r)*e;return s<o?(a.root0=s,a.root1=o):(a.root0=o,a.root1=s),a}const r=-n/(2*t);return 0!==r?(a.root0=a.root1=r,a):void 0}(n.Cartesian3.dot(o,o),2*n.Cartesian3.dot(o,l),n.Cartesian3.magnitudeSquared(l)-u,S);if(e.defined(C))return r.start=C.root0,r.stop=C.root1,r}m.raySphere=function(t,n,a){if(a=O(t,n,a),e.defined(a)&&!(a.stop<0))return a.start=Math.max(a.start,0),a};const x=new h;m.lineSegmentSphere=function(t,a,i,r){const s=x;n.Cartesian3.clone(t,s.origin);const o=n.Cartesian3.subtract(a,t,s.direction),c=n.Cartesian3.magnitude(o);if(n.Cartesian3.normalize(o,o),r=O(s,i,r),!(!e.defined(r)||r.stop<0||r.start>c))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,c),r};const y=new n.Cartesian3,P=new n.Cartesian3;function N(t,n,e){const a=t+n;return r.CesiumMath.sign(t)!==r.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}m.rayEllipsoid=function(t,e){const a=e.oneOverRadii,r=n.Cartesian3.multiplyComponents(a,t.origin,y),s=n.Cartesian3.multiplyComponents(a,t.direction,P),o=n.Cartesian3.magnitudeSquared(r),c=n.Cartesian3.dot(r,s);let u,l,C,M,h;if(o>1){if(c>=0)return;const t=c*c;if(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,t<C)return;if(t>C){M=c*c-C,h=-c+Math.sqrt(M);const t=h/l,n=u/h;return t<n?new i.Interval(t,n):{start:n,stop:t}}const e=Math.sqrt(u/l);return new i.Interval(e,e)}return o<1?(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,M=c*c-C,h=-c+Math.sqrt(M),new i.Interval(0,h/l)):c<0?(l=n.Cartesian3.magnitudeSquared(s),new i.Interval(0,-c/l)):void 0};const b=new n.Cartesian3,q=new n.Cartesian3,L=new n.Cartesian3,I=new n.Cartesian3,E=new n.Cartesian3,z=new n.Matrix3,T=new n.Matrix3,v=new n.Matrix3,U=new n.Matrix3,W=new n.Matrix3,B=new n.Matrix3,V=new n.Matrix3,Z=new n.Cartesian3,D=new n.Cartesian3,A=new n.Cartographic;m.grazingAltitudeLocation=function(t,a){const i=t.origin,o=t.direction;if(!n.Cartesian3.equals(i,n.Cartesian3.ZERO)){const t=a.geodeticSurfaceNormal(i,b);if(n.Cartesian3.dot(o,t)>=0)return i}const c=e.defined(this.rayEllipsoid(t,a)),u=a.transformPositionToScaledSpace(o,b),C=n.Cartesian3.normalize(u,u),M=n.Cartesian3.mostOrthogonalAxis(u,I),h=n.Cartesian3.normalize(n.Cartesian3.cross(M,C,q),q),m=n.Cartesian3.normalize(n.Cartesian3.cross(C,h,L),L),f=z;f[0]=C.x,f[1]=C.y,f[2]=C.z,f[3]=h.x,f[4]=h.y,f[5]=h.z,f[6]=m.x,f[7]=m.y,f[8]=m.z;const d=n.Matrix3.transpose(f,T),g=n.Matrix3.fromScale(a.radii,v),p=n.Matrix3.fromScale(a.oneOverRadii,U),w=W;w[0]=0,w[1]=-o.z,w[2]=o.y,w[3]=o.z,w[4]=0,w[5]=-o.x,w[6]=-o.y,w[7]=o.x,w[8]=0;const R=n.Matrix3.multiply(n.Matrix3.multiply(d,p,B),w,B),S=n.Matrix3.multiply(n.Matrix3.multiply(R,g,V),f,V),O=n.Matrix3.multiplyByVector(R,i,E),x=function(t,e,a,i,o){const c=i*i,u=o*o,C=(t[n.Matrix3.COLUMN1ROW1]-t[n.Matrix3.COLUMN2ROW2])*u,M=o*(i*N(t[n.Matrix3.COLUMN1ROW0],t[n.Matrix3.COLUMN0ROW1],r.CesiumMath.EPSILON15)+e.y),h=t[n.Matrix3.COLUMN0ROW0]*c+t[n.Matrix3.COLUMN2ROW2]*u+i*e.x+a,m=u*N(t[n.Matrix3.COLUMN2ROW1],t[n.Matrix3.COLUMN1ROW2],r.CesiumMath.EPSILON15),f=o*(i*N(t[n.Matrix3.COLUMN2ROW0],t[n.Matrix3.COLUMN0ROW2])+e.z);let d;const g=[];if(0===f&&0===m){if(d=s.computeRealRoots(C,M,h),0===d.length)return g;const t=d[0],e=Math.sqrt(Math.max(1-t*t,0));if(g.push(new n.Cartesian3(i,o*t,o*-e)),g.push(new n.Cartesian3(i,o*t,o*e)),2===d.length){const t=d[1],e=Math.sqrt(Math.max(1-t*t,0));g.push(new n.Cartesian3(i,o*t,o*-e)),g.push(new n.Cartesian3(i,o*t,o*e))}return g}const p=f*f,w=m*m,R=f*m,S=C*C+w,O=2*(M*C+R),x=2*h*C+M*M-w+p,y=2*(h*M-R),P=h*h-p;if(0===S&&0===O&&0===x&&0===y)return g;d=l.computeRealRoots(S,O,x,y,P);const b=d.length;if(0===b)return g;for(let t=0;t<b;++t){const e=d[t],a=e*e,s=Math.max(1-a,0),c=Math.sqrt(s);let u;u=r.CesiumMath.sign(C)===r.CesiumMath.sign(h)?N(C*a+h,M*e,r.CesiumMath.EPSILON12):r.CesiumMath.sign(h)===r.CesiumMath.sign(M*e)?N(C*a,M*e+h,r.CesiumMath.EPSILON12):N(C*a+M*e,h,r.CesiumMath.EPSILON12);const l=u*N(m*e,f,r.CesiumMath.EPSILON15);l<0?g.push(new n.Cartesian3(i,o*e,o*c)):l>0?g.push(new n.Cartesian3(i,o*e,o*-c)):0!==c?(g.push(new n.Cartesian3(i,o*e,o*-c)),g.push(new n.Cartesian3(i,o*e,o*c)),++t):g.push(new n.Cartesian3(i,o*e,o*c))}return g}(S,n.Cartesian3.negate(O,b),0,0,1);let y,P;const F=x.length;if(F>0){let t=n.Cartesian3.clone(n.Cartesian3.ZERO,D),e=Number.NEGATIVE_INFINITY;for(let a=0;a<F;++a){y=n.Matrix3.multiplyByVector(g,n.Matrix3.multiplyByVector(f,x[a],Z),Z);const r=n.Cartesian3.normalize(n.Cartesian3.subtract(y,i,I),I),s=n.Cartesian3.dot(r,o);s>e&&(e=s,t=n.Cartesian3.clone(y,t))}const s=a.cartesianToCartographic(t,A);return e=r.CesiumMath.clamp(e,0,1),P=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,i,I))*Math.sqrt(1-e*e),P=c?-P:P,s.height=P,a.cartographicToCartesian(s,new n.Cartesian3)}};const F=new n.Cartesian3;m.lineSegmentPlane=function(t,a,i,s){e.defined(s)||(s=new n.Cartesian3);const o=n.Cartesian3.subtract(a,t,F),c=i.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<r.CesiumMath.EPSILON6)return;const l=n.Cartesian3.dot(c,t),C=-(i.distance+l)/u;return C<0||C>1?void 0:(n.Cartesian3.multiplyByScalar(o,C,s),n.Cartesian3.add(t,s,s),s)},m.trianglePlaneIntersection=function(t,e,a,i){const r=i.normal,s=i.distance,o=n.Cartesian3.dot(r,t)+s<0,c=n.Cartesian3.dot(r,e)+s<0,u=n.Cartesian3.dot(r,a)+s<0;let l,C,M=0;if(M+=o?1:0,M+=c?1:0,M+=u?1:0,1!==M&&2!==M||(l=new n.Cartesian3,C=new n.Cartesian3),1===M){if(o)return m.lineSegmentPlane(t,e,i,l),m.lineSegmentPlane(t,a,i,C),{positions:[t,e,a,l,C],indices:[0,3,4,1,2,4,1,4,3]};if(c)return m.lineSegmentPlane(e,a,i,l),m.lineSegmentPlane(e,t,i,C),{positions:[t,e,a,l,C],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(a,t,i,l),m.lineSegmentPlane(a,e,i,C),{positions:[t,e,a,l,C],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===M){if(!o)return m.lineSegmentPlane(e,t,i,l),m.lineSegmentPlane(a,t,i,C),{positions:[t,e,a,l,C],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return m.lineSegmentPlane(a,e,i,l),m.lineSegmentPlane(t,e,i,C),{positions:[t,e,a,l,C],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,a,i,l),m.lineSegmentPlane(e,a,i,C),{positions:[t,e,a,l,C],indices:[0,1,4,0,4,3,2,3,4]}}},t.IntersectionTests=m,t.Ray=h}));
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Transforms-eb5c1a84","./Matrix2-37e55508","./RuntimeError-8952249c","./defaultValue-81eec7ed","./EllipsoidTangentPlane-678e34e4","./ComponentDatatype-a15c9a19","./Plane-6ee42cab"],(function(a,t,e,n,r,i,s,o){"use strict";function c(a,t){this.center=e.Cartesian3.clone(r.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=e.Matrix3.clone(r.defaultValue(t,e.Matrix3.ZERO))}c.packedLength=e.Cartesian3.packedLength+e.Matrix3.packedLength,c.pack=function(a,t,n){return n=r.defaultValue(n,0),e.Cartesian3.pack(a.center,t,n),e.Matrix3.pack(a.halfAxes,t,n+e.Cartesian3.packedLength),t},c.unpack=function(a,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new c),e.Cartesian3.unpack(a,t,n.center),e.Matrix3.unpack(a,t+e.Cartesian3.packedLength,n.halfAxes),n};const C=new e.Cartesian3,u=new e.Cartesian3,l=new e.Cartesian3,d=new e.Cartesian3,h=new e.Cartesian3,x=new e.Cartesian3,m=new e.Matrix3,M={unitary:new e.Matrix3,diagonal:new e.Matrix3};c.fromPoints=function(a,t){if(r.defined(t)||(t=new c),!r.defined(a)||0===a.length)return t.halfAxes=e.Matrix3.ZERO,t.center=e.Cartesian3.ZERO,t;let n;const i=a.length,s=e.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)e.Cartesian3.add(s,a[n],s);const o=1/i;e.Cartesian3.multiplyByScalar(s,o,s);let f,p=0,w=0,g=0,y=0,b=0,N=0;for(n=0;n<i;n++)f=e.Cartesian3.subtract(a[n],s,u),p+=f.x*f.x,w+=f.x*f.y,g+=f.x*f.z,y+=f.y*f.y,b+=f.y*f.z,N+=f.z*f.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=e.Matrix3.computeEigenDecomposition(T,M),A=e.Matrix3.clone(O.unitary,t.halfAxes);let P=e.Matrix3.getColumn(A,0,d),I=e.Matrix3.getColumn(A,1,h),R=e.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(n=0;n<i;n++)f=a[n],E=Math.max(e.Cartesian3.dot(P,f),E),S=Math.max(e.Cartesian3.dot(I,f),S),U=Math.max(e.Cartesian3.dot(R,f),U),L=Math.min(e.Cartesian3.dot(P,f),L),z=Math.min(e.Cartesian3.dot(I,f),z),B=Math.min(e.Cartesian3.dot(R,f),B);P=e.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=e.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=e.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=e.Cartesian3.add(P,I,t.center);e.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,e.Cartesian3.multiplyByScalar(_,.5,_),e.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const f=new e.Cartesian3,p=new e.Cartesian3;function w(a,t,n,i,s,o,C,u,l,d,h){r.defined(h)||(h=new c);const x=h.halfAxes;e.Matrix3.setColumn(x,0,t,x),e.Matrix3.setColumn(x,1,n,x),e.Matrix3.setColumn(x,2,i,x);let m=f;m.x=(s+o)/2,m.y=(C+u)/2,m.z=(l+d)/2;const M=p;M.x=(o-s)/2,M.y=(u-C)/2,M.z=(d-l)/2;const w=h.center;return m=e.Matrix3.multiplyByVector(x,m,m),e.Cartesian3.add(a,m,w),e.Matrix3.multiplyByScale(x,M,x),h}const g=new e.Cartographic,y=new e.Cartesian3,b=new e.Cartographic,N=new e.Cartographic,T=new e.Cartographic,O=new e.Cartographic,A=new e.Cartographic,P=new e.Cartesian3,I=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,S=new e.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new e.Cartesian3,k=new e.Cartesian3,W=new e.Cartesian3,D=new e.Cartesian3,X=new e.Cartesian2,q=new e.Cartesian3,j=new e.Cartesian3,Z=new e.Cartesian3,v=new o.Plane(e.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,t,n,c,C){let u,l,d,h,x,m,M;if(t=r.defaultValue(t,0),n=r.defaultValue(n,0),c=r.defaultValue(c,e.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),f=new i.EllipsoidTangentPlane(s,c);M=f.plane;const p=r.longitude,_=a.south<0&&a.north>0?0:r.latitude,k=e.Cartographic.fromRadians(p,a.north,n,b),W=e.Cartographic.fromRadians(a.west,a.north,n,N),D=e.Cartographic.fromRadians(a.west,_,n,T),X=e.Cartographic.fromRadians(a.west,a.south,n,O),q=e.Cartographic.fromRadians(p,a.south,n,A),j=c.cartographicToCartesian(k,P);let Z=c.cartographicToCartesian(W,I);const v=c.cartographicToCartesian(D,R);let Y=c.cartographicToCartesian(X,E);const G=c.cartographicToCartesian(q,S),F=f.projectPointToNearestOnPlane(j,U),H=f.projectPointToNearestOnPlane(Z,L),J=f.projectPointToNearestOnPlane(v,z),K=f.projectPointToNearestOnPlane(Y,B),Q=f.projectPointToNearestOnPlane(G,V);return u=Math.min(H.x,J.x,K.x),l=-u,h=Math.max(H.y,F.y),d=Math.min(K.y,Q.y),W.height=X.height=t,Z=c.cartographicToCartesian(W,I),Y=c.cartographicToCartesian(X,E),x=Math.min(o.Plane.getPointDistance(M,Z),o.Plane.getPointDistance(M,Y)),m=n,w(f.origin,f.xAxis,f.yAxis,f.zAxis,u,l,d,h,x,m,C)}const f=a.south>0,p=a.north<0,Y=f?a.south:p?a.north:0,G=e.Rectangle.center(a,g).longitude,F=e.Cartesian3.fromRadians(G,Y,n,c,_);F.z=0;const H=Math.abs(F.x)<s.CesiumMath.EPSILON10&&Math.abs(F.y)<s.CesiumMath.EPSILON10?e.Cartesian3.UNIT_X:e.Cartesian3.normalize(F,k),J=e.Cartesian3.UNIT_Z,K=e.Cartesian3.cross(H,J,W);M=o.Plane.fromPointNormal(F,H,v);const Q=e.Cartesian3.fromRadians(G+s.CesiumMath.PI_OVER_TWO,Y,n,c,D);l=e.Cartesian3.dot(o.Plane.projectPointOntoPlane(M,Q,X),K),u=-l,h=e.Cartesian3.fromRadians(0,a.north,p?t:n,c,q).z,d=e.Cartesian3.fromRadians(0,a.south,f?t:n,c,j).z;const $=e.Cartesian3.fromRadians(a.east,Y,n,c,Z);return x=o.Plane.getPointDistance(M,$),m=0,w(F,K,J,H,u,l,d,h,x,m,C)},c.fromTransformation=function(a,t){return r.defined(t)||(t=new c),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=e.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},c.clone=function(a,t){if(r.defined(a))return r.defined(t)?(e.Cartesian3.clone(a.center,t.center),e.Matrix3.clone(a.halfAxes,t.halfAxes),t):new c(a.center,a.halfAxes)},c.intersectPlane=function(a,n){const r=a.center,i=n.normal,s=a.halfAxes,o=i.x,c=i.y,C=i.z,u=Math.abs(o*s[e.Matrix3.COLUMN0ROW0]+c*s[e.Matrix3.COLUMN0ROW1]+C*s[e.Matrix3.COLUMN0ROW2])+Math.abs(o*s[e.Matrix3.COLUMN1ROW0]+c*s[e.Matrix3.COLUMN1ROW1]+C*s[e.Matrix3.COLUMN1ROW2])+Math.abs(o*s[e.Matrix3.COLUMN2ROW0]+c*s[e.Matrix3.COLUMN2ROW1]+C*s[e.Matrix3.COLUMN2ROW2]),l=e.Cartesian3.dot(i,r)+n.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new e.Cartesian3,G=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3,J=new e.Cartesian3,K=new e.Cartesian3;c.distanceSquaredTo=function(a,t){const n=e.Cartesian3.subtract(t,a.center,f),r=a.halfAxes;let i=e.Matrix3.getColumn(r,0,Y),o=e.Matrix3.getColumn(r,1,G),c=e.Matrix3.getColumn(r,2,F);const C=e.Cartesian3.magnitude(i),u=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(c);let d=!0,h=!0,x=!0;C>0?e.Cartesian3.divideByScalar(i,C,i):d=!1,u>0?e.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?e.Cartesian3.divideByScalar(c,l,c):x=!1;const m=!d+!h+!x;let M,p,w;if(1===m){let a=i;M=o,p=c,h?x||(a=c,p=i):(a=o,M=i),w=e.Cartesian3.cross(M,p,J),a===i?i=w:a===o?o=w:a===c&&(c=w)}else if(2===m){M=i,h?M=o:x&&(M=c);let a=e.Cartesian3.UNIT_Y;a.equalsEpsilon(M,s.CesiumMath.EPSILON3)&&(a=e.Cartesian3.UNIT_X),p=e.Cartesian3.cross(M,a,H),e.Cartesian3.normalize(p,p),w=e.Cartesian3.cross(M,p,J),e.Cartesian3.normalize(w,w),M===i?(o=p,c=w):M===o?(c=p,i=w):M===c&&(i=p,o=w)}else 3===m&&(i=e.Cartesian3.UNIT_X,o=e.Cartesian3.UNIT_Y,c=e.Cartesian3.UNIT_Z);const g=K;g.x=e.Cartesian3.dot(n,i),g.y=e.Cartesian3.dot(n,o),g.z=e.Cartesian3.dot(n,c);let y,b=0;return g.x<-C?(y=g.x+C,b+=y*y):g.x>C&&(y=g.x-C,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new e.Cartesian3,$=new e.Cartesian3;c.computePlaneDistances=function(a,n,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const C=a.center,u=a.halfAxes,l=e.Matrix3.getColumn(u,0,Y),d=e.Matrix3.getColumn(u,1,G),h=e.Matrix3.getColumn(u,2,F),x=e.Cartesian3.add(l,d,Q);e.Cartesian3.add(x,h,x),e.Cartesian3.add(x,C,x);const m=e.Cartesian3.subtract(x,n,$);let M=e.Cartesian3.dot(i,m);return o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),s.start=o,s.stop=c,s};const aa=new e.Cartesian3,ta=new e.Cartesian3,ea=new e.Cartesian3;c.computeCorners=function(a,t){r.defined(t)||(t=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3]);const n=a.center,i=a.halfAxes,s=e.Matrix3.getColumn(i,0,aa),o=e.Matrix3.getColumn(i,1,ta),c=e.Matrix3.getColumn(i,2,ea);return e.Cartesian3.clone(n,t[0]),e.Cartesian3.subtract(t[0],s,t[0]),e.Cartesian3.subtract(t[0],o,t[0]),e.Cartesian3.subtract(t[0],c,t[0]),e.Cartesian3.clone(n,t[1]),e.Cartesian3.subtract(t[1],s,t[1]),e.Cartesian3.subtract(t[1],o,t[1]),e.Cartesian3.add(t[1],c,t[1]),e.Cartesian3.clone(n,t[2]),e.Cartesian3.subtract(t[2],s,t[2]),e.Cartesian3.add(t[2],o,t[2]),e.Cartesian3.subtract(t[2],c,t[2]),e.Cartesian3.clone(n,t[3]),e.Cartesian3.subtract(t[3],s,t[3]),e.Cartesian3.add(t[3],o,t[3]),e.Cartesian3.add(t[3],c,t[3]),e.Cartesian3.clone(n,t[4]),e.Cartesian3.add(t[4],s,t[4]),e.Cartesian3.subtract(t[4],o,t[4]),e.Cartesian3.subtract(t[4],c,t[4]),e.Cartesian3.clone(n,t[5]),e.Cartesian3.add(t[5],s,t[5]),e.Cartesian3.subtract(t[5],o,t[5]),e.Cartesian3.add(t[5],c,t[5]),e.Cartesian3.clone(n,t[6]),e.Cartesian3.add(t[6],s,t[6]),e.Cartesian3.add(t[6],o,t[6]),e.Cartesian3.subtract(t[6],c,t[6]),e.Cartesian3.clone(n,t[7]),e.Cartesian3.add(t[7],s,t[7]),e.Cartesian3.add(t[7],o,t[7]),e.Cartesian3.add(t[7],c,t[7]),t};const na=new e.Matrix3;c.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const n=a.center,i=e.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(i,n,t)};const ra=new t.BoundingSphere;c.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},c.prototype.intersectPlane=function(a){return c.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){return c.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,t,e){return c.computePlaneDistances(this,a,t,e)},c.prototype.computeCorners=function(a){return c.computeCorners(this,a)},c.prototype.computeTransformation=function(a){return c.computeTransformation(this,a)},c.prototype.isOccluded=function(a){return c.isOccluded(this,a)},c.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&e.Cartesian3.equals(a.center,t.center)&&e.Matrix3.equals(a.halfAxes,t.halfAxes)},c.prototype.clone=function(a){return c.clone(this,a)},c.prototype.equals=function(a){return c.equals(this,a)},a.OrientedBoundingBox=c}));
|
1
|
+
define(["exports","./Transforms-c8cb8f43","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./EllipsoidTangentPlane-a01286f6","./ComponentDatatype-a15c9a19","./Plane-3f01019d"],(function(a,t,e,n,r,i,s,o){"use strict";function c(a,t){this.center=e.Cartesian3.clone(r.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=e.Matrix3.clone(r.defaultValue(t,e.Matrix3.ZERO))}c.packedLength=e.Cartesian3.packedLength+e.Matrix3.packedLength,c.pack=function(a,t,n){return n=r.defaultValue(n,0),e.Cartesian3.pack(a.center,t,n),e.Matrix3.pack(a.halfAxes,t,n+e.Cartesian3.packedLength),t},c.unpack=function(a,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new c),e.Cartesian3.unpack(a,t,n.center),e.Matrix3.unpack(a,t+e.Cartesian3.packedLength,n.halfAxes),n};const C=new e.Cartesian3,u=new e.Cartesian3,l=new e.Cartesian3,d=new e.Cartesian3,h=new e.Cartesian3,x=new e.Cartesian3,m=new e.Matrix3,f={unitary:new e.Matrix3,diagonal:new e.Matrix3};c.fromPoints=function(a,t){if(r.defined(t)||(t=new c),!r.defined(a)||0===a.length)return t.halfAxes=e.Matrix3.ZERO,t.center=e.Cartesian3.ZERO,t;let n;const i=a.length,s=e.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)e.Cartesian3.add(s,a[n],s);const o=1/i;e.Cartesian3.multiplyByScalar(s,o,s);let M,p=0,w=0,g=0,y=0,b=0,N=0;for(n=0;n<i;n++)M=e.Cartesian3.subtract(a[n],s,u),p+=M.x*M.x,w+=M.x*M.y,g+=M.x*M.z,y+=M.y*M.y,b+=M.y*M.z,N+=M.z*M.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=e.Matrix3.computeEigenDecomposition(T,f),A=e.Matrix3.clone(O.unitary,t.halfAxes);let P=e.Matrix3.getColumn(A,0,d),I=e.Matrix3.getColumn(A,1,h),R=e.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(n=0;n<i;n++)M=a[n],E=Math.max(e.Cartesian3.dot(P,M),E),S=Math.max(e.Cartesian3.dot(I,M),S),U=Math.max(e.Cartesian3.dot(R,M),U),L=Math.min(e.Cartesian3.dot(P,M),L),z=Math.min(e.Cartesian3.dot(I,M),z),B=Math.min(e.Cartesian3.dot(R,M),B);P=e.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=e.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=e.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=e.Cartesian3.add(P,I,t.center);e.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,e.Cartesian3.multiplyByScalar(_,.5,_),e.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const M=new e.Cartesian3,p=new e.Cartesian3;function w(a,t,n,i,s,o,C,u,l,d,h){r.defined(h)||(h=new c);const x=h.halfAxes;e.Matrix3.setColumn(x,0,t,x),e.Matrix3.setColumn(x,1,n,x),e.Matrix3.setColumn(x,2,i,x);let m=M;m.x=(s+o)/2,m.y=(C+u)/2,m.z=(l+d)/2;const f=p;f.x=(o-s)/2,f.y=(u-C)/2,f.z=(d-l)/2;const w=h.center;return m=e.Matrix3.multiplyByVector(x,m,m),e.Cartesian3.add(a,m,w),e.Matrix3.multiplyByScale(x,f,x),h}const g=new e.Cartographic,y=new e.Cartesian3,b=new e.Cartographic,N=new e.Cartographic,T=new e.Cartographic,O=new e.Cartographic,A=new e.Cartographic,P=new e.Cartesian3,I=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,S=new e.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new e.Cartesian3,k=new e.Cartesian3,W=new e.Cartesian3,D=new e.Cartesian3,X=new e.Cartesian2,q=new e.Cartesian3,j=new e.Cartesian3,Z=new e.Cartesian3,v=new o.Plane(e.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,t,n,c,C){let u,l,d,h,x,m,f;if(t=r.defaultValue(t,0),n=r.defaultValue(n,0),c=r.defaultValue(c,e.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),M=new i.EllipsoidTangentPlane(s,c);f=M.plane;const p=r.longitude,_=a.south<0&&a.north>0?0:r.latitude,k=e.Cartographic.fromRadians(p,a.north,n,b),W=e.Cartographic.fromRadians(a.west,a.north,n,N),D=e.Cartographic.fromRadians(a.west,_,n,T),X=e.Cartographic.fromRadians(a.west,a.south,n,O),q=e.Cartographic.fromRadians(p,a.south,n,A),j=c.cartographicToCartesian(k,P);let Z=c.cartographicToCartesian(W,I);const v=c.cartographicToCartesian(D,R);let Y=c.cartographicToCartesian(X,E);const G=c.cartographicToCartesian(q,S),F=M.projectPointToNearestOnPlane(j,U),H=M.projectPointToNearestOnPlane(Z,L),J=M.projectPointToNearestOnPlane(v,z),K=M.projectPointToNearestOnPlane(Y,B),Q=M.projectPointToNearestOnPlane(G,V);return u=Math.min(H.x,J.x,K.x),l=-u,h=Math.max(H.y,F.y),d=Math.min(K.y,Q.y),W.height=X.height=t,Z=c.cartographicToCartesian(W,I),Y=c.cartographicToCartesian(X,E),x=Math.min(o.Plane.getPointDistance(f,Z),o.Plane.getPointDistance(f,Y)),m=n,w(M.origin,M.xAxis,M.yAxis,M.zAxis,u,l,d,h,x,m,C)}const M=a.south>0,p=a.north<0,Y=M?a.south:p?a.north:0,G=e.Rectangle.center(a,g).longitude,F=e.Cartesian3.fromRadians(G,Y,n,c,_);F.z=0;const H=Math.abs(F.x)<s.CesiumMath.EPSILON10&&Math.abs(F.y)<s.CesiumMath.EPSILON10?e.Cartesian3.UNIT_X:e.Cartesian3.normalize(F,k),J=e.Cartesian3.UNIT_Z,K=e.Cartesian3.cross(H,J,W);f=o.Plane.fromPointNormal(F,H,v);const Q=e.Cartesian3.fromRadians(G+s.CesiumMath.PI_OVER_TWO,Y,n,c,D);l=e.Cartesian3.dot(o.Plane.projectPointOntoPlane(f,Q,X),K),u=-l,h=e.Cartesian3.fromRadians(0,a.north,p?t:n,c,q).z,d=e.Cartesian3.fromRadians(0,a.south,M?t:n,c,j).z;const $=e.Cartesian3.fromRadians(a.east,Y,n,c,Z);return x=o.Plane.getPointDistance(f,$),m=0,w(F,K,J,H,u,l,d,h,x,m,C)},c.fromTransformation=function(a,t){return r.defined(t)||(t=new c),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=e.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},c.clone=function(a,t){if(r.defined(a))return r.defined(t)?(e.Cartesian3.clone(a.center,t.center),e.Matrix3.clone(a.halfAxes,t.halfAxes),t):new c(a.center,a.halfAxes)},c.intersectPlane=function(a,n){const r=a.center,i=n.normal,s=a.halfAxes,o=i.x,c=i.y,C=i.z,u=Math.abs(o*s[e.Matrix3.COLUMN0ROW0]+c*s[e.Matrix3.COLUMN0ROW1]+C*s[e.Matrix3.COLUMN0ROW2])+Math.abs(o*s[e.Matrix3.COLUMN1ROW0]+c*s[e.Matrix3.COLUMN1ROW1]+C*s[e.Matrix3.COLUMN1ROW2])+Math.abs(o*s[e.Matrix3.COLUMN2ROW0]+c*s[e.Matrix3.COLUMN2ROW1]+C*s[e.Matrix3.COLUMN2ROW2]),l=e.Cartesian3.dot(i,r)+n.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new e.Cartesian3,G=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3,J=new e.Cartesian3,K=new e.Cartesian3;c.distanceSquaredTo=function(a,t){const n=e.Cartesian3.subtract(t,a.center,M),r=a.halfAxes;let i=e.Matrix3.getColumn(r,0,Y),o=e.Matrix3.getColumn(r,1,G),c=e.Matrix3.getColumn(r,2,F);const C=e.Cartesian3.magnitude(i),u=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(c);let d=!0,h=!0,x=!0;C>0?e.Cartesian3.divideByScalar(i,C,i):d=!1,u>0?e.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?e.Cartesian3.divideByScalar(c,l,c):x=!1;const m=!d+!h+!x;let f,p,w;if(1===m){let a=i;f=o,p=c,h?x||(a=c,p=i):(a=o,f=i),w=e.Cartesian3.cross(f,p,J),a===i?i=w:a===o?o=w:a===c&&(c=w)}else if(2===m){f=i,h?f=o:x&&(f=c);let a=e.Cartesian3.UNIT_Y;a.equalsEpsilon(f,s.CesiumMath.EPSILON3)&&(a=e.Cartesian3.UNIT_X),p=e.Cartesian3.cross(f,a,H),e.Cartesian3.normalize(p,p),w=e.Cartesian3.cross(f,p,J),e.Cartesian3.normalize(w,w),f===i?(o=p,c=w):f===o?(c=p,i=w):f===c&&(i=p,o=w)}else 3===m&&(i=e.Cartesian3.UNIT_X,o=e.Cartesian3.UNIT_Y,c=e.Cartesian3.UNIT_Z);const g=K;g.x=e.Cartesian3.dot(n,i),g.y=e.Cartesian3.dot(n,o),g.z=e.Cartesian3.dot(n,c);let y,b=0;return g.x<-C?(y=g.x+C,b+=y*y):g.x>C&&(y=g.x-C,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new e.Cartesian3,$=new e.Cartesian3;c.computePlaneDistances=function(a,n,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const C=a.center,u=a.halfAxes,l=e.Matrix3.getColumn(u,0,Y),d=e.Matrix3.getColumn(u,1,G),h=e.Matrix3.getColumn(u,2,F),x=e.Cartesian3.add(l,d,Q);e.Cartesian3.add(x,h,x),e.Cartesian3.add(x,C,x);const m=e.Cartesian3.subtract(x,n,$);let f=e.Cartesian3.dot(i,m);return o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),s.start=o,s.stop=c,s};const aa=new e.Cartesian3,ta=new e.Cartesian3,ea=new e.Cartesian3;c.computeCorners=function(a,t){r.defined(t)||(t=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3]);const n=a.center,i=a.halfAxes,s=e.Matrix3.getColumn(i,0,aa),o=e.Matrix3.getColumn(i,1,ta),c=e.Matrix3.getColumn(i,2,ea);return e.Cartesian3.clone(n,t[0]),e.Cartesian3.subtract(t[0],s,t[0]),e.Cartesian3.subtract(t[0],o,t[0]),e.Cartesian3.subtract(t[0],c,t[0]),e.Cartesian3.clone(n,t[1]),e.Cartesian3.subtract(t[1],s,t[1]),e.Cartesian3.subtract(t[1],o,t[1]),e.Cartesian3.add(t[1],c,t[1]),e.Cartesian3.clone(n,t[2]),e.Cartesian3.subtract(t[2],s,t[2]),e.Cartesian3.add(t[2],o,t[2]),e.Cartesian3.subtract(t[2],c,t[2]),e.Cartesian3.clone(n,t[3]),e.Cartesian3.subtract(t[3],s,t[3]),e.Cartesian3.add(t[3],o,t[3]),e.Cartesian3.add(t[3],c,t[3]),e.Cartesian3.clone(n,t[4]),e.Cartesian3.add(t[4],s,t[4]),e.Cartesian3.subtract(t[4],o,t[4]),e.Cartesian3.subtract(t[4],c,t[4]),e.Cartesian3.clone(n,t[5]),e.Cartesian3.add(t[5],s,t[5]),e.Cartesian3.subtract(t[5],o,t[5]),e.Cartesian3.add(t[5],c,t[5]),e.Cartesian3.clone(n,t[6]),e.Cartesian3.add(t[6],s,t[6]),e.Cartesian3.add(t[6],o,t[6]),e.Cartesian3.subtract(t[6],c,t[6]),e.Cartesian3.clone(n,t[7]),e.Cartesian3.add(t[7],s,t[7]),e.Cartesian3.add(t[7],o,t[7]),e.Cartesian3.add(t[7],c,t[7]),t};const na=new e.Matrix3;c.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const n=a.center,i=e.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(i,n,t)};const ra=new t.BoundingSphere;c.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},c.prototype.intersectPlane=function(a){return c.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){return c.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,t,e){return c.computePlaneDistances(this,a,t,e)},c.prototype.computeCorners=function(a){return c.computeCorners(this,a)},c.prototype.computeTransformation=function(a){return c.computeTransformation(this,a)},c.prototype.isOccluded=function(a){return c.isOccluded(this,a)},c.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&e.Cartesian3.equals(a.center,t.center)&&e.Matrix3.equals(a.halfAxes,t.halfAxes)},c.prototype.clone=function(a){return c.clone(this,a)},c.prototype.equals=function(a){return c.equals(this,a)},a.OrientedBoundingBox=c}));
|
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./Matrix2-
|
1
|
+
define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19"],(function(n,e,a,t,r){"use strict";function i(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}i.fromPointNormal=function(n,a,r){const s=-e.Cartesian3.dot(a,n);return t.defined(r)?(e.Cartesian3.clone(a,r.normal),r.distance=s,r):new i(a,s)};const s=new e.Cartesian3;i.fromCartesian4=function(n,a){const r=e.Cartesian3.fromCartesian4(n,s),o=n.w;return t.defined(a)?(e.Cartesian3.clone(r,a.normal),a.distance=o,a):new i(r,o)},i.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const o=new e.Cartesian3;i.projectPointOntoPlane=function(n,a,r){t.defined(r)||(r=new e.Cartesian3);const s=i.getPointDistance(n,a),c=e.Cartesian3.multiplyByScalar(n.normal,s,o);return e.Cartesian3.subtract(a,c,r)};const c=new e.Matrix4,l=new e.Cartesian4,d=new e.Cartesian3;i.transform=function(n,a,t){const r=n.normal,s=n.distance,o=e.Matrix4.inverseTranspose(a,c);let C=e.Cartesian4.fromElements(r.x,r.y,r.z,s,l);C=e.Matrix4.multiplyByVector(o,C,C);const u=e.Cartesian3.fromCartesian4(C,d);return C=e.Cartesian4.divideByScalar(C,e.Cartesian3.magnitude(u),C),i.fromCartesian4(C,t)},i.clone=function(n,a){return t.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new i(n.normal,n.distance)},i.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},i.ORIGIN_XY_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Y,0)),n.Plane=i}));
|
@@ -1 +1 @@
|
|
1
|
-
define(["exports","./ArcType-fc72c06c","./arrayRemoveDuplicates-dc2f4046","./Matrix2-
|
1
|
+
define(["exports","./ArcType-fc72c06c","./arrayRemoveDuplicates-dc2f4046","./Matrix2-47e98d76","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./EllipsoidRhumbLine-6145377b","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./GeometryPipeline-309fad76","./IndexDatatype-f1dcdf35","./PolygonPipeline-a934c4dd","./Transforms-c8cb8f43"],(function(e,t,n,i,o,r,a,s,c,l,u,h,f){"use strict";function p(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(p.prototype,{length:{get:function(){return this._length}}}),p.prototype.enqueue=function(e){this._array.push(e),this._length++},p.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},p.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},p.prototype.contains=function(e){return-1!==this._array.indexOf(e)},p.prototype.clear=function(){this._array.length=this._offset=this._length=0},p.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const d={computeHierarchyPackedLength:function(e){let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(!r.defined(e))continue;t+=2;const o=e.positions,a=e.holes;if(r.defined(o)&&(t+=o.length*i.Cartesian3.packedLength),r.defined(a)){const e=a.length;for(let t=0;t<e;++t)n.push(a[t])}}return t},packPolygonHierarchy:function(e,t,n){const o=[e];for(;o.length>0;){const e=o.pop();if(!r.defined(e))continue;const a=e.positions,s=e.holes;if(t[n++]=r.defined(a)?a.length:0,t[n++]=r.defined(s)?s.length:0,r.defined(a)){const e=a.length;for(let o=0;o<e;++o,n+=3)i.Cartesian3.pack(a[o],t,n)}if(r.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t){const n=e[t++],o=e[t++],r=new Array(n),a=o>0?new Array(o):void 0;for(let o=0;o<n;++o,t+=i.Cartesian3.packedLength)r[o]=i.Cartesian3.unpack(e,t);for(let n=0;n<o;++n)a[n]=d.unpackPolygonHierarchy(e,t),t=a[n].startingIndex,delete a[n].startingIndex;return{positions:r,holes:a,startingIndex:t}}},y=new i.Cartesian3;function g(e,t,n,o){return i.Cartesian3.subtract(t,e,y),i.Cartesian3.multiplyByScalar(y,n/o,y),i.Cartesian3.add(e,y,y),[y.x,y.y,y.z]}d.subdivideLineCount=function(e,t,n){const r=i.Cartesian3.distance(e,t)/n,a=Math.max(0,Math.ceil(o.CesiumMath.log2(r)));return Math.pow(2,a)};const m=new i.Cartographic,C=new i.Cartographic,b=new i.Cartographic,T=new i.Cartesian3;d.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,m),s=e.cartesianToCartographic(n,C),c=new a.EllipsoidRhumbLine(r,s,e).surfaceDistance/i,l=Math.max(0,Math.ceil(o.CesiumMath.log2(c)));return Math.pow(2,l)},d.subdivideLine=function(e,t,n,o){const a=d.subdivideLineCount(e,t,n),s=i.Cartesian3.distance(e,t),c=s/a;r.defined(o)||(o=[]);const l=o;l.length=3*a;let u=0;for(let n=0;n<a;n++){const i=g(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},d.subdivideRhumbLine=function(e,t,n,i,s){const c=e.cartesianToCartographic(t,m),l=e.cartesianToCartographic(n,C),u=new a.EllipsoidRhumbLine(c,l,e),h=u.surfaceDistance/i,f=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),p=Math.pow(2,f),d=u.surfaceDistance/p;r.defined(s)||(s=[]);const y=s;y.length=3*p;let g=0;for(let t=0;t<p;t++){const n=u.interpolateUsingSurfaceDistance(t*d,b),i=e.cartographicToCartesian(n,T);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const w=new i.Cartesian3,I=new i.Cartesian3,x=new i.Cartesian3,v=new i.Cartesian3;d.scaleToGeodeticHeightExtruded=function(e,t,n,o,a){o=r.defaultValue(o,i.Ellipsoid.WGS84);const s=w;let c=I;const l=x;let u=v;if(r.defined(e)&&r.defined(e.attributes)&&r.defined(e.attributes.position)){const r=e.attributes.position.values,h=r.length/2;for(let e=0;e<h;e+=3)i.Cartesian3.fromArray(r,e,l),o.geodeticSurfaceNormal(l,s),u=o.scaleToGeodeticSurface(l,u),c=i.Cartesian3.multiplyByScalar(s,n,c),c=i.Cartesian3.add(u,c,c),r[e+h]=c.x,r[e+1+h]=c.y,r[e+2+h]=c.z,a&&(u=i.Cartesian3.clone(l,u)),c=i.Cartesian3.multiplyByScalar(s,t,c),c=i.Cartesian3.add(u,c,c),r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return e},d.polygonOutlinesFromHierarchy=function(e,t,o){const a=[],s=new p;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)o.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,i.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const f=e.holes?e.holes.length:0;for(c=0;c<f;c++){const h=e.holes[c];let f=h.positions;if(t)for(u=f.length,l=0;l<u;++l)o.scaleToGeodeticSurface(f[l],f[l]);if(f=n.arrayRemoveDuplicates(f,i.Cartesian3.equalsEpsilon,!0),f.length<3)continue;a.push(f);let p=0;for(r.defined(h.holes)&&(p=h.holes.length),l=0;l<p;l++)s.enqueue(h.holes[l])}a.push(h)}return a},d.polygonsFromHierarchy=function(e,t,o,a){const s=[],c=[],l=new p;for(l.enqueue(e);0!==l.length;){const e=l.dequeue();let u=e.positions;const f=e.holes;let p,d;if(o)for(d=u.length,p=0;p<d;p++)a.scaleToGeodeticSurface(u[p],u[p]);if(u=n.arrayRemoveDuplicates(u,i.Cartesian3.equalsEpsilon,!0),u.length<3)continue;let y=t(u);if(!r.defined(y))continue;const g=[];let m=h.PolygonPipeline.computeWindingOrder2D(y);m===h.WindingOrder.CLOCKWISE&&(y.reverse(),u=u.slice().reverse());let C=u.slice();const b=r.defined(f)?f.length:0,T=[];let w;for(p=0;p<b;p++){const e=f[p];let s=e.positions;if(o)for(d=s.length,w=0;w<d;++w)a.scaleToGeodeticSurface(s[w],s[w]);if(s=n.arrayRemoveDuplicates(s,i.Cartesian3.equalsEpsilon,!0),s.length<3)continue;const c=t(s);if(!r.defined(c))continue;m=h.PolygonPipeline.computeWindingOrder2D(c),m===h.WindingOrder.CLOCKWISE&&(c.reverse(),s=s.slice().reverse()),T.push(s),g.push(C.length),C=C.concat(s),y=y.concat(c);let u=0;for(r.defined(e.holes)&&(u=e.holes.length),w=0;w<u;w++)l.enqueue(e.holes[w])}s.push({outerRing:u,holes:T}),c.push({positions:C,positions2D:y,holes:g})}return{hierarchy:s,polygons:c}};const E=new i.Cartesian2,A=new i.Cartesian3,P=new f.Quaternion,_=new i.Matrix3;d.computeBoundingRectangle=function(e,t,n,o,a){const s=f.Quaternion.fromAxisAngle(e,o,P),c=i.Matrix3.fromQuaternion(s,_);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const o=i.Cartesian3.clone(n[e],A);i.Matrix3.multiplyByVector(c,o,o);const a=t(o,E);r.defined(a)&&(l=Math.min(l,a.x),u=Math.max(u,a.x),h=Math.min(h,a.y),p=Math.max(p,a.y))}return a.x=l,a.y=h,a.width=u-l,a.height=p-h,a},d.createGeometryFromPositions=function(e,n,i,r,a,c){let u=h.PolygonPipeline.triangulate(n.positions2D,n.holes);u.length<3&&(u=[0,1,2]);const f=n.positions;if(r){const e=f.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=f[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const i=new s.Geometry({attributes:{position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:u,primitiveType:s.PrimitiveType.TRIANGLES});return a.normal?l.GeometryPipeline.computeNormal(i):i}return c===t.ArcType.GEODESIC?h.PolygonPipeline.computeSubdivision(e,f,u,i):c===t.ArcType.RHUMB?h.PolygonPipeline.computeRhumbLineSubdivision(e,f,u,i):void 0};const G=[],L=new i.Cartesian3,M=new i.Cartesian3;d.computeWallGeometry=function(e,n,r,a,l){let h,f,p,y,g,m=e.length,C=0;if(a)for(f=3*m*2,h=new Array(2*f),p=0;p<m;p++)y=e[p],g=e[(p+1)%m],h[C]=h[C+f]=y.x,++C,h[C]=h[C+f]=y.y,++C,h[C]=h[C+f]=y.z,++C,h[C]=h[C+f]=g.x,++C,h[C]=h[C+f]=g.y,++C,h[C]=h[C+f]=g.z,++C;else{const i=o.CesiumMath.chordLength(r,n.maximumRadius);let a=0;if(l===t.ArcType.GEODESIC)for(p=0;p<m;p++)a+=d.subdivideLineCount(e[p],e[(p+1)%m],i);else if(l===t.ArcType.RHUMB)for(p=0;p<m;p++)a+=d.subdivideRhumbLineCount(n,e[p],e[(p+1)%m],i);for(f=3*(a+m),h=new Array(2*f),p=0;p<m;p++){let o;y=e[p],g=e[(p+1)%m],l===t.ArcType.GEODESIC?o=d.subdivideLine(y,g,i,G):l===t.ArcType.RHUMB&&(o=d.subdivideRhumbLine(n,y,g,i,G));const r=o.length;for(let e=0;e<r;++e,++C)h[C]=o[e],h[C+f]=o[e];h[C]=g.x,h[C+f]=g.x,++C,h[C]=g.y,h[C+f]=g.y,++C,h[C]=g.z,h[C+f]=g.z,++C}}m=h.length;const b=u.IndexDatatype.createTypedArray(m/3,m-6*e.length);let T=0;for(m/=6,p=0;p<m;p++){const e=p,t=e+1,n=e+m,r=n+1;y=i.Cartesian3.fromArray(h,3*e,L),g=i.Cartesian3.fromArray(h,3*t,M),i.Cartesian3.equalsEpsilon(y,g,o.CesiumMath.EPSILON10,o.CesiumMath.EPSILON10)||(b[T++]=e,b[T++]=n,b[T++]=t,b[T++]=t,b[T++]=n,b[T++]=r)}return new s.Geometry({attributes:new c.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h})}),indices:b,primitiveType:s.PrimitiveType.TRIANGLES})},e.PolygonGeometryLibrary=d}));
|