1 |
- define(["./defaultValue-81eec7ed","./Transforms-98ffa11d","./Cartesian3-7e9cc2ff","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./VertexFormat-d50a69ba","./Matrix2-e3fb4559","./Math-5f585871","./Matrix4-d34187af","./RuntimeError-26acdd3b","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./WebGLConstants-508b9636"],(function(e,t,n,a,r,o,i,m,c,u,p,s,y,f,l){"use strict";function b(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);const n=e.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}b.packedLength=m.VertexFormat.packedLength,b.pack=function(t,n,a){return a=e.defaultValue(a,0),m.VertexFormat.pack(t._vertexFormat,n,a),n};const A=new m.VertexFormat,F={vertexFormat:A};b.unpack=function(t,n,a){n=e.defaultValue(n,0);const r=m.VertexFormat.unpack(t,n,A);return e.defined(a)?(a._vertexFormat=m.VertexFormat.clone(r,a._vertexFormat),a):new b(F)};const d=new n.Cartesian3(-.5,-.5,0),x=new n.Cartesian3(.5,.5,0);return b.createGeometry=function(e){const a=e._vertexFormat,m=new i.GeometryAttributes;let c,u;if(a.position){if(u=new Float64Array(12),u[0]=d.x,u[1]=d.y,u[2]=0,u[3]=x.x,u[4]=d.y,u[5]=0,u[6]=x.x,u[7]=x.y,u[8]=0,u[9]=d.x,u[10]=x.y,u[11]=0,m.position=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),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,m.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,m.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,m.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,m.bitangent=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}c=new Uint16Array(6),c[0]=0,c[1]=1,c[2]=2,c[3]=0,c[4]=2,c[5]=3}return new o.Geometry({attributes:m,indices:c,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=b.unpack(t,n)),b.createGeometry(t)}}));
|