forked from integrated_whb/integrated_whb_vue
2 lines
5.4 KiB
JavaScript
2 lines
5.4 KiB
JavaScript
|
define(["./Transforms-713aa3a8","./BoxGeometry-fcc27623","./Matrix3-b6f074fa","./Color-27beebda","./CylinderGeometry-da3b2d57","./defaultValue-0a909f67","./EllipsoidGeometry-4cf60170","./IndexDatatype-2149f06c","./Matrix2-163b5a1d","./createTaskProcessorWorker","./Math-e97915da","./combine-ca22a614","./RuntimeError-06c93819","./ComponentDatatype-77274976","./WebGLConstants-a8cc3e8c","./GeometryAttribute-0b8b7b82","./GeometryAttributes-f06a2792","./GeometryOffsetAttribute-04332ce7","./VertexFormat-ab2e00e6","./CylinderGeometryLibrary-20be4f8b"],(function(e,t,n,a,r,i,o,s,c,d,l,f,u,h,b,p,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,M=c.Matrix4.packedLength+n.Cartesian3.packedLength,k=c.Matrix4.packedLength+2,B=c.Matrix4.packedLength+n.Cartesian3.packedLength,w=n.Cartesian3.packedLength+1,A={modelMatrix:new c.Matrix4,boundingVolume:new e.BoundingSphere};function O(e,t){let a=t*M;const r=n.Cartesian3.unpack(e,a,I);a+=n.Cartesian3.packedLength;const i=c.Matrix4.unpack(e,a,A.modelMatrix);c.Matrix4.multiplyByScale(i,r,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 a=t*k;const r=e[a++],i=e[a++],o=n.Cartesian3.fromElements(r,r,i,I),s=c.Matrix4.unpack(e,a,A.modelMatrix);c.Matrix4.multiplyByScale(s,o,s);const d=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,d.center),d.radius=Math.sqrt(2),A}function v(e,t){let a=t*B;const r=n.Cartesian3.unpack(e,a,I);a+=n.Cartesian3.packedLength;const i=c.Matrix4.unpack(e,a,A.modelMatrix);c.Matrix4.multiplyByScale(i,r,i);const o=A.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,A}function E(e,t){let a=t*w;const r=e[a++],i=n.Cartesian3.unpack(e,a,I),o=c.Matrix4.fromTranslation(i,A.modelMatrix);c.Matrix4.multiplyByUniformScale(o,r,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,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,x=t.batchTableColors,g=t.batchedIndices,m=t.indexOffsets,I=t.indexCounts,M=t.boundingVolumes,k=t.modelMatrix,B=t.center;let w=t.positionOffset,A=t.batchIdIndex,O=t.indexOffset;const L=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,U);c.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,B,t),n.Cartesian3.pack(t,h,3*w+e),b[A++]=l}const E=u.length;for(let e=0;e<E;++e)p[O+e]=u[e]+w;const G=t+L;g[G]=new C({offset:O,count:E,color:a.Color.fromRgba(x[l]),batchIds:[l]}),y[G]=l,m[G]=O,I[G]=E,M[G]=e.BoundingSphere.transform(i.boundingVolume,s),w+=v/3,O+=E}t.positionOffset=w,t.batchIdIndex=A,t.indexOffset=O,t.batchedIndicesOffset+=l}const S=new n.Cartesian3,V=new c.Matrix4;function T(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,b=i.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,p=i.defined(e.spheres)?new Float32Array(e.spheres):void 0,y=i.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,x
|