qd-changjing/public/static/Build/Cesium/Workers/createVerticesFromGoogleEar...

2 lines
7.3 KiB
JavaScript
Raw Normal View History

2022-07-05 16:56:29 +08:00
define(["./AxisAlignedBoundingBox-a572809f","./Transforms-f15de320","./Matrix2-c6c16658","./when-4bbc8319","./TerrainEncoding-6d07f5d8","./ComponentDatatype-3d0a0aac","./OrientedBoundingBox-f3d80bd4","./RuntimeError-5b082e8f","./WebMercatorProjection-baa60d8a","./createTaskProcessorWorker","./combine-e9466e32","./AttributeCompression-f7a901f9","./WebGLConstants-508b9636","./EllipsoidTangentPlane-41514392","./IntersectionTests-a4e54d9a","./Plane-26e67b94"],(function(t,e,n,i,o,a,r,s,c,u,h,d,l,g,m,p){"use strict";const I=Uint16Array.BYTES_PER_ELEMENT,f=Int32Array.BYTES_PER_ELEMENT,E=Uint32Array.BYTES_PER_ELEMENT,T=Float32Array.BYTES_PER_ELEMENT,C=Float64Array.BYTES_PER_ELEMENT;function M(t,e,n){n=i.defaultValue(n,a.CesiumMath);const o=t.length;for(let i=0;i<o;++i)if(n.equalsEpsilon(t[i],e,a.CesiumMath.EPSILON12))return i;return-1}const x=new n.Cartographic,N=new n.Cartesian3,b=new n.Cartesian3,S=new n.Cartesian3,w=new n.Matrix4;function B(t,e,o,r,s,c,u,h,d,l,g){const m=h.length;for(let p=0;p<m;++p){const I=h[p],f=I.cartographic,E=I.index,T=t.length,C=f.longitude;let M=f.latitude;M=a.CesiumMath.clamp(M,-a.CesiumMath.PI_OVER_TWO,a.CesiumMath.PI_OVER_TWO);const b=f.height-u.skirtHeight;u.hMin=Math.min(u.hMin,b),n.Cartographic.fromRadians(C,M,b,x),l&&(x.longitude+=d),l?p===m-1?x.latitude+=g:0===p&&(x.latitude-=g):x.latitude+=d;const S=u.ellipsoid.cartographicToCartesian(x);t.push(S),e.push(b),o.push(n.Cartesian2.clone(o[E])),r.length>0&&r.push(r[E]),s.length>0&&s.push(s[E]),n.Matrix4.multiplyByPoint(u.toENU,S,N);const w=u.minimum,B=u.maximum;n.Cartesian3.minimumByComponent(N,w,w),n.Cartesian3.maximumByComponent(N,B,B);const P=u.lastBorderPoint;if(i.defined(P)){const t=P.index;c.push(t,T-1,T,T,E,t)}u.lastBorderPoint=I}}return u((function(u,h){u.ellipsoid=n.Ellipsoid.clone(u.ellipsoid),u.rectangle=n.Rectangle.clone(u.rectangle);const d=function(u,h,d,l,g,m,p,P,A,y,R){let _,W,v,F,O,Y;i.defined(l)?(_=l.west,W=l.south,v=l.east,F=l.north,O=l.width,Y=l.height):(_=a.CesiumMath.toRadians(g.west),W=a.CesiumMath.toRadians(g.south),v=a.CesiumMath.toRadians(g.east),F=a.CesiumMath.toRadians(g.north),O=a.CesiumMath.toRadians(l.width),Y=a.CesiumMath.toRadians(l.height));const U=[W,F],V=[_,v],k=e.Transforms.eastNorthUpToFixedFrame(h,d),H=n.Matrix4.inverseTransformation(k,w);let L,D;A&&(L=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(W),D=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F)-L));const G=1!==m,j=new DataView(u);let z=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY;const J=b;J.x=Number.POSITIVE_INFINITY,J.y=Number.POSITIVE_INFINITY,J.z=Number.POSITIVE_INFINITY;const K=S;K.x=Number.NEGATIVE_INFINITY,K.y=Number.NEGATIVE_INFINITY,K.z=Number.NEGATIVE_INFINITY;let Q,X,Z=0,$=0,tt=0;for(X=0;X<4;++X){let t=Z;Q=j.getUint32(t,!0),t+=E;const e=a.CesiumMath.toRadians(180*j.getFloat64(t,!0));t+=C,-1===M(V,e)&&V.push(e);const n=a.CesiumMath.toRadians(180*j.getFloat64(t,!0));t+=C,-1===M(U,n)&&U.push(n),t+=2*C;let i=j.getInt32(t,!0);t+=f,$+=i,i=j.getInt32(t,!0),tt+=3*i,Z+=Q+E}const et=[],nt=[],it=new Array($),ot=new Array($),at=new Array($),rt=A?new Array($):[],st=G?new Array($):[],ct=new Array(tt),ut=[],ht=[],dt=[],lt=[];let gt=0,mt=0;for(Z=0,X=0;X<4;++X){Q=j.getUint32(Z,!0),Z+=E;const t=Z,e=a.CesiumMath.toRadians(180*j.getFloat64(Z,!0));Z+=C;const i=a.CesiumMath.toRadians(180*j.getFloat64(Z,!0));Z+=C;const o=a.CesiumMath.toRadians(180*j.getFloat64(Z,!0)),r=.5*o;Z+=C;const u=a.CesiumMath.toRadians(180*j.getFloat64(Z,!0)),h=.5*u;Z+=C;const l=j.getInt32(Z,!0);Z+=f;const g=j.getInt32(Z,!0);Z+=f,Z+=f;const m=new Array(l);for(let t=0;t<l;++t){const s=e+j.getUint8(Z++)*o;x.longitude=s;const l=i+j.getUint8(Z++)*u;x.latitude=l;let g=j.getFloat32(Z,!0);if(Z+=T,0!==g&&g<R&&(g*=-Math.pow(2,y)),g*=6371010,x.height=g,-1!==M(V,s)||-1!==M(U,l)){const e=M(et,x,n.Cartographic);if(-1!==e){m[t]=nt[e];continue}et.push(n.Cartographic.clone(x)),nt.push(gt)}m[t]=gt,Math.abs(s-_)<r?ut.push({index:gt,cartographic:n.Cartographic.clone(x)}):Math.abs(s-v)<r?dt.push({index:gt,cartographic:n.Cartographic.clone(x)}):Math.abs(l-W)<h?ht.push({index:gt,car