qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/PolygonGeometry-95e6b579.js

2 lines
15 KiB
JavaScript
Raw Permalink Normal View History

2024-01-02 14:12:39 +08:00
define(["exports","./ArcType-fc72c06c","./GeometryOffsetAttribute-ed56ff58","./BoundingRectangle-0e36efc3","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./EllipsoidGeodesic-e7a5ca44","./EllipsoidTangentPlane-4d138901","./GeometryAttribute-2b42a913","./GeometryInstance-1b39c9e8","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./Math-e73894ab","./Matrix4-4c545f70","./PolygonGeometryLibrary-231711c2","./PolygonPipeline-04baeb41","./Transforms-5b829630","./Rectangle-cf3e0e3e","./VertexFormat-d50a69ba"],(function(e,t,o,r,n,a,i,s,l,c,u,p,y,g,m,d,h,f,b,_,P,x,C){"use strict";const w=new a.Cartographic,T=new a.Cartographic;function I(e,t,o,r){const n=r.cartesianToCartographic(e,w).height,a=r.cartesianToCartographic(t,T);a.height=n,r.cartographicToCartesian(a,t);const i=r.cartesianToCartographic(o,T);i.height=n-100,r.cartographicToCartesian(i,o)}const A=new r.BoundingRectangle,E=new i.Cartesian3,v=new i.Cartesian3,G=new i.Cartesian3,O=new i.Cartesian3,V=new i.Cartesian3,F=new i.Cartesian3;let N=new i.Cartesian3,D=new i.Cartesian3,H=new i.Cartesian3;const L=new a.Cartesian2,R=new a.Cartesian2,M=new i.Cartesian3,S=new P.Quaternion,B=new f.Matrix3,k=new f.Matrix3;function z(e){const t=e.vertexFormat,r=e.geometry,n=e.shadowVolume,s=r.attributes.position.values;let u=s.length;const p=e.wall,g=e.top||p,m=e.bottom||p;if(t.st||t.normal||t.tangent||t.bitangent||n){const o=e.boundingRectangle,c=e.tangentPlane,d=e.ellipsoid,b=e.stRotation,_=e.perPositionHeight,x=L;x.x=o.x,x.y=o.y;const C=t.st?new Float32Array(u/3*2):void 0;let w;t.normal&&(w=_&&g&&!p?r.attributes.normal.values:new Float32Array(u));const T=t.tangent?new Float32Array(u):void 0,A=t.bitangent?new Float32Array(u):void 0,z=n?new Float32Array(u):void 0;let W=0,Y=0,U=v,j=G,Q=O,q=!0,K=B,Z=k;if(0!==b){let e=P.Quaternion.fromAxisAngle(c._plane.normal,b,S);K=f.Matrix3.fromQuaternion(e,K),e=P.Quaternion.fromAxisAngle(c._plane.normal,-b,S),Z=f.Matrix3.fromQuaternion(e,Z)}else K=f.Matrix3.clone(f.Matrix3.IDENTITY,K),Z=f.Matrix3.clone(f.Matrix3.IDENTITY,Z);let J=0,X=0;g&&m&&(J=u/2,X=u/3,u/=2);for(let r=0;r<u;r+=3){const l=i.Cartesian3.fromArray(s,r,M);if(t.st){let e=f.Matrix3.multiplyByVector(K,l,E);e=d.scaleToGeodeticSurface(e,e);const t=c.projectPointOntoPlane(e,R);a.Cartesian2.subtract(t,x,t);const r=h.CesiumMath.clamp(t.x/o.width,0,1),n=h.CesiumMath.clamp(t.y/o.height,0,1);m&&(C[W+X]=r,C[W+1+X]=n),g&&(C[W]=r,C[W+1]=n),W+=2}if(t.normal||t.tangent||t.bitangent||n){const o=Y+1,a=Y+2;if(p){if(r+3<u){const e=i.Cartesian3.fromArray(s,r+3,V);if(q){const t=i.Cartesian3.fromArray(s,r+u,F);_&&I(l,e,t,d),i.Cartesian3.subtract(e,l,e),i.Cartesian3.subtract(t,l,t),U=i.Cartesian3.normalize(i.Cartesian3.cross(t,e,U),U),q=!1}i.Cartesian3.equalsEpsilon(e,l,h.CesiumMath.EPSILON10)&&(q=!0)}(t.tangent||t.bitangent)&&(Q=d.geodeticSurfaceNormal(l,Q),t.tangent&&(j=i.Cartesian3.normalize(i.Cartesian3.cross(Q,U,j),j)))}else U=d.geodeticSurfaceNormal(l,U),(t.tangent||t.bitangent)&&(_&&(N=i.Cartesian3.fromArray(w,Y,N),D=i.Cartesian3.cross(i.Cartesian3.UNIT_Z,N,D),D=i.Cartesian3.normalize(f.Matrix3.multiplyByVector(Z,D,D),D),t.bitangent&&(H=i.Cartesian3.normalize(i.Cartesian3.cross(N,D,H),H))),j=i.Cartesian3.cross(i.Cartesian3.UNIT_Z,U,j),j=i.Cartesian3.normalize(f.Matrix3.multiplyByVector(Z,j,j),j),t.bitangent&&(Q=i.Cartesian3.normalize(i.Cartesian3.cross(U,j,Q),Q)));t.normal&&(e.wall?(w[Y+J]=U.x,w[o+J]=U.y,w[a+J]=U.z):m&&(w[Y+J]=-U.x,w[o+J]=-U.y,w[a+J]=-U.z),(g&&!_||p)&&(w[Y]=U.x,w[o]=U.y,w[a]=U.z)),n&&(p&&(U=d.geodeticSurfaceNormal(l,U)),z[Y+J]=-U.x,z[o+J]=-U.y,z[a+J]=-U.z),t.tangent&&(e.wall?(T[Y+J]=j.x,T[o+J]=j.y,T[a+J]=j.z):m&&(T[Y+J]=-j.x,T[o+J]=-j.y,T[a+J]=-j.z),g&&(_?(T[Y]=D.x,T[o]=D.y,T[a]=D.z):(T[Y]=j.x,T[o]=j.y,T[a]=j.z))),t.bitangent&&(m&&(A[Y+J]=Q.x,A[o+J]=Q.y,A[a+J]=Q.z),g&&(_?(A[Y]=H.x,A[o]=H.y,A[a]=H.z):(A[Y]=Q.x,A[o]=Q.y,A[a]=Q.z))),Y+=3}}t.st&&(r.attributes.st=new y.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(r.att