NONGYESHUZIDIZUO/public/Cesium/Workers/BoxGeometry-6ec9e668.js

2 lines
7.6 KiB
JavaScript

define(["exports","./arrayFill-deb10550","./buildModuleUrl-d920237a","./Cartographic-1d953166","./Check-2514d21d","./ComponentDatatype-07894a2b","./when-d186add7","./GeometryAttribute-95780fd1","./GeometryAttributes-9c67dd14","./GeometryOffsetAttribute-da5a1d35","./FeatureDetection-4281d393","./VertexFormat-769ac289"],(function(t,e,n,o,a,r,i,m,u,y,p,s){"use strict";var f=new o.t;function c(t){var e=(t=i.u(t,i.u.EMPTY_OBJECT)).minimum,n=t.maximum;if(a.o.typeOf.object("min",e),a.o.typeOf.object("max",n),i.e(t.offsetAttribute)&&t.offsetAttribute===y.z.TOP)throw new a.t("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");var r=i.u(t.vertexFormat,s.n.DEFAULT);this._minimum=o.t.clone(e),this._maximum=o.t.clone(n),this._vertexFormat=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}c.fromDimensions=function(t){var e=(t=i.u(t,i.u.EMPTY_OBJECT)).dimensions;a.o.typeOf.object("dimensions",e),a.o.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),a.o.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),a.o.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0);var n=o.t.multiplyByScalar(e,.5,new o.t);return new c({minimum:o.t.negate(n,new o.t),maximum:n,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},c.fromAxisAlignedBoundingBox=function(t){return a.o.typeOf.object("boundingBox",t),new c({minimum:t.minimum,maximum:t.maximum})},c.packedLength=2*o.t.packedLength+s.n.packedLength+1,c.pack=function(t,e,n){return a.o.typeOf.object("value",t),a.o.defined("array",e),n=i.u(n,0),o.t.pack(t._minimum,e,n),o.t.pack(t._maximum,e,n+o.t.packedLength),s.n.pack(t._vertexFormat,e,n+2*o.t.packedLength),e[n+2*o.t.packedLength+s.n.packedLength]=i.u(t._offsetAttribute,-1),e};var x,d=new o.t,b=new o.t,A=new s.n,l={minimum:d,maximum:b,vertexFormat:A,offsetAttribute:void 0};c.unpack=function(t,e,n){a.o.defined("array",t),e=i.u(e,0);var r=o.t.unpack(t,e,d),m=o.t.unpack(t,e+o.t.packedLength,b),u=s.n.unpack(t,e+2*o.t.packedLength,A),y=t[e+2*o.t.packedLength+s.n.packedLength];return i.e(n)?(n._minimum=o.t.clone(r,n._minimum),n._maximum=o.t.clone(m,n._maximum),n._vertexFormat=s.n.clone(u,n._vertexFormat),n._offsetAttribute=-1===y?void 0:y,n):(l.offsetAttribute=-1===y?void 0:y,new c(l))},c.createGeometry=function(t){var a=t._minimum,s=t._maximum,c=t._vertexFormat;if(!o.t.equals(a,s)){var x,d,b=new u.a;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&((d=new Float64Array(72))[0]=a.x,d[1]=a.y,d[2]=s.z,d[3]=s.x,d[4]=a.y,d[5]=s.z,d[6]=s.x,d[7]=s.y,d[8]=s.z,d[9]=a.x,d[10]=s.y,d[11]=s.z,d[12]=a.x,d[13]=a.y,d[14]=a.z,d[15]=s.x,d[16]=a.y,d[17]=a.z,d[18]=s.x,d[19]=s.y,d[20]=a.z,d[21]=a.x,d[22]=s.y,d[23]=a.z,d[24]=s.x,d[25]=a.y,d[26]=a.z,d[27]=s.x,d[28]=s.y,d[29]=a.z,d[30]=s.x,d[31]=s.y,d[32]=s.z,d[33]=s.x,d[34]=a.y,d[35]=s.z,d[36]=a.x,d[37]=a.y,d[38]=a.z,d[39]=a.x,d[40]=s.y,d[41]=a.z,d[42]=a.x,d[43]=s.y,d[44]=s.z,d[45]=a.x,d[46]=a.y,d[47]=s.z,d[48]=a.x,d[49]=s.y,d[50]=a.z,d[51]=s.x,d[52]=s.y,d[53]=a.z,d[54]=s.x,d[55]=s.y,d[56]=s.z,d[57]=a.x,d[58]=s.y,d[59]=s.z,d[60]=a.x,d[61]=a.y,d[62]=a.z,d[63]=s.x,d[64]=a.y,d[65]=a.z,d[66]=s.x,d[67]=a.y,d[68]=s.z,d[69]=a.x,d[70]=a.y,d[71]=s.z,b.position=new m.o({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),c.normal){var A=new Float32Array(72);A[0]=0,A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=1,A[9]=0,A[10]=0,A[11]=1,A[12]=0,A[13]=0,A[14]=-1,A[15]=0,A[16]=0,A[17]=-1,A[18]=0,A[19]=0,A[20]=-1,A[21]=0,A[22]=0,A[23]=-1,A[24]=1,A[25]=0,A[26]=0,A[27]=1,A[28]=0,A[29]=0,A[30]=1,A[31]=0,A[32]=0,A[33]=1,A[34]=0,A[35]=0,A[36]=-1,A[37]=0,A[38]=0,A[39]=-1,A[40]=0,A[41]=0,A[42]=-1,A[43]=0,A[44]=0,A[45]=-1,A[46]=0,A[47]=0,A[48]=0,A[49]=1,A[50]=0,A[51]=0,A[52]=1,A[53]=0,A[54]=0,A[55]=1,A[56]=0,A[57]=0,A[58]=1,A[59]=0,A[60]=0,A[61]=-1,A[62]=0,A[63]=0,A[64]=-1,A[65]=0,A[66]=0,A[67]=-1,A[68]=0,A[69]=0,A[70]=-1,A[71]=0,b.normal=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var l=new Float32Array(72),v=0;l[v++]=0,l[v++]=0,l[v++]=-1,l[v++]=1,l[v++]=0,l[v++]=-1,l[v++]=1,l[v++]=1,l[v++]=-1,l[v++]=0,l[v++]=1,l[v++]=-1,l[v++]=1,l[v++]=0,l[v++]=-1,l[v++]=0,l[v++]=0,l[v++]=-1,l[v++]=0,l[v++]=1,l[v++]=-1,l[v++]=1,l[v++]=1,l[v++]=-1,l[v++]=0,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=1,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=0,l[v++]=0,l[v++]=0,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=1,l[v++]=1,l[v++]=1,l[v++]=1,l[v++]=0,l[v++]=0,l[v++]=1,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=1,l[v++]=1,l[v++]=1,l[v++]=0,l[v++]=1,l[v++]=1,b.st=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:l})}if(c.tangent){var z=new Float32Array(72);z[0]=1,z[1]=0,z[2]=0,z[3]=1,z[4]=0,z[5]=0,z[6]=1,z[7]=0,z[8]=0,z[9]=1,z[10]=0,z[11]=0,z[12]=-1,z[13]=0,z[14]=0,z[15]=-1,z[16]=0,z[17]=0,z[18]=-1,z[19]=0,z[20]=0,z[21]=-1,z[22]=0,z[23]=0,z[24]=0,z[25]=1,z[26]=0,z[27]=0,z[28]=1,z[29]=0,z[30]=0,z[31]=1,z[32]=0,z[33]=0,z[34]=1,z[35]=0,z[36]=0,z[37]=-1,z[38]=0,z[39]=0,z[40]=-1,z[41]=0,z[42]=0,z[43]=-1,z[44]=0,z[45]=0,z[46]=-1,z[47]=0,z[48]=-1,z[49]=0,z[50]=0,z[51]=-1,z[52]=0,z[53]=0,z[54]=-1,z[55]=0,z[56]=0,z[57]=-1,z[58]=0,z[59]=0,z[60]=1,z[61]=0,z[62]=0,z[63]=1,z[64]=0,z[65]=0,z[66]=1,z[67]=0,z[68]=0,z[69]=1,z[70]=0,z[71]=0,b.tangent=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:z})}if(c.bitangent){var w=new Float32Array(72);w[0]=0,w[1]=1,w[2]=0,w[3]=0,w[4]=1,w[5]=0,w[6]=0,w[7]=1,w[8]=0,w[9]=0,w[10]=1,w[11]=0,w[12]=0,w[13]=1,w[14]=0,w[15]=0,w[16]=1,w[17]=0,w[18]=0,w[19]=1,w[20]=0,w[21]=0,w[22]=1,w[23]=0,w[24]=0,w[25]=0,w[26]=1,w[27]=0,w[28]=0,w[29]=1,w[30]=0,w[31]=0,w[32]=1,w[33]=0,w[34]=0,w[35]=1,w[36]=0,w[37]=0,w[38]=1,w[39]=0,w[40]=0,w[41]=1,w[42]=0,w[43]=0,w[44]=1,w[45]=0,w[46]=0,w[47]=1,w[48]=0,w[49]=0,w[50]=1,w[51]=0,w[52]=0,w[53]=1,w[54]=0,w[55]=0,w[56]=1,w[57]=0,w[58]=0,w[59]=1,w[60]=0,w[61]=0,w[62]=1,w[63]=0,w[64]=0,w[65]=1,w[66]=0,w[67]=0,w[68]=1,w[69]=0,w[70]=0,w[71]=1,b.bitangent=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})}(x=new Uint16Array(36))[0]=0,x[1]=1,x[2]=2,x[3]=0,x[4]=2,x[5]=3,x[6]=6,x[7]=5,x[8]=4,x[9]=7,x[10]=6,x[11]=4,x[12]=8,x[13]=9,x[14]=10,x[15]=8,x[16]=10,x[17]=11,x[18]=14,x[19]=13,x[20]=12,x[21]=15,x[22]=14,x[23]=12,x[24]=18,x[25]=17,x[26]=16,x[27]=19,x[28]=18,x[29]=16,x[30]=20,x[31]=21,x[32]=22,x[33]=20,x[34]=22,x[35]=23}else(d=new Float64Array(24))[0]=a.x,d[1]=a.y,d[2]=a.z,d[3]=s.x,d[4]=a.y,d[5]=a.z,d[6]=s.x,d[7]=s.y,d[8]=a.z,d[9]=a.x,d[10]=s.y,d[11]=a.z,d[12]=a.x,d[13]=a.y,d[14]=s.z,d[15]=s.x,d[16]=a.y,d[17]=s.z,d[18]=s.x,d[19]=s.y,d[20]=s.z,d[21]=a.x,d[22]=s.y,d[23]=s.z,b.position=new m.o({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d}),(x=new Uint16Array(36))[0]=4,x[1]=5,x[2]=6,x[3]=4,x[4]=6,x[5]=7,x[6]=1,x[7]=0,x[8]=3,x[9]=1,x[10]=3,x[11]=2,x[12]=1,x[13]=6,x[14]=5,x[15]=1,x[16]=2,x[17]=6,x[18]=2,x[19]=3,x[20]=7,x[21]=2,x[22]=7,x[23]=6,x[24]=3,x[25]=0,x[26]=4,x[27]=3,x[28]=4,x[29]=7,x[30]=0,x[31]=1,x[32]=5,x[33]=0,x[34]=5,x[35]=4;var g=o.t.subtract(s,a,f),O=.5*o.t.magnitude(g);if(i.e(t._offsetAttribute)){var _=d.length,h=new Uint8Array(_/3),F=t._offsetAttribute===y.z.NONE?0:1;e.d(h,F),b.applyOffset=new m.o({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new m.I({attributes:b,indices:x,primitiveType:p._0x12cc5d.TRIANGLES,boundingSphere:new n.i(o.t.ZERO,O),offsetAttribute:t._offsetAttribute})}},c.getUnitBox=function(){return i.e(x)||(x=c.createGeometry(c.fromDimensions({dimensions:new o.t(1,1,1),vertexFormat:s.n.POSITION_ONLY}))),x},t.O=c}));