4x/irrigation-monitoring-platf.../public/Cesium/Workers/EllipseGeometry-dc5ed710.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2024-12-26 19:24:07 +08:00
define(["exports","./GeometryOffsetAttribute-1772960d","./Transforms-d13cc04e","./Matrix2-9aa31791","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./when-4bbc8319","./EllipseGeometryLibrary-962723df","./GeometryAttribute-43536dc0","./GeometryAttributes-7827a6c2","./GeometryInstance-47b34185","./GeometryPipeline-b1a36b18","./IndexDatatype-b7d979a6","./VertexFormat-71718faa"],(function(t,e,r,a,i,n,o,s,l,u,m,p,y,c){"use strict";var d=new a.Cartesian3,f=new a.Cartesian3,A=new a.Cartesian3,x=new a.Cartesian3,h=new a.Cartesian2,g=new a.Matrix3,_=new a.Matrix3,b=new r.Quaternion,v=new a.Cartesian3,C=new a.Cartesian3,w=new a.Cartesian3,E=new a.Cartographic,M=new a.Cartesian3,I=new a.Cartesian2,T=new a.Cartesian2;function G(t,i,m){var p=i.vertexFormat,y=i.center,c=i.semiMajorAxis,x=i.semiMinorAxis,G=i.ellipsoid,N=i.stRotation,P=m?t.length/3*2:t.length/3,F=i.shadowVolume,V=p.st?new Float32Array(2*P):void 0,D=p.normal?new Float32Array(3*P):void 0,O=p.tangent?new Float32Array(3*P):void 0,S=p.bitangent?new Float32Array(3*P):void 0,L=F?new Float32Array(3*P):void 0,R=0,j=v,z=C,k=w,B=new r.GeographicProjection(G),Y=B.project(G.cartesianToCartographic(y,E),M),H=G.scaleToGeodeticSurface(y,d);G.geodeticSurfaceNormal(H,H);var U=g,Q=_;if(0!==N){var W=r.Quaternion.fromAxisAngle(H,N,b);U=a.Matrix3.fromQuaternion(W,U),W=r.Quaternion.fromAxisAngle(H,-N,b),Q=a.Matrix3.fromQuaternion(W,Q)}else U=a.Matrix3.clone(a.Matrix3.IDENTITY,U),Q=a.Matrix3.clone(a.Matrix3.IDENTITY,Q);for(var J=a.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,I),q=a.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,T),Z=t.length,K=m?Z:0,X=K/3*2,$=0;$<Z;$+=3){var tt=$+1,et=$+2,rt=a.Cartesian3.fromArray(t,$,d);if(p.st){var at=a.Matrix3.multiplyByVector(U,rt,f),it=B.project(G.cartesianToCartographic(at,E),A);a.Cartesian3.subtract(it,Y,it),h.x=(it.x+c)/(2*c),h.y=(it.y+x)/(2*x),J.x=Math.min(h.x,J.x),J.y=Math.min(h.y,J.y),q.x=Math.max(h.x,q.x),q.y=Math.max(h.y,q.y),m&&(V[R+X]=h.x,V[R+1+X]=h.y),V[R++]=h.x,V[R++]=h.y}(p.normal||p.tangent||p.bitangent||F)&&(j=G.geodeticSurfaceNormal(rt,j),F&&(L[$+K]=-j.x,L[tt+K]=-j.y,L[et+K]=-j.z),(p.normal||p.tangent||p.bitangent)&&((p.tangent||p.bitangent)&&(z=a.Cartesian3.normalize(a.Cartesian3.cross(a.Cartesian3.UNIT_Z,j,z),z),a.Matrix3.multiplyByVector(Q,z,z)),p.normal&&(D[$]=j.x,D[tt]=j.y,D[et]=j.z,m&&(D[$+K]=-j.x,D[tt+K]=-j.y,D[et+K]=-j.z)),p.tangent&&(O[$]=z.x,O[tt]=z.y,O[et]=z.z,m&&(O[$+K]=-z.x,O[tt+K]=-z.y,O[et+K]=-z.z)),p.bitangent&&(k=a.Cartesian3.normalize(a.Cartesian3.cross(j,z,k),k),S[$]=k.x,S[tt]=k.y,S[et]=k.z,m&&(S[$+K]=k.x,S[tt+K]=k.y,S[et+K]=k.z))))}if(p.st){Z=V.length;for(var nt=0;nt<Z;nt+=2)V[nt]=(V[nt]-J.x)/(q.x-J.x),V[nt+1]=(V[nt+1]-J.y)/(q.y-J.y)}var ot=new u.GeometryAttributes;if(p.position){var st=s.EllipseGeometryLibrary.raisePositionsToHeight(t,i,m);ot.position=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:st})}if(p.st&&(ot.st=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),p.normal&&(ot.normal=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),p.tangent&&(ot.tangent=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),p.bitangent&&(ot.bitangent=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),F&&(ot.extrudeDirection=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),m&&o.defined(i.offsetAttribute)){var lt=new Uint8Array(P);if(i.offsetAttribute===e.GeometryOffsetAttribute.TOP)lt=e.arrayFill(lt,1,0,P/2);else{var ut=i.offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;lt=e.arrayFill(lt,ut)}ot.applyOffset=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:lt})}return ot}function N(t){var e,r,a,i,n,o=new Array(t*(t+1)*12-6),s=0;for(e=0,a=1,i=0;i<3;i++)o[s++]=a++,o[s++]=e,o[s++]=a;