/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.110.1 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as be,b as Ne}from"./chunk-EUG6TMMH.js";import{a as Ae}from"./chunk-N6UO7CHL.js";import{a as ue}from"./chunk-LTVWSPJ4.js";import{a as ee}from"./chunk-CAKU43HZ.js";import"./chunk-BV3RKX5O.js";import"./chunk-XQLAWHTP.js";import"./chunk-EVUMPJJC.js";import"./chunk-BXMC6F3B.js";import{a as Ve}from"./chunk-EUSUDYW7.js";import{d as de}from"./chunk-O5E7EBKP.js";import"./chunk-LEJDAZA7.js";import{c as Se,d as Z}from"./chunk-GMFQULD7.js";import"./chunk-IS523WNE.js";import{a as A,b as Ie,c as Ce}from"./chunk-4ZQSV4FU.js";import{a as N}from"./chunk-CLQ5X6HS.js";import"./chunk-6Y3U6IMI.js";import"./chunk-7DENS74L.js";import"./chunk-FOJGNIAW.js";import{a as V,b as q}from"./chunk-UGI536VH.js";import{e as f}from"./chunk-BQUQ5TPM.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=on,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push(new m),B.push(new m),B.push(new m);let b,j;for(t=0;t=P.length)&&(b=B[0].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[1].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O),b=e?(le.push(t),x=a):x=x*2+He,c[t]=x,y=Math.round(p[t]),y<=g?(ge.push(t),y=0):y>=w?(we.push(t),y=a):y=y*2+qe,p[t]=y,H=N.lerp(se,ae,d[t]/a),H_&&(_=H),d[t]=H,te.longitude=N.lerp(xe,ce,x/a),te.latitude=N.lerp(Re,Ee,y/a),te.height=H,re.cartographicToCartesian(te,E),M.push(E.x),M.push(E.y),M.push(E.z);let he=de.fromVertices(M,A.ZERO,3,Qe),Ue=ue.fromRectangle(J,U,_,re,Ze),ve=new be(re).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(he.center,M,3,he.center,U,Je),Pe=_-U,X=new Uint16Array(c.length+p.length+d.length);for(t=0;t