qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/EllipseGeometry-fe34b594.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2024-01-02 14:12:39 +08:00
define(["exports","./GeometryOffsetAttribute-ed56ff58","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./EllipseGeometryLibrary-6649af71","./GeographicProjection-c931c7fb","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./GeometryInstance-1b39c9e8","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./Math-e73894ab","./Matrix4-4c545f70","./Transforms-5b829630","./Rectangle-cf3e0e3e","./VertexFormat-d50a69ba"],(function(t,e,i,r,n,o,a,s,l,u,c,m,p,y,d,f,A,h,x,g){"use strict";const _=new n.Cartesian3,b=new n.Cartesian3,C=new n.Cartesian3,w=new n.Cartesian3,M=new r.Cartesian2,E=new A.Matrix3,I=new A.Matrix3,T=new h.Quaternion,G=new n.Cartesian3,N=new n.Cartesian3,P=new n.Cartesian3,F=new r.Cartographic,v=new n.Cartesian3,V=new r.Cartesian2,D=new r.Cartesian2;function S(t,i,o){const p=i.vertexFormat,y=i.center,d=i.semiMajorAxis,f=i.semiMinorAxis,x=i.ellipsoid,g=i.stRotation,w=o?t.length/3*2:t.length/3,S=i.shadowVolume,O=p.st?new Float32Array(2*w):void 0,L=p.normal?new Float32Array(3*w):void 0,R=p.tangent?new Float32Array(3*w):void 0,j=p.bitangent?new Float32Array(3*w):void 0,k=S?new Float32Array(3*w):void 0;let z=0,B=G,Y=N,H=P;const U=new u.GeographicProjection(x),Q=U.project(x.cartesianToCartographic(y,F),v),W=x.scaleToGeodeticSurface(y,_);x.geodeticSurfaceNormal(W,W);let J=E,q=I;if(0!==g){let t=h.Quaternion.fromAxisAngle(W,g,T);J=A.Matrix3.fromQuaternion(t,J),t=h.Quaternion.fromAxisAngle(W,-g,T),q=A.Matrix3.fromQuaternion(t,q)}else J=A.Matrix3.clone(A.Matrix3.IDENTITY,J),q=A.Matrix3.clone(A.Matrix3.IDENTITY,q);const Z=r.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),K=r.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,D);let X=t.length;const $=o?X:0,tt=$/3*2;for(let e=0;e<X;e+=3){const i=e+1,r=e+2,a=n.Cartesian3.fromArray(t,e,_);if(p.st){const t=A.Matrix3.multiplyByVector(J,a,b),e=U.project(x.cartesianToCartographic(t,F),C);n.Cartesian3.subtract(e,Q,e),M.x=(e.x+d)/(2*d),M.y=(e.y+f)/(2*f),Z.x=Math.min(M.x,Z.x),Z.y=Math.min(M.y,Z.y),K.x=Math.max(M.x,K.x),K.y=Math.max(M.y,K.y),o&&(O[z+tt]=M.x,O[z+1+tt]=M.y),O[z++]=M.x,O[z++]=M.y}(p.normal||p.tangent||p.bitangent||S)&&(B=x.geodeticSurfaceNormal(a,B),S&&(k[e+$]=-B.x,k[i+$]=-B.y,k[r+$]=-B.z),(p.normal||p.tangent||p.bitangent)&&((p.tangent||p.bitangent)&&(Y=n.Cartesian3.normalize(n.Cartesian3.cross(n.Cartesian3.UNIT_Z,B,Y),Y),A.Matrix3.multiplyByVector(q,Y,Y)),p.normal&&(L[e]=B.x,L[i]=B.y,L[r]=B.z,o&&(L[e+$]=-B.x,L[i+$]=-B.y,L[r+$]=-B.z)),p.tangent&&(R[e]=Y.x,R[i]=Y.y,R[r]=Y.z,o&&(R[e+$]=-Y.x,R[i+$]=-Y.y,R[r+$]=-Y.z)),p.bitangent&&(H=n.Cartesian3.normalize(n.Cartesian3.cross(B,Y,H),H),j[e]=H.x,j[i]=H.y,j[r]=H.z,o&&(j[e+$]=H.x,j[i+$]=H.y,j[r+$]=H.z))))}if(p.st){X=O.length;for(let t=0;t<X;t+=2)O[t]=(O[t]-Z.x)/(K.x-Z.x),O[t+1]=(O[t+1]-Z.y)/(K.y-Z.y)}const et=new m.GeometryAttributes;if(p.position){const e=l.EllipseGeometryLibrary.raisePositionsToHeight(t,i,o);et.position=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}if(p.st&&(et.st=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:O})),p.normal&&(et.normal=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),p.tangent&&(et.tangent=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),p.bitangent&&(et.bitangent=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),S&&(et.extrudeDirection=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:k})),o&&s.defined(i.offsetAttribute)){let t=new Uint8Array(w);if(i.offsetAttribute===e.GeometryOffsetAttribute.TOP)t=e.arrayFill(t,1,0,w/2);else{const r=i.offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;t=e.arrayFill(t,r)}et.applyOffset=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNE