1 |
- define(["./AttributeCompression-49f7b62a","./Cartographic-67e73ef9","./Color-45274500","./when-92c6cf3c","./Rectangle-bab7abf0","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./OrientedBoundingBox-513cf61d","./createTaskProcessorWorker","./Cartesian2-6033fa5d","./Check-52a7d806","./FeatureDetection-067cb23c","./WebGLConstants-71f10989","./buildModuleUrl-3d15f25c","./Intersect-b97e930a","./PrimitiveType-cdfe443e","./Cartesian4-ad128b5d","./RuntimeError-c6a62a80","./Event-3390cd7d","./EllipsoidTangentPlane-53184efd","./IntersectionTests-a42760d9","./Plane-f8d22530","./GeometryAttribute-ef657318","./PolygonPipeline-b86e8785","./WindingOrder-1b9c8a87","./ComponentDatatype-81047f82","./EllipsoidRhumbLine-8847d1a1","./Buffer-1d0f8963","./RenderState-94064c70","./BoundingRectangle-418864a2"],(function(e,t,r,a,n,i,o,f,c,d,s,u,h,l,b,p,g,y,v,I,m,w,x,A,N,T,k,E,L,P){"use strict";var C=new t.t,O=new n.t,U=new n.h,B={min:void 0,max:void 0,indexBytesPerElement:void 0};function F(e,t,a){var n=t.length,i=2+n*f.x.packedLength+1+function(e){for(var t=e.length,a=0,n=0;n<t;++n)a+=r.e.packedLength+3+e[n].batchIds.length;return a}(a),o=new Float64Array(i),c=0;o[c++]=e,o[c++]=n;for(var d=0;d<n;++d)f.x.pack(t[d],o,c),c+=f.x.packedLength;var s=a.length;o[c++]=s;for(var u=0;u<s;++u){var h=a[u];r.e.pack(h.color,o,c),c+=r.e.packedLength,o[c++]=h.offset,o[c++]=h.count;var l=h.batchIds,b=l.length;o[c++]=b;for(var p=0;p<b;++p)o[c++]=l[p]}return o}var S=new t.t,D=new t.t,R=new t.t,_=new t.t,G=new t.t,M=new t.t$1,Y=new n.h;return c((function(c,d){var s;!function(e){var r=new Float64Array(e),a=0;B.indexBytesPerElement=r[a++],B.min=r[a++],B.max=r[a++],t.t.unpack(r,a,C),a+=t.t.packedLength,n.t.unpack(r,a,O),a+=n.t.packedLength,n.h.unpack(r,a,U)}(c.packedBuffer),s=2===B.indexBytesPerElement?new Uint16Array(c.indices):new Uint32Array(c.indices);var u,h,l,b=new Uint16Array(c.positions),p=new Uint32Array(c.counts),g=new Uint32Array(c.indexCounts),y=new Uint32Array(c.batchIds),v=new Uint32Array(c.batchTableColors),I=new Array(p.length),m=C,w=O,x=U,A=B.min,N=B.max,T=c.minimumHeights,k=c.maximumHeights;a.e(T)&&a.e(k)&&(T=new Float32Array(T),k=new Float32Array(k));var E=b.length/2,L=b.subarray(0,E),P=b.subarray(E,2*E);e.t.zigZagDeltaDecode(L,P);var V=new Float32Array(3*E);for(u=0;u<E;++u){var H=L[u],W=P[u],$=o.e.lerp(x.west,x.east,H/32767),z=o.e.lerp(x.south,x.north,W/32767),Z=t.t$1.fromRadians($,z,0,M),j=w.cartographicToCartesian(Z,S);t.t.pack(j,V,3*u)}var q=p.length,J=new Array(q),K=new Array(q),Q=0,X=0;for(u=0;u<q;++u)J[u]=Q,K[u]=X,Q+=p[u],X+=g[u];var ee,te=new Float32Array(3*E*2),re=new Uint16Array(2*E),ae=new Uint32Array(K.length),ne=new Uint32Array(g.length),ie=[],oe={};for(u=0;u<q;++u)l=v[u],a.e(oe[l])?(oe[l].positionLength+=p[u],oe[l].indexLength+=g[u],oe[l].batchIds.push(u)):oe[l]={positionLength:p[u],indexLength:g[u],offset:0,indexOffset:0,batchIds:[u]};var fe=0,ce=0;for(l in oe)if(oe.hasOwnProperty(l)){(ee=oe[l]).offset=fe,ee.indexOffset=ce;var de=2*ee.positionLength,se=2*ee.indexLength+6*ee.positionLength;fe+=de,ce+=se,ee.indexLength=se}var ue=[];for(l in oe)oe.hasOwnProperty(l)&&(ee=oe[l],ue.push({color:r.e.fromRgba(parseInt(l)),offset:ee.indexOffset,count:ee.indexLength,batchIds:ee.batchIds}));for(u=0;u<q;++u){var he=(ee=oe[l=v[u]]).offset,le=3*he,be=he,pe=J[u],ge=p[u],ye=y[u],ve=A,Ie=N;a.e(T)&&a.e(k)&&(ve=T[u],Ie=k[u]);var me=Number.POSITIVE_INFINITY,we=Number.NEGATIVE_INFINITY,xe=Number.POSITIVE_INFINITY,Ae=Number.NEGATIVE_INFINITY;for(h=0;h<ge;++h){var Ne=t.t.unpack(V,3*pe+3*h,S);w.scaleToGeodeticSurface(Ne,Ne);var Te=w.cartesianToCartographic(Ne,M),ke=Te.latitude,Ee=Te.longitude;me=Math.min(ke,me),we=Math.max(ke,we),xe=Math.min(Ee,xe),Ae=Math.max(Ee,Ae);var Le=w.geodeticSurfaceNormal(Ne,D),Pe=t.t.multiplyByScalar(Le,ve,R),Ce=t.t.add(Ne,Pe,_);Pe=t.t.multiplyByScalar(Le,Ie,Pe);var Oe=t.t.add(Ne,Pe,G);t.t.subtract(Oe,m,Oe),t.t.subtract(Ce,m,Ce),t.t.pack(Oe,te,le),t.t.pack(Ce,te,le+3),re[be]=ye,re[be+1]=ye,le+=6,be+=2}(x=Y).west=xe,x.east=Ae,x.south=me,x.north=we,I[u]=f.x.fromRectangle(x,A,N,w);var Ue=ee.indexOffset,Be=K[u],Fe=g[u];for(ae[u]=Ue,h=0;h<Fe;h+=3){var Se=s[Be+h]-pe,De=s[Be+h+1]-pe,Re=s[Be+h+2]-pe;ie[Ue++]=2*Se+he,ie[Ue++]=2*De+he,ie[Ue++]=2*Re+he,ie[Ue++]=2*Re+1+he,ie[Ue++]=2*De+1+he,ie[Ue++]=2*Se+1+he}for(h=0;h<ge;++h){var _e=h,Ge=(h+1)%ge;ie[Ue++]=2*_e+1+he,ie[Ue++]=2*Ge+he,ie[Ue++]=2*_e+he,ie[Ue++]=2*_e+1+he,ie[Ue++]=2*Ge+1+he,ie[Ue++]=2*Ge+he}ee.offset+=2*ge,ee.indexOffset=Ue,ne[u]=Ue-ae[u]}ie=i.IndexDatatype.createTypedArray(te.length/3,ie);for(var Me=ue.length,Ye=0;Ye<Me;++Ye){for(var Ve=ue[Ye].batchIds,He=0,We=Ve.length,$e=0;$e<We;++$e)He+=ne[Ve[$e]];ue[Ye].count=He}var ze=F(2===ie.BYTES_PER_ELEMENT?i.IndexDatatype.UNSIGNED_SHORT:i.IndexDatatype.UNSIGNED_INT,I,ue);return d.push(te.buffer,ie.buffer,ae.buffer,ne.buffer,re.buffer,ze.buffer),{positions:te.buffer,indices:ie.buffer,indexOffsets:ae.buffer,indexCounts:ne.buffer,batchIds:re.buffer,packedBuffer:ze.buffer}}))}));
|