qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/createVectorTileGeometries.js

2 lines
5.6 KiB
JavaScript
Raw Permalink Normal View History

2024-01-02 14:12:39 +08:00
define(["./BoundingSphere-9a3b5656","./BoxGeometry-786261a7","./Cartesian3-e0307675","./Color-82ef4a75","./CylinderGeometry-73e7e8e1","./defaultValue-81eec7ed","./EllipsoidGeometry-204918b6","./IndexDatatype-3f3c99e8","./Matrix4-4c545f70","./createTaskProcessorWorker","./Cartesian2-bd414876","./Check-741c5f3c","./Math-e73894ab","./GeographicProjection-c931c7fb","./Rectangle-cf3e0e3e","./GeometryOffsetAttribute-ed56ff58","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./GeometryAttribute-2b42a913","./Matrix2-dc0c61cc","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda","./RuntimeError-26acdd3b","./GeometryAttributes-32b29525","./VertexFormat-d50a69ba","./CylinderGeometryLibrary-6ad7b69e"],(function(e,t,n,a,r,i,o,s,c,d,l,f,u,h,b,p,y,g,x,C,m,I,k,M,B,w,A,O){"use strict";function L(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const v=new n.Cartesian3,E=c.Matrix4.packedLength+n.Cartesian3.packedLength,U=c.Matrix4.packedLength+2,G=c.Matrix4.packedLength+n.Cartesian3.packedLength,S=n.Cartesian3.packedLength+1,V={modelMatrix:new c.Matrix4,boundingVolume:new e.BoundingSphere};function R(e,t){let a=t*E;const r=n.Cartesian3.unpack(e,a,v);a+=n.Cartesian3.packedLength;const i=c.Matrix4.unpack(e,a,V.modelMatrix);c.Matrix4.multiplyByScale(i,r,i);const o=V.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),V}function T(e,t){let a=t*U;const r=e[a++],i=e[a++],o=n.Cartesian3.fromElements(r,r,i,v),s=c.Matrix4.unpack(e,a,V.modelMatrix);c.Matrix4.multiplyByScale(s,o,s);const d=V.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,d.center),d.radius=Math.sqrt(2),V}function F(e,t){let a=t*G;const r=n.Cartesian3.unpack(e,a,v);a+=n.Cartesian3.packedLength;const i=c.Matrix4.unpack(e,a,V.modelMatrix);c.Matrix4.multiplyByScale(i,r,i);const o=V.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,V}function P(e,t){let a=t*S;const r=e[a++],i=n.Cartesian3.unpack(e,a,v),o=c.Matrix4.fromTranslation(i,V.modelMatrix);c.Matrix4.multiplyByUniformScale(o,r,o);const s=V.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,V}const Z=new n.Cartesian3;function D(t,r,o,s,d){if(!i.defined(r))return;const l=o.length,f=s.attributes.position.values,u=s.indices,h=t.positions,b=t.vertexBatchIds,p=t.indices,y=t.batchIds,g=t.batchTableColors,x=t.batchedIndices,C=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<l;++t){const i=d(r,t),s=i.modelMatrix;c.Matrix4.multiply(k,s,s);const l=o[t],v=f.length;for(let e=0;e<v;e+=3){const t=n.Cartesian3.unpack(f,e,Z);c.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,M,t),n.Cartesian3.pack(t,h,3*B+e),b[w++]=l}const E=u.length;for(let e=0;e<E;++e)p[A+e]=u[e]+B;const U=t+O;x[U]=new L({offset:A,count:E,color:a.Color.fromRgba(g[l]),batchIds:[l]}),y[U]=l,C[U]=A,m[U]=E,I[U]=e.BoundingSphere.transform(i.boundingVolume,s),B+=v/3,A+=E}t.positionOffset=B,t.batchIdIndex=w,t.indexOffset=A,t.batchedIndicesOffset+=l}const q=new n.Cartesian3,W=new c.Matrix4;function _(t,n,r){const i=r.length,o=2+i*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let r=0;r<t;++r)n+=a.Color.packedLength+3+e[r].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(r[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];a.Color.pack(t.color,s,c),c+=a.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const r=t.batchIds,i=r.length;s[c++]=i;for(let e=0;e<i;++e)s[c++]=r[e]}return s}return d((function(e,a){const d=i.defined(e.boxes)?new Float32Array(e.boxes):void 0,l=i.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,f=i.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,u=i.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,h=i.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0