fuchengshen
2022-07-04 343ba87e09501be7a63abde000a43e13a5b4f03e
1
define(["./when-7b580518","./Transforms-a7d32f6c","./Cartesian2-40b13f31","./Check-3917d765","./ComponentDatatype-6c2e43c1","./GeometryAttribute-8f00b923","./GeometryAttributes-fbd9a3fb","./VertexFormat-8d463a4f","./Math-87254c13","./combine-83aa7971","./RuntimeError-fad4d3c6","./WebGLConstants-4e26b85a"],function(n,o,m,e,i,u,p,a,t,r,c,y){"use strict";function s(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);e=n.defaultValue(e.vertexFormat,a.VertexFormat.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}s.packedLength=a.VertexFormat.packedLength,s.pack=function(e,t,r){return r=n.defaultValue(r,0),a.VertexFormat.pack(e._vertexFormat,t,r),t};var b=new a.VertexFormat,A={vertexFormat:b};s.unpack=function(e,t,r){t=n.defaultValue(t,0);t=a.VertexFormat.unpack(e,t,b);return n.defined(r)?(r._vertexFormat=a.VertexFormat.clone(t,r._vertexFormat),r):new s(A)};var l=new m.Cartesian3(-.5,-.5,0),F=new m.Cartesian3(.5,.5,0);return s.createGeometry=function(e){var t,r,n=e._vertexFormat,a=new p.GeometryAttributes;return n.position&&((e=new Float64Array(12))[0]=l.x,e[1]=l.y,e[2]=0,e[3]=F.x,e[4]=l.y,e[5]=0,e[6]=F.x,e[7]=F.y,e[8]=0,e[9]=l.x,e[10]=F.y,e[11]=0,a.position=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),n.normal&&((e=new Float32Array(12))[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,a.normal=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),n.st&&((t=new Float32Array(8))[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,a.st=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})),n.tangent&&((t=new Float32Array(12))[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,a.tangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),n.bitangent&&((r=new Float32Array(12))[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,a.bitangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),(r=new Uint16Array(6))[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3),new u.Geometry({attributes:a,indices:r,primitiveType:u.PrimitiveType.TRIANGLES,boundingSphere:new o.BoundingSphere(m.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return n.defined(t)&&(e=s.unpack(e,t)),s.createGeometry(e)}});