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
5.2 KiB
1 lines
5.2 KiB
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./GeometryAttributes-90846c5f","./IndexDatatype-354a5ea3","./createTaskProcessorWorker","./GeometryOffsetAttribute-84f7eff3","./VertexFormat-cc24f342","./BoxGeometry-42281bde","./CylinderGeometryLibrary-07878882","./CylinderGeometry-f4876345","./EllipsoidGeometry-59db9dd4","./Color-bfeeb147"],function(F,e,t,R,Z,n,r,a,i,o,D,d,s,c,P,f,q,W,S){"use strict";function T(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var l=new R.Cartesian3,u=Z.Matrix4.packedLength+R.Cartesian3.packedLength,h=Z.Matrix4.packedLength+2,p=Z.Matrix4.packedLength+R.Cartesian3.packedLength,b=R.Cartesian3.packedLength+1,y={modelMatrix:new Z.Matrix4,boundingVolume:new Z.BoundingSphere};function _(e,t){var n=t*u,r=R.Cartesian3.unpack(e,n,l);n+=R.Cartesian3.packedLength;var a=Z.Matrix4.unpack(e,n,y.modelMatrix);Z.Matrix4.multiplyByScale(a,r,a);var i=y.boundingVolume;return R.Cartesian3.clone(R.Cartesian3.ZERO,i.center),i.radius=Math.sqrt(3),y}function N(e,t){var n=t*h,r=e[n++],a=e[n++],i=R.Cartesian3.fromElements(r,r,a,l),o=Z.Matrix4.unpack(e,n,y.modelMatrix);Z.Matrix4.multiplyByScale(o,i,o);var d=y.boundingVolume;return R.Cartesian3.clone(R.Cartesian3.ZERO,d.center),d.radius=Math.sqrt(2),y}function Y(e,t){var n=t*p,r=R.Cartesian3.unpack(e,n,l);n+=R.Cartesian3.packedLength;var a=Z.Matrix4.unpack(e,n,y.modelMatrix);Z.Matrix4.multiplyByScale(a,r,a);var i=y.boundingVolume;return R.Cartesian3.clone(R.Cartesian3.ZERO,i.center),i.radius=1,y}function j(e,t){var n=t*b,r=e[n++],a=R.Cartesian3.unpack(e,n,l),i=Z.Matrix4.fromTranslation(a,y.modelMatrix);Z.Matrix4.multiplyByUniformScale(i,r,i);var o=y.boundingVolume;return R.Cartesian3.clone(R.Cartesian3.ZERO,o.center),o.radius=1,y}var V=new R.Cartesian3;function z(e,t,n,r,a){if(F.defined(t)){for(var i=n.length,o=r.attributes.position.values,d=r.indices,s=e.positions,c=e.vertexBatchIds,f=e.indices,l=e.batchIds,u=e.batchTableColors,h=e.batchedIndices,p=e.indexOffsets,b=e.indexCounts,y=e.boundingVolumes,x=e.modelMatrix,g=e.center,v=e.positionOffset,C=e.batchIdIndex,m=e.indexOffset,I=e.batchedIndicesOffset,k=0;k<i;++k){var M=a(t,k),B=M.modelMatrix;Z.Matrix4.multiply(x,B,B);for(var w=n[k],A=o.length,O=0;O<A;O+=3){var L=R.Cartesian3.unpack(o,O,V);Z.Matrix4.multiplyByPoint(B,L,L),R.Cartesian3.subtract(L,g,L),R.Cartesian3.pack(L,s,3*v+O),c[C++]=w}for(var E=d.length,U=0;U<E;++U)f[m+U]=d[U]+v;var G=k+I;h[G]=new T({offset:m,count:E,color:S.Color.fromRgba(u[w]),batchIds:[w]}),l[G]=w,p[G]=m,b[G]=E,y[G]=Z.BoundingSphere.transform(M.boundingVolume,B),v+=A/3,m+=E}e.positionOffset=v,e.batchIdIndex=C,e.indexOffset=m,e.batchedIndicesOffset+=i}}var H=new R.Cartesian3,J=new Z.Matrix4;function K(e,t,n){var r=n.length,a=2+r*Z.BoundingSphere.packedLength+1+function(e){for(var t=e.length,n=0,r=0;r<t;++r)n+=S.Color.packedLength+3+e[r].batchIds.length;return n}(t),i=new Float64Array(a),o=0;i[o++]=e,i[o++]=r;for(var d=0;d<r;++d)Z.BoundingSphere.pack(n[d],i,o),o+=Z.BoundingSphere.packedLength;var s=t.length;i[o++]=s;for(var c=0;c<s;++c){var f=t[c];S.Color.pack(f.color,i,o),o+=S.Color.packedLength,i[o++]=f.offset,i[o++]=f.count;var l=f.batchIds,u=l.length;i[o++]=u;for(var h=0;h<u;++h)i[o++]=l[h]}return i}return d(function(e,t){var n=F.defined(e.boxes)?new Float32Array(e.boxes):void 0,r=F.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,a=F.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,i=F.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,o=F.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,d=F.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,s=F.defined(e.spheres)?new Float32Array(e.spheres):void 0,c=F.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,f=F.defined(n)?r.length:0,l=F.defined(a)?i.length:0,u=F.defined(o)?d.length:0,h=F.defined(s)?c.length:0,p=P.BoxGeometry.getUnitBox(),b=q.CylinderGeometry.getUnitCylinder(),y=W.EllipsoidGeometry.getUnitEllipsoid(),x=p.attributes.position.values,g=b.attributes.position.values,v=y.attributes.position.values,C=x.length*f;C+=g.length*l,C+=v.length*(u+h);var m=p.indices,I=b.indices,k=y.indices,M=m.length*f;M+=I.length*l,M+=k.length*(u+h);var B=new Float32Array(C),w=new Uint16Array(C/3),A=D.IndexDatatype.createTypedArray(C/3,M),O=f+l+u+h,L=new Uint16Array(O),E=new Array(O),U=new Uint32Array(O),G=new Uint32Array(O),S=new Array(O);!function(e){var t=new Float64Array(e),n=0;R.Cartesian3.unpack(t,n,H),n+=R.Cartesian3.packedLength,Z.Matrix4.unpack(t,n,J)}(e.packedBuffer);var T={batchTableColors:new Uint32Array(e.batchTableColors),positions:B,vertexBatchIds:w,indices:A,batchIds:L,batchedIndices:E,indexOffsets:U,indexCounts:G,boundingVolumes:S,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:J,center:H};z(T,n,r,p,_),z(T,a,i,b,N),z(T,o,d,y,Y),z(T,s,c,y,j);var V=K(A.BYTES_PER_ELEMENT,E,S);return t.push(B.buffer,w.buffer,A.buffer),t.push(L.buffer,U.buffer,G.buffer),t.push(V.buffer),{positions:B.buffer,vertexBatchIds:w.buffer,indices:A.buffer,indexOffsets:U.buffer,indexCounts:G.buffer,batchIds:L.buffer,packedBuffer:V.buffer}})});
|
|
|