2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
define(["./defaultValue-81eec7ed","./BoundingSphere-9a3b5656","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./VertexFormat-d50a69ba","./Cartesian2-bd414876","./Math-e73894ab","./GeographicProjection-c931c7fb","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./Rectangle-cf3e0e3e","./WebGLConstants-508b9636","./Matrix2-dc0c61cc","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda"],(function(e,t,n,a,r,o,i,c,u,m,p,s,y,b,l,f,A,d,F,w){"use strict";function x(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);const n=e.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}x.packedLength=c.VertexFormat.packedLength,x.pack=function(t,n,a){return a=e.defaultValue(a,0),c.VertexFormat.pack(t._vertexFormat,n,a),n};const G=new c.VertexFormat,v={vertexFormat:G};x.unpack=function(t,n,a){n=e.defaultValue(n,0);const r=c.VertexFormat.unpack(t,n,G);return e.defined(a)?(a._vertexFormat=c.VertexFormat.clone(r,a._vertexFormat),a):new x(v)};const C=new n.Cartesian3(-.5,-.5,0),D=new n.Cartesian3(.5,.5,0);return x.createGeometry=function(e){const a=e._vertexFormat,c=new i.GeometryAttributes;let u,m;if(a.position){if(m=new Float64Array(12),m[0]=C.x,m[1]=C.y,m[2]=0,m[3]=D.x,m[4]=C.y,m[5]=0,m[6]=D.x,m[7]=D.y,m[8]=0,m[9]=C.x,m[10]=D.y,m[11]=0,c.position=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m}),a.normal){const e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,c.normal=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(a.st){const e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,c.st=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e})}if(a.tangent){const e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,c.tangent=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(a.bitangent){const e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,c.bitangent=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}u=new Uint16Array(6),u[0]=0,u[1]=1,u[2]=2,u[3]=0,u[4]=2,u[5]=3}return new o.Geometry({attributes:c,indices:u,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=x.unpack(t,n)),x.createGeometry(t)}}));
|