2023-09-11 21:56:39 +08:00
|
|
|
define(["./EllipsoidTangentPlane-b2b18d75","./BoundingSphere-561b54d0","./Cartesian2-47311507","./Cartographic-3309dd0d","./when-b60132fc","./TerrainEncoding-e04be3ba","./Math-119be1a3","./OrientedBoundingBox-f1d7843f","./RuntimeError-4a5c8994","./Transforms-cb0006b0","./WebMercatorProjection-01b1b5e7","./createTaskProcessorWorker","./Check-7b2a090c","./Cartesian4-3ca25aab","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./AttributeCompression-90851096","./ComponentDatatype-c140a87d","./WebGLConstants-4ae0db90","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206"],(function(e,t,i,a,r,n,o,s,u,h,d,c,l,g,m,p,v,I,E,C,T){"use strict";var f=Uint16Array.BYTES_PER_ELEMENT,M=Int32Array.BYTES_PER_ELEMENT,b=Uint32Array.BYTES_PER_ELEMENT,N=Float32Array.BYTES_PER_ELEMENT,x=Float64Array.BYTES_PER_ELEMENT;function S(e,t,i){i=r.defaultValue(i,o.CesiumMath);for(var a=e.length,n=0;n<a;++n)if(i.equalsEpsilon(e[n],t,o.CesiumMath.EPSILON12))return n;return-1}var w=new a.Cartographic,P=new a.Cartesian3,B=new a.Cartesian3,y=new a.Cartesian3,A=new t.Matrix4;function R(e,n,s,u,h,d,c,l,g,m){for(var p=c.length,v=0;v<p;++v){var I=c[v],E=I.cartographic,C=I.index,T=e.length,f=E.longitude,M=E.latitude;M=o.CesiumMath.clamp(M,-o.CesiumMath.PI_OVER_TWO,o.CesiumMath.PI_OVER_TWO);var b=E.height-d.skirtHeight;d.hMin=Math.min(d.hMin,b),a.Cartographic.fromRadians(f,M,b,w),g&&(w.longitude+=l),g?v===p-1?w.latitude+=m:0===v&&(w.latitude-=m):w.latitude+=l;var N=d.ellipsoid.cartographicToCartesian(w);e.push(N),n.push(b),s.push(i.Cartesian2.clone(s[C])),u.length>0&&u.push(u[C]),t.Matrix4.multiplyByPoint(d.toENU,N,P);var x=d.minimum,S=d.maximum;a.Cartesian3.minimumByComponent(P,x,x),a.Cartesian3.maximumByComponent(P,S,S);var B=d.lastBorderPoint;if(r.defined(B)){var y=B.index;h.push(y,T-1,T,T,C,y)}d.lastBorderPoint=I}}return c((function(c,l){c.ellipsoid=i.Ellipsoid.clone(c.ellipsoid),c.rectangle=i.Rectangle.clone(c.rectangle);var g=function(c,l,g,m,p,v,I,E,C,T){var _,F,W,O,U,Y;r.defined(m)?(_=m.west,F=m.south,W=m.east,O=m.north,U=m.width,Y=m.height):(_=o.CesiumMath.toRadians(p.west),F=o.CesiumMath.toRadians(p.south),W=o.CesiumMath.toRadians(p.east),O=o.CesiumMath.toRadians(p.north),U=o.CesiumMath.toRadians(m.width),Y=o.CesiumMath.toRadians(m.height));var k,V,H=[F,O],L=[_,W],D=h.Transforms.eastNorthUpToFixedFrame(l,g),G=t.Matrix4.inverseTransformation(D,A);E&&(k=d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F),V=1/(d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(O)-k));var j=new DataView(c),z=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,J=B;J.x=Number.POSITIVE_INFINITY,J.y=Number.POSITIVE_INFINITY,J.z=Number.POSITIVE_INFINITY;var K=y;K.x=Number.NEGATIVE_INFINITY,K.y=Number.NEGATIVE_INFINITY,K.z=Number.NEGATIVE_INFINITY;var Q,X,Z=0,$=0,ee=0;for(X=0;X<4;++X){var te=Z;Q=j.getUint32(te,!0),te+=b;var ie=o.CesiumMath.toRadians(180*j.getFloat64(te,!0));te+=x,-1===S(L,ie)&&L.push(ie);var ae=o.CesiumMath.toRadians(180*j.getFloat64(te,!0));te+=x,-1===S(H,ae)&&H.push(ae),te+=2*x;var re=j.getInt32(te,!0);te+=M,$+=re,ee+=3*(re=j.getInt32(te,!0)),Z+=Q+b}var ne=[],oe=[],se=new Array($),ue=new Array($),he=new Array($),de=E?new Array($):[],ce=new Array(ee),le=[],ge=[],me=[],pe=[],ve=0,Ie=0;for(Z=0,X=0;X<4;++X){Q=j.getUint32(Z,!0);var Ee=Z+=b,Ce=o.CesiumMath.toRadians(180*j.getFloat64(Z,!0));Z+=x;var Te=o.CesiumMath.toRadians(180*j.getFloat64(Z,!0));Z+=x;var fe=o.CesiumMath.toRadians(180*j.getFloat64(Z,!0)),Me=.5*fe;Z+=x;var be=o.CesiumMath.toRadians(180*j.getFloat64(Z,!0)),Ne=.5*be;Z+=x;var xe=j.getInt32(Z,!0);Z+=M;var Se=j.getInt32(Z,!0);Z+=M,Z+=M;for(var we=new Array(xe),Pe=0;Pe<xe;++Pe){var Be=Ce+j.getUint8(Z++)*fe;w.longitude=Be;var ye=Te+j.getUint8(Z++)*be;w.latitude=ye;var Ae=j.getFloat32(Z,!0);if(Z+=N,0!==Ae&&Ae<T&&(Ae*=-Math.pow(2,C)),Ae*=6371010*v,w.height=Ae,-1!==S(L,Be)||-1!==S(H,ye)){var Re=S(ne,w,a.Cartographic);if(-1!==Re){we[Pe]=oe[Re];continue}ne.push(a.Cartographic.clone(w)),oe.push(ve)}we[Pe]=ve,Math.abs(Be-_)<Me?le.push({index:ve,cartographic:a.Cartographic.clone(w)}):Math.abs(Be-W)<Me?me.push({index:ve,cartographic:a.Cartographic.c
|