2 lines
7.6 KiB
JavaScript
2 lines
7.6 KiB
JavaScript
|
|
define(["exports","./arrayFill-deb10550","./buildModuleUrl-d920237a","./Cartographic-1d953166","./Check-2514d21d","./ComponentDatatype-07894a2b","./when-d186add7","./GeometryAttribute-95780fd1","./GeometryAttributes-9c67dd14","./GeometryOffsetAttribute-da5a1d35","./FeatureDetection-4281d393","./VertexFormat-769ac289"],(function(t,e,n,o,a,r,i,m,u,y,p,s){"use strict";var f=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,s.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+s.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),s.n.pack(t._vertexFormat,e,n+2*o.t.packedLength),e[n+2*o.t.packedLength+s.n.packedLength]=i.u(t._offsetAttribute,-1),e};var x,d=new o.t,b=new o.t,A=new s.n,l={minimum:d,maximum:b,vertexFormat:A,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,d),m=o.t.unpack(t,e+o.t.packedLength,b),u=s.n.unpack(t,e+2*o.t.packedLength,A),y=t[e+2*o.t.packedLength+s.n.packedLength];return i.e(n)?(n._minimum=o.t.clone(r,n._minimum),n._maximum=o.t.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 a=t._minimum,s=t._maximum,c=t._vertexFormat;if(!o.t.equals(a,s)){var x,d,b=new u.a;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&((d=new Float64Array(72))[0]=a.x,d[1]=a.y,d[2]=s.z,d[3]=s.x,d[4]=a.y,d[5]=s.z,d[6]=s.x,d[7]=s.y,d[8]=s.z,d[9]=a.x,d[10]=s.y,d[11]=s.z,d[12]=a.x,d[13]=a.y,d[14]=a.z,d[15]=s.x,d[16]=a.y,d[17]=a.z,d[18]=s.x,d[19]=s.y,d[20]=a.z,d[21]=a.x,d[22]=s.y,d[23]=a.z,d[24]=s.x,d[25]=a.y,d[26]=a.z,d[27]=s.x,d[28]=s.y,d[29]=a.z,d[30]=s.x,d[31]=s.y,d[32]=s.z,d[33]=s.x,d[34]=a.y,d[35]=s.z,d[36]=a.x,d[37]=a.y,d[38]=a.z,d[39]=a.x,d[40]=s.y,d[41]=a.z,d[42]=a.x,d[43]=s.y,d[44]=s.z,d[45]=a.x,d[46]=a.y,d[47]=s.z,d[48]=a.x,d[49]=s.y,d[50]=a.z,d[51]=s.x,d[52]=s.y,d[53]=a.z,d[54]=s.x,d[55]=s.y,d[56]=s.z,d[57]=a.x,d[58]=s.y,d[59]=s.z,d[60]=a.x,d[61]=a.y,d[62]=a.z,d[63]=s.x,d[64]=a.y,d[65]=a.z,d[66]=s.x,d[67]=a.y,d[68]=s.z,d[69]=a.x,d[70]=a.y,d[71]=s.z,b.position=new m.o({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),c.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,b.normal=new m.o({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var l=new Float32Array(72),v=0;l[v++]=0,l[v++]=0,l[v++]=-1,l[v++]=1,l
|