NONGYESHUZIDIZUO/public/Cesium/Workers/buildModuleUrl-d920237a.js

2 lines
42 KiB
JavaScript
Raw Permalink Normal View History

2025-01-21 08:36:33 +08:00
define(["exports","./Cartographic-1d953166","./Check-2514d21d","./when-d186add7","./Rectangle-f841217d","./Math-7f5f2992","./FeatureDetection-4281d393","./Event-50568704","./RuntimeError-4a74cd1a"],(function(e,t,r,n,o,i,u,a,s){"use strict";function c(e){this._ellipsoid=n.u(e,o.t.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),c.prototype.project=function(e,r){var o=this._semimajorAxis,i=e.longitude*o,u=e.latitude*o,a=e.height;return n.e(r)?(r.x=i,r.y=u,r.z=a,r):new t.t(i,u,a)},c.prototype.unproject=function(e,o){if(!n.e(e))throw new r.t("cartesian is required");var i=this._oneOverSemimajorAxis,u=e.x*i,a=e.y*i,s=e.z;return n.e(o)?(o.longitude=u,o.latitude=a,o.height=s,o):new t.t$1(u,a,s)};var p=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function f(e,t){this.start=n.u(e,0),this.stop=n.u(t,0)}function l(e,r){this.center=t.t.clone(n.u(e,t.t.ZERO)),this.radius=n.u(r,0)}var h=new t.t,d=new t.t,m=new t.t,y=new t.t,v=new t.t,g=new t.t,q=new t.t,b=new t.t,w=new t.t,O=new t.t,R=new t.t,x=new t.t,A=4/3*i.e.PI;l.fromPoints=function(e,r){if(n.e(r)||(r=new l),!n.e(e)||0===e.length)return r.center=t.t.clone(t.t.ZERO,r.center),r.radius=0,r;var o,i=t.t.clone(e[0],q),u=t.t.clone(i,h),a=t.t.clone(i,d),s=t.t.clone(i,m),c=t.t.clone(i,y),p=t.t.clone(i,v),f=t.t.clone(i,g),A=e.length;for(o=1;o<A;o++){t.t.clone(e[o],i);var S=i.x,E=i.y,_=i.z;S<u.x&&t.t.clone(i,u),S>c.x&&t.t.clone(i,c),E<a.y&&t.t.clone(i,a),E>p.y&&t.t.clone(i,p),_<s.z&&t.t.clone(i,s),_>f.z&&t.t.clone(i,f)}var C=t.t.magnitudeSquared(t.t.subtract(c,u,b)),I=t.t.magnitudeSquared(t.t.subtract(p,a,b)),T=t.t.magnitudeSquared(t.t.subtract(f,s,b)),U=u,P=c,j=C;I>j&&(j=I,U=a,P=p),T>j&&(j=T,U=s,P=f);var B=w;B.x=.5*(U.x+P.x),B.y=.5*(U.y+P.y),B.z=.5*(U.z+P.z);var k=t.t.magnitudeSquared(t.t.subtract(P,B,b)),D=Math.sqrt(k),z=O;z.x=u.x,z.y=a.y,z.z=s.z;var L=R;L.x=c.x,L.y=p.y,L.z=f.z;var K=t.t.midpoint(z,L,x),M=0;for(o=0;o<A;o++){t.t.clone(e[o],i);var F=t.t.magnitude(t.t.subtract(i,K,b));F>M&&(M=F);var N=t.t.magnitudeSquared(t.t.subtract(i,B,b));if(N>k){var H=Math.sqrt(N);k=(D=.5*(D+H))*D;var V=H-D;B.x=(D*B.x+V*i.x)/H,B.y=(D*B.y+V*i.y)/H,B.z=(D*B.z+V*i.z)/H}}return D<M?(t.t.clone(B,r.center),r.radius=D):(t.t.clone(K,r.center),r.radius=M),r};var S=new c,E=new t.t,_=new t.t,C=new t.t$1,I=new t.t$1;l.fromRectangle2D=function(e,t,r){return l.fromRectangleWithHeights2D(e,t,0,0,r)},l.fromRectangleWithHeights2D=function(e,r,i,u,a){if(n.e(a)||(a=new l),!n.e(e))return a.center=t.t.clone(t.t.ZERO,a.center),a.radius=0,a;r=n.u(r,S),o.h.southwest(e,C),C.height=i,o.h.northeast(e,I),I.height=u;var s=r.project(C,E),c=r.project(I,_),p=c.x-s.x,f=c.y-s.y,h=c.z-s.z;a.radius=.5*Math.sqrt(p*p+f*f+h*h);var d=a.center;return d.x=s.x+.5*p,d.y=s.y+.5*f,d.z=s.z+.5*h,a};var T=[];l.fromRectangle3D=function(e,r,i,u){if(r=n.u(r,o.t.WGS84),i=n.u(i,0),n.e(u)||(u=new l),!n.e(e))return u.center=t.t.clone(t.t.ZERO,u.center),u.radius=0,u;var a=o.h.subsample(e,r,i,T);return l.fromPoints(a,u)},l.fromVertices=function(e,o,i,u){if(n.e(u)||(u=new l),!n.e(e)||0===e.length)return u.center=t.t.clone(t.t.ZERO,u.center),u.radius=0,u;o=n.u(o,t.t.ZERO),i=n.u(i,3),r.o.typeOf.number.greaterThanOrEquals("stride",i,3);var a=q;a.x=e[0]+o.x,a.y=e[1]+o.y,a.z=e[2]+o.z;var s,c=t.t.clone(a,h),p=t.t.clone(a,d),f=t.t.clone(a,m),A=t.t.clone(a,y),S=t.t.clone(a,v),E=t.t.clone(a,g),_=e.length;for(s=0;s<_;s+=i){var C=e[s]+o.x,I=e[s+1]+o.y,T=e[s+2]+o.z;a.x=C,a.y=I,a.z=T,C<c.x&&t.t.clone(a,c),C>A.x&&t.t.clone(a,A),I<p.y&&t.t.clone(a,p),I>S.y&&t.t.clone(a,S),T<f.z&&t.t.clone(a,f),T>E.z&&t.t.clone(a,E)}var U=t.t.magnitudeSquared(t.t.subtract(A,c,b)),P=t.t.magnitudeSquared(t.t.subtract(S,p,b)),j=t.t.magnitudeSquared(t.t.subtract(E,f,b)),B=c,k=A,D=U;P>D&&(D=P,B=p,k=S),j>D&&(D=j,B=f,k=E);var z=w;z.x=.5*(B.x+k.x),z.y=.5*(B.y+k.y),z.z=.5*(B.z+k.z);var L=t.t.magnitudeSquared(t.t.subtract(k,z,b)),K=Math.sqrt(L),M=O;M.x=c.x,M.y=p.y,M.z=f.z;var F=R;F.x=A.x,F.y=S.y,F.z=E.z;var N=t.t.midpoint(M,F,x),H=0;for(s=0;s<_;s+=i){a