2 lines
9.0 KiB
JavaScript
2 lines
9.0 KiB
JavaScript
|
define(["exports","./Matrix2-e3fb4559","./Cartesian3-7e9cc2ff","./Matrix4-d34187af","./defaultValue-81eec7ed","./EllipsoidTangentPlane-f566b6b5","./Math-5f585871","./PolylinePipeline-e0b963d6","./Transforms-99272364","./Check-741c5f3c"],(function(e,a,t,n,r,i,s,o,l,c){"use strict";var C=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const u={};function d(e,a){r.defined(u[e])||(u[e]=!0,console.warn(r.defaultValue(a,e)))}d.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.",d.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",d.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",d.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const y=[new t.Cartesian3,new t.Cartesian3],f=new t.Cartesian3,m=new t.Cartesian3,g=new t.Cartesian3,h=new t.Cartesian3,w=new t.Cartesian3,p=new t.Cartesian3,x=new t.Cartesian3,M=new t.Cartesian3,P=new t.Cartesian3,E=new t.Cartesian3,T=new t.Cartesian3,b={};let z=new a.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 A=new t.Cartesian3,S=new t.Cartesian3;const D=new t.Cartesian3(-1,0,0);let R=new n.Matrix4;const v=new n.Matrix4;let F=new n.Matrix3;const G=n.Matrix3.IDENTITY.clone(),I=new t.Cartesian3,O=new n.Cartesian4,L=new t.Cartesian3;function V(e,s,o,c,C,u,d,y,f,m,g,h){let w=O;if(R=l.Transforms.eastNorthUpToFixedFrame(e,C,R),r.defined(m)||(m=new t.Cartesian3),0===m.z){let r=I;r=n.Matrix4.multiplyByPointAsVector(R,D,r),r=t.Cartesian3.normalize(r,r);const o=function(e,n,r,s){const o=new i.EllipsoidTangentPlane(r,s),l=o.projectPointOntoPlane(t.Cartesian3.add(r,e,A),A),c=o.projectPointOntoPlane(t.Cartesian3.add(r,n,S),S),C=a.Cartesian2.angleBetween(l,c);return c.x*l.y-c.y*l.x>=0?-C:C}(r,s,e,C);F=n.Matrix3.fromRotationZ(o)}else{let e=t.Cartesian3.subtract(f[1],f[0],new t.Cartesian3);e=t.Cartesian3.normalize(e,e);const a=new t.Cartesian3(0,0,-1);let r=new t.Cartesian3;t.Cartesian3.cross(a,e,r);t.Cartesian3.magnitude(r)<1e-5&&(r=a),t.Cartesian3.normalize(r,r);const i=t.Cartesian3.angleBetween(a,e),s=l.Quaternion.fromAxisAngle(r,i);F=n.Matrix3.fromQuaternion(s)}L.z=u,R=n.Matrix4.multiplyTransformation(R,n.Matrix4.fromRotationTranslation(F,L,v),R);const p=G;p[0]=d;for(let e=0;e<y;e++)for(let e=0;e<o.length;e+=3)w=t.Cartesian3.fromArray(o,e,w),w=n.Matrix3.multiplyByVector(p,w,w),w=n.Matrix4.multiplyByPoint(R,w,w),1===g&&(w=n.Matrix4.multiplyByPoint(h,w,w)),c.push(w.x,w.y,w.z);return c}const N=new t.Cartesian3;function _(e,a,n,r,i,s,o,l,c,C,u){for(let d=0;d<e.length;d+=3){r=V(t.Cartesian3.fromArray(e,d,N),a,n,r,i,s[d/3],o,1,l,c,C,u)}return r}function Q(e,a,n){const i=e.length,s=new Array(3*i);let o=0;const l=a.x+a.width/2,c=a.y+a.height/2;if(r.defined(n)||(n=new t.Cartesian3),0===n.z)for(let a=0;a<i;a++)s[o++]=e[a].x-l,s[o++]=0,s[o++]=e[a].y-c;else for(let a=0;a<i;a++)s[o++]=e[a].x-l,s[o++]=e[a].y-c,s[o++]=0;return s}const H=new l.Quaternion,j=new t.Cartesian3,q=new n.Matrix3;function U(e,a,r,i,o,c,u,d,y,f){const m=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,E),t.Cartesian3.subtract(r,e,T)),g=i===C.BEVELED?0:Math.ceil(m/s.CesiumMath.toRadians(5));let h,w,p;if(h=o?n.Matrix3.fromQuaternion(l.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,E),m/(g+1),H),q):n.Matrix3.fromQuaternion(l.Quaternion.fromAxisAngle(e,m/(g+1),H),q),a=t.Cartesian3.clone(a,j),g>0){const r=f?2:1;for(let i=0;i<g;i++)a=n.Matrix3.multiplyByVector(h,a,a),w=t.Cartesian3.subtract(a,e,E),w=t.Cartesian3.normalize(w,w),o||(w=t.Cartesian3.negate(w,w)),p=c.scaleToGeodeticSurfa
|