Agriculture-front-end/public/Cesium/Workers/createPlaneGeometry.js

2 lines
2.6 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./when-b60132fc","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./PrimitiveType-39acab88","./VertexFormat-6446fca0","./Cartesian2-47311507","./Math-119be1a3","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./Transforms-cb0006b0","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206"],(function(e,t,a,r,n,o,i,u,m,p,c,y,s,b,d,l,A){"use strict";function F(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);var a=e.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT);this._vertexFormat=a,this._workerName="createPlaneGeometry"}F.packedLength=m.VertexFormat.packedLength,F.pack=function(t,a,r){return r=e.defaultValue(r,0),m.VertexFormat.pack(t._vertexFormat,a,r),a};var v=new m.VertexFormat,f={vertexFormat:v};F.unpack=function(t,a,r){a=e.defaultValue(a,0);var n=m.VertexFormat.unpack(t,a,v);return e.defined(r)?(r._vertexFormat=m.VertexFormat.clone(n,r._vertexFormat),r):new F(f)};var w=new a.Cartesian3(-.5,-.5,0),x=new a.Cartesian3(.5,.5,0);return F.createGeometry=function(e){var r,m,p=e._vertexFormat,c=new i.GeometryAttributes;if(p.position){if((m=new Float64Array(12))[0]=w.x,m[1]=w.y,m[2]=0,m[3]=x.x,m[4]=w.y,m[5]=0,m[6]=x.x,m[7]=x.y,m[8]=0,m[9]=w.x,m[10]=x.y,m[11]=0,c.position=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m}),p.normal){var y=new Float32Array(12);y[0]=0,y[1]=0,y[2]=1,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=1,y[9]=0,y[10]=0,y[11]=1,c.normal=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})}if(p.st){var s=new Float32Array(8);s[0]=0,s[1]=0,s[2]=1,s[3]=0,s[4]=1,s[5]=1,s[6]=0,s[7]=1,c.st=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})}if(p.tangent){var b=new Float32Array(12);b[0]=1,b[1]=0,b[2]=0,b[3]=1,b[4]=0,b[5]=0,b[6]=1,b[7]=0,b[8]=0,b[9]=1,b[10]=0,b[11]=0,c.tangent=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b})}if(p.bitangent){var d=new Float32Array(12);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,c.bitangent=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})}(r=new Uint16Array(6))[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3}return new o.Geometry({attributes:c,indices:r,primitiveType:u.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(a.Cartesian3.ZERO,Math.sqrt(2))})},function(t,a){return e.defined(a)&&(t=F.unpack(t,a)),F.createGeometry(t)}}));