You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.8 KiB
1 lines
2.8 KiB
define(["exports","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30"],function(a,R,W,h){"use strict";var r={},x=new W.Cartesian3,M=new W.Cartesian3,z=new h.Quaternion,f=new h.Matrix3;function S(a,r,e,t,i,n,s,o,l,C){var y=a+r;W.Cartesian3.multiplyByScalar(t,Math.cos(y),x),W.Cartesian3.multiplyByScalar(e,Math.sin(y),M),W.Cartesian3.add(x,M,x);var u=Math.cos(a);u*=u;var m=Math.sin(a);m*=m;var c=n/Math.sqrt(s*u+i*m)/o;return h.Quaternion.fromAxisAngle(x,c,z),h.Matrix3.fromQuaternion(z,f),h.Matrix3.multiplyByVector(f,l,C),W.Cartesian3.normalize(C,C),W.Cartesian3.multiplyByScalar(C,o,C),C}var B=new W.Cartesian3,b=new W.Cartesian3,Q=new W.Cartesian3,_=new W.Cartesian3;r.raisePositionsToHeight=function(a,r,e){for(var t=r.ellipsoid,i=r.height,n=r.extrudedHeight,s=e?a.length/3*2:a.length/3,o=new Float64Array(3*s),l=a.length,C=e?l:0,y=0;y<l;y+=3){var u=y+1,m=y+2,c=W.Cartesian3.fromArray(a,y,B);t.scaleToGeodeticSurface(c,c);var h=W.Cartesian3.clone(c,b),x=t.geodeticSurfaceNormal(c,_),M=W.Cartesian3.multiplyByScalar(x,i,Q);W.Cartesian3.add(c,M,c),e&&(W.Cartesian3.multiplyByScalar(x,n,M),W.Cartesian3.add(h,M,h),o[y+C]=h.x,o[u+C]=h.y,o[m+C]=h.z),o[y]=c.x,o[u]=c.y,o[m]=c.z}return o};var G=new W.Cartesian3,H=new W.Cartesian3,N=new W.Cartesian3;r.computeEllipsePositions=function(a,r,e){var t=a.semiMinorAxis,i=a.semiMajorAxis,n=a.rotation,s=a.center,o=8*a.granularity,l=t*t,C=i*i,y=i*t,u=W.Cartesian3.magnitude(s),m=W.Cartesian3.normalize(s,G),c=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,s,H);c=W.Cartesian3.normalize(c,c);var h=W.Cartesian3.cross(m,c,N),x=1+Math.ceil(R.CesiumMath.PI_OVER_TWO/o),M=R.CesiumMath.PI_OVER_TWO/(x-1),z=R.CesiumMath.PI_OVER_TWO-x*M;z<0&&(x-=Math.ceil(Math.abs(z)/M));var f,_,d,v,O,p=r?new Array(3*(x*(x+2)*2)):void 0,w=0,P=B,T=b,I=4*x*3,g=I-1,E=0,V=e?new Array(I):void 0;for(P=S(z=R.CesiumMath.PI_OVER_TWO,n,h,c,l,y,C,u,m,P),r&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z),e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x),z=R.CesiumMath.PI_OVER_TWO-M,f=1;f<x+1;++f){if(P=S(z,n,h,c,l,y,C,u,m,P),T=S(Math.PI-z,n,h,c,l,y,C,u,m,T),r){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,d=2*f+2,_=1;_<d-1;++_)v=_/(d-1),O=W.Cartesian3.lerp(P,T,v,Q),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,V[E++]=T.x,V[E++]=T.y,V[E++]=T.z),z=R.CesiumMath.PI_OVER_TWO-(f+1)*M}for(f=x;1<f;--f){if(P=S(-(z=R.CesiumMath.PI_OVER_TWO-(f-1)*M),n,h,c,l,y,C,u,m,P),T=S(z+Math.PI,n,h,c,l,y,C,u,m,T),r){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,d=2*(f-1)+2,_=1;_<d-1;++_)v=_/(d-1),O=W.Cartesian3.lerp(P,T,v,Q),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,V[E++]=T.x,V[E++]=T.y,V[E++]=T.z)}P=S(-(z=R.CesiumMath.PI_OVER_TWO),n,h,c,l,y,C,u,m,P);var A={};return r&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,A.positions=p,A.numPts=x),e&&(V[g--]=P.z,V[g--]=P.y,V[g--]=P.x,A.outerPositions=V),A},a.EllipseGeometryLibrary=r});
|
|
|