| | |
| | | * Version 5.3.1 |
| | | */ |
| | | |
| | | import{a as Oe}from"./chunk-DMXICNHG.js";import{a as Z}from"./chunk-3B3UDCHP.js";import{a as Ct}from"./chunk-X2QIAW2L.js";import{a as De}from"./chunk-5B7R4ODL.js";import{a as Le}from"./chunk-A6RR2BLJ.js";import{a as ee}from"./chunk-EPQZOCRV.js";import{b as te}from"./chunk-BUR4N7VJ.js";import{a as Xt}from"./chunk-33CJ2NM7.js";import{c as Ce,d as jt}from"./chunk-TNSV6TPX.js";import{a as vt,d as G}from"./chunk-QHUUGFLC.js";import{d as _e,e as Ne,f as Qt,i as U}from"./chunk-BHJLM5NY.js";import{a as zt}from"./chunk-3LWOQSP3.js";import{a as At,b as t,c as u,d as Pt,e as z,f as Bt}from"./chunk-7DK7KB7Q.js";import{a as p}from"./chunk-JSZDCKFG.js";import"./chunk-YGIPMXAD.js";import"./chunk-54HAFFPJ.js";import{a as L}from"./chunk-5HWP5DW7.js";import{a as St,b as et}from"./chunk-INT7THOB.js";import{e as m}from"./chunk-PPCZYYBW.js";function rt(e){e=L(e,L.EMPTY_OBJECT),this._ellipsoid=L(e.ellipsoid,z.default),this._rectangle=L(e.rectangle,U.MAX_VALUE),this._bounds=L(e.bounds,[]),this._projection=new vt(this._ellipsoid),this._numberOfLevelZeroTilesX=L(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=L(e.numberOfLevelZeroTilesY,1),this._tileInfo=e.tileInfo}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},bounds:{get:function(){return this._bounds}},projection:{get:function(){return this._projection}}});rt.prototype.getNumberOfXTilesAtLevel=function(e){if(!m(this._tileInfo))return this._numberOfLevelZeroTilesX<<e;let r=this._tileInfo.lods.filter(function(n){return n.level===e})[0].resolution;return Math.round(360/(this._tileInfo.rows*r))};rt.prototype.getNumberOfYTilesAtLevel=function(e){if(!m(this._tileInfo))return this._numberOfLevelZeroTilesY<<e;let r=this._tileInfo.lods.filter(function(n){return n.level===e})[0].resolution;return Math.round(180/(this._tileInfo.cols*r))};rt.prototype.rectangleToNativeRectangle=function(e,o){et.defined("rectangle",e);let r=p.toDegrees(e.west),n=p.toDegrees(e.south),i=p.toDegrees(e.east),a=p.toDegrees(e.north);return m(o)?(o.west=r,o.south=n,o.east=i,o.north=a,o):new U(r,n,i,a)};rt.prototype.tileXYToNativeRectangle=function(e,o,r,n){let i=this.tileXYToRectangle(e,o,r,n);return i.west=p.toDegrees(i.west),i.south=p.toDegrees(i.south),i.east=p.toDegrees(i.east),i.north=p.toDegrees(i.north),i};rt.prototype.tileXYToRectangle=function(e,o,r,n){let i=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=i.width/a,s=e*l+i.west,f=(e+1)*l+i.west,h=i.height/c,_=i.north-o*h,S=i.north-(o+1)*h;return m(n)||(n=new U(s,S,f,_)),n.west=s,n.south=S,n.east=f,n.north=_,n};rt.prototype.positionToTileXY=function(e,o,r){let n=this._rectangle;if(!U.contains(n,e))return;let i=this.getNumberOfXTilesAtLevel(o),a=this.getNumberOfYTilesAtLevel(o),c=n.width/i,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);let f=(s-n.west)/c|0;f>=i&&(f=i-1);let h=(n.north-e.latitude)/l|0;return h>=a&&(h=a-1),m(r)?(r.x=f,r.y=h,r):new Pt(f,h)};var Ie=rt;var He=new t,ye=new t,ke=new u,ne=new t,pn=new t,Me=new G,fn=new Ie,Ot=[new u,new u,new u,new u],Lt=new Pt,w={};w.initialize=function(){let e=w._initPromise;return m(e)||(e=_e.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(o){if(At.changeApproximateTerrainHeights===!0)for(let r in o)o.hasOwnProperty(r)&&(o[r][0]=At.minTerrainHeight,o[r][1]=At.maxTerrainHeight);w._terrainHeights=o}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,o){if(et.defined("rectangle",e),!m(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=L(o,z.default);let r=be(e),n=w._defaultMinTerrainHeight,i=w._defaultMaxTerrainHeight;if(m(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];m(c)&&(n=c[0],i=c[1]),o.cartographicToCartesian(U.northeast(e,ke),He),o.cartographicToCartesian(U.southwest(e,ke),ye),t.midpoint(ye,He,ne);let l=o.scaleToGeodeticSurface(ne,pn);if(m(l)){let s=t.distance(ne,l);n=Math.min(n,-s)}else n=w._defaultMinTerrainHeight}return n=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:i}};w.getBoundingSphere=function(e,o){if(et.defined("rectangle",e),!m(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=L(o,z.default);let r=be(e),n=w._defaultMaxTerrainHeight;if(m(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];m(c)&&(n=c[1])}let i=G.fromRectangle3D(e,o,0);return G.fromRectangle3D(e,o,n,Me),G.union(i,Me,i)};function be(e){u.fromRadians(e.east,e.north,0,Ot[0]),u.fromRadians(e.west,e.north,0,Ot[1]),u.fromRadians(e.east,e.south,0,Ot[2]),u.fromRadians(e.west,e.south,0,Ot[3]);let o=0,r=0,n=0,i=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let f=Ot[s];if(fn.positionToTileXY(f,c,Lt),s===0)n=Lt.x,i=Lt.y;else if(n!==Lt.x||i!==Lt.y){l=!0;break}}if(l)break;o=n,r=i}if(c!==0)return{x:o,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void 0;w._initPromise=void 0;Object.defineProperties(w,{initialized:{get:function(){return m(w._terrainHeights)}}});var Yt=w;var he=[vt,Oe],dn=he.length,Qe=Math.cos(p.toRadians(30)),Re=Math.cos(p.toRadians(150)),tn=0,en=1e3;function ct(e){e=L(e,L.EMPTY_OBJECT);let o=e.positions;if(!m(o)||o.length<2)throw new St("At least two positions are required.");if(m(e.arcType)&&e.arcType!==Z.GEODESIC&&e.arcType!==Z.RHUMB)throw new St("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=L(e.width,1),this._positions=o,this.granularity=L(e.granularity,9999),this.loop=L(e.loop,!1),this.arcType=L(e.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+z.packedLength+1+1}}});ct.setProjectionAndEllipsoid=function(e,o){let r=0;for(let n=0;n<dn;n++)if(o instanceof he[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=o.ellipsoid};var mn=new t,Ae=new t,Pe=new t;function le(e,o,r,n,i){let a=A(n,e,0,mn),c=A(n,e,r,Ae),l=A(n,o,0,Pe),s=nt(c,a,Ae),f=nt(l,a,Pe);return t.cross(f,s,i),t.normalize(i,i)}var gn=new u,un=new t,wn=new t,Sn=new t;function oe(e,o,r,n,i,a,c,l,s,f,h){if(i===0)return;let _;a===Z.GEODESIC?_=new De(e,o,c):a===Z.RHUMB&&(_=new ee(e,o,c));let S=_.surfaceDistance;if(S<i)return;let R=le(e,o,n,c,Sn),D=Math.ceil(S/i),I=S/D,j=I,q=D-1,d=l.length;for(let X=0;X<q;X++){let v=_.interpolateUsingSurfaceDistance(j,gn),k=A(c,v,r,un),H=A(c,v,n,wn);t.pack(R,l,d),t.pack(k,s,d),t.pack(H,f,d),h.push(v.latitude),h.push(v.longitude),d+=3,j+=I}}var ie=new u;function A(e,o,r,n){return u.clone(o,ie),ie.height=r,u.toCartesian(ie,e,n)}ct.pack=function(e,o,r){et.typeOf.object("value",e),et.defined("array",o);let n=L(r,0),i=e._positions,a=i.length;o[n++]=a;for(let c=0;c<a;++c){let l=i[c];t.pack(l,o,n),n+=3}return o[n++]=e.granularity,o[n++]=e.loop?1:0,o[n++]=e.arcType,z.pack(e._ellipsoid,o,n),n+=z.packedLength,o[n++]=e._projectionIndex,o[n++]=e._scene3DOnly?1:0,o};ct.unpack=function(e,o,r){et.defined("array",e);let n=L(o,0),i=e[n++],a=new Array(i);for(let S=0;S<i;S++)a[S]=t.unpack(e,n),n+=3;let c=e[n++],l=e[n++]===1,s=e[n++],f=z.unpack(e,n);n+=z.packedLength;let h=e[n++],_=e[n++]===1;return m(r)||(r=new ct({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=f,r._projectionIndex=h,r._scene3DOnly=_,r};function nt(e,o,r){return t.subtract(e,o,r),t.normalize(r,r),r}function ve(e,o,r,n){return n=nt(e,o,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}var Tn=new t,En=new t,xn=new t,nn=new t,_n=0,Nn=-1;function re(e,o,r,n,i){let a=nt(r,o,nn),c=ve(e,o,a,Tn),l=ve(n,o,a,En);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return i=t.cross(a,c,i),i=t.normalize(i,i),i;i=t.add(l,c,i),i=t.normalize(i,i);let s=t.cross(a,i,xn);return t.dot(l,s)<_n&&(i=t.negate(i,i)),i}var qt=Xt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,On=new t,Ln=new t,Dn=new t,In=new t,Ft=new t,Ut=new u,Be=new u,ze=new u;ct.createGeometry=function(e){let o=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,i=e.granularity,a=e.arcType,c=new he[e._projectionIndex](n),l=tn,s=en,f,h,_=e._positions,S=_.length;S===2&&(r=!1);let R,D,I,j,q=new ee(void 0,void 0,n),d,X,v,k=[_[0]];for(h=0;h<S-1;h++)R=_[h],D=_[h+1],d=te.lineSegmentPlane(R,D,qt,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?k.push(t.clone(d)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(d,Ut).longitude,I=n.cartesianToCartographic(R,Ut),j=n.cartesianToCartographic(D,Be),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,ze),d=n.cartographicToCartesian(X,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&k.push(t.clone(d)))),k.push(D);r&&(R=_[S-1],D=_[0],d=te.lineSegmentPlane(R,D,qt,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?k.push(t.clone(d)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(d,Ut).longitude,I=n.cartesianToCartographic(R,Ut),j=n.cartesianToCartographic(D,Be),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,ze),d=n.cartographicToCartesian(X,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&k.push(t.clone(d)))));let H=k.length,N=new Array(H);for(h=0;h<H;h++){let F=u.fromCartesian(k[h],n);F.height=0,N[h]=F}if(N=Le(N,u.equalsEpsilon),H=N.length,H<2)return;let y=[],P=[],B=[],E=[],x=Cn,O=On,C=Ln,Y=Dn,M=In,g=N[0],V=N[1],It=N[H-1];for(x=A(n,It,l,x),Y=A(n,V,l,Y),O=A(n,g,l,O),C=A(n,g,s,C),r?M=re(x,O,C,Y,M):M=le(g,V,s,n,M),t.pack(M,P,0),t.pack(O,B,0),t.pack(C,E,0),y.push(g.latitude),y.push(g.longitude),oe(g,V,l,s,i,a,n,P,B,E,y),h=1;h<H-1;++h){x=t.clone(O,x),O=t.clone(Y,O);let F=N[h];A(n,F,s,C),A(n,N[h+1],l,Y),re(x,O,C,Y,M),f=P.length,t.pack(M,P,f),t.pack(O,B,f),t.pack(C,E,f),y.push(F.latitude),y.push(F.longitude),oe(N[h],N[h+1],l,s,i,a,n,P,B,E,y)}let b=N[H-1],Tt=N[H-2];if(O=A(n,b,l,O),C=A(n,b,s,C),r){let F=N[0];x=A(n,Tt,l,x),Y=A(n,F,l,Y),M=re(x,O,C,Y,M)}else M=le(Tt,b,s,n,M);if(f=P.length,t.pack(M,P,f),t.pack(O,B,f),t.pack(C,E,f),y.push(b.latitude),y.push(b.longitude),r){for(oe(b,g,l,s,i,a,n,P,B,E,y),f=P.length,h=0;h<3;++h)P[f+h]=P[h],B[f+h]=B[h],E[f+h]=E[h];y.push(g.latitude),y.push(g.longitude)}return to(r,c,B,E,P,y,o)};var Hn=new t,yn=new Bt,kn=new Qt;function je(e,o,r,n){let i=nt(r,o,Hn),a=t.dot(i,e);if(a>Qe||a<Re){let c=nt(n,r,nn),l=a<Re?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Qt.fromAxisAngle(c,l,kn),f=Bt.fromQuaternion(s,yn);return Bt.multiplyByVector(f,e,e),!0}return!1}var Xe=new u,Mn=new t,Ye=new t;function Dt(e,o,r,n,i){let a=u.toCartesian(o,e._ellipsoid,Mn),c=t.add(a,r,Ye),l=!1,s=e._ellipsoid,f=s.cartesianToCartographic(c,Xe);Math.abs(o.longitude-f.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Ye),f=s.cartesianToCartographic(c,Xe)),f.height=0;let h=e.project(f,i);return i=t.subtract(h,n,i),i.z=0,i=t.normalize(i,i),l&&t.negate(i,i),i}var bn=new t,Fe=new t;function Ue(e,o,r,n,i,a){let c=t.subtract(o,e,bn);t.normalize(c,c);let l=r-tn,s=t.multiplyByScalar(c,l,Fe);t.add(e,s,i);let f=n-en;s=t.multiplyByScalar(c,f,Fe),t.add(o,s,a)}var Rn=new t;function Gt(e,o){let r=Xt.getPointDistance(qt,e),n=Xt.getPointDistance(qt,o),i=Rn;p.equalsEpsilon(r,0,p.EPSILON2)?(i=nt(o,e,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(e,i,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(i=nt(e,o,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(o,i,o))}function An(e,o){let r=Math.abs(e.longitude),n=Math.abs(o.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let i=p.sign(o.longitude);return e.longitude=i*(r-p.EPSILON11),1}else if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let i=p.sign(e.longitude);return o.longitude=i*(n-p.EPSILON11),2}return 0}var on=new u,rn=new u,Ge=new t,ae=new t,qe=new t,We=new t,Pn=new t,Ze=new t,vn=[on,rn],Bn=new U,zn=new t,jn=new t,Xn=new t,Yn=new t,Fn=new t,Un=new t,ce=new t,se=new t,Gn=new t,qn=new t,Wn=new t,Ve=new t,Zn=new t,Vn=new t,$n=new Ct,Jn=new Ct,$e=new t,Kn=new t,Je=new t,Qn=[new G,new G],an=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Ke=an.length;function to(e,o,r,n,i,a,c){let l,s,f=o._ellipsoid,h=r.length/3-1,_=h*8,S=_*4,R=h*36,D=_>65535?new Uint32Array(R):new Uint16Array(R),I=new Float64Array(_*3),j=new Float32Array(S),q=new Float32Array(S),d=new Float32Array(S),X=new Float32Array(S),v=new Float32Array(S),k,H,N,y;c&&(k=new Float32Array(S),H=new Float32Array(S),N=new Float32Array(S),y=new Float32Array(_*2));let P=a.length/2,B=0,E=on;E.height=0;let x=rn;x.height=0;let O=Ge,C=ae;if(c)for(s=0,l=1;l<P;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],O=o.project(E,O),C=o.project(x,C),B+=t.distance(O,C),s+=2;let Y=n.length/3;C=t.unpack(n,0,C);let M=0;for(s=3,l=1;l<Y;l++)O=t.clone(C,O),C=t.unpack(n,s,C),M+=t.distance(O,C),s+=3;let g;s=3;let V=0,It=0,b=0,Tt=0,F=!1,st=t.unpack(r,0,We),lt=t.unpack(n,0,ae),W=t.unpack(i,0,Ze);if(e){let ht=t.unpack(r,r.length-6,qe);je(W,ht,st,lt)&&(W=t.negate(W,W))}let fe=0,de=0,Wt=0;for(l=0;l<h;l++){let ht=t.clone(st,qe),Vt=t.clone(lt,Ge),mt=t.clone(W,Pn);F&&(mt=t.negate(mt,mt)),st=t.unpack(r,s,We),lt=t.unpack(n,s,ae),W=t.unpack(i,s,Ze),F=je(W,ht,st,lt),E.latitude=a[V],E.longitude=a[V+1],x.latitude=a[V+2],x.longitude=a[V+3];let pt,gt,ot,it;if(c){let T=An(E,x);pt=o.project(E,Fn),gt=o.project(x,Un);let wt=nt(gt,pt,$e);wt.y=Math.abs(wt.y),ot=ce,it=se,T===0||t.dot(wt,t.UNIT_Y)>Qe?(ot=Dt(o,E,mt,pt,ce),it=Dt(o,x,W,gt,se)):T===1?(it=Dt(o,x,W,gt,se),ot.x=0,ot.y=p.sign(E.longitude-Math.abs(x.longitude)),ot.z=0):(ot=Dt(o,E,mt,pt,ce),it.x=0,it.y=p.sign(E.longitude-x.longitude),it.z=0)}let ue=t.distance(Vt,lt),we=Ct.fromCartesian(ht,$n),Ht=t.subtract(st,ht,Gn),cn=t.normalize(Ht,Ve),xt=t.subtract(Vt,ht,qn);xt=t.normalize(xt,xt);let ut=t.cross(cn,xt,Ve);ut=t.normalize(ut,ut);let yt=t.cross(xt,mt,Zn);yt=t.normalize(yt,yt);let kt=t.subtract(lt,st,Wn);kt=t.normalize(kt,kt);let Mt=t.cross(W,kt,Vn);Mt=t.normalize(Mt,Mt);let sn=ue/M,ln=fe/M,$t=0,_t,bt,ft,Se=0,Te=0;if(c){$t=t.distance(pt,gt),_t=Ct.fromCartesian(pt,Jn),bt=t.subtract(gt,pt,$e),ft=t.normalize(bt,Kn);let T=ft.x;ft.x=ft.y,ft.y=-T,Se=$t/B,Te=de/B}for(g=0;g<8;g++){let T=Tt+g*4,wt=It+g*2,Nt=T+3,xe=g<4?1:-1,Rt=g===2||g===3||g===6||g===7?1:-1;t.pack(we.high,j,T),j[Nt]=Ht.x,t.pack(we.low,q,T),q[Nt]=Ht.y,t.pack(yt,d,T),d[Nt]=Ht.z,t.pack(Mt,X,T),X[Nt]=sn*xe,t.pack(ut,v,T);let dt=ln*Rt;dt===0&&Rt<0&&(dt=9),v[Nt]=dt,c&&(k[T]=_t.high.x,k[T+1]=_t.high.y,k[T+2]=_t.low.x,k[T+3]=_t.low.y,N[T]=-ot.y,N[T+1]=ot.x,N[T+2]=it.y,N[T+3]=-it.x,H[T]=bt.x,H[T+1]=bt.y,H[T+2]=ft.x,H[T+3]=ft.y,y[wt]=Se*xe,dt=Te*Rt,dt===0&&Rt<0&&(dt=9),y[wt+1]=dt)}let $=Xn,J=Yn,K=zn,Q=jn,hn=U.fromCartographicArray(vn,Bn),Ee=Yt.getMinimumMaximumHeights(hn,f),Jt=Ee.minimumTerrainHeight,Kt=Ee.maximumTerrainHeight;Wt+=Math.abs(Jt),Wt+=Math.abs(Kt),Ue(ht,Vt,Jt,Kt,$,K),Ue(st,lt,Jt,Kt,J,Q);let tt=t.multiplyByScalar(ut,p.EPSILON5,Je);t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Gt($,J),Gt(K,Q),t.pack($,I,b),t.pack(J,I,b+3),t.pack(Q,I,b+6),t.pack(K,I,b+9),tt=t.multiplyByScalar(ut,-2*p.EPSILON5,Je),t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Gt($,J),Gt(K,Q),t.pack($,I,b+12),t.pack(J,I,b+15),t.pack(Q,I,b+18),t.pack(K,I,b+21),V+=2,s+=3,It+=16,b+=24,Tt+=32,fe+=ue,de+=$t}s=0;let me=0;for(l=0;l<h;l++){for(g=0;g<Ke;g++)D[s+g]=an[g]+me;me+=8,s+=Ke}let Zt=Qn;G.fromVertices(r,t.ZERO,3,Zt[0]),G.fromVertices(n,t.ZERO,3,Zt[1]);let ge=G.fromBoundingSpheres(Zt);ge.radius+=Wt/(h*2);let Et={position:new jt({componentDatatype:zt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:at(j),startLoAndForwardOffsetY:at(q),startNormalAndForwardOffsetZ:at(d),endNormalAndTextureCoordinateNormalizationX:at(X),rightNormalAndTextureCoordinateNormalizationY:at(v)};return c&&(Et.startHiLo2D=at(k),Et.offsetAndRight2D=at(H),Et.startEndNormals2D=at(N),Et.texcoordNormalization2D=new jt({componentDatatype:zt.FLOAT,componentsPerAttribute:2,normalize:!1,values:y})),new Ce({attributes:Et,indices:D,boundingSphere:ge})}function at(e){return new jt({componentDatatype:zt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ct._projectNormal=Dt;var pe=ct;function eo(e,o){return Yt.initialize().then(function(){return m(o)&&(e=pe.unpack(e,o)),pe.createGeometry(e)})}var ni=eo;export{ni as default}; |
| | | import{a as Oe}from"./chunk-NJVIDNJ6.js";import{a as Z}from"./chunk-3B3UDCHP.js";import{a as Ct}from"./chunk-E5FOJ77O.js";import{a as De}from"./chunk-45NF2JU3.js";import{a as Le}from"./chunk-EX67AA2G.js";import{a as ee}from"./chunk-V5KKODOM.js";import{b as te}from"./chunk-AIYLFSI3.js";import{a as Xt}from"./chunk-FBQDLPON.js";import{c as Ce,d as jt}from"./chunk-WI5KIEME.js";import{a as vt,d as G}from"./chunk-ZPW6H6BB.js";import{d as _e,e as Ne,f as Qt,i as U}from"./chunk-HMXXHGCW.js";import{a as zt}from"./chunk-NFDMGE7Q.js";import{a as At,b as t,c as u,d as Pt,e as z,f as Bt}from"./chunk-VDZXURWO.js";import{a as p}from"./chunk-UEFEFMYS.js";import"./chunk-YGIPMXAD.js";import"./chunk-PZ34T7DL.js";import{a as L}from"./chunk-5HWP5DW7.js";import{a as St,b as et}from"./chunk-3K67FZLU.js";import{e as m}from"./chunk-55TU6MJR.js";function rt(e){e=L(e,L.EMPTY_OBJECT),this._ellipsoid=L(e.ellipsoid,z.default),this._rectangle=L(e.rectangle,U.MAX_VALUE),this._bounds=L(e.bounds,[]),this._projection=new vt(this._ellipsoid),this._numberOfLevelZeroTilesX=L(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=L(e.numberOfLevelZeroTilesY,1),this._tileInfo=e.tileInfo}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},bounds:{get:function(){return this._bounds}},projection:{get:function(){return this._projection}}});rt.prototype.getNumberOfXTilesAtLevel=function(e){if(!m(this._tileInfo))return this._numberOfLevelZeroTilesX<<e;let r=this._tileInfo.lods.filter(function(n){return n.level===e})[0].resolution;return Math.round(360/(this._tileInfo.rows*r))};rt.prototype.getNumberOfYTilesAtLevel=function(e){if(!m(this._tileInfo))return this._numberOfLevelZeroTilesY<<e;let r=this._tileInfo.lods.filter(function(n){return n.level===e})[0].resolution;return Math.round(180/(this._tileInfo.cols*r))};rt.prototype.rectangleToNativeRectangle=function(e,o){et.defined("rectangle",e);let r=p.toDegrees(e.west),n=p.toDegrees(e.south),i=p.toDegrees(e.east),a=p.toDegrees(e.north);return m(o)?(o.west=r,o.south=n,o.east=i,o.north=a,o):new U(r,n,i,a)};rt.prototype.tileXYToNativeRectangle=function(e,o,r,n){let i=this.tileXYToRectangle(e,o,r,n);return i.west=p.toDegrees(i.west),i.south=p.toDegrees(i.south),i.east=p.toDegrees(i.east),i.north=p.toDegrees(i.north),i};rt.prototype.tileXYToRectangle=function(e,o,r,n){let i=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=i.width/a,s=e*l+i.west,f=(e+1)*l+i.west,h=i.height/c,_=i.north-o*h,S=i.north-(o+1)*h;return m(n)||(n=new U(s,S,f,_)),n.west=s,n.south=S,n.east=f,n.north=_,n};rt.prototype.positionToTileXY=function(e,o,r){let n=this._rectangle;if(!U.contains(n,e))return;let i=this.getNumberOfXTilesAtLevel(o),a=this.getNumberOfYTilesAtLevel(o),c=n.width/i,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);let f=(s-n.west)/c|0;f>=i&&(f=i-1);let h=(n.north-e.latitude)/l|0;return h>=a&&(h=a-1),m(r)?(r.x=f,r.y=h,r):new Pt(f,h)};var Ie=rt;var He=new t,ye=new t,ke=new u,ne=new t,pn=new t,Me=new G,fn=new Ie,Ot=[new u,new u,new u,new u],Lt=new Pt,w={};w.initialize=function(){let e=w._initPromise;return m(e)||(e=_e.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(o){if(At.changeApproximateTerrainHeights===!0)for(let r in o)o.hasOwnProperty(r)&&(o[r][0]=At.minTerrainHeight,o[r][1]=At.maxTerrainHeight);w._terrainHeights=o}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,o){if(et.defined("rectangle",e),!m(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=L(o,z.default);let r=be(e),n=w._defaultMinTerrainHeight,i=w._defaultMaxTerrainHeight;if(m(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];m(c)&&(n=c[0],i=c[1]),o.cartographicToCartesian(U.northeast(e,ke),He),o.cartographicToCartesian(U.southwest(e,ke),ye),t.midpoint(ye,He,ne);let l=o.scaleToGeodeticSurface(ne,pn);if(m(l)){let s=t.distance(ne,l);n=Math.min(n,-s)}else n=w._defaultMinTerrainHeight}return n=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:i}};w.getBoundingSphere=function(e,o){if(et.defined("rectangle",e),!m(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=L(o,z.default);let r=be(e),n=w._defaultMaxTerrainHeight;if(m(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];m(c)&&(n=c[1])}let i=G.fromRectangle3D(e,o,0);return G.fromRectangle3D(e,o,n,Me),G.union(i,Me,i)};function be(e){u.fromRadians(e.east,e.north,0,Ot[0]),u.fromRadians(e.west,e.north,0,Ot[1]),u.fromRadians(e.east,e.south,0,Ot[2]),u.fromRadians(e.west,e.south,0,Ot[3]);let o=0,r=0,n=0,i=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let f=Ot[s];if(fn.positionToTileXY(f,c,Lt),s===0)n=Lt.x,i=Lt.y;else if(n!==Lt.x||i!==Lt.y){l=!0;break}}if(l)break;o=n,r=i}if(c!==0)return{x:o,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void 0;w._initPromise=void 0;Object.defineProperties(w,{initialized:{get:function(){return m(w._terrainHeights)}}});var Yt=w;var he=[vt,Oe],dn=he.length,Qe=Math.cos(p.toRadians(30)),Re=Math.cos(p.toRadians(150)),tn=0,en=1e3;function ct(e){e=L(e,L.EMPTY_OBJECT);let o=e.positions;if(!m(o)||o.length<2)throw new St("At least two positions are required.");if(m(e.arcType)&&e.arcType!==Z.GEODESIC&&e.arcType!==Z.RHUMB)throw new St("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=L(e.width,1),this._positions=o,this.granularity=L(e.granularity,9999),this.loop=L(e.loop,!1),this.arcType=L(e.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+z.packedLength+1+1}}});ct.setProjectionAndEllipsoid=function(e,o){let r=0;for(let n=0;n<dn;n++)if(o instanceof he[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=o.ellipsoid};var mn=new t,Ae=new t,Pe=new t;function le(e,o,r,n,i){let a=A(n,e,0,mn),c=A(n,e,r,Ae),l=A(n,o,0,Pe),s=nt(c,a,Ae),f=nt(l,a,Pe);return t.cross(f,s,i),t.normalize(i,i)}var gn=new u,un=new t,wn=new t,Sn=new t;function oe(e,o,r,n,i,a,c,l,s,f,h){if(i===0)return;let _;a===Z.GEODESIC?_=new De(e,o,c):a===Z.RHUMB&&(_=new ee(e,o,c));let S=_.surfaceDistance;if(S<i)return;let R=le(e,o,n,c,Sn),D=Math.ceil(S/i),I=S/D,j=I,q=D-1,d=l.length;for(let X=0;X<q;X++){let v=_.interpolateUsingSurfaceDistance(j,gn),k=A(c,v,r,un),H=A(c,v,n,wn);t.pack(R,l,d),t.pack(k,s,d),t.pack(H,f,d),h.push(v.latitude),h.push(v.longitude),d+=3,j+=I}}var ie=new u;function A(e,o,r,n){return u.clone(o,ie),ie.height=r,u.toCartesian(ie,e,n)}ct.pack=function(e,o,r){et.typeOf.object("value",e),et.defined("array",o);let n=L(r,0),i=e._positions,a=i.length;o[n++]=a;for(let c=0;c<a;++c){let l=i[c];t.pack(l,o,n),n+=3}return o[n++]=e.granularity,o[n++]=e.loop?1:0,o[n++]=e.arcType,z.pack(e._ellipsoid,o,n),n+=z.packedLength,o[n++]=e._projectionIndex,o[n++]=e._scene3DOnly?1:0,o};ct.unpack=function(e,o,r){et.defined("array",e);let n=L(o,0),i=e[n++],a=new Array(i);for(let S=0;S<i;S++)a[S]=t.unpack(e,n),n+=3;let c=e[n++],l=e[n++]===1,s=e[n++],f=z.unpack(e,n);n+=z.packedLength;let h=e[n++],_=e[n++]===1;return m(r)||(r=new ct({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=f,r._projectionIndex=h,r._scene3DOnly=_,r};function nt(e,o,r){return t.subtract(e,o,r),t.normalize(r,r),r}function ve(e,o,r,n){return n=nt(e,o,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}var Tn=new t,En=new t,xn=new t,nn=new t,_n=0,Nn=-1;function re(e,o,r,n,i){let a=nt(r,o,nn),c=ve(e,o,a,Tn),l=ve(n,o,a,En);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return i=t.cross(a,c,i),i=t.normalize(i,i),i;i=t.add(l,c,i),i=t.normalize(i,i);let s=t.cross(a,i,xn);return t.dot(l,s)<_n&&(i=t.negate(i,i)),i}var qt=Xt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,On=new t,Ln=new t,Dn=new t,In=new t,Ft=new t,Ut=new u,Be=new u,ze=new u;ct.createGeometry=function(e){let o=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,i=e.granularity,a=e.arcType,c=new he[e._projectionIndex](n),l=tn,s=en,f,h,_=e._positions,S=_.length;S===2&&(r=!1);let R,D,I,j,q=new ee(void 0,void 0,n),d,X,v,k=[_[0]];for(h=0;h<S-1;h++)R=_[h],D=_[h+1],d=te.lineSegmentPlane(R,D,qt,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?k.push(t.clone(d)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(d,Ut).longitude,I=n.cartesianToCartographic(R,Ut),j=n.cartesianToCartographic(D,Be),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,ze),d=n.cartographicToCartesian(X,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&k.push(t.clone(d)))),k.push(D);r&&(R=_[S-1],D=_[0],d=te.lineSegmentPlane(R,D,qt,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?k.push(t.clone(d)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(d,Ut).longitude,I=n.cartesianToCartographic(R,Ut),j=n.cartesianToCartographic(D,Be),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,ze),d=n.cartographicToCartesian(X,Ft),m(d)&&!t.equalsEpsilon(d,R,p.EPSILON7)&&!t.equalsEpsilon(d,D,p.EPSILON7)&&k.push(t.clone(d)))));let H=k.length,N=new Array(H);for(h=0;h<H;h++){let F=u.fromCartesian(k[h],n);F.height=0,N[h]=F}if(N=Le(N,u.equalsEpsilon),H=N.length,H<2)return;let y=[],P=[],B=[],E=[],x=Cn,O=On,C=Ln,Y=Dn,M=In,g=N[0],V=N[1],It=N[H-1];for(x=A(n,It,l,x),Y=A(n,V,l,Y),O=A(n,g,l,O),C=A(n,g,s,C),r?M=re(x,O,C,Y,M):M=le(g,V,s,n,M),t.pack(M,P,0),t.pack(O,B,0),t.pack(C,E,0),y.push(g.latitude),y.push(g.longitude),oe(g,V,l,s,i,a,n,P,B,E,y),h=1;h<H-1;++h){x=t.clone(O,x),O=t.clone(Y,O);let F=N[h];A(n,F,s,C),A(n,N[h+1],l,Y),re(x,O,C,Y,M),f=P.length,t.pack(M,P,f),t.pack(O,B,f),t.pack(C,E,f),y.push(F.latitude),y.push(F.longitude),oe(N[h],N[h+1],l,s,i,a,n,P,B,E,y)}let b=N[H-1],Tt=N[H-2];if(O=A(n,b,l,O),C=A(n,b,s,C),r){let F=N[0];x=A(n,Tt,l,x),Y=A(n,F,l,Y),M=re(x,O,C,Y,M)}else M=le(Tt,b,s,n,M);if(f=P.length,t.pack(M,P,f),t.pack(O,B,f),t.pack(C,E,f),y.push(b.latitude),y.push(b.longitude),r){for(oe(b,g,l,s,i,a,n,P,B,E,y),f=P.length,h=0;h<3;++h)P[f+h]=P[h],B[f+h]=B[h],E[f+h]=E[h];y.push(g.latitude),y.push(g.longitude)}return to(r,c,B,E,P,y,o)};var Hn=new t,yn=new Bt,kn=new Qt;function je(e,o,r,n){let i=nt(r,o,Hn),a=t.dot(i,e);if(a>Qe||a<Re){let c=nt(n,r,nn),l=a<Re?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Qt.fromAxisAngle(c,l,kn),f=Bt.fromQuaternion(s,yn);return Bt.multiplyByVector(f,e,e),!0}return!1}var Xe=new u,Mn=new t,Ye=new t;function Dt(e,o,r,n,i){let a=u.toCartesian(o,e._ellipsoid,Mn),c=t.add(a,r,Ye),l=!1,s=e._ellipsoid,f=s.cartesianToCartographic(c,Xe);Math.abs(o.longitude-f.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Ye),f=s.cartesianToCartographic(c,Xe)),f.height=0;let h=e.project(f,i);return i=t.subtract(h,n,i),i.z=0,i=t.normalize(i,i),l&&t.negate(i,i),i}var bn=new t,Fe=new t;function Ue(e,o,r,n,i,a){let c=t.subtract(o,e,bn);t.normalize(c,c);let l=r-tn,s=t.multiplyByScalar(c,l,Fe);t.add(e,s,i);let f=n-en;s=t.multiplyByScalar(c,f,Fe),t.add(o,s,a)}var Rn=new t;function Gt(e,o){let r=Xt.getPointDistance(qt,e),n=Xt.getPointDistance(qt,o),i=Rn;p.equalsEpsilon(r,0,p.EPSILON2)?(i=nt(o,e,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(e,i,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(i=nt(e,o,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(o,i,o))}function An(e,o){let r=Math.abs(e.longitude),n=Math.abs(o.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let i=p.sign(o.longitude);return e.longitude=i*(r-p.EPSILON11),1}else if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let i=p.sign(e.longitude);return o.longitude=i*(n-p.EPSILON11),2}return 0}var on=new u,rn=new u,Ge=new t,ae=new t,qe=new t,We=new t,Pn=new t,Ze=new t,vn=[on,rn],Bn=new U,zn=new t,jn=new t,Xn=new t,Yn=new t,Fn=new t,Un=new t,ce=new t,se=new t,Gn=new t,qn=new t,Wn=new t,Ve=new t,Zn=new t,Vn=new t,$n=new Ct,Jn=new Ct,$e=new t,Kn=new t,Je=new t,Qn=[new G,new G],an=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Ke=an.length;function to(e,o,r,n,i,a,c){let l,s,f=o._ellipsoid,h=r.length/3-1,_=h*8,S=_*4,R=h*36,D=_>65535?new Uint32Array(R):new Uint16Array(R),I=new Float64Array(_*3),j=new Float32Array(S),q=new Float32Array(S),d=new Float32Array(S),X=new Float32Array(S),v=new Float32Array(S),k,H,N,y;c&&(k=new Float32Array(S),H=new Float32Array(S),N=new Float32Array(S),y=new Float32Array(_*2));let P=a.length/2,B=0,E=on;E.height=0;let x=rn;x.height=0;let O=Ge,C=ae;if(c)for(s=0,l=1;l<P;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],O=o.project(E,O),C=o.project(x,C),B+=t.distance(O,C),s+=2;let Y=n.length/3;C=t.unpack(n,0,C);let M=0;for(s=3,l=1;l<Y;l++)O=t.clone(C,O),C=t.unpack(n,s,C),M+=t.distance(O,C),s+=3;let g;s=3;let V=0,It=0,b=0,Tt=0,F=!1,st=t.unpack(r,0,We),lt=t.unpack(n,0,ae),W=t.unpack(i,0,Ze);if(e){let ht=t.unpack(r,r.length-6,qe);je(W,ht,st,lt)&&(W=t.negate(W,W))}let fe=0,de=0,Wt=0;for(l=0;l<h;l++){let ht=t.clone(st,qe),Vt=t.clone(lt,Ge),mt=t.clone(W,Pn);F&&(mt=t.negate(mt,mt)),st=t.unpack(r,s,We),lt=t.unpack(n,s,ae),W=t.unpack(i,s,Ze),F=je(W,ht,st,lt),E.latitude=a[V],E.longitude=a[V+1],x.latitude=a[V+2],x.longitude=a[V+3];let pt,gt,ot,it;if(c){let T=An(E,x);pt=o.project(E,Fn),gt=o.project(x,Un);let wt=nt(gt,pt,$e);wt.y=Math.abs(wt.y),ot=ce,it=se,T===0||t.dot(wt,t.UNIT_Y)>Qe?(ot=Dt(o,E,mt,pt,ce),it=Dt(o,x,W,gt,se)):T===1?(it=Dt(o,x,W,gt,se),ot.x=0,ot.y=p.sign(E.longitude-Math.abs(x.longitude)),ot.z=0):(ot=Dt(o,E,mt,pt,ce),it.x=0,it.y=p.sign(E.longitude-x.longitude),it.z=0)}let ue=t.distance(Vt,lt),we=Ct.fromCartesian(ht,$n),Ht=t.subtract(st,ht,Gn),cn=t.normalize(Ht,Ve),xt=t.subtract(Vt,ht,qn);xt=t.normalize(xt,xt);let ut=t.cross(cn,xt,Ve);ut=t.normalize(ut,ut);let yt=t.cross(xt,mt,Zn);yt=t.normalize(yt,yt);let kt=t.subtract(lt,st,Wn);kt=t.normalize(kt,kt);let Mt=t.cross(W,kt,Vn);Mt=t.normalize(Mt,Mt);let sn=ue/M,ln=fe/M,$t=0,_t,bt,ft,Se=0,Te=0;if(c){$t=t.distance(pt,gt),_t=Ct.fromCartesian(pt,Jn),bt=t.subtract(gt,pt,$e),ft=t.normalize(bt,Kn);let T=ft.x;ft.x=ft.y,ft.y=-T,Se=$t/B,Te=de/B}for(g=0;g<8;g++){let T=Tt+g*4,wt=It+g*2,Nt=T+3,xe=g<4?1:-1,Rt=g===2||g===3||g===6||g===7?1:-1;t.pack(we.high,j,T),j[Nt]=Ht.x,t.pack(we.low,q,T),q[Nt]=Ht.y,t.pack(yt,d,T),d[Nt]=Ht.z,t.pack(Mt,X,T),X[Nt]=sn*xe,t.pack(ut,v,T);let dt=ln*Rt;dt===0&&Rt<0&&(dt=9),v[Nt]=dt,c&&(k[T]=_t.high.x,k[T+1]=_t.high.y,k[T+2]=_t.low.x,k[T+3]=_t.low.y,N[T]=-ot.y,N[T+1]=ot.x,N[T+2]=it.y,N[T+3]=-it.x,H[T]=bt.x,H[T+1]=bt.y,H[T+2]=ft.x,H[T+3]=ft.y,y[wt]=Se*xe,dt=Te*Rt,dt===0&&Rt<0&&(dt=9),y[wt+1]=dt)}let $=Xn,J=Yn,K=zn,Q=jn,hn=U.fromCartographicArray(vn,Bn),Ee=Yt.getMinimumMaximumHeights(hn,f),Jt=Ee.minimumTerrainHeight,Kt=Ee.maximumTerrainHeight;Wt+=Math.abs(Jt),Wt+=Math.abs(Kt),Ue(ht,Vt,Jt,Kt,$,K),Ue(st,lt,Jt,Kt,J,Q);let tt=t.multiplyByScalar(ut,p.EPSILON5,Je);t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Gt($,J),Gt(K,Q),t.pack($,I,b),t.pack(J,I,b+3),t.pack(Q,I,b+6),t.pack(K,I,b+9),tt=t.multiplyByScalar(ut,-2*p.EPSILON5,Je),t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Gt($,J),Gt(K,Q),t.pack($,I,b+12),t.pack(J,I,b+15),t.pack(Q,I,b+18),t.pack(K,I,b+21),V+=2,s+=3,It+=16,b+=24,Tt+=32,fe+=ue,de+=$t}s=0;let me=0;for(l=0;l<h;l++){for(g=0;g<Ke;g++)D[s+g]=an[g]+me;me+=8,s+=Ke}let Zt=Qn;G.fromVertices(r,t.ZERO,3,Zt[0]),G.fromVertices(n,t.ZERO,3,Zt[1]);let ge=G.fromBoundingSpheres(Zt);ge.radius+=Wt/(h*2);let Et={position:new jt({componentDatatype:zt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:at(j),startLoAndForwardOffsetY:at(q),startNormalAndForwardOffsetZ:at(d),endNormalAndTextureCoordinateNormalizationX:at(X),rightNormalAndTextureCoordinateNormalizationY:at(v)};return c&&(Et.startHiLo2D=at(k),Et.offsetAndRight2D=at(H),Et.startEndNormals2D=at(N),Et.texcoordNormalization2D=new jt({componentDatatype:zt.FLOAT,componentsPerAttribute:2,normalize:!1,values:y})),new Ce({attributes:Et,indices:D,boundingSphere:ge})}function at(e){return new jt({componentDatatype:zt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ct._projectNormal=Dt;var pe=ct;function eo(e,o){return Yt.initialize().then(function(){return m(o)&&(e=pe.unpack(e,o)),pe.createGeometry(e)})}var ni=eo;export{ni as default}; |