2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
|
define(["exports","./Matrix2-413c4048","./Matrix3-81054f0f","./EllipsoidTangentPlane-d430e7d5","./Math-2ce22ee9","./PolylinePipeline-5ae670bc","./Transforms-20461479","./defaultValue-f6d5e6da"],(function(e,a,t,n,r,i,s,o){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new t.Cartesian3,new t.Cartesian3],d=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,f=new t.Cartesian3,p=new t.Cartesian3,w=new t.Cartesian3,x=new t.Cartesian3,E=new t.Cartesian3,P=new t.Cartesian3,M={};let T=new t.Cartographic;function b(e,a,n,r){const i=e[0],s=e[1],o=t.Cartesian3.angleBetween(i,s),l=Math.ceil(o/r),c=new Array(l);let C;if(a===n){for(C=0;C<l;C++)c[C]=a;return c.push(n),c}const u=(n-a)/l;for(C=1;C<l;C++){const e=a+C*u;c[C]=e}return c[0]=a,c.push(n),c}const B=new t.Cartesian3,z=new t.Cartesian3;const S=new t.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new t.Matrix3;const O=t.Matrix3.IDENTITY.clone(),V=new t.Cartesian3,I=new a.Cartesian4,v=new t.Cartesian3;function N(e,r,i,o,l,c,C,u){let d=V,g=I;A=s.Transforms.eastNorthUpToFixedFrame(e,l,A),d=a.Matrix4.multiplyByPointAsVector(A,S,d),d=t.Cartesian3.normalize(d,d);const y=function(e,r,i,s){const o=new n.EllipsoidTangentPlane(i,s),l=o.projectPointOntoPlane(t.Cartesian3.add(i,e,B),B),c=o.projectPointOntoPlane(t.Cartesian3.add(i,r,z),z),C=a.Cartesian2.angleBetween(l,c);return c.x*l.y-c.y*l.x>=0?-C:C}(d,r,e,l);R=t.Matrix3.fromRotationZ(y,R),v.z=c,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,v,D),A);const h=O;h[0]=C;for(let e=0;e<u;e++)for(let e=0;e<i.length;e+=3)g=t.Cartesian3.fromArray(i,e,g),g=t.Matrix3.multiplyByVector(h,g,g),g=a.Matrix4.multiplyByPoint(A,g,g),o.push(g.x,g.y,g.z);return o}const G=new t.Cartesian3;function H(e,a,n,r,i,s,o){for(let l=0;l<e.length;l+=3){r=N(t.Cartesian3.fromArray(e,l,G),a,n,r,i,s[l/3],o,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-s;return n}const j=new s.Quaternion,Q=new t.Cartesian3,q=new t.Matrix3;function F(e,a,n,i,o,c,C,u,d,g){const y=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,E),t.Cartesian3.subtract(n,e,P)),h=i===l.BEVELED?0:Math.ceil(y/r.CesiumMath.toRadians(5));let m,f,p;if(m=o?t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,E),y/(h+1),j),q):t.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e,y/(h+1),j),q),a=t.Cartesian3.clone(a,Q),h>0){const n=g?2:1;for(let r=0;r<h;r++)a=t.Matrix3.multiplyByVector(m,a,a),f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,n)}else f=t.Cartesian3.subtract(a,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(a,P),C=N(p,f,u,C,c,d,1,1),n=t.Cartesian3.clone(n,Q),f=t.Cartesian3.subtract(n,e,E),f=t.Cartesian3.normalize(f,f),o||(f=t.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(n,P),C=N(p,f,u,C,c,d,1,1);return C}M.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],s=e[i];a.Cartesian2.equals(t,s)||n.push(s)}return n},M.angleIsGreaterThanPi=function(e,a,r,i){const s=new n.EllipsoidTangentPlane(r,i),o=s.projectPointOnto
|