1 |
- define(["exports","./arrayFill-0358accf","./buildModuleUrl-3d15f25c","./Cartographic-67e73ef9","./Check-52a7d806","./ComponentDatatype-81047f82","./when-92c6cf3c","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryOffsetAttribute-b4d599f5","./PrimitiveType-cdfe443e","./VertexFormat-f496a3f1"],(function(t,e,n,o,a,r,i,m,u,y,p,f){"use strict";var s=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,f.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+f.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),f.n.pack(t._vertexFormat,e,n+2*o.t.packedLength),e[n+2*o.t.packedLength+f.n.packedLength]=i.u(t._offsetAttribute,-1),e};var x,b=new o.t,A=new o.t,d=new f.n,l={minimum:b,maximum:A,vertexFormat:d,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,b),m=o.t.unpack(t,e+o.t.packedLength,A),u=f.n.unpack(t,e+2*o.t.packedLength,d),y=t[e+2*o.t.packedLength+f.n.packedLength];return i.e(n)?(n._minimum=o.t.clone(r,n._minimum),n._maximum=o.t.clone(m,n._maximum),n._vertexFormat=f.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,f=t._maximum,c=t._vertexFormat;if(!o.t.equals(a,f)){var x,b,A=new u.a;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&((b=new Float64Array(72))[0]=a.x,b[1]=a.y,b[2]=f.z,b[3]=f.x,b[4]=a.y,b[5]=f.z,b[6]=f.x,b[7]=f.y,b[8]=f.z,b[9]=a.x,b[10]=f.y,b[11]=f.z,b[12]=a.x,b[13]=a.y,b[14]=a.z,b[15]=f.x,b[16]=a.y,b[17]=a.z,b[18]=f.x,b[19]=f.y,b[20]=a.z,b[21]=a.x,b[22]=f.y,b[23]=a.z,b[24]=f.x,b[25]=a.y,b[26]=a.z,b[27]=f.x,b[28]=f.y,b[29]=a.z,b[30]=f.x,b[31]=f.y,b[32]=f.z,b[33]=f.x,b[34]=a.y,b[35]=f.z,b[36]=a.x,b[37]=a.y,b[38]=a.z,b[39]=a.x,b[40]=f.y,b[41]=a.z,b[42]=a.x,b[43]=f.y,b[44]=f.z,b[45]=a.x,b[46]=a.y,b[47]=f.z,b[48]=a.x,b[49]=f.y,b[50]=a.z,b[51]=f.x,b[52]=f.y,b[53]=a.z,b[54]=f.x,b[55]=f.y,b[56]=f.z,b[57]=a.x,b[58]=f.y,b[59]=f.z,b[60]=a.x,b[61]=a.y,b[62]=a.z,b[63]=f.x,b[64]=a.y,b[65]=a.z,b[66]=f.x,b[67]=a.y,b[68]=f.z,b[69]=a.x,b[70]=a.y,b[71]=f.z,A.position=new m.o({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b})),c.normal){var d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,A.normal=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})}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,A.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,A.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,A.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(b=new Float64Array(24))[0]=a.x,b[1]=a.y,b[2]=a.z,b[3]=f.x,b[4]=a.y,b[5]=a.z,b[6]=f.x,b[7]=f.y,b[8]=a.z,b[9]=a.x,b[10]=f.y,b[11]=a.z,b[12]=a.x,b[13]=a.y,b[14]=f.z,b[15]=f.x,b[16]=a.y,b[17]=f.z,b[18]=f.x,b[19]=f.y,b[20]=f.z,b[21]=a.x,b[22]=f.y,b[23]=f.z,A.position=new m.o({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b}),(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(f,a,s),O=.5*o.t.magnitude(g);if(i.e(t._offsetAttribute)){var _=b.length,h=new Uint8Array(_/3),F=t._offsetAttribute===y.z.NONE?0:1;e.d(h,F),A.applyOffset=new m.o({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new m.I({attributes:A,indices:x,primitiveType:p._0x29ba75.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:f.n.POSITION_ONLY}))),x},t.O=c}));
|