mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-05 20:56:33 -04:00
2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
|
define(["./GeometryOffsetAttribute-4f901209","./arrayRemoveDuplicates-ee080d9d","./Transforms-ab7258fe","./Matrix2-46444433","./RuntimeError-608565a6","./ComponentDatatype-692a36d3","./PolylineVolumeGeometryLibrary-7cb18244","./CorridorGeometryLibrary-56a78daf","./when-229515d6","./GeometryAttribute-d3bef603","./GeometryAttributes-b253752a","./IndexDatatype-7c683b18","./PolygonPipeline-259e0bdf","./VertexFormat-7272aabd","./combine-35b6d9cb","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-4deba134","./AxisAlignedBoundingBox-8f6cec20","./IntersectionTests-4cf437d5","./Plane-1f2a7880","./PolylinePipeline-3b21ed18","./EllipsoidGeodesic-94d72244","./EllipsoidRhumbLine-9cd85d72"],(function(t,e,r,a,i,o,n,s,l,d,u,c,m,y,f,p,g,h,C,b,A,_,w){"use strict";const v=new a.Cartesian3,T=new a.Cartesian3,G=new a.Cartesian3,E=new a.Cartesian3,V=new a.Cartesian3,x=new a.Cartesian3,F=new a.Cartesian3,L=new a.Cartesian3;function P(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function N(t,e,r,i,o,n){const l=t.normals,d=t.tangents,u=t.bitangents,c=a.Cartesian3.normalize(a.Cartesian3.cross(r,e,F),F);n.normal&&s.CorridorGeometryLibrary.addAttribute(l,e,i,o),n.tangent&&s.CorridorGeometryLibrary.addAttribute(d,c,i,o),n.bitangent&&s.CorridorGeometryLibrary.addAttribute(u,r,i,o)}function D(t,e,r){const i=t.positions,n=t.corners,m=t.endPositions,y=t.lefts,f=t.normals,p=new u.GeometryAttributes;let g,h,C,b=0,A=0,_=0;for(h=0;h<i.length;h+=2)C=i[h].length-3,b+=C,_+=2*C,A+=i[h+1].length-3;for(b+=3,A+=3,h=0;h<n.length;h++){g=n[h];const t=n[h].leftPositions;l.defined(t)?(C=t.length,b+=C,_+=C):(C=n[h].rightPositions.length,A+=C,_+=C)}const w=l.defined(m);let V;w&&(V=m[0].length-3,b+=V,A+=V,V/=3,_+=6*V);const P=b+A,D=new Float64Array(P),M={normals:e.normal?new Float32Array(P):void 0,tangents:e.tangent?new Float32Array(P):void 0,bitangents:e.bitangent?new Float32Array(P):void 0};let O,I,S,R,k,H,z=0,B=P-1,U=v,Y=T;const W=V/2,q=c.IndexDatatype.createTypedArray(P/3,_);let J=0;if(w){H=G,k=E;const t=m[0];for(U=a.Cartesian3.fromArray(f,0,U),Y=a.Cartesian3.fromArray(y,0,Y),h=0;h<W;h++)H=a.Cartesian3.fromArray(t,3*(W-1-h),H),k=a.Cartesian3.fromArray(t,3*(W+h),k),s.CorridorGeometryLibrary.addAttribute(D,k,z),s.CorridorGeometryLibrary.addAttribute(D,H,void 0,B),N(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[J++]=O,q[J++]=I,q[J++]=S,q[J++]=S,q[J++]=I,q[J++]=R,z+=3,B-=3}let j,K,Q=0,X=0,Z=i[Q++],$=i[Q++];for(D.set(Z,z),D.set($,B-$.length+1),Y=a.Cartesian3.fromArray(y,X,Y),C=$.length-3,h=0;h<C;h+=3)j=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,h,F),F),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C-h,L),L),U=a.Cartesian3.normalize(a.Cartesian3.add(j,K,U),U),N(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[J++]=O,q[J++]=I,q[J++]=S,q[J++]=S,q[J++]=I,q[J++]=R,z+=3,B-=3;for(j=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,C,F),F),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C,L),L),U=a.Cartesian3.normalize(a.Cartesian3.add(j,K,U),U),X+=3,h=0;h<n.length;h++){let t;g=n[h];const o=g.leftPositions,d=g.rightPositions;let u,c,m=x,p=G,b=E;if(U=a.Cartesian3.fromArray(f,X,U),l.defined(o)){for(N(M,U,Y,void 0,B,e),B-=3,u=R,c=S,t=0;t<o.length/3;t++)m=a.Cartesian3.fromArray(o,3*t,m),q[J++]=u,q[J++]=c-t-1,q[J++]=c-t,s.CorridorGeometryLibrary.addAttribute(D,m,void 0,B),p=a.Cartesian3.fromArray(D,3*(c-t-1),p),b=a.Cartesian3.fromArray(D,3*u,b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),N(M,U,Y,void 0,B,e),B-=3;m=a.Cartesian3.fromArray(D,3*u,m),p=a.Cartesian3.subtract(a.Cartesian3.fromArray(D,3*c,p),m,p),b=a.Cartesian3.subtract(a.Cartesian3.fromArray(D,3*(c-t),b),m,b),Y=a.Cartesian3.normalize(a.Cartesian3.add(p,b,Y),Y),N(M,U,Y,z,void 0,e),z+=3}else{for(N(M,U,Y,z,void 0,e),z+=3,u=S,c=R,t=0;t<d.length/3;t++)m=a.Cartesian3.fromArray(d,3*t,m),q[J++]=u,q[J++]=c+t,q[J++]=c+t+1,s.CorridorGeometryLibrary.addAttribute(D,m,z),p=a.Cartesian3.fromArray(D,3*u,p),b=a.Cartesian3.fromArray(D,3*(c+t),b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),N(M,U,Y,z,void 0,e),z+=3;m=a.Cartesian3.fromArray(D,3*u,m),p=a.Cartesian3.subtract(a.C
|