| 1 |
- define(["exports","./arrayFill-4513d7ad","./buildModuleUrl-57a32107","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./when-b60132fc","./GeometryAttribute-c42d25b7","./GeometryAttributes-252e9929","./GeometryOffsetAttribute-fbeb6f1a","./VertexFormat-6446fca0"],(function(t,e,a,n,r,i,o,m,u,s,y){"use strict";var p=new n.Cartesian3;function x(t){var e=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,r=o.defaultValue(t.vertexFormat,y.VertexFormat.DEFAULT);this._minimum=n.Cartesian3.clone(e),this._maximum=n.Cartesian3.clone(a),this._vertexFormat=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}x.fromDimensions=function(t){var e=(t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(e,.5,new n.Cartesian3);return new x({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},x.fromAxisAlignedBoundingBox=function(t){return new x({minimum:t.minimum,maximum:t.maximum})},x.packedLength=2*n.Cartesian3.packedLength+y.VertexFormat.packedLength+1,x.pack=function(t,e,a){return a=o.defaultValue(a,0),n.Cartesian3.pack(t._minimum,e,a),n.Cartesian3.pack(t._maximum,e,a+n.Cartesian3.packedLength),y.VertexFormat.pack(t._vertexFormat,e,a+2*n.Cartesian3.packedLength),e[a+2*n.Cartesian3.packedLength+y.VertexFormat.packedLength]=o.defaultValue(t._offsetAttribute,-1),e};var f,c=new n.Cartesian3,l=new n.Cartesian3,A=new y.VertexFormat,d={minimum:c,maximum:l,vertexFormat:A,offsetAttribute:void 0};x.unpack=function(t,e,a){e=o.defaultValue(e,0);var r=n.Cartesian3.unpack(t,e,c),i=n.Cartesian3.unpack(t,e+n.Cartesian3.packedLength,l),m=y.VertexFormat.unpack(t,e+2*n.Cartesian3.packedLength,A),u=t[e+2*n.Cartesian3.packedLength+y.VertexFormat.packedLength];return o.defined(a)?(a._minimum=n.Cartesian3.clone(r,a._minimum),a._maximum=n.Cartesian3.clone(i,a._maximum),a._vertexFormat=y.VertexFormat.clone(m,a._vertexFormat),a._offsetAttribute=-1===u?void 0:u,a):(d.offsetAttribute=-1===u?void 0:u,new x(d))},x.createGeometry=function(t){var r=t._minimum,y=t._maximum,x=t._vertexFormat;if(!n.Cartesian3.equals(r,y)){var f,c,l=new u.GeometryAttributes;if(x.position&&(x.st||x.normal||x.tangent||x.bitangent)){if(x.position&&((c=new Float64Array(72))[0]=r.x,c[1]=r.y,c[2]=y.z,c[3]=y.x,c[4]=r.y,c[5]=y.z,c[6]=y.x,c[7]=y.y,c[8]=y.z,c[9]=r.x,c[10]=y.y,c[11]=y.z,c[12]=r.x,c[13]=r.y,c[14]=r.z,c[15]=y.x,c[16]=r.y,c[17]=r.z,c[18]=y.x,c[19]=y.y,c[20]=r.z,c[21]=r.x,c[22]=y.y,c[23]=r.z,c[24]=y.x,c[25]=r.y,c[26]=r.z,c[27]=y.x,c[28]=y.y,c[29]=r.z,c[30]=y.x,c[31]=y.y,c[32]=y.z,c[33]=y.x,c[34]=r.y,c[35]=y.z,c[36]=r.x,c[37]=r.y,c[38]=r.z,c[39]=r.x,c[40]=y.y,c[41]=r.z,c[42]=r.x,c[43]=y.y,c[44]=y.z,c[45]=r.x,c[46]=r.y,c[47]=y.z,c[48]=r.x,c[49]=y.y,c[50]=r.z,c[51]=y.x,c[52]=y.y,c[53]=r.z,c[54]=y.x,c[55]=y.y,c[56]=y.z,c[57]=r.x,c[58]=y.y,c[59]=y.z,c[60]=r.x,c[61]=r.y,c[62]=r.z,c[63]=y.x,c[64]=r.y,c[65]=r.z,c[66]=y.x,c[67]=r.y,c[68]=y.z,c[69]=r.x,c[70]=r.y,c[71]=y.z,l.position=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})),x.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,l.normal=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})}if(x.st){var d=new Float32Array(72),b=0;d[b++]=0,d[b++]=0,d[b++]=-1,d[b++]=1,d[b++]=0,d[b++]=-1,d[b++]=1,d[b++]=1,d[b++]=-1,d[b++]=0,d[b++]=1,d[b++]=-1,d[b++]=1,d[b++]=0,d[b++]=-1,d[b++]=0,d[b++]=0,d[b++]=-1,d[b++]=0,d[b++]=1,d[b++]=-1,d[b++]=1,d[b++]=1,d[b++]=-1,d[b++]=0,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=1,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=0,d[b++]=0,d[b++]=0,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=1,d[b++]=1,d[b++]=1,d[b++]=1,d[b++]=0,d[b++]=0,d[b++]=1,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=1,d[b++]=1,d[b++]=1,d[b++]=0,d[b++]=1,d[b++]=1,l.st=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})}if(x.tangent){var C=new Float32Array(72);C[0]=1,C[1]=0,C[2]=0,C[3]=1,C[4]=0,C[5]=0,C[6]=1,C[7]=0,C[8]=0,C[9]=1,C[10]=0,C[11]=0,C[12]=-1,C[13]=0,C[14]=0,C[15]=-1,C[16]=0,C[17]=0,C[18]=-1,C[19]=0,C[20]=0,C[21]=-1,C[22]=0,C[23]=0,C[24]=0,C[25]=1,C[26]=0,C[27]=0,C[28]=1,C[29]=0,C[30]=0,C[31]=1,C[32]=0,C[33]=0,C[34]=1,C[35]=0,C[36]=0,C[37]=-1,C[38]=0,C[39]=0,C[40]=-1,C[41]=0,C[42]=0,C[43]=-1,C[44]=0,C[45]=0,C[46]=-1,C[47]=0,C[48]=-1,C[49]=0,C[50]=0,C[51]=-1,C[52]=0,C[53]=0,C[54]=-1,C[55]=0,C[56]=0,C[57]=-1,C[58]=0,C[59]=0,C[60]=1,C[61]=0,C[62]=0,C[63]=1,C[64]=0,C[65]=0,C[66]=1,C[67]=0,C[68]=0,C[69]=1,C[70]=0,C[71]=0,l.tangent=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C})}if(x.bitangent){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,l.bitangent=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})}(f=new Uint16Array(36))[0]=0,f[1]=1,f[2]=2,f[3]=0,f[4]=2,f[5]=3,f[6]=6,f[7]=5,f[8]=4,f[9]=7,f[10]=6,f[11]=4,f[12]=8,f[13]=9,f[14]=10,f[15]=8,f[16]=10,f[17]=11,f[18]=14,f[19]=13,f[20]=12,f[21]=15,f[22]=14,f[23]=12,f[24]=18,f[25]=17,f[26]=16,f[27]=19,f[28]=18,f[29]=16,f[30]=20,f[31]=21,f[32]=22,f[33]=20,f[34]=22,f[35]=23}else(c=new Float64Array(24))[0]=r.x,c[1]=r.y,c[2]=r.z,c[3]=y.x,c[4]=r.y,c[5]=r.z,c[6]=y.x,c[7]=y.y,c[8]=r.z,c[9]=r.x,c[10]=y.y,c[11]=r.z,c[12]=r.x,c[13]=r.y,c[14]=y.z,c[15]=y.x,c[16]=r.y,c[17]=y.z,c[18]=y.x,c[19]=y.y,c[20]=y.z,c[21]=r.x,c[22]=y.y,c[23]=y.z,l.position=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),(f=new Uint16Array(36))[0]=4,f[1]=5,f[2]=6,f[3]=4,f[4]=6,f[5]=7,f[6]=1,f[7]=0,f[8]=3,f[9]=1,f[10]=3,f[11]=2,f[12]=1,f[13]=6,f[14]=5,f[15]=1,f[16]=2,f[17]=6,f[18]=2,f[19]=3,f[20]=7,f[21]=2,f[22]=7,f[23]=6,f[24]=3,f[25]=0,f[26]=4,f[27]=3,f[28]=4,f[29]=7,f[30]=0,f[31]=1,f[32]=5,f[33]=0,f[34]=5,f[35]=4;var F=n.Cartesian3.subtract(y,r,p),z=.5*n.Cartesian3.magnitude(F);if(o.defined(t._offsetAttribute)){var w=c.length,g=new Uint8Array(w/3),_=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(g,_),l.applyOffset=new m.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}return new m.Geometry({attributes:l,indices:f,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:new a.BoundingSphere(n.Cartesian3.ZERO,z),offsetAttribute:t._offsetAttribute})}},x.getUnitBox=function(){return o.defined(f)||(f=x.createGeometry(x.fromDimensions({dimensions:new n.Cartesian3(1,1,1),vertexFormat:y.VertexFormat.POSITION_ONLY}))),f},t.BoxGeometry=x}));
|