月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-06-14 a7ceb07fdcbcac1edcecb8c96bfa7808ea7670c5
1
define(["./Transforms-3e1dc9c2","./BoxGeometry-c3cf7e8a","./Matrix2-52f9f880","./Color-6b5fa738","./CylinderGeometry-5585072a","./defaultValue-69ee94f4","./EllipsoidGeometry-38f68f70","./IndexDatatype-1cbc8622","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryOffsetAttribute-4d39b441","./GeometryAttribute-c774c37f","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd","./PixelFormat-9ceadbf3","./CylinderGeometryLibrary-fe5ec654"],(function(e,t,n,r,a,i,o,s,c,d,l,f,u,h,p,b,y,x,g,m){"use strict";function C(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const I=new n.Cartesian3,k=n.Matrix4.packedLength+n.Cartesian3.packedLength,M=n.Matrix4.packedLength+2,B=n.Matrix4.packedLength+n.Cartesian3.packedLength,w=n.Cartesian3.packedLength+1,A={modelMatrix:new n.Matrix4,boundingVolume:new e.BoundingSphere};function O(e,t){let r=t*k;const a=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,A.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),A}function L(e,t){let r=t*M;const a=e[r++],i=e[r++],o=n.Cartesian3.fromElements(a,a,i,I),s=n.Matrix4.unpack(e,r,A.modelMatrix);n.Matrix4.multiplyByScale(s,o,s);const c=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,c.center),c.radius=Math.sqrt(2),A}function v(e,t){let r=t*B;const a=n.Cartesian3.unpack(e,r,I);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,A.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,A}function E(e,t){let r=t*w;const a=e[r++],i=n.Cartesian3.unpack(e,r,I),o=n.Matrix4.fromTranslation(i,A.modelMatrix);n.Matrix4.multiplyByUniformScale(o,a,o);const s=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,A}const U=new n.Cartesian3;function G(t,a,o,s,c){if(!i.defined(a))return;const d=o.length,l=s.attributes.position.values,f=s.indices,u=t.positions,h=t.vertexBatchIds,p=t.indices,b=t.batchIds,y=t.batchTableColors,x=t.batchedIndices,g=t.indexOffsets,m=t.indexCounts,I=t.boundingVolumes,k=t.modelMatrix,M=t.center;let B=t.positionOffset,w=t.batchIdIndex,A=t.indexOffset;const O=t.batchedIndicesOffset;for(let t=0;t<d;++t){const i=c(a,t),s=i.modelMatrix;n.Matrix4.multiply(k,s,s);const d=o[t],L=l.length;for(let e=0;e<L;e+=3){const t=n.Cartesian3.unpack(l,e,U);n.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,M,t),n.Cartesian3.pack(t,u,3*B+e),h[w++]=d}const v=f.length;for(let e=0;e<v;++e)p[A+e]=f[e]+B;const E=t+O;x[E]=new C({offset:A,count:v,color:r.Color.fromRgba(y[d]),batchIds:[d]}),b[E]=d,g[E]=A,m[E]=v,I[E]=e.BoundingSphere.transform(i.boundingVolume,s),B+=L/3,A+=v}t.positionOffset=B,t.batchIdIndex=w,t.indexOffset=A,t.batchedIndicesOffset+=d}const S=new n.Cartesian3,V=new n.Matrix4;function F(t,n,a){const i=a.length,o=2+i*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let a=0;a<t;++a)n+=r.Color.packedLength+3+e[a].batchIds.length;return n}(n),s=new Float64Array(o);let c=0;s[c++]=t,s[c++]=i;for(let t=0;t<i;++t)e.BoundingSphere.pack(a[t],s,c),c+=e.BoundingSphere.packedLength;const d=n.length;s[c++]=d;for(let e=0;e<d;++e){const t=n[e];r.Color.pack(t.color,s,c),c+=r.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const a=t.batchIds,i=a.length;s[c++]=i;for(let e=0;e<i;++e)s[c++]=a[e]}return s}return c((function(e,r){const c=i.defined(e.boxes)?new Float32Array(e.boxes):void 0,d=i.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,l=i.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,f=i.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,u=i.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=i.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,p=i.defined(e.spheres)?new Float32Array(e.spheres):void 0,b=i.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=i.defined(c)?d.length:0,x=i.defined(l)?f.length:0,g=i.defined(u)?h.length:0,m=i.defined(p)?b.length:0,C=t.BoxGeometry.getUnitBox(),I=a.CylinderGeometry.getUnitCylinder(),k=o.EllipsoidGeometry.getUnitEllipsoid(),M=C.attributes.position.values,B=I.attributes.position.values,w=k.attributes.position.values;let A=M.length*y;A+=B.length*x,A+=w.length*(g+m);const U=C.indices,T=I.indices,R=k.indices;let P=U.length*y;P+=T.length*x,P+=R.length*(g+m);const Z=new Float32Array(A),D=new Uint16Array(A/3),_=s.IndexDatatype.createTypedArray(A/3,P),q=y+x+g+m,W=new Uint16Array(q),j=new Array(q),H=new Uint32Array(q),N=new Uint32Array(q),Y=new Array(q);!function(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,S),r+=n.Cartesian3.packedLength,n.Matrix4.unpack(t,r,V)}(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:Z,vertexBatchIds:D,indices:_,batchIds:W,batchedIndices:j,indexOffsets:H,indexCounts:N,boundingVolumes:Y,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:V,center:S};G(z,c,d,C,O),G(z,l,f,I,L),G(z,u,h,k,v),G(z,p,b,k,E);const J=F(_.BYTES_PER_ELEMENT,j,Y);return r.push(Z.buffer,D.buffer,_.buffer),r.push(W.buffer,H.buffer,N.buffer),r.push(J.buffer),{positions:Z.buffer,vertexBatchIds:D.buffer,indices:_.buffer,indexOffsets:H.buffer,indexCounts:N.buffer,batchIds:W.buffer,packedBuffer:J.buffer}}))}));