integrated_traffic_vue/public/lib/Cesium/Workers/createCoplanarPolygonGeomet...

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2024-01-31 09:03:02 +08:00
define(["./arrayRemoveDuplicates-e9673044","./BoundingRectangle-47fd0937","./Transforms-713aa3a8","./Matrix2-163b5a1d","./Matrix3-b6f074fa","./ComponentDatatype-77274976","./CoplanarPolygonGeometryLibrary-7df3d256","./defaultValue-0a909f67","./GeometryAttribute-0b8b7b82","./GeometryAttributes-f06a2792","./GeometryInstance-9b27c40d","./GeometryPipeline-b6eb7525","./IndexDatatype-2149f06c","./Math-e97915da","./PolygonGeometryLibrary-af483c87","./PolygonPipeline-1b86ab0c","./VertexFormat-ab2e00e6","./combine-ca22a614","./RuntimeError-06c93819","./WebGLConstants-a8cc3e8c","./OrientedBoundingBox-e3f4d571","./EllipsoidTangentPlane-8eee3c2f","./AxisAlignedBoundingBox-c7183545","./IntersectionTests-87baf287","./Plane-1c5a21a3","./AttributeCompression-e18a879a","./EncodedCartesian3-de837603","./ArcType-ce2e50ab","./EllipsoidRhumbLine-7f84cca0"],(function(e,t,n,o,a,r,i,s,l,c,y,p,u,d,m,g,b,f,C,h,x,P,A,L,w,G,F,v,E){"use strict";const _=new a.Cartesian3,T=new t.BoundingRectangle,k=new o.Cartesian2,D=new o.Cartesian2,V=new a.Cartesian3,R=new a.Cartesian3,H=new a.Cartesian3,I=new a.Cartesian3,M=new a.Cartesian3,B=new a.Cartesian3,O=new n.Quaternion,z=new a.Matrix3,S=new a.Matrix3,N=new a.Cartesian3;function Q(e,t,i,y,p,m,b,f,C){const h=e.positions;let x=g.PolygonPipeline.triangulate(e.positions2D,e.holes);x.length<3&&(x=[0,1,2]);const P=u.IndexDatatype.createTypedArray(h.length,x.length);P.set(x);let A=z;if(0!==y){let e=n.Quaternion.fromAxisAngle(b,y,O);if(A=a.Matrix3.fromQuaternion(e,A),t.tangent||t.bitangent){e=n.Quaternion.fromAxisAngle(b,-y,O);const o=a.Matrix3.fromQuaternion(e,S);f=a.Cartesian3.normalize(a.Matrix3.multiplyByVector(o,f,f),f),t.bitangent&&(C=a.Cartesian3.normalize(a.Cartesian3.cross(b,f,C),C))}}else A=a.Matrix3.clone(a.Matrix3.IDENTITY,A);const L=D;t.st&&(L.x=i.x,L.y=i.y);const w=h.length,G=3*w,F=new Float64Array(G),v=t.normal?new Float32Array(G):void 0,E=t.tangent?new Float32Array(G):void 0,T=t.bitangent?new Float32Array(G):void 0,V=t.st?new Float32Array(2*w):void 0;let R=0,H=0,I=0,M=0,B=0;for(let e=0;e<w;e++){const n=h[e];if(F[R++]=n.x,F[R++]=n.y,F[R++]=n.z,t.st)if(s.defined(p)&&p.positions.length===w)V[B++]=p.positions[e].x,V[B++]=p.positions[e].y;else{const e=m(a.Matrix3.multiplyByVector(A,n,_),k);o.Cartesian2.subtract(e,L,e);const t=d.CesiumMath.clamp(e.x/i.width,0,1),r=d.CesiumMath.clamp(e.y/i.height,0,1);V[B++]=t,V[B++]=r}t.normal&&(v[H++]=b.x,v[H++]=b.y,v[H++]=b.z),t.tangent&&(E[M++]=f.x,E[M++]=f.y,E[M++]=f.z),t.bitangent&&(T[I++]=C.x,T[I++]=C.y,T[I++]=C.z)}const N=new c.GeometryAttributes;return t.position&&(N.position=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),t.normal&&(N.normal=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(N.tangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(N.bitangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(N.st=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),new l.Geometry({attributes:N,indices:P,primitiveType:l.PrimitiveType.TRIANGLES})}function j(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=e.textureCoordinates,r=s.defaultValue(e.vertexFormat,b.VertexFormat.DEFAULT);this._vertexFormat=b.VertexFormat.clone(r),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=a.Ellipsoid.clone(s.defaultValue(e.ellipsoid,a.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=m.PolygonGeometryLibrary.computeHierarchyPackedLength(t,a.Cartesian3)+b.VertexFormat.packedLength+a.Ellipsoid.packedLength+(s.defined(n)?m.PolygonGeometryLibrary.computeHierarchyPackedLength(n,o.Cartesian2):1)+2}j.fromPositions=function(e){return new j({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexF