You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
4.7 KiB
1 lines
4.7 KiB
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./AttributeCompression-bb3dc748","./IndexDatatype-354a5ea3","./IntersectionTests-8371bf29","./Plane-929e0674","./createTaskProcessorWorker","./EllipsoidTangentPlane-af8ae194","./OrientedBoundingBox-b779e812","./Color-bfeeb147"],function(Te,e,ke,Be,a,r,n,Le,Oe,t,i,o,s,Ue,Pe){"use strict";var Fe=new Be.Cartesian3,Se=new Be.Ellipsoid,Re=new Be.Rectangle,De={min:void 0,max:void 0,indexBytesPerElement:void 0};function Me(e,a,r){var n=a.length,t=2+n*Ue.OrientedBoundingBox.packedLength+1+function(e){for(var a=e.length,r=0,n=0;n<a;++n)r+=Pe.Color.packedLength+3+e[n].batchIds.length;return r}(r),i=new Float64Array(t),o=0;i[o++]=e,i[o++]=n;for(var s=0;s<n;++s)Ue.OrientedBoundingBox.pack(a[s],i,o),o+=Ue.OrientedBoundingBox.packedLength;var f=r.length;i[o++]=f;for(var d=0;d<f;++d){var c=r[d];Pe.Color.pack(c.color,i,o),o+=Pe.Color.packedLength,i[o++]=c.offset,i[o++]=c.count;var u=c.batchIds,h=u.length;i[o++]=h;for(var l=0;l<h;++l)i[o++]=u[l]}return i}var _e=new Be.Cartesian3,Ge=new Be.Cartesian3,Ye=new Be.Cartesian3,Ve=new Be.Cartesian3,He=new Be.Cartesian3,We=new Be.Cartographic,ze=new Be.Rectangle;return o(function(e,a){var r;!function(e){var a=new Float64Array(e),r=0;De.indexBytesPerElement=a[r++],De.min=a[r++],De.max=a[r++],Be.Cartesian3.unpack(a,r,Fe),r+=Be.Cartesian3.packedLength,Be.Ellipsoid.unpack(a,r,Se),r+=Be.Ellipsoid.packedLength,Be.Rectangle.unpack(a,r,Re)}(e.packedBuffer),r=2===De.indexBytesPerElement?new Uint16Array(e.indices):new Uint32Array(e.indices);var n,t,i,o=new Uint16Array(e.positions),s=new Uint32Array(e.counts),f=new Uint32Array(e.indexCounts),d=new Uint32Array(e.batchIds),c=new Uint32Array(e.batchTableColors),u=new Array(s.length),h=Fe,l=Se,g=Re,p=De.min,b=De.max,C=e.minimumHeights,v=e.maximumHeights;Te.defined(C)&&Te.defined(v)&&(C=new Float32Array(C),v=new Float32Array(v));var y=o.length/2,I=o.subarray(0,y),m=o.subarray(y,2*y);Le.AttributeCompression.zigZagDeltaDecode(I,m);var w=new Float64Array(3*y);for(n=0;n<y;++n){var x=I[n],A=m[n],E=ke.CesiumMath.lerp(g.west,g.east,x/32767),N=ke.CesiumMath.lerp(g.south,g.north,A/32767),T=Be.Cartographic.fromRadians(E,N,0,We),k=l.cartographicToCartesian(T,_e);Be.Cartesian3.pack(k,w,3*n)}var B=s.length,L=new Array(B),O=new Array(B),U=0,P=0;for(n=0;n<B;++n)L[n]=U,O[n]=P,U+=s[n],P+=f[n];var F,S=new Float32Array(3*y*2),R=new Uint16Array(2*y),D=new Uint32Array(O.length),M=new Uint32Array(f.length),_=[],G={};for(n=0;n<B;++n)i=c[n],Te.defined(G[i])?(G[i].positionLength+=s[n],G[i].indexLength+=f[n],G[i].batchIds.push(n)):G[i]={positionLength:s[n],indexLength:f[n],offset:0,indexOffset:0,batchIds:[n]};var Y=0,V=0;for(i in G)if(G.hasOwnProperty(i)){(F=G[i]).offset=Y,F.indexOffset=V;var H=2*F.positionLength,W=2*F.indexLength+6*F.positionLength;Y+=H,V+=W,F.indexLength=W}var z=[];for(i in G)G.hasOwnProperty(i)&&(F=G[i],z.push({color:Pe.Color.fromRgba(parseInt(i)),offset:F.indexOffset,count:F.indexLength,batchIds:F.batchIds}));for(n=0;n<B;++n){var Z=(F=G[i=c[n]]).offset,j=3*Z,q=Z,J=L[n],K=s[n],Q=d[n],X=p,$=b;Te.defined(C)&&Te.defined(v)&&(X=C[n],$=v[n]);var ee=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,re=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY;for(t=0;t<K;++t){var te=Be.Cartesian3.unpack(w,3*J+3*t,_e);l.scaleToGeodeticSurface(te,te);var ie=l.cartesianToCartographic(te,We),oe=ie.latitude,se=ie.longitude;ee=Math.min(oe,ee),ae=Math.max(oe,ae),re=Math.min(se,re),ne=Math.max(se,ne);var fe=l.geodeticSurfaceNormal(te,Ge),de=Be.Cartesian3.multiplyByScalar(fe,X,Ye),ce=Be.Cartesian3.add(te,de,Ve);de=Be.Cartesian3.multiplyByScalar(fe,$,de);var ue=Be.Cartesian3.add(te,de,He);Be.Cartesian3.subtract(ue,h,ue),Be.Cartesian3.subtract(ce,h,ce),Be.Cartesian3.pack(ue,S,j),Be.Cartesian3.pack(ce,S,j+3),R[q]=Q,R[q+1]=Q,j+=6,q+=2}(g=ze).west=re,g.east=ne,g.south=ee,g.north=ae,u[n]=Ue.OrientedBoundingBox.fromRectangle(g,p,b,l);var he=F.indexOffset,le=O[n],ge=f[n];for(D[n]=he,t=0;t<ge;t+=3){var pe=r[le+t]-J,be=r[le+t+1]-J,Ce=r[le+t+2]-J;_[he++]=2*pe+Z,_[he++]=2*be+Z,_[he++]=2*Ce+Z,_[he++]=2*Ce+1+Z,_[he++]=2*be+1+Z,_[he++]=2*pe+1+Z}for(t=0;t<K;++t){var ve=t,ye=(t+1)%K;_[he++]=2*ve+1+Z,_[he++]=2*ye+Z,_[he++]=2*ve+Z,_[he++]=2*ve+1+Z,_[he++]=2*ye+1+Z,_[he++]=2*ye+Z}F.offset+=2*K,F.indexOffset=he,M[n]=he-D[n]}_=Oe.IndexDatatype.createTypedArray(S.length/3,_);for(var Ie=z.length,me=0;me<Ie;++me){for(var we=z[me].batchIds,xe=0,Ae=we.length,Ee=0;Ee<Ae;++Ee)xe+=M[we[Ee]];z[me].count=xe}var Ne=Me(2===_.BYTES_PER_ELEMENT?Oe.IndexDatatype.UNSIGNED_SHORT:Oe.IndexDatatype.UNSIGNED_INT,u,z);return a.push(S.buffer,_.buffer,D.buffer,M.buffer,R.buffer,Ne.buffer),{positions:S.buffer,indices:_.buffer,indexOffsets:D.buffer,indexCounts:M.buffer,batchIds:R.buffer,packedBuffer:Ne.buffer}})});
|
|
|