2023-09-11 21:56:39 +08:00
|
|
|
define(["./AttributeCompression-90851096","./Cartographic-3309dd0d","./Color-5008547b","./when-b60132fc","./Cartesian2-47311507","./IndexDatatype-8a5eead4","./Math-119be1a3","./OrientedBoundingBox-f1d7843f","./createTaskProcessorWorker","./Check-7b2a090c","./FeatureDetection-c3b71206","./WebGLConstants-4ae0db90","./BoundingSphere-561b54d0","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./EllipsoidTangentPlane-b2b18d75","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./buildModuleUrl-3addfe33"],(function(e,a,r,n,t,i,o,s,d,f,c,u,h,l,g,p,b,C,v,y){"use strict";var I=new a.Cartesian3,m=new t.Ellipsoid,w=new t.Rectangle,x={min:void 0,max:void 0,indexBytesPerElement:void 0};function A(e,a,n){var t=a.length,i=2+t*s.OrientedBoundingBox.packedLength+1+function(e){for(var a=e.length,n=0,t=0;t<a;++t)n+=r.Color.packedLength+3+e[t].batchIds.length;return n}(n),o=new Float64Array(i),d=0;o[d++]=e,o[d++]=t;for(var f=0;f<t;++f)s.OrientedBoundingBox.pack(a[f],o,d),d+=s.OrientedBoundingBox.packedLength;var c=n.length;o[d++]=c;for(var u=0;u<c;++u){var h=n[u];r.Color.pack(h.color,o,d),d+=r.Color.packedLength,o[d++]=h.offset,o[d++]=h.count;var l=h.batchIds,g=l.length;o[d++]=g;for(var p=0;p<g;++p)o[d++]=l[p]}return o}var E=new a.Cartesian3,N=new a.Cartesian3,T=new a.Cartesian3,k=new a.Cartesian3,B=new a.Cartesian3,L=new a.Cartographic,O=new t.Rectangle;return d((function(d,f){var c;!function(e){var r=new Float64Array(e),n=0;x.indexBytesPerElement=r[n++],x.min=r[n++],x.max=r[n++],a.Cartesian3.unpack(r,n,I),n+=a.Cartesian3.packedLength,t.Ellipsoid.unpack(r,n,m),n+=t.Ellipsoid.packedLength,t.Rectangle.unpack(r,n,w)}(d.packedBuffer),c=2===x.indexBytesPerElement?new Uint16Array(d.indices):new Uint32Array(d.indices);var u,h,l,g=new Uint16Array(d.positions),p=new Uint32Array(d.counts),b=new Uint32Array(d.indexCounts),C=new Uint32Array(d.batchIds),v=new Uint32Array(d.batchTableColors),y=new Array(p.length),U=I,F=m,P=w,S=x.min,D=x.max,M=d.minimumHeights,R=d.maximumHeights;n.defined(M)&&n.defined(R)&&(M=new Float32Array(M),R=new Float32Array(R));var _=g.length/2,G=g.subarray(0,_),Y=g.subarray(_,2*_);e.AttributeCompression.zigZagDeltaDecode(G,Y);var V=new Float32Array(3*_);for(u=0;u<_;++u){var H=G[u],W=Y[u],z=o.CesiumMath.lerp(P.west,P.east,H/32767),Z=o.CesiumMath.lerp(P.south,P.north,W/32767),j=a.Cartographic.fromRadians(z,Z,0,L),q=F.cartographicToCartesian(j,E);a.Cartesian3.pack(q,V,3*u)}var J=p.length,K=new Array(J),Q=new Array(J),X=0,$=0;for(u=0;u<J;++u)K[u]=X,Q[u]=$,X+=p[u],$+=b[u];var ee,ae=new Float32Array(3*_*2),re=new Uint16Array(2*_),ne=new Uint32Array(Q.length),te=new Uint32Array(b.length),ie=[],oe={};for(u=0;u<J;++u)l=v[u],n.defined(oe[l])?(oe[l].positionLength+=p[u],oe[l].indexLength+=b[u],oe[l].batchIds.push(u)):oe[l]={positionLength:p[u],indexLength:b[u],offset:0,indexOffset:0,batchIds:[u]};var se=0,de=0;for(l in oe)if(oe.hasOwnProperty(l)){(ee=oe[l]).offset=se,ee.indexOffset=de;var fe=2*ee.positionLength,ce=2*ee.indexLength+6*ee.positionLength;se+=fe,de+=ce,ee.indexLength=ce}var ue=[];for(l in oe)oe.hasOwnProperty(l)&&(ee=oe[l],ue.push({color:r.Color.fromRgba(parseInt(l)),offset:ee.indexOffset,count:ee.indexLength,batchIds:ee.batchIds}));for(u=0;u<J;++u){var he=(ee=oe[l=v[u]]).offset,le=3*he,ge=he,pe=K[u],be=p[u],Ce=C[u],ve=S,ye=D;n.defined(M)&&n.defined(R)&&(ve=M[u],ye=R[u]);var Ie=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,we=Number.POSITIVE_INFINITY,xe=Number.NEGATIVE_INFINITY;for(h=0;h<be;++h){var Ae=a.Cartesian3.unpack(V,3*pe+3*h,E);F.scaleToGeodeticSurface(Ae,Ae);var Ee=F.cartesianToCartographic(Ae,L),Ne=Ee.latitude,Te=Ee.longitude;Ie=Math.min(Ne,Ie),me=Math.max(Ne,me),we=Math.min(Te,we),xe=Math.max(Te,xe);var ke=F.geodeticSurfaceNormal(Ae,N),Be=a.Cartesian3.multiplyByScalar(ke,ve,T),Le=a.Cartesian3.add(Ae,Be,k);Be=a.Cartesian3.multiplyByScalar(ke,ye,Be);var Oe=a.Cartesian3.add(Ae,Be,B);a.Cartesian3.subtract(Oe,U,Oe),a.Cartesian3.subtract(Le,U,Le),a.Cartesian3.pack(Oe,ae,le),a.Cartesian3.pack(Le,ae,le+3),re[ge]=Ce,re[ge+1]=Ce,le+=6,ge+=2}(P=O).west=we,P.east=xe,P.south=Ie,P.north=me,y[u]=s.Or
|