NONGYESHUZIDIZUO/public/Cesium/Workers/BoxGeometry-995be07a.js

2 lines
7.6 KiB
JavaScript
Raw Permalink Normal View History

2025-01-21 08:36:33 +08:00
define(["exports","./arrayFill-4d3cc415","./buildModuleUrl-dba4ec07","./Cartographic-1bbcab04","./Check-3aa71481","./ComponentDatatype-d430c7f7","./when-515d5295","./GeometryAttribute-9bc31a7f","./GeometryAttributes-7d904f0f","./GeometryOffsetAttribute-800f7650","./PrimitiveType-b38a4004","./VertexFormat-e844760b"],(function(t,e,n,a,r,o,i,m,u,y,p,s){"use strict";var f=new a.a;function c(t){var e=(t=i.e(t,i.e.EMPTY_OBJECT)).minimum,n=t.maximum;if(r.n.typeOf.object("min",e),r.n.typeOf.object("max",n),i.t(t.offsetAttribute)&&t.offsetAttribute===y.I.TOP)throw new r.t("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");var o=i.e(t.vertexFormat,s.n.DEFAULT);this._minimum=a.a.clone(e),this._maximum=a.a.clone(n),this._vertexFormat=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}c.fromDimensions=function(t){var e=(t=i.e(t,i.e.EMPTY_OBJECT)).dimensions;r.n.typeOf.object("dimensions",e),r.n.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),r.n.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),r.n.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0);var n=a.a.multiplyByScalar(e,.5,new a.a);return new c({minimum:a.a.negate(n,new a.a),maximum:n,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},c.fromAxisAlignedBoundingBox=function(t){return r.n.typeOf.object("boundingBox",t),new c({minimum:t.minimum,maximum:t.maximum})},c.packedLength=2*a.a.packedLength+s.n.packedLength+1,c.pack=function(t,e,n){return r.n.typeOf.object("value",t),r.n.defined("array",e),n=i.e(n,0),a.a.pack(t._minimum,e,n),a.a.pack(t._maximum,e,n+a.a.packedLength),s.n.pack(t._vertexFormat,e,n+2*a.a.packedLength),e[n+2*a.a.packedLength+s.n.packedLength]=i.e(t._offsetAttribute,-1),e};var x,b=new a.a,A=new a.a,d=new s.n,l={minimum:b,maximum:A,vertexFormat:d,offsetAttribute:void 0};c.unpack=function(t,e,n){r.n.defined("array",t),e=i.e(e,0);var o=a.a.unpack(t,e,b),m=a.a.unpack(t,e+a.a.packedLength,A),u=s.n.unpack(t,e+2*a.a.packedLength,d),y=t[e+2*a.a.packedLength+s.n.packedLength];return i.t(n)?(n._minimum=a.a.clone(o,n._minimum),n._maximum=a.a.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 r=t._minimum,s=t._maximum,c=t._vertexFormat;if(!a.a.equals(r,s)){var x,b,A=new u.t;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&((b=new Float64Array(72))[0]=r.x,b[1]=r.y,b[2]=s.z,b[3]=s.x,b[4]=r.y,b[5]=s.z,b[6]=s.x,b[7]=s.y,b[8]=s.z,b[9]=r.x,b[10]=s.y,b[11]=s.z,b[12]=r.x,b[13]=r.y,b[14]=r.z,b[15]=s.x,b[16]=r.y,b[17]=r.z,b[18]=s.x,b[19]=s.y,b[20]=r.z,b[21]=r.x,b[22]=s.y,b[23]=r.z,b[24]=s.x,b[25]=r.y,b[26]=r.z,b[27]=s.x,b[28]=s.y,b[29]=r.z,b[30]=s.x,b[31]=s.y,b[32]=s.z,b[33]=s.x,b[34]=r.y,b[35]=s.z,b[36]=r.x,b[37]=r.y,b[38]=r.z,b[39]=r.x,b[40]=s.y,b[41]=r.z,b[42]=r.x,b[43]=s.y,b[44]=s.z,b[45]=r.x,b[46]=r.y,b[47]=s.z,b[48]=r.x,b[49]=s.y,b[50]=r.z,b[51]=s.x,b[52]=s.y,b[53]=r.z,b[54]=s.x,b[55]=s.y,b[56]=s.z,b[57]=r.x,b[58]=s.y,b[59]=s.z,b[60]=r.x,b[61]=r.y,b[62]=r.z,b[63]=s.x,b[64]=r.y,b[65]=r.z,b[66]=s.x,b[67]=r.y,b[68]=s.z,b[69]=r.x,b[70]=r.y,b[71]=s.z,A.position=new m.r({componentDatatype:o.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.r({componentDatatype:o.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+