Newer
Older
ganzhou-feidu / static / lib / freedo / Freedo / Workers / createPlaneGeometry.js
bairujie on 14 Apr 2023 2 KB init
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-e66fad2a","./Cartesian2-44433f55","./Matrix3-146a3f23","./Transforms-fc4c03e8","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-dee5e12d","./GeometryAttributes-90846c5f","./VertexFormat-cc24f342"],function(a,e,t,p,r,c,n,o,y,s,A,i){"use strict";function m(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT);var t=a.defaultValue(e.vertexFormat,i.VertexFormat.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}m.packedLength=i.VertexFormat.packedLength,m.pack=function(e,t,r){return r=a.defaultValue(r,0),i.VertexFormat.pack(e._vertexFormat,t,r),t};var u=new i.VertexFormat,f={vertexFormat:u};m.unpack=function(e,t,r){t=a.defaultValue(t,0);var n=i.VertexFormat.unpack(e,t,u);return a.defined(r)?(r._vertexFormat=i.VertexFormat.clone(n,r._vertexFormat),r):new m(f)};var l=new p.Cartesian3(-.5,-.5,0),F=new p.Cartesian3(.5,.5,0);return m.createGeometry=function(e){var t,r,n,a,o,i,m=e._vertexFormat,u=new A.GeometryAttributes;return m.position&&((i=new Float64Array(12))[0]=l.x,i[1]=l.y,i[2]=0,i[3]=F.x,i[4]=l.y,i[5]=0,i[6]=F.x,i[7]=F.y,i[8]=0,i[9]=l.x,i[10]=F.y,i[11]=0,u.position=new s.GeometryAttribute({componentDatatype:y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:i}),m.normal&&((r=new Float32Array(12))[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,u.normal=new s.GeometryAttribute({componentDatatype:y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),m.st&&((n=new Float32Array(8))[0]=0,n[1]=0,n[2]=1,n[3]=0,n[4]=1,n[5]=1,n[6]=0,n[7]=1,u.st=new s.GeometryAttribute({componentDatatype:y.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n})),m.tangent&&((a=new Float32Array(12))[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a[6]=1,a[7]=0,a[8]=0,a[9]=1,a[10]=0,a[11]=0,u.tangent=new s.GeometryAttribute({componentDatatype:y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:a})),m.bitangent&&((o=new Float32Array(12))[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,u.bitangent=new s.GeometryAttribute({componentDatatype:y.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:o})),(t=new Uint16Array(6))[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3),new s.Geometry({attributes:u,indices:t,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:new c.BoundingSphere(p.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return a.defined(t)&&(e=m.unpack(e,t)),m.createGeometry(e)}});