YZProjectCloud/yanzhu-ui-vue3/public/Engine/Workers/BoxGeometry-59bbebbc.js

2 lines
7.7 KiB
JavaScript
Raw Normal View History

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