learning_cesium/js/XbsjCesium/Workers/BoxGeometry-f1467a7d.js

2 lines
7.3 KiB
JavaScript
Raw Normal View History

2024-03-19 18:06:25 +08:00
define(["exports","./GeometryOffsetAttribute-6e5d8e16","./Transforms-251ff661","./Cartesian2-697a9954","./Check-f3fec9b0","./ComponentDatatype-417761a2","./when-54335d57","./GeometryAttribute-7ca1c9e4","./GeometryAttributes-caa08d6c","./VertexFormat-acf45ede"],function(e,s,y,p,t,x,c,f,A,o){"use strict";var l=new p.Cartesian3;function m(e){var t=(e=c.defaultValue(e,c.defaultValue.EMPTY_OBJECT)).minimum,a=e.maximum,n=c.defaultValue(e.vertexFormat,o.VertexFormat.DEFAULT);this._minimum=p.Cartesian3.clone(t),this._maximum=p.Cartesian3.clone(a),this._vertexFormat=n,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}m.fromDimensions=function(e){var t=(e=c.defaultValue(e,c.defaultValue.EMPTY_OBJECT)).dimensions,t=p.Cartesian3.multiplyByScalar(t,.5,new p.Cartesian3);return new m({minimum:p.Cartesian3.negate(t,new p.Cartesian3),maximum:t,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},m.fromAxisAlignedBoundingBox=function(e){return new m({minimum:e.minimum,maximum:e.maximum})},m.packedLength=2*p.Cartesian3.packedLength+o.VertexFormat.packedLength+1,m.pack=function(e,t,a){return a=c.defaultValue(a,0),p.Cartesian3.pack(e._minimum,t,a),p.Cartesian3.pack(e._maximum,t,a+p.Cartesian3.packedLength),o.VertexFormat.pack(e._vertexFormat,t,a+2*p.Cartesian3.packedLength),t[a+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength]=c.defaultValue(e._offsetAttribute,-1),t};var a,u=new p.Cartesian3,d=new p.Cartesian3,C=new o.VertexFormat,b={minimum:u,maximum:d,vertexFormat:C,offsetAttribute:void 0};m.unpack=function(e,t,a){t=c.defaultValue(t,0);var n=p.Cartesian3.unpack(e,t,u),r=p.Cartesian3.unpack(e,t+p.Cartesian3.packedLength,d),i=o.VertexFormat.unpack(e,t+2*p.Cartesian3.packedLength,C),t=e[t+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength];return c.defined(a)?(a._minimum=p.Cartesian3.clone(n,a._minimum),a._maximum=p.Cartesian3.clone(r,a._maximum),a._vertexFormat=o.VertexFormat.clone(i,a._vertexFormat),a._offsetAttribute=-1===t?void 0:t,a):(b.offsetAttribute=-1===t?void 0:t,new m(b))},m.createGeometry=function(e){var t=e._minimum,a=e._maximum,n=e._vertexFormat;if(!p.Cartesian3.equals(t,a)){var r,i,o,m=new A.GeometryAttributes;n.position&&(n.st||n.normal||n.tangent||n.bitangent)?(n.position&&((u=new Float64Array(72))[0]=t.x,u[1]=t.y,u[2]=a.z,u[3]=a.x,u[4]=t.y,u[5]=a.z,u[6]=a.x,u[7]=a.y,u[8]=a.z,u[9]=t.x,u[10]=a.y,u[11]=a.z,u[12]=t.x,u[13]=t.y,u[14]=t.z,u[15]=a.x,u[16]=t.y,u[17]=t.z,u[18]=a.x,u[19]=a.y,u[20]=t.z,u[21]=t.x,u[22]=a.y,u[23]=t.z,u[24]=a.x,u[25]=t.y,u[26]=t.z,u[27]=a.x,u[28]=a.y,u[29]=t.z,u[30]=a.x,u[31]=a.y,u[32]=a.z,u[33]=a.x,u[34]=t.y,u[35]=a.z,u[36]=t.x,u[37]=t.y,u[38]=t.z,u[39]=t.x,u[40]=a.y,u[41]=t.z,u[42]=t.x,u[43]=a.y,u[44]=a.z,u[45]=t.x,u[46]=t.y,u[47]=a.z,u[48]=t.x,u[49]=a.y,u[50]=t.z,u[51]=a.x,u[52]=a.y,u[53]=t.z,u[54]=a.x,u[55]=a.y,u[56]=a.z,u[57]=t.x,u[58]=a.y,u[59]=a.z,u[60]=t.x,u[61]=t.y,u[62]=t.z,u[63]=a.x,u[64]=t.y,u[65]=t.z,u[66]=a.x,u[67]=t.y,u[68]=a.z,u[69]=t.x,u[70]=t.y,u[71]=a.z,m.position=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&((r=new Float32Array(72))[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,r[12]=0,r[13]=0,r[14]=-1,r[15]=0,r[16]=0,r[17]=-1,r[18]=0,r[19]=0,r[20]=-1,r[21]=0,r[22]=0,r[23]=-1,r[24]=1,r[25]=0,r[26]=0,r[27]=1,r[28]=0,r[29]=0,r[30]=1,r[31]=0,r[32]=0,r[33]=1,r[34]=0,r[35]=0,r[36]=-1,r[37]=0,r[38]=0,r[39]=-1,r[40]=0,r[41]=0,r[42]=-1,r[43]=0,r[44]=0,r[45]=-1,r[46]=0,r[47]=0,r[48]=0,r[49]=1,r[50]=0,r[51]=0,r[52]=1,r[53]=0,r[54]=0,r[55]=1,r[56]=0,r[57]=0,r[58]=1,r[59]=0,r[60]=0,r[61]=-1,r[62]=0,r[63]=0,r[64]=-1,r[65]=0,r[66]=0,r[67]=-1,r[68]=0,r[69]=0,r[70]=-1,r[71]=0,m.normal=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),n.st&&((i=new Float32Array(48))[0]=0,i[1]=0,i[2]=1,i[3]=0,i[4]=1,i[5]=1,i[6]=0,i[7]=1,i[8]=1,i[9]=0,i[10]=0,i[11]=0,i[12]=0,i[13]=1,i[14]=1,i[15]=1,i[16]=0,i[17]=0,i[18]=1,i[19]=0,i[20]=1,i[21]=1,i[22]=0,i[23]=1,i[24]=1,i[25]=0,i[26]=0,i[27]=0,i[28]=0,i[29]=