Your Name
2022-03-14 aaebe147d319e59a8b510ff4ce9271088a330732
1
2
3
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("cesium/Cesium")):"function"===typeof define&&define.amd?define(["cesium/Cesium"],e):"object"===typeof exports?exports.space=e(require("cesium/Cesium")):t.space=e(t.Cesium)}("undefined"!==typeof self?self:this,function(t){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=5)}([function(e,i){e.exports=t},function(t,e,i){"use strict";function n(t){var e=t.indices,i=t.attributes,n=e.length;if(i.position){var r=i.position.values;if(void 0===i.normal)i.normal=new l.GeometryAttribute({componentDatatype:l.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(r.length)});else for(var a=i.normal.values,s=0;s<n;s++)a[s]=0;for(var h,u,m,c=i.normal.values,p=new l.Cartesian3(),d=new l.Cartesian3(),f=new l.Cartesian3(),y=new l.Cartesian3(),_=new l.Cartesian3(),s=0;s<n;s+=3)h=3*e[s+0],u=3*e[s+1],m=3*e[s+2],l.Cartesian3.fromArray(r,h,p),l.Cartesian3.fromArray(r,u,d),l.Cartesian3.fromArray(r,m,f),l.Cartesian3.subtract(f,d,y),l.Cartesian3.subtract(p,d,_),l.Cartesian3.cross(y,_,y),c[h]+=y.x,c[h+1]+=y.y,c[h+2]+=y.z,c[u]+=y.x,c[u+1]+=y.y,c[u+2]+=y.z,c[m]+=y.x,c[m+1]+=y.y,c[m+2]+=y.z;o(t),i.normal.needsUpdate=!0}return t}function o(t){for(var e,i,n,o,r=t.attributes.normal.values,a=0;a<r.length;a+=3)e=r[a],i=r[a+1],n=r[a+2],o=1/Math.sqrt(e*e+i*i+n*n),r[a]=e*o,r[a+1]=i*o,r[a+2]=n*o}function r(t,e,i){return a(l.Matrix4.fromRotationTranslation(l.Matrix3.fromQuaternion(e,p),t,d),i)}function a(t,e){return l.Matrix4.multiplyByPoint(t,l.Cartesian3.ZERO,u),u.clone(m.origin),s(new l.Cartesian3(0,0,e?-100:100),t,m)}function s(t,e,i,n){n=n||l.Ellipsoid.WGS84,l.Matrix4.multiplyByPoint(e,t,u),l.Cartesian3.subtract(u,i.origin,i.direction),l.Cartesian3.normalize(i.direction,i.direction);var o=l.IntersectionTests.rayEllipsoid(i,n),r=null;if(o&&(r=l.Ray.getPoint(i,o.start)),r)try{l.Cartographic.fromCartesian(r,null,c)}catch(t){return null}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.computeVertexNormals=n,e.getRayEarthPosition=r,e.getRayEarthPositionByMatrix=a,e.extend2Earth=s;var h=i(0),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(h),u=new l.Cartesian3(),m=new l.Ray(),c=new l.Cartographic(),p=new l.Matrix3(),d=new l.Matrix4()},function(t,e,i){"use strict";function n(t){this.length=t.length,this.topRadius=t.topRadius,this.bottomRadius=t.bottomRadius,this.slices=r.defaultValue(t.slices,64),this.zReverse=t.zReverse}Object.defineProperty(e,"__esModule",{value:!0}),e.CylinderGeometry=void 0;var o=i(0),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(o),a=i(1),s=new r.Cartesian2(),h=new r.Cartesian3(),l=new r.Ray();n._createGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,o=t.slices,a=2*Math.PI/(o-1),h=t.zReverse,l=[],u=[],m=[],c=[],p=[n,i],d=[0,h?-e:e],f=0,y=Math.atan2(n-i,e),_=s;_.z=Math.sin(y);for(var v=Math.cos(y),g=0;g<d.length;g++){c[g]=[];for(var C=p[g],w=0;w<o;w++){c[g].push(f++);var x=a*w,M=C*Math.cos(x),b=C*Math.sin(x);l.push(M,b,d[g]),M=v*Math.cos(x),b=v*Math.sin(x),u.push(M,b,_.z),m.push(g/(d.length-1),0)}}for(var P=[],g=1;g<d.length;g++)for(var w=1;w<o;w++){var A=c[g-1][w-1],E=c[g][w-1],S=c[g][w],T=c[g-1][w];P.push(S),P.push(T),P.push(A),P.push(S),P.push(A),P.push(E),w==c[g].length-1&&(A=c[g-1][w],E=c[g][w],S=c[g][0],T=c[g-1][0],P.push(S),P.push(T),P.push(A),P.push(S),P.push(A),P.push(E))}P=new Int16Array(P),l=new Float32Array(l),u=new Float32Array(u),m=new Float32Array(m);var k={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l}),normal:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},F=r.BoundingSphere.fromVertices(l),R=new r.Geometry({attributes:k,indices:P,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:F});return l=[],P=[],m=[],R},n.createGeometry=function(t,e,i){if(!e)return n._createGeometry(t);r.Matrix4.multiplyByPoint(e,r.Cartesian3.ZERO,h),h.clone(l.origin);var o=t.length,s=t.topRadius,u=(t.bottomRadius,t.slices),m=2*Math.PI/(u-1),c=t.zReverse,p=[],d=[],f=[],y=[],_=[0,c?-o:o],v=0,v=0;p.push(0,0,0),d.push(1,1),v++;for(var g=new r.Cartesian3(),C=s/15,w=0;w<16;w++){for(var x=C*w,M=[],b=0;b<u;b++){var P=m*b,A=x*Math.cos(P),E=x*Math.sin(P);g.x=A,g.y=E,g.z=_[1];var S=r.Matrix4.multiplyByPoint(e,g,new r.Cartesian3());S?(M.push(v),p.push(A,E,_[1]),d.push(w/15,1),v++):(S=h,M.push(-1))}y.push(M)}for(var T,k,F=[0,y.length-1],R=0;R<F.length;R++)for(var w=F[R],b=1;b<y[w].length;b++)T=y[w][b-1],k=y[w][b],T>=0&&k>=0&&f.push(0,T,k);p=new Float32Array(p),f=new Int32Array(f),d=new Float32Array(d);var L={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})},V=r.BoundingSphere.fromVertices(p),D=new r.Geometry({attributes:L,indices:f,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:V});return(0,a.computeVertexNormals)(D),p=[],f=[],D},n.createOutlineGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,o=t.slices,a=2*Math.PI/(o-1),h=t.zReverse,l=[],u=[],m=[],c=[],p=[n,i],d=[0,h?-e:e],f=0,y=Math.atan2(n-i,e),_=s;_.z=Math.sin(y);for(var v=Math.cos(y),g=0;g<d.length;g++){c[g]=[];for(var C=p[g],w=0;w<o;w++){c[g].push(f++);var x=a*w,M=C*Math.cos(x),b=C*Math.sin(x);l.push(M,b,d[g]),M=v*Math.cos(x),b=v*Math.sin(x),u.push(M,b,_.z),m.push(g/(d.length-1),0)}}for(var P=[],g=1;g<d.length;g++)for(var w=1;w<o;w+=1){var A=c[g-1][w-1],E=c[g][w-1];c[g][w],c[g-1][w];w%8==1&&P.push(A,E)}P=new Int16Array(P),l=new Float32Array(l),u=new Float32Array(u),m=new Float32Array(m);var S={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l}),normal:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:u}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:m})},T=r.BoundingSphere.fromVertices(l),k=new r.Geometry({attributes:S,indices:P,primitiveType:r.PrimitiveType.LINES,boundingSphere:T});return l=[],P=[],m=[],k},n.fromAngleAndLength=function(t,e,i){return t=r.Math.toRadians(t),new n({topRadius:Math.tan(t)*e/2,bottomRadius:0,length:e,zReverse:i})},e.CylinderGeometry=n},function(t,e,i){"use strict";function n(t){this._bottomWidth=t.bottomWidth,this._bottomHeight=t.bottomHeight,this._topWidth=t.topWidth,this._topHeight=t.topHeight,this._length=t.length,this._zReverse=t.zReverse,this._slices=r.defaultValue(t.slices,8)}Object.defineProperty(e,"__esModule",{value:!0}),e.FourPrismGeometry=void 0;var o=i(0),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(o),a=i(1),s=new r.Cartesian3(),h=new r.Ray();n._createGeometry=function(t){for(var e=t._bottomWidth,i=t._bottomHeight,n=t._topWidth,o=t._topHeight,a=t._zReverse,s=(a?-1:1)*t._length,h=new Float32Array(24),l=[],u=[],m=new r.Cartesian3(0,0,s),c=[0,s],p=[e,n],d=[i,o],f=0,y=0;y<2;y++)h[3*f]=-p[y]/2,h[3*f+1]=-d[y]/2,h[3*f+2]=c[y],u[2*f]=y,u[2*f+1]=0,f++,h[3*f]=-p[y]/2,h[3*f+1]=d[y]/2,h[3*f+2]=c[y],u[2*f]=y,u[2*f+1]=0,f++,h[3*f]=p[y]/2,h[3*f+1]=d[y]/2,h[3*f+2]=c[y],u[2*f]=y,u[2*f+1]=0,f++,h[3*f]=p[y]/2,h[3*f+1]=-d[y]/2,h[3*f+2]=c[y],u[2*f]=y,u[2*f+1]=0,f++;l.push(0,1,3),l.push(1,2,3),l.push(0,4,5),l.push(0,5,1),l.push(1,2,6),l.push(1,6,5),l.push(2,3,7),l.push(7,6,2),l.push(0,3,7),l.push(7,4,0),l.push(4,5,6),l.push(6,7,4),l=new Int16Array(l),u=new Float32Array(u);var _={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},v=r.BoundingSphere.fromVertices(h),g=new r.Geometry({attributes:_,indices:l,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:v});return g=r.GeometryPipeline.computeNormal(g),h=[],l=[],g.bottomCenter=m,g},n.createGeometry=function(t,e,i){if(!e)return n._createGeometry(cylinderGeometry);r.Matrix4.multiplyByPoint(e,r.Cartesian3.ZERO,s),s.clone(h.origin);var o=t._slices,l=(t._bottomWidth,t._bottomHeight,t._topWidth),u=t._topHeight,m=t._zReverse,c=(m?-1:1)*t._length,p=[],d=[],f=[],y=l/2,_=u/2,v=o,g=o,C=0;p.push(0,0,0),f.push(1,1),C++;for(var w=new r.Cartesian3(),x=[],M=-g;M<g;M++){for(var b=[],P=-v;P<v;P++){var A=_*M/g,E=y*P/v;w.x=E,w.y=A,w.z=c;(0,a.extend2Earth)(w,e,h);p.push(E,A,c),f.push(1,1),b.push(C),C++}x.push(b)}for(var S,T,k=[0,x.length-1],F=0;F<k.length;F++)for(var M=k[F],P=1;P<x[M].length;P++)S=x[M][P-1],T=x[M][P],S>=0&&T>=0&&d.push(0,S,T);for(var R=(x[0].length,0);R<x.length;R++)if(0==R||R==x.length-1)for(var M=1;M<x.length;M++)S=x[M-1][R],T=x[M][R],S>=0&&T>=0&&d.push(0,S,T);p=new Float32Array(p),d=new Int32Array(d),f=new Float32Array(f);var L={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})},V=r.BoundingSphere.fromVertices(p),D=new r.Geometry({attributes:L,indices:d,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:V});return D.myindexs=d,(0,a.computeVertexNormals)(D),p=[],d=[],D},n.createOutlineGeometry=function(t){for(var e=t._bottomWidth,i=t._bottomHeight,n=t._topWidth,o=t._topHeight,a=t._zReverse,s=(a?-1:1)*t._length,h=new Float32Array(24),l=[],u=[],m=[0,s],c=[e,n],p=[i,o],d=0,f=0;f<2;f++)h[3*d]=-c[f]/2,h[3*d+1]=-p[f]/2,h[3*d+2]=m[f],u[2*d]=f,u[2*d+1]=0,d++,h[3*d]=-c[f]/2,h[3*d+1]=p[f]/2,h[3*d+2]=m[f],u[2*d]=f,u[2*d+1]=0,d++,h[3*d]=c[f]/2,h[3*d+1]=p[f]/2,h[3*d+2]=m[f],u[2*d]=f,u[2*d+1]=0,d++,h[3*d]=c[f]/2,h[3*d+1]=-p[f]/2,h[3*d+2]=m[f],u[2*d]=f,u[2*d+1]=0,d++;l.push(0,1,1,2),l.push(2,3,3,0),l.push(0,4),l.push(1,5),l.push(2,6),l.push(3,7),l.push(4,5,5,6),l.push(6,7,7,4),l=new Int16Array(l),u=new Float32Array(u);var y={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:u})},_=r.BoundingSphere.fromVertices(h),v=new r.Geometry({attributes:y,indices:l,primitiveType:r.PrimitiveType.LINES,boundingSphere:_});return h=[],l=[],v},n.createOutlineGeometry2=function(t){var e=(t._bottomWidth,t._bottomHeight,t._topWidth),i=t._topHeight,n=t._zReverse,o=(n?-1:1)*t._length,s=[],h=[],l=[],u=e/2,m=i/2,c=0;s.push(0,0,0),l.push(1,1),c++;for(var p=[],d=-16;d<16;d++){for(var f=[],y=-16;y<16;y++){f.push(c);var _=m*d/16,v=u*y/16;s.push(v,_,o),l.push(1,1),c++}p.push(f)}for(var g,C,w=[0,p.length-1],x=0;x<w.length;x++)for(var d=w[x],y=1;y<p[d].length;y++)g=p[d][y-1],C=p[d][y],h.push(0,g,C);for(var M=[0,p[0].length-1],b=0;b<M.length;b++)for(var y=M[b],d=1;d<p.length;d++)g=p[d-1][y],C=p[d][y],h.push(0,g,C);s=new Float32Array(s),h=new Int16Array(h),l=new Float32Array(l);var P={position:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:s}),st:new r.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},A=r.BoundingSphere.fromVertices(s),E=new r.Geometry({attributes:P,indices:h,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:A});return(0,a.computeVertexNormals)(E),r.GeometryPipeline.toWireframe(E),s=[],h=[],E},n.fromAnglesLength=function(t,e,i,o){var a={length:i,zReverse:o,bottomHeight:i,bottomWidth:i,topHeight:i,topWidth:i};return t=r.Math.toRadians(t),e=r.Math.toRadians(e),o?(a.bottomHeight=0,a.bottomWidth=0,a.topHeight=i*Math.tan(t),a.topWidth=i*Math.tan(e)):(a.topHeight=0,a.topWidth=0,a.bottomHeight=i*Math.tan(t),a.bottomWidth=i*Math.tan(e)),new n(a)},e.FourPrismGeometry=n},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){var e=[];for(var i in t.attributes)t.attributes.hasOwnProperty(i)&&t.attributes[i]&&e.push(i);return e}function a(t,e,i,n,o,r,a,h){o=o||m.Ellipsoid.WGS84,r||(r=[]),m.Matrix4.inverse(e,g),m.Matrix4.multiplyByPoint(e,m.Cartesian3.ZERO,w),w.clone(x.origin);var l=0;n=Math.min(t.length,i+n);for(var u=0,c=i;c<n;c+=3){m.Cartesian3.unpack(t,c,C),m.Matrix4.multiplyByPoint(e,C,w),m.Cartesian3.subtract(w,x.origin,x.direction),m.Cartesian3.normalize(x.direction,x.direction);var p=m.IntersectionTests.rayEllipsoid(x,o),d=null;if(!p)return h.maxLength=u,s(t,e,i,n,o,r,a,h,!0);d=m.Ray.getPoint(x,p.start),u=m.Cartesian3.magnitude(d),d?(d.clone(w),r[l]=w.clone(r[l]),a&&a instanceof Float32Array&&(m.Matrix4.multiplyByPoint(g,w,w),a[i+3*l]=w.x,a[i+3*l+1]=w.y,a[i+3*l+2]=w.z),l++):l++}return r}function s(t,e,i,n,o,r,a,s,h){o=o||m.Ellipsoid.WGS84,r||(r=[]),m.Matrix4.inverse(e,g),m.Matrix4.multiplyByPoint(e,m.Cartesian3.ZERO,w),w.clone(x.origin);var l=0;n=Math.min(t.length,i+n);for(var u=i;u<n;u+=3){m.Cartesian3.unpack(t,u,C),m.Matrix4.multiplyByPoint(e,C,w),m.Cartesian3.subtract(w,x.origin,x.direction),m.Cartesian3.normalize(x.direction,x.direction);var c=m.IntersectionTests.rayEllipsoid(x,o),p=null;if(h){var d=Math.max(s.angle1||0,s.angle2||0)/2,f=m.Math.toRadians(d),y=Math.cos(f),_=m.Cartographic.fromCartesian(x.origin).height,v=s.inputLength||Math.max(s.maxLength||_,_),M=v/y;M=_+6371e3,p=m.Ray.getPoint(x,M)}else if(c)p=m.Ray.getPoint(x,c.start);else{var b=m.Cartesian3.normalize(m.Cartesian3.negate(x.origin,new m.Cartesian3()),new m.Cartesian3()),P=m.Cartesian3.cross(b,x.direction,new m.Cartesian3()),A=m.Cartesian3.cross(P,b,new m.Cartesian3()),E=new m.Ray(new m.Cartesian3(),A);p=m.Ray.getPoint(E,6371e3)}p?(p.clone(w),r[l]=w.clone(r[l]),a&&a instanceof Float32Array&&(m.Matrix4.multiplyByPoint(g,w,w),a[i+3*l]=w.x,a[i+3*l+1]=w.y,a[i+3*l+2]=w.z),l++):l++}return r}Object.defineProperty(e,"__esModule",{value:!0}),e.SatelliteCoverageSimulation=void 0;var h,l=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),u=i(0),m=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(u),c=i(2),p=i(3),d=i(1),f=i(6),y=n(f),_=i(7),v=n(_),g=new m.Matrix4(),C=new m.Cartesian3(),w=new m.Cartesian3(),x=new m.Ray(),M=new m.Cartographic(),b=new m.Quaternion(),P={Cone:1,FourPrism:2},A=e.SatelliteCoverageSimulation=function(){function t(e,i){o(this,t),this.viewer=e,i=i||{},h=e.scene.globe.ellipsoid,this._geometry=null,this._areaType=m.defaultValue(i.areaType,P.FourPrism),this._angle1=m.defaultValue(i.angle1,10),this._angle2=m.defaultValue(i.angle2,10),this._length=m.defaultValue(i.length,1e6),this._position=i.position,this.autoAngle=i.autoAngle,this._rotation=m.defaultValue(i.rotation,{heading:0,pitch:0,roll:0}),this._fixedFrameTransform=m.defaultValue(i.fixedFrameTransform,m.Transforms.eastNorthUpToFixedFrame),this._reverse=m.defaultValue(i.reverse,!0),this._outline=m.defaultValue(i.outline,!1),this._groundArea=m.defaultValue(i.groundArea,!1),this._groundOutLine=m.defaultValue(i.groundOutLine,!1),this.defaultColor=m.defaultValue(i.color,m.Color.YELLOW),this.defaultLineColor=i.lineColor,this._groundAreaColor=i.groundAreaColor,this._groundOutLineColor=i.groundOutLineColor,this._rayEllipsoid=m.defaultValue(i.rayEllipsoid,!1),this.inputLength=m.defaultValue(i.inputLength,null),this._modelMatrix=m.Matrix4.clone(m.Matrix4.IDENTITY),this._quaternion=new m.Quaternion(),this._translation=new m.Cartesian3(),this._scale=new m.Cartesian3(1,1,1),this._matrix=new m.Matrix4(),this._inverseMatrix=new m.Matrix4(),this._positionCartographic=new m.Cartographic(),this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this._imagingAreaPositions=[],this._depthTestChange=!1,this._trackedEntity=i.trackedEntity,this._trackPositions=[],this._trackGeometries=[],this._track={geometry:null,needsUpdate:!1,lastestFrame:null},m.defaultValue(i.show,!0)&&this.addToScene()}return l(t,[{key:"addToScene",value:function(){this._show||(this._show=!0,this.viewer.scene.primitives.add(this),this.groundAreaEntity?this.viewer.entities.add(this.groundAreaEntity):this.addGroundAreaEntity(this._groundArea||this._groundOutLine))}},{key:"addGroundAreaEntity",value:function(t){if(t&&!this.groundAreaEntity){var e=this,i=new m.PolygonHierarchy();this.groundAreaEntity=this.viewer.entities.add({polygon:{show:this._groundArea,material:this._groundAreaColor||this.defaultColor,hierarchy:new m.CallbackProperty(function(t){return i.positions=e._imagingAreaPositions,i},!1)},polyline:{show:this._groundOutLine,material:this._groundOutLineColor||this._groundAreaColor||this.defaultColor,width:1.5,positions:new m.CallbackProperty(function(t){return e._imagingAreaPositions},!1)}})}}},{key:"mergeGeometries",value:function(t,e){if(!t||!t.length)throw new Error("缺少geometries参数");for(var i=[],n=!1,o=!1,a=t[0].primitiveType,s=0;s<t.length;s++){if(i[s]=r(t[s]),s>0){if(a!=t[s].primitiveType){o=!0;break}var h=i[s-1];if(!(n=h.length!=i[s].length))for(var l=0;l<h.length;l++)if(h[l]!=i[s][l]){n=!0;break}}if(a=t[s].primitiveType,n||o)break}if(o)throw new Error("待合并的几何体中primitiveType属性不完全一致");if(n)throw new Error("待合并的几何体中属性数量和和名称不完全一致");for(var u={},c=i[0],s=0;s<c.length;s++){var p=c[s],d=t[0];u[p]={};for(var f in d.attributes[p])d.attributes[p].hasOwnProperty(f)&&(u[p][f]=d.attributes[p][f]);for(var y=Array.from(u[p].values),l=1;l<t.length;l++){d=t[l];for(var _=0;_<d.attributes[p].values.length;_++)y.push(d.attributes[p].values[_])}u[p].values=new u[p].values.constructor(y)}for(var v=[],g=0,l=0;l<t.length;l++){for(var d=t[0],s=0;s<d.indices.length;s++)v.push(d.indices[s]+g);g+=d.attributes.position.values.length/3}var C=m.BoundingSphere.fromVertices(u.position.values);return new m.Geometry({attributes:u,indices:new Int32Array(v),primitiveType:t[0].primitiveType,boundingSphere:C})}},{key:"updateGeometry",value:function(){var t=this._reverse?this._length:-this._length;this._areaType==P.Cone?(this._geometry=c.CylinderGeometry.createGeometry(c.CylinderGeometry.fromAngleAndLength(this._angle1,t,!0),this._matrix,this),this._outlineGeometry=c.CylinderGeometry.createOutlineGeometry(c.CylinderGeometry.fromAngleAndLength(this._angle1,t,!0))):(this._geometry=p.FourPrismGeometry.createGeometry(p.FourPrismGeometry.fromAnglesLength(this._angle1,this._angle2,t,!0),this._matrix,this),this._outlineGeometry=p.FourPrismGeometry.createOutlineGeometry(p.FourPrismGeometry.fromAnglesLength(this._angle1,this._angle2,t,!0))),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var e=0;e<this._positions.length;e++)this._positions[e]=this._geometry.attributes.position.values[e];this._outlinePositions=[]}},{key:"updateVolumeGeometry",value:function(){var t=1+this._imagingAreaPositions.length,e=new Float32Array(3+3*this._imagingAreaPositions.length),i=0;e[i++]=this._positionCartesian.x,e[i++]=this._positionCartesian.y,e[i++]=this._positionCartesian.z;for(var n=0;n<this._imagingAreaPositions.length;n++)e[i++]=this._imagingAreaPositions[n].x,e[i++]=this._imagingAreaPositions[n].y,e[i++]=this._imagingAreaPositions[n].z;for(var o=[],r=[],n=1;n<t-1;n++)r.push(0,n);o=this._geometry.indices;var a={position:new m.GeometryAttribute({componentDatatype:m.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})},s=m.BoundingSphere.fromVertices(e),h=new m.Geometry({attributes:a,indices:o,primitiveType:m.PrimitiveType.TRIANGLES,boundingSphere:s}),l=new m.Geometry({attributes:a,indices:new Uint32Array(r),primitiveType:m.PrimitiveType.LINES,boundingSphere:s});this._volumeGeometry=h,this._volumeOutlineGeometry=l}},{key:"updateImagingAreaGeometry",value:function(t){if(this._track.lastestFrame){var e=this._track.lastestFrame.length!=this._outlinePositions.length;if(!e)for(var i=0;i<this._track.lastestFrame.length;i++)if(!this._track.lastestFrame[i].equals(this._outlinePositions[i])){e=!0;break}if(!e)return}if(this._track.lastestFrame&&this._track.lastestFrame.length==this._outlinePositions.length)for(var i=0;i<this._outlinePositions.length;i++)this._outlinePositions[i].clone(this._track.lastestFrame[i]);else{this._track.lastestFrame=[];for(var i=0;i<this._outlinePositions.length;i++)this._track.lastestFrame.push(this._outlinePositions[i].clone())}var n=this.updateImagingAreaGeometry2(t);if(this._trackGeometries.push(n),this._track.geometry){var o=this._track.geometry.attributes;for(var i in o)o.hasOwnProperty(i)&&delete o[i];for(var i in this._track.geometry)this._track.geometry.hasOwnProperty(i)&&delete this._track.geometry[i]}this._track.geometry=this.mergeGeometries(this._trackGeometries),this._track.needsUpdate=!0}},{key:"update",value:function(t){if(this._show&&(this.computeMatrix(t.time),this._positionCartesian)){this._geometry||this.updateGeometry(),this._outlinePositions=a(this._positions,this._matrix,3,this._positions.length-3,h,this._outlinePositions,this._geometry.attributes.position.values,this),this._imagingAreaPositions.splice(0,this._imagingAreaPositions.length);var e=t.mode===m.SceneMode.SCENE3D?this.cartesian2llh():this.exportImagingArea();if(e&&e.length){if(this._rayEllipsoid)for(var i=0;i<e.length;i++){var n=e[i];this._imagingAreaPositions.push(m.Cartesian3.fromDegrees(n[0],n[1]))}else this._imagingAreaPositions=m.clone(this._outlinePositions);t.mode===m.SceneMode.SCENE3D?(this.updateVolumeGeometry(),this._volumeGeometry&&(this._volumeCommand&&(this._volumeCommand.vertexArray=this._volumeCommand.vertexArray&&this._volumeCommand.vertexArray.destroy(),this._volumeCommand=null),this._volumeCommand=this.createDrawCommand(this._volumeGeometry,t,m.Matrix4.IDENTITY.clone()),t.commandList.push(this._volumeCommand),this._outline&&(this._volumeOutlineCommand&&(this._volumeOutlineCommand.vertexArray=this._volumeOutlineCommand.vertexArray&&this._volumeOutlineCommand.vertexArray.destroy(),this._volumeOutlineCommand=null),this._volumeOutlineCommand=this.createDrawCommand(this._volumeOutlineGeometry,t,m.Matrix4.IDENTITY.clone()),t.commandList.push(this._volumeOutlineCommand))),this.groundAreaEntity&&(this.groundAreaEntity.polygon.show=this._groundArea&&this._show,this.groundAreaEntity.polyline.show=this._groundOutLine&&this._show)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.polygon.show=!0)}else this._outline&&(this._outlineGeometry._drawCommand||(this._outlineGeometry._drawCommand=this.createDrawCommand(this._outlineGeometry,t)),t.commandList.push(this._outlineGeometry._drawCommand)),this.groundAreaEntity&&(this.groundAreaEntity.polygon.show=!1,this.groundAreaEntity.polyline.show=!1)}}},{key:"createDrawCommand",value:function(t,e,i){var n=e.context,o=new m.Cartesian3();m.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,o);var r=(new m.BoundingSphere(o,t.boundingSphere.radius),new m.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:m.Pass.OPAQUE})),a=this,s=m.GeometryPipeline.createAttributeLocations(t);return r.vertexArray=m.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:s,bufferUsage:m.BufferUsage.STATIC_DRAW}),r.vertexArray._attributeLocations=s,r.shaderProgram=m.ShaderProgram.replaceCache({context:n,vertexShaderSource:v.default,fragmentShaderSource:y.default,attributeLocations:s}),r.renderState=m.RenderState.fromCache({blending:m.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:m.DepthFunction.LESS},cull:{enabled:!1,face:m.CullFace.BACK},depthMask:!1}),r.uniformMap={},r.uniformMap.projectionMatrix=function(){return e.context.uniformState.projection},r.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},r.uniformMap.shininess=function(){return a.shininess||(a.shininess=0),a.shininess},r.uniformMap.emission=function(){return a.emission||(a.emission=new m.Cartesian3(.2,.2,.2)),a.emission},r.uniformMap.specular=function(){return a.specular||(a.specular=0),a.specular},r.uniformMap.isLine=function(){return t.primitiveType==m.PrimitiveType.LINES},r.uniformMap.defaultColor=function(){return t.color?t.color:t.primitiveType==m.PrimitiveType.LINES?a.defaultLineColor||a.defaultColor||new m.Color(1,1,0,.5):a.defaultColor||new m.Color(1,0,0,1)},r.uniformMap.picked=function(){return a.picked||(a.picked=0),a.picked},r.uniformMap.pickedColor=function(){return a.pickedColor||(a.pickedColor=new m.Color(1,1,0,1)),a.pickedColor},r.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},r.uniformMap.glowPower=function(){return.25},r}},{key:"clearCommands",value:function(){this._drawCommands.forEach(function(t){t.vertexArray.destroy()}),this._drawCommands=[]}},{key:"computeMatrix",value:function(t,e){if(!this.position)return this._matrix=new m.Matrix4(),this._matrix;if(this.position instanceof m.Cartesian3?this._positionCartesian=this.position:"function"===typeof this.position.getValue?this._positionCartesian=this.position.getValue(t):this.position._value&&this.position._value instanceof m.Cartesian3&&(this._positionCartesian=this.position._value),!this._positionCartesian)return this._matrix=new m.Matrix4(),this._matrix;if(this._modelMatrix=this._fixedFrameTransform(this._positionCartesian,h,this._modelMatrix),this._positionCartographic=m.Cartographic.fromCartesian(this._positionCartesian,h,this._positionCartographic),this._fixedFrameTransform(this._positionCartesian,h,this._modelMatrix),this.autoAngle&&this._trackedEntity&&this._trackedEntity.orientation){var i=m.Property.getValueOrUndefined(this._trackedEntity.orientation,t,b);if(this._positionCartesian&&i){var n=wutu3d.matrix.getHeadingPitchRollByOrientation(this._positionCartesian,i,h,this._fixedFrameTransform);this._rotation.heading=n.heading}}return m.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=m.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),m.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),m.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix}},{key:"cartesian2llh",value:function(){for(var t=this._outlinePositions,e=[],i=0;i<t.length;i++){var n=t[i];if(n){m.Cartographic.fromCartesian(n,void 0,M);var o=[m.Math.toDegrees(M.longitude),m.Math.toDegrees(M.latitude)];e.push(o)}}return e}},{key:"exportImagingArea",value:function(t,e){var i=this._outlinePositions;if(e){if(this.computeMatrix(e),!this._positionCartesian)return;i=a(this._positions,this._matrix,3,this._positions.length-3,h,null,this._geometry.attributes.position.values)}for(var n=[],o=0;o<i.length;o++){var r=i[o];if(r){m.Cartographic.fromCartesian(r,void 0,M);var s=[m.Math.toDegrees(M.longitude),m.Math.toDegrees(M.latitude)];t&&(s[0]=parseFloat(s[0].toFixed(t)),s[1]=parseFloat(s[1].toFixed(t))),n.push(turf.point(s))}}var l=[];if(n.length>0){n=turf.featureCollection(n);var u=turf.convex(n);if(u){var c=turf.getCoords(u);c&&c.length>0&&(l=c[0])}}return l}},{key:"updateImagingAreaGeometry2",value:function(t){for(var e=[],i=[],n=0,o=0;o<this._outlinePositions.length;o+=2){var r=this._outlinePositions[0];e.push(r.x,r.y,r.z),i.push(n++)}return e=new Float32Array(e),i=new Int32Array(i),new m.Geometry({attributes:{position:new m.GeometryAttribute({componentDatatype:m.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})},primitiveType:m.PrimitiveType.LINES,indices:i,boundingSphere:m.BoundingSphere.fromVertices(e)})}},{key:"remove",value:function(){this._show&&(this._show=!1,this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity))}},{key:"destroy",value:function(t){if(t){if(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[],this._outlineGeometry&&this._outlineGeometry.attributes)for(var e in this._outlineGeometry.attributes)this._outlineGeometry.attributes.hasOwnProperty(e)&&delete this._outlineGeometry.attributes[e];if(delete this._outlineGeometry,this._geometry&&this._geometry.attributes)for(var e in this._geometry.attributes)this._geometry.attributes.hasOwnProperty(e)&&delete this._geometry.attributes[e];delete this._geometry,delete this._positionCartesian,delete this._position,this._outlinePositions=[]}}},{key:"color",get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},{key:"lineColor",get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},{key:"trackedEntity",get:function(){return this._trackedEntity},set:function(t){t!=this._trackedEntity&&(this.position=t.position),this._trackedEntity=t}},{key:"show",get:function(){return this._show},set:function(t){t?this.addToScene():this.remove()}},{key:"outline",get:function(){return this._outline},set:function(t){this._outline=t}},{key:"angle1",get:function(){return this._angle1},set:function(t){this._angle1=t,this.clearCommands(),this._geometry=null}},{key:"angle2",get:function(){return this._angle2},set:function(t){this._angle2=t,this.clearCommands(),this._geometry=null}},{key:"areaType",get:function(){return this._areaType},set:function(t){this._areaType=t,this.clearCommands(),this._geometry=null}},{key:"rotation",get:function(){return this._rotation},set:function(t){this._rotation=t,this.clearCommands(),this._geometry=null}},{key:"heading",get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t,this.clearCommands(),this._geometry=null}},{key:"pitch",get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t,this.clearCommands(),this._geometry=null}},{key:"roll",get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t,this.clearCommands(),this._geometry=null}},{key:"position",get:function(){return this._position},set:function(t){this._position=t,this._geometry=null,this._drawCommands=[]}},{key:"groundPosition",get:function(){return(0,d.getRayEarthPositionByMatrix)(this._matrix,this._reverse)}}]),t}();A.AreaType=P,A.extend2CartesianArray=a},function(t,e,i){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}var o=i(0),r=(n(o),i(2)),a=i(3),s=i(4),h=i(8),l=i(9),u=i(1),m=n(u),c=i(10),p=i(11),d=i(12);window.wutu3d,wutu3d.CylinderGeometry=r.CylinderGeometry,wutu3d.FourPrismGeometry=a.FourPrismGeometry,wutu3d.SatelliteCoverageSimulation=s.SatelliteCoverageSimulation,wutu3d.galculateGroundPoly=h.galculateGroundPoly,wutu3d.Satellite=l.Satellite,wutu3d.Satellite.util=m,wutu3d.RadarPrimitive=c.RadarPrimitive,wutu3d.FourPrismPrimitive=p.FourPrismPrimitive,wutu3d.CamberRadarPrimitive=d.CamberRadarPrimitive},function(t,e){t.exports="//FACE_FORWARD当有光照的的时候,当视图正对它的时候反转法向量,避免墙体的背面是黑色的。\r\n#define FACE_FORWARD\r\nvarying vec3 v_position;\r\nvarying vec3 v_normal;\r\nuniform float picked;\r\nuniform vec4  pickedColor;\r\nuniform vec4  defaultColor;\r\nuniform float specular;\r\nuniform float shininess;\r\nuniform vec3  emission;\r\nvarying vec2 v_st;\r\nuniform bool isLine;\r\nuniform float glowPower;\r\nvoid main() {\r\n    vec3 positionToEyeEC = -v_position; \r\n    vec3 normalEC =normalize(v_normal);\r\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n    vec4 color=defaultColor;\r\n    if(picked!=0.0){\r\n        color = pickedColor;\r\n    }\r\n    if(v_st.x<0.5){\r\n        color.a = color.a*( 0.75-v_st.x); \r\n    }\r\n    else  {\r\n        color.a =color.a*(v_st.x-0.25); \r\n    }\r\n    czm_material material;\r\n    material.specular = specular;\r\n    material.shininess = shininess;\r\n    material.normal =  normalEC;\r\n    material.emission =emission;//vec3(0.2,0.2,0.2);\r\n    material.diffuse = color.rgb ;\r\n    if(isLine){\r\n        material.alpha = 1.0; \r\n    }\r\n    else{\r\n        material.alpha = color.a; \r\n    }\r\n        //float glow = glowPower / abs(v_st.t  ) - (glowPower / 0.5); \r\n        // \r\n        //material.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb); \r\n        //if(isLine)\r\n        //    material.alpha = clamp(0.0, 1.0, glow) * color.a; \r\n         \r\n    if(v_st.x==0.0){ \r\n          gl_FragColor =color ;\r\n    }else { \r\n        // gl_FragColor =   czm_phong(normalize(positionToEyeEC), material) ; \r\n        gl_FragColor =   vec4(material.diffuse,material.alpha) ; \r\n    } \r\n}"},function(t,e){t.exports="#ifdef GL_ES\r\n    precision highp float;\r\n#endif\r\n\r\nattribute vec3 position;\r\nattribute vec2 st;\r\nattribute vec3 normal;\r\nuniform mat4 modelViewMatrix;\r\nuniform mat3 normalMatrix;\r\nuniform mat4 projectionMatrix;\r\nvarying vec3 v_position;\r\nvarying vec3 v_normal;\r\nvarying vec2 v_st;\r\n\r\nvarying vec3 v_light0Direction;\r\n\r\nvoid main(void) \r\n{\r\n    vec4 pos =  modelViewMatrix * vec4( position,1.0);\r\n    v_normal =  normalMatrix *  normal;\r\n    v_st = st;\r\n    v_position = pos.xyz;\r\n    v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\r\n    gl_Position =  projectionMatrix * pos;\r\n}"},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,i,n,o,r,a){o=o||l.Ellipsoid.WGS84,r||(r=[]),l.Matrix4.inverse(e,c),l.Matrix4.multiplyByPoint(e,l.Cartesian3.ZERO,d),d.clone(f.origin);var s=0;n=Math.min(t.length,i+n);for(var h=i;h<n;h+=3){l.Cartesian3.unpack(t,h,p),l.Matrix4.multiplyByPoint(e,p,d),l.Cartesian3.subtract(d,f.origin,f.direction),l.Cartesian3.normalize(f.direction,f.direction);var u=l.IntersectionTests.rayEllipsoid(f,o),m=null;u&&(m=l.Ray.getPoint(f,u.start)),m?(m.clone(d),r[s]=d.clone(r[s]),a&&a instanceof Float32Array&&(l.Matrix4.multiplyByPoint(c,d,d),a[i+3*s]=d.x,a[i+3*s+1]=d.y,a[i+3*s+2]=d.z),s++):s++}return r}function r(t,e){for(var i=new l.SampledPositionProperty(l.ReferenceFrame.INERTIAL),n=0,o=t.length;n<o;n++){var r=t[n];i.addSample(r.time,r.position)}return i.setInterpolationOptions({interpolationDegree:2,interpolationAlgorithm:l.LagrangePolynomialApproximation}),new g({position:i,angle1:e.angle,angle2:e.step||10,areaType:e.areaType||v.FourPrism,rotation:{pitch:l.Math.toRadians(e.pitch||0),roll:l.Math.toRadians(e.roll||0)}}).exportShadingArea()}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();e.galculateGroundPoly=r;var s,h=i(0),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(h),u=i(2),m=i(3),c=new l.Matrix4(),p=new l.Cartesian3(),d=new l.Cartesian3(),f=new l.Ray(),y=new l.Cartographic(),_=new l.Quaternion(),v={Cone:1,FourPrism:2},g=function(){function t(e){n(this,t),e=e||{},s=e.ellipsoid||l.Ellipsoid.WGS84,this._geometry=null,this._areaType=e.areaType?e.areaType:v.FourPrism,this._angle1=e.angle1?e.angle1:10,this._angle2=e.angle2?e.angle2:10,this._length=e.length?e.length:1e6,this._position=e.position,this._fixedFrameTransform=l.defaultValue(e.fixedFrameTransform,l.Transforms.eastNorthUpToFixedFrame),this._orientation=e.orientation,this.autoAngle=l.defaultValue(e.autoAngle,!0),this.autoAngle&&(this._orientation=new l.VelocityOrientationProperty(this._position)),this._rotation=e.rotation?e.rotation:{heading:0,pitch:0,roll:0},this._modelMatrix=l.Matrix4.clone(l.Matrix4.IDENTITY),this._quaternion=new l.Quaternion(),this._translation=new l.Cartesian3(),this._scale=new l.Cartesian3(1,1,1),this._matrix=new l.Matrix4(),this._inverseMatrix=new l.Matrix4(),this._positionCartographic=new l.Cartographic(),this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this._imagingAreaPositions=[]}return a(t,[{key:"exportShadingArea",value:function(t){for(var e=this._position._property._times,i=[],n=0,o=e.length;n<o;n++){var r=e[n],a=this.exportImagingArea(r);i.push(a)}return i}},{key:"exportImagingArea",value:function(t){if(this.computeMatrix(t),this._positionCartesian){this.updateGeometry();for(var e=o(this._positions,this._matrix,3,this._positions.length-3,s,null,this._geometry.attributes.position.values),i=[],n=0;n<e.length;n++){var r=e[n];l.Cartographic.fromCartesian(r,void 0,y);var a=[l.Math.toDegrees(y.longitude),l.Math.toDegrees(y.latitude)];i.push(turf.point(a))}var h=[];if(i.length>0){i=turf.featureCollection(i);var u=turf.convex(i);if(u){var m=turf.getCoords(u);m&&m.length>0&&(h=m[0])}}return h}}},{key:"computeMatrix",value:function(t,e){if(this._positionCartesian||(this._positionCartesian=new l.Cartesian3()),this._position instanceof l.Cartesian3?this._positionCartesian=this._position:"function"===typeof this._position.getValue?this._positionCartesian=this._position.getValue(t):this._position._value&&this._position._value instanceof l.Cartesian3&&(this._positionCartesian=this._position._value),!this._positionCartesian)return this._matrix;if(this._modelMatrix=this._fixedFrameTransform(this._positionCartesian,s,this._modelMatrix),this._positionCartographic=l.Cartographic.fromCartesian(this._positionCartesian,s,this._positionCartographic),this._fixedFrameTransform(this._positionCartesian,s,this._modelMatrix),this.autoAngle&&this._orientation){var i=l.Property.getValueOrUndefined(this._orientation,t,_);if(i){var n=wutu3d.matrix.getHeadingPitchRollByOrientation(i,s,this._fixedFrameTransform);this._rotation.heading=n.heading}}return l.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=l.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),l.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),l.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix}},{key:"updateGeometry",value:function(){this._areaType==v.Cone?(this._geometry=u.CylinderGeometry.createGeometry(u.CylinderGeometry.fromAngleAndLength(this._angle1,this._length,!0),this._matrix),this._outlineGeometry=u.CylinderGeometry.createOutlineGeometry(u.CylinderGeometry.fromAngleAndLength(this._angle1,this._length,!0))):(this._geometry=m.FourPrismGeometry.createGeometry(m.FourPrismGeometry.fromAnglesLength(this._angle1,this._angle2,this._length,!0),this._matrix),this._outlineGeometry=m.FourPrismGeometry.createOutlineGeometry(m.FourPrismGeometry.fromAnglesLength(this._angle1,this._angle2,this._length,!0))),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var t=0;t<this._positions.length;t++)this._positions[t]=this._geometry.attributes.position.values[t];this._outlinePositions=[]}}]),t}()},function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Satellite=void 0;var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=i(0),h=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(s),l=i(4),u=i(1),m=new h.Quaternion();e.Satellite=function(){function t(e,i){var n=this;o(this,t),this.viewer=e,this.id=h.defaultValue(i.id,0),this.name=h.defaultValue(i.name,"卫星"),this.arrTimeShading=[],this._visible=!0;var r={model:{scale:1,minimumPixelSize:90,opacity:1,angleType:!1,heading:0,pitch:0,roll:0},label:{show:!0,color:"#ffffff",opacity:1,font_family:"楷体",font_size:30,border:!0,border_color:"#000000",border_width:3,background:!0,background_color:"#000000",background_opacity:.5,font_weight:"normal",font_style:"normal",hasPixelOffset:!0,pixelOffsetX:0,pixelOffsetY:-20,scaleByDistance:!0,scaleByDistance_far:1e7,scaleByDistance_farValue:.4,scaleByDistance_near:1e5,scaleByDistance_nearValue:1,distanceDisplayCondition:!1,distanceDisplayCondition_far:1e4,distanceDisplayCondition_near:0},cone:{show:!1,areaType:!1,reverse:!0,angle1:10,angle2:10,color:"#6ef500",outline:!1},path:{show:!0,lineType:"solid",color:"#3388ff",opacity:.5,width:1,outline:!1,outlineColor:"#ffffff",outlineWidth:2},shadingLine:{show:!1,lineType:"dash",color:"#ff0000",width:3,outline:!1,outlineColor:"#ffffff",outlineWidth:2,opacity:1}};for(var a in r){var s=r[a];if(i.hasOwnProperty(a))for(var l in s)i[a].hasOwnProperty(l)||(i[a][l]=s[l]);else i[a]=s}return this.options=i,this._fixedFrameTransform=h.defaultValue(this.options.fixedFrameTransform,h.Transforms.eastNorthUpToFixedFrame),window.satellite?(this.options.period=satellite.get_period(this.options.tle2),!isNaN(this.options.period)&&(this.period_m=60*this.options.period*1e3,this.time_zone=288e5,this.time_tick_local=h.JulianDate.toDate(this.viewer.clock.currentTime).getTime(),this.color_define=[],this.color_define.push(h.Color.RED.withAlpha(.3)),this.color_define.push(h.Color.YELLOW.withAlpha(.3)),this.color_define.push(h.Color.BLUE.withAlpha(.3)),this.color_define.push(h.Color.GREEN.withAlpha(.3)),this.color_define.push(h.Color.CHARTREUSE.withAlpha(.3)),this.color_define.push(h.Color.CORAL.withAlpha(.3)),this.color_define.push(h.Color.AQUA.withAlpha(.3)),this.color_define.push(h.Color.DARKGREEN.withAlpha(.3)),this.color_define.push(h.Color.BLUEVIOLET.withAlpha(.3)),this.update(),void(i.hasOwnProperty("interval")&&!i.interval||(this.timeTik=setInterval(function(){n.update()},1e3*(i.interval||1)))))):void console.log("请引入satellite.js才能继续使用该类")}return a(t,[{key:"isNeedRecalculate",value:function(){if(null==this.orbit_bt||null==this.orbit_et)return!0;var t=this.time_tick_local,e=this.orbit_bt+this.period_m/4,i=this.orbit_et-this.period_m/4;return!(t>e&&t<i)}},{key:"calculateOrbitPoints",value:function(){this.property=new h.SampledPositionProperty(h.ReferenceFrame.INERTIAL);var t=[],e=12e4;this.options.period>1e3&&(e=3e5);for(var i=this.time_tick_local-this.period_m/2,n=this.time_tick_local+this.period_m/2,o=i;o<=n;){var r=satellite.calculate_sat_pos_ex("ECI",this.options.tle1,this.options.tle2,o-this.time_zone);if(isNaN(r.x)||isNaN(r.longitude))return null;var a=h.JulianDate.fromDate(new Date(o)),s=new h.Cartesian3(1e3*r.x,1e3*r.y,1e3*r.z),l=h.Cartesian3.fromRadians(r.longitude,r.latitude);this.property.addSample(a,s),t.push({position:l,positionWX:s,time:a,millis:o}),o+=e}this._points=t,this.property.setInterpolationOptions({interpolationDegree:2,interpolationAlgorithm:h.LagrangePolynomialApproximation}),this.orbit_bt=this.time_tick_local-this.period_m/2,this.orbit_et=this.time_tick_local+this.period_m/2+e}},{key:"createEntity",value:function(){var t,e=this;this.options.label.text=this.name;var i=wutu3d.draw.attr.model.style2Entity(this.options.model),o=wutu3d.draw.attr.label.style2Entity(this.options.label),r=wutu3d.draw.attr.polyline.style2Entity(this.options.path,{}),a=new h.VelocityOrientationProperty(this.property);this.velocityOrientation=a;var s=this.viewer.entities.add((t={name:this.name,availability:new h.TimeIntervalCollection([new h.TimeInterval({start:h.JulianDate.fromDate(new Date(this.orbit_bt)),stop:h.JulianDate.fromDate(new Date(this.orbit_et))})]),position:this.property,orientation:new h.CallbackProperty(function(t){return e.orientation},!1),model:i,label:o,path:r,popup:this.options.popup},n(t,"popup",this.options.tooltip),n(t,"click",this.options.click),t));this.entity=s,this.options.shadingLine&&this.showShadingLine(),this.options.cone&&this.showCone(),this.updateOrientation()}},{key:"updateEntity",value:function(){this.entity.availability=new h.TimeIntervalCollection([new h.TimeInterval({start:h.JulianDate.fromDate(new Date(this.orbit_bt)),stop:h.JulianDate.fromDate(new Date(this.orbit_et))})]),this.entity.position=this.property,this.velocityOrientation.position=this.property;var t=this;this.coneEntityList&&this.coneEntityList.forEach(function(e,i,n){e.position=t.property}),this.coneEntity&&(this.coneEntity.position=this.property)}},{key:"update",value:function(){if(this._visible)return this.time_tick_local=h.JulianDate.toDate(this.viewer.clock.currentTime).getTime(),this.updateOrientation(),this.updateShadingPositions(),!this.isNeedRecalculate()||(this.calculateOrbitPoints(),null!=this.property&&(null==this.entity?this.createEntity():this.updateEntity(),!0))}},{key:"updateStyle",value:function(t){for(var e in t)if("object"===r(t[e])&&this.options[e])for(var i in t[e])this.options[e][i]=t[e][i];else this.options[e]=t[e];if(this.options.label.text=this.name,this.options.tle2){if(this.options.period=satellite.get_period(this.options.tle2),isNaN(this.options.period))return!1;this.period_m=60*this.options.period*1e3}wutu3d.draw.attr.model.style2Entity(this.options.model,this.entity.model),wutu3d.draw.attr.label.style2Entity(this.options.label,this.entity.label),wutu3d.draw.attr.polyline.style2Entity(this.options.path,this.entity.path),this.options.cone&&this.showCone(),this.options.shadingLine&&this.showShadingLine(),this.updateOrientation()}},{key:"getPointTime",value:function(t,e){e=e||this._points;for(var i=wutu3d.point.setPositionsHeight(t,0),n=0,o=0,r=[],a=0,s=e.length;a<s;a++){var l=e[a],u=Math.abs(h.Cartesian3.distance(i,l.position));0==a&&(n=u),r.push(u),u<n&&(n=u,o=a)}var m;if(0==o||o==e.length-1)m=h.JulianDate.toDate(e[o].time);else{var c,p,d=r[o-1],f=r[o+1];d<=f?(c=h.JulianDate.toDate(e[o-1].time),p=h.JulianDate.toDate(e[o].time),f=n):(c=h.JulianDate.toDate(e[o].time),p=h.JulianDate.toDate(e[o+1].time),d=n);var y=d/(d+f)*(p.getTime()-c.getTime());c.setTime(c.getTime()+y),m=c}return m}},{key:"updateOrientation",value:function(t){if(null!=this.property){var e=this.viewer.clock.currentTime,i=h.Property.getValueOrUndefined(this.property,e,new h.Cartesian3());if(i){if(t&&(this.options.model.heading=h.defaultValue(t.heading,this.options.model.heading),this.options.model.pitch=h.defaultValue(t.pitch,this.options.model.pitch),this.options.model.roll=h.defaultValue(t.roll,this.options.model.roll)),!this.options.model.angleType&&this.velocityOrientation){var n=h.Property.getValueOrUndefined(this.velocityOrientation,e,m),o=wutu3d.matrix.getHeadingPitchRollByOrientation(i,n,this.viewer.scene.globe.ellipsoid,this._fixedFrameTransform);this.options.model.heading=Math.round(h.Math.toDegrees(o.heading))}var r=h.Math.toRadians(Number(this.options.model.heading||0)),a=h.Math.toRadians(Number(this.options.model.pitch||0)),s=h.Math.toRadians(Number(this.options.model.roll||0)),o=new h.HeadingPitchRoll(r,a,s);if(this.orientation=h.Transforms.headingPitchRollQuaternion(i,o),this.coneEntityList){var l=this;this.coneEntityList.forEach(function(t,e,i){var n=l.calculate_cam_sight(h.Math.toRadians(s),h.Math.toRadians(a),h.Math.toRadians(r),h.Math.toRadians(90-t.angle_sight_Yaxis),0,0);t._rotation.heading=n.yaw,t._rotation.pitch=n.pitch,t._rotation.roll=n.roll})}this.coneEntity&&(this.coneEntity._rotation.heading=r,this.coneEntity._rotation.pitch=a,this.coneEntity._rotation.roll=s)}}}},{key:"updateShadingPositions",value:function(){if(this._points&&0!=this._points.length&&this.options.shadingLine.show){var t=this.viewer.clock.currentTime,e=this._points.length;if(!(e<2)){var i=Math.floor(e/1e3);i<1&&(i=1);for(var n=[],o=0;o<e;o+=i){var r=this._points[o];if(h.JulianDate.greaterThan(r.time,t))break;n.push(r.position)}var a=h.Property.getValueOrUndefined(this.entity.position,this.viewer.clock.currentTime,new h.Cartesian3());if(a){var s=h.Cartographic.fromCartesian(a);n.push(h.Cartesian3.fromDegrees(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)))}this._shadingPositions=n}}}},{key:"showCone",value:function(){var t=this.options.cone;t.show?t.list&&t.list.length>0?this._showListCone(t):this._showOneCone(t):(this.coneEntityList&&(this.coneEntityList.forEach(function(t,e,i){t.remove(),t.destroy(!0)}),this.coneEntityList.clear()),this.coneEntity&&(this.coneEntity.remove(),this.coneEntity.destroy(!0),delete this.coneEntity))}},{key:"_showOneCone",value:function(t){if(this.coneEntity)this.coneEntity.angle1=t.angle1||20,this.coneEntity.angle2=t.angle2||20,this.coneEntity.areaType=t.areaType?wutu3d.SatelliteCoverageSimulation.AreaType.FourPrism:wutu3d.SatelliteCoverageSimulation.AreaType.Cone,this.coneEntity.heading=h.Math.toRadians(this.options.model.heading||0),this.coneEntity.pitch=h.Math.toRadians(this.options.model.pitch||0),this.coneEntity.roll=h.Math.toRadians(this.options.model.roll||0),this.coneEntity.color=new h.Color.fromCssColorString(t.color||"#6ef500").withAlpha(Number(t.opacity||.5)),this.coneEntity.outline=t.outline;else{var e=new wutu3d.SatelliteCoverageSimulation(this.viewer,{position:this.entity.position,angle1:t.angle1||20,angle2:t.angle2||20,areaType:t.areaType?wutu3d.SatelliteCoverageSimulation.AreaType.FourPrism:wutu3d.SatelliteCoverageSimulation.AreaType.Cone,autoAngle:!1,//!this.options.model.angleType,
rotation:{heading:h.Math.toRadians(this.options.model.heading||0),pitch:h.Math.toRadians(this.options.model.pitch||0),roll:h.Math.toRadians(this.options.model.roll||0)},color:new h.Color.fromCssColorString(t.color||"#6ef500").withAlpha(Number(t.opacity||.5)),outline:t.outline,reverse:t.reverse});e.trackedEntity=this.entity,this.coneEntity=e}}},{key:"_showListCone",value:function(t){this.coneEntityList||(this.coneEntityList=new Map());for(var e=0;e<t.list.length;e++){var i=t.list[e];if(i.name=i.name||e,i.hasOwnProperty("show")&&!i.show){if(this.coneEntityList.has(i.name)){var n=this.coneEntityList.get(i.name);n.remove(),n.destroy(!0),this.coneEntityList.delete(i.name)}}else{var o=1e-4;i.out_side_sight&&(o+=i.out_side_sight),i.in_side_sight&&(o+=i.in_side_sight);var r=1e-4;i.up_side_sight&&(r+=i.up_side_sight),i.down_side_sight&&(r+=i.down_side_sight);var a=this.calculate_cam_sight(h.Math.toRadians(this.options.model.roll||0),h.Math.toRadians(this.options.model.pitch||0),h.Math.toRadians(this.options.model.heading||0),h.Math.toRadians(90-i.angle_sight_Yaxis),0,0);if(this.coneEntityList.has(i.name)){var n=this.coneEntityList.get(i.name);n.angle1=o,n.angle2=r,n.areaType=t.areaType?l.SatelliteCoverageSimulation.AreaType.FourPrism:l.SatelliteCoverageSimulation.AreaType.Cone,n.heading=a.yaw,n.pitch=a.pitch,n.roll=a.roll,n.color=this.color_define[e],n.outline=t.outline,n.angle_sight_Xaxis=i.angle_sight_Xaxis||90,n.angle_sight_Yaxis=i.angle_sight_Yaxis||90,n.angle_sight_Zaxis=i.angle_sight_Zaxis||0}else{var n=new l.SatelliteCoverageSimulation(this.viewer,{position:this.entity.position,angle1:o,angle2:r,areaType:t.areaType?l.SatelliteCoverageSimulation.AreaType.FourPrism:l.SatelliteCoverageSimulation.AreaType.Cone,autoAngle:!1,//!this.options.model.angleType,
rotation:{heading:a.yaw,pitch:a.pitch,roll:a.roll},color:this.color_define[e],outline:t.outline});n.angle_sight_Xaxis=i.angle_sight_Xaxis||90,n.angle_sight_Yaxis=i.angle_sight_Yaxis||90,n.angle_sight_Zaxis=i.angle_sight_Zaxis||0,n.trackedEntity=this.entity,this.coneEntityList.set(i.name,n)}}}}},{key:"calculate_cam_sight",value:function(t,e,i,n,o,r){var a=Math.cos(i)*Math.cos(e),s=Math.cos(i)*Math.sin(e)*Math.sin(t)-Math.sin(i)*Math.cos(t),h=Math.cos(i)*Math.sin(e)*Math.cos(t)+Math.sin(i)*Math.sin(t),l=Math.sin(i)*Math.cos(e),u=Math.sin(i)*Math.sin(e)*Math.sin(t)+Math.cos(i)*Math.cos(t),m=Math.sin(i)*Math.sin(e)*Math.cos(t)-Math.cos(i)*Math.sin(t),c=0-Math.sin(e),p=Math.cos(e)*Math.sin(t),d=Math.cos(e)*Math.cos(t),f=Math.cos(r)*Math.cos(o),y=Math.cos(r)*Math.sin(o)*Math.sin(n)-Math.sin(r)*Math.cos(n),_=Math.cos(r)*Math.sin(o)*Math.cos(n)+Math.sin(r)*Math.sin(n),v=Math.sin(r)*Math.cos(o),g=Math.sin(r)*Math.sin(o)*Math.sin(n)+Math.cos(r)*Math.cos(n),C=Math.sin(r)*Math.sin(o)*Math.cos(n)-Math.cos(r)*Math.sin(n),w=0-Math.sin(o),x=Math.cos(o)*Math.sin(n),M=Math.cos(o)*Math.cos(n),b=a*f+s*v+h*w,P=l*f+u*v+m*w,A=c*f+p*v+d*w,E=c*y+p*g+d*x,S=c*_+p*C+d*M;return{roll:Math.atan2(E,S),pitch:Math.atan2(0-A,Math.sqrt(E*E+S*S)),yaw:Math.atan2(P,b)}}},{key:"showShadingLine",value:function(){var t=this,e=this.options.shadingLine;if(e.show)if(this.shadingLineEntity)wutu3d.draw.attr.polyline.style2Entity(e,this.shadingLineEntity.polyline);else{var i=wutu3d.draw.attr.polyline.style2Entity(e);i.positions=new h.CallbackProperty(function(e){return t._shadingPositions},!1);var n=this.viewer.entities.add({name:"地面投影线",polyline:i});this.shadingLineEntity=n}else this.shadingLineEntity&&(this.viewer.entities.remove(this.shadingLineEntity),delete this.shadingLineEntity)}},{key:"setVisible",value:function(t){this._visible!==t&&(this._visible=t,this._visible?(this.entity&&this.viewer.entities.add(this.entity),this.coneEntityList&&this.coneEntityList.forEach(function(t,e,i){t.addToScene()}),this.coneEntity&&this.coneEntity.addToScene(),this.shadingLineEntity&&this.viewer.entities.add(this.shadingLineEntity),this.shadingAreaEntity&&this.viewer.entities.add(this.shadingAreaEntity)):(this.entity&&this.viewer.entities.remove(this.entity),this.coneEntityList&&this.coneEntityList.forEach(function(t,e,i){t.remove()}),this.coneEntity&&this.coneEntity.remove(),this.shadingLineEntity&&this.viewer.entities.remove(this.shadingLineEntity),this.shadingAreaEntity&&this.viewer.entities.remove(this.shadingAreaEntity)))}},{key:"flyTo",value:function(t){var e=this.viewer.clock.currentTime,i=h.Property.getValueOrUndefined(this.property,e,new h.Cartesian3()),n=h.Cartographic.fromCartesian(i);this.viewer.camera.flyTo({destination:h.Cartesian3.fromDegrees(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude),2.5*n.height),duration:t,orientation:{heading:0,pitch:h.Math.toRadians(-90),roll:0}})}},{key:"destroy",value:function(){clearInterval(this.timeTik),this.viewer.entities.remove(this.entity),delete this.entity,this.coneEntityList&&(this.coneEntityList.forEach(function(t,e,i){t.remove(),t.destroy(!0)}),this.coneEntityList.clear()),this.coneEntity&&(this.coneEntity.remove(),this.coneEntity.destroy(!0),delete this.coneEntity),this.shadingLineEntity&&(this.viewer.entities.remove(this.shadingLineEntity),delete this.shadingLineEntity),this.shadingAreaEntity&&(this.viewer.entities.remove(this.shadingAreaEntity),delete this.shadingAreaEntity)}},{key:"config",get:function(){return this.options},set:function(t){this.updateStyle(t)}},{key:"position",get:function(){return this.property?h.Property.getValueOrUndefined(this.property,this.viewer.clock.currentTime,new h.Cartesian3()):null}},{key:"groundPosition",get:function(){return(0,u.getRayEarthPosition)(this.position,this.orientation,this.options.cone.reverse)}},{key:"visible",get:function(){return this._visible},set:function(t){this.setVisible(t)}},{key:"timeRange",get:function(){return{start:new Date(this.orbit_bt).format("yyyy-MM-dd HH:mm:ss"),end:new Date(this.orbit_et).format("yyyy-MM-dd HH:mm:ss")}}},{key:"angle1",get:function(){return this.options.cone.angle1},set:function(t){this.updateStyle({cone:{angle1:t}})}},{key:"angle2",get:function(){return this.options.cone.angle2},set:function(t){this.updateStyle({cone:{angle2:t}})}},{key:"heading",get:function(){return this.options.model.heading},set:function(t){this.updateOrientation({heading:t})}},{key:"pitch",get:function(){return this.options.model.pitch},set:function(t){this.updateOrientation({pitch:t})}},{key:"roll",get:function(){return this.options.model.roll},set:function(t){this.updateOrientation({roll:t})}}]),t}()},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RadarPrimitive=void 0;var o,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=i(0),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(a),h=i(2),l=i(1),u=new s.Cartesian3();e.RadarPrimitive=function(){function t(e,i){n(this,t),this.viewer=e,i=s.defaultValue(i,{}),o=e.scene.globe.ellipsoid,this._geometry=null,this._angle=i.angle,this._radius=s.defaultValue(i.radius,5),this._position=i.position,this._rotation=s.defaultValue(i.rotation,{heading:0,pitch:0,roll:0}),this._trackedEntity=i.trackedEntity,this._fixedFrameTransform=s.defaultValue(i.fixedFrameTransform,s.Transforms.eastNorthUpToFixedFrame),this.defaultColor=s.defaultValue(i.color,s.Color.YELLOW),this.defaultLineColor=s.defaultValue(i.lineColor,this.defaultColor),this.hintPotsNum=s.defaultValue(i.hintPotsNum,15),this._outline=s.defaultValue(i.outline,!1),this._topShow=s.defaultValue(i.top,!0),this._topOutline=s.defaultValue(i.topOutline,!0),this._groundArea=s.defaultValue(i.groundArea,!1),this._modelMatrix=s.Matrix4.clone(s.Matrix4.IDENTITY),this._quaternion=new s.Quaternion(),this._translation=new s.Cartesian3(),this._scale=new s.Cartesian3(1,1,1),this._matrix=new s.Matrix4(),this._inverseMatrix=new s.Matrix4(),this._positionCartographic=new s.Cartographic(),this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],s.defaultValue(i.show,!0)&&this.addToScene()}return r(t,[{key:"updateGroundCircleRadius",value:function(){this._ground_radius=this._radius*Math.cos(s.Math.toRadians(this._angle))}},{key:"addGroundAreaEntity",value:function(t){if(t&&!this.groundAreaEntity){var e=this;this.updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this.position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new s.CallbackProperty(function(t){return e._ground_radius},!1),semiMajorAxis:new s.CallbackProperty(function(t){return e._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new s.CallbackProperty(function(t){var i=e.getNowPosition(t);return i&&e._trackedEntityPosition?s.Cartesian3.distance(i,e._trackedEntityPosition)>e._radius?[]:[i,e._trackedEntityPosition]:[]},!1),followSurface:!1,material:new s.PolylineDashMaterialProperty({color:s.Color.CYAN}),width:1}})}}},{key:"computeHintPots",value:function(t){var e=[],i=this.getNowPosition(t);if(!i)return e;for(var n=this._radius*Math.sin(s.Math.toRadians(90-this._angle)),o=s.Matrix4.multiplyByPoint(this._matrix,this.lbcenter,new s.Cartesian3()),r=s.Cartesian3.subtract(o,i,new s.Cartesian3()),a=s.Cartesian3.cross(r,o,new s.Cartesian3()),h=s.Cartesian3.cross(o,r,new s.Cartesian3()),l=0;l<=this.hintPotsNum;l++){var u=new s.Ray(o,a),m=n*l/this.hintPotsNum,c=s.Ray.getPoint(u,m,new s.Cartesian3()),p=s.Cartesian3.subtract(c,i,new s.Cartesian3());u=new s.Ray(i,p);var d=s.Ray.getPoint(u,this._radius,new s.Cartesian3());e.push(d)}e.push(i);for(var l=this.hintPotsNum;l>=0;l--){var u=new s.Ray(o,h),m=n*l/this.hintPotsNum,c=s.Ray.getPoint(u,m,new s.Cartesian3()),p=s.Cartesian3.subtract(c,i,new s.Cartesian3());u=new s.Ray(i,p);var d=s.Ray.getPoint(u,this._radius,new s.Cartesian3());e.push(d)}return e}},{key:"addHintLines",value:function(){if(!this.hintLines){var t=this;this.hintLines=viewer.entities.add({polygon:{hierarchy:new s.CallbackProperty(function(e,i){return new s.PolygonHierarchy(t.computeHintPots(e))},!1),outline:!0,outlineColor:s.Color.WHITE.withAlpha(1),outlineWidth:1,material:s.Color.RED.withAlpha(.5)},show:this.viewer.scene._mode==s.SceneMode.SCENE2D})}}},{key:"getNowPosition",value:function(t){var e;return this.position instanceof s.Cartesian3?e=this.position:"function"===typeof this.position.getValue?e=this.position.getValue(t):this.position._value&&this.position._value instanceof s.Cartesian3&&(e=this.position._value),e}},{key:"computeMatrix",value:function(t,e){if(this._positionCartesian=this.getNowPosition(t),!this._positionCartesian)return this._matrix=new s.Matrix4(),this._matrix;if(this._trackedEntity&&this._trackedEntity.position){var i=this._positionCartesian,n=s.Property.getValueOrUndefined(this._trackedEntity.position,t,u);if(s.defined(n)){this._trackedEntityPosition=n;var r=wutu3d.matrix.getHeadingPitchRollForLine(i,n,o,this._fixedFrameTransform);this._rotation.heading=r.heading,this._rotation.pitch=r.pitch,this._rotation.roll=r.roll}}return this._modelMatrix=this._fixedFrameTransform(this._positionCartesian,o,this._modelMatrix),this._positionCartographic=s.Cartographic.fromCartesian(this._positionCartesian,o,this._positionCartographic),this._fixedFrameTransform(this._positionCartesian,o,this._modelMatrix),s.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=s.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),s.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),s.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix}},{key:"getTopGeometry",value:function(){var t=this.radius,e=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,h=2*Math.PI/127;this.lbcenter=new s.Cartesian3(0,0,t);for(var u=0,m=this.angle;m<91;m+=a){var c=s.Math.toRadians(m<90?m:90);c=Math.cos(c)*t;for(var p=[],d=0;d<128;d++){var f=h*d,y=c*Math.cos(f),_=c*Math.sin(f),v=Math.sqrt(t*t-y*y-_*_);e.push(y,_,v),i.push(1,1),p.push(u++)}o.push(p)}for(var m=1;m<o.length;m++)for(var d=1;d<o[m].length;d++){var g=o[m-1][d-1],C=o[m][d-1],w=o[m][d],x=o[m-1][d];n.push(g,C,w),n.push(g,w,x)}e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i);var M={position:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},b=s.BoundingSphere.fromVertices(e),P=new s.Geometry({attributes:M,indices:n,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:b});return(0,l.computeVertexNormals)(P),P}},{key:"getTopOutlineGeometry",value:function(){for(var t=this.radius,e=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,h=2*Math.PI/127,u=0,m=this.angle;m<91;m+=a){var c=s.Math.toRadians(m<90?m:90);c=Math.cos(c)*t;for(var p=[],d=0;d<128;d++){var f=h*d,y=c*Math.cos(f),_=c*Math.sin(f),v=Math.sqrt(t*t-y*y-_*_);e.push(y,_,v),i.push(1,1),p.push(u++)}o.push(p)}for(var m=1;m<o.length;m++)for(var d=1;d<o[m].length;d++){var g=o[m-1][d-1],C=o[m][d-1],w=o[m][d];o[m-1][d];d%8==1&&n.push(g,C),m%8==1&&n.push(C,w)}e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i);var x={position:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},M=s.BoundingSphere.fromVertices(e),b=new s.Geometry({attributes:x,indices:n,primitiveType:s.PrimitiveType.LINES,boundingSphere:M});return(0,l.computeVertexNormals)(b),b}},{key:"updateGeometry",value:function(){this._geometry=h.CylinderGeometry.createGeometry(new h.CylinderGeometry({topRadius:this._radius*Math.cos(s.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(s.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=h.CylinderGeometry.createOutlineGeometry(new h.CylinderGeometry({topRadius:this._radius*Math.cos(s.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(s.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var t=0;t<this._positions.length;t++)this._positions[t]=this._geometry.attributes.position.values[t];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))}},{key:"update",value:function(t){if(this._show){this.computeMatrix(t.time);t.mode===s.SceneMode.SCENE3D?(this._geometry.boundingSphere=s.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands=[],this._drawCommands.push(this.createDrawCommand(this._geometry,t)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,t)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,t)),this._topOutline&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,t))),this._drawCommands.forEach(function(e){t.commandList.push(e)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1),this.hintLines&&(this.hintLines.show=!1)):(!this.hintLines||0===this._rotation.pitch&&0===this._rotation.roll||(this.hintLines.show=!0),this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll))}}},{key:"getFragmentShaderSource",value:function(t){return"\nvarying vec3 v_position;\nvarying vec3 v_normal;\nuniform float picked;\nuniform vec4  pickedColor;\nuniform vec4  defaultColor;\nuniform float specular;\nuniform float shininess;\nuniform vec3  emission;\nvarying vec2 v_st;\nuniform bool isLine;\nuniform float glowPower;\nvoid main() {\n    vec3 positionToEyeEC = -v_position; \n    vec3 normalEC =normalize(v_normal);\n    vec4 color=defaultColor;\n    if(picked!=0.0){\n        color = pickedColor;\n    }\n    //if(v_st.x<0.5){\n    //    color.a =0.75-v_st.x; \n    //}\n    //else  {\n    //    color.a =v_st.x-0.25; \n    //}\n    czm_material material;\n    material.specular = specular;\n    material.shininess = shininess;\n    material.normal =  normalEC;\n    material.emission =emission;//vec3(0.2,0.2,0.2);\n    material.diffuse = color.rgb ;\n    if(isLine){\n        material.alpha = 1.0; \n    }\n    else{\n        material.alpha =  color.a; \n    }\n        //float glow = glowPower / abs(v_st.t  ) - (glowPower / 0.5); \n        // \n        //material.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb); \n        //if(isLine)\n        //    material.alpha = clamp(0.0, 1.0, glow) * color.a; \n         \n    if(v_st.x==0.0){ \n          gl_FragColor =color ;\n    }else { \n        gl_FragColor = czm_phong(normalize(positionToEyeEC), material) ; \n    } \n}"}},{key:"getVertexShaderSource",value:function(t){return"\n#ifdef GL_ES\n    precision highp float;\n#endif\n\nattribute vec3 position;\nattribute vec2 st;\nattribute vec3 normal;\nuniform mat4 modelViewMatrix;\nuniform mat3 normalMatrix;\nuniform mat4 projectionMatrix;\nvarying vec3 v_position;\nvarying vec3 v_normal;\nvarying vec2 v_st;\n\nvarying vec3 v_light0Direction;\n\nvoid main(void) \n{\n    vec4 pos =  czm_modelView * vec4( position,1.0);\n    v_normal =  normalMatrix *  normal;\n    v_st = st;\n    v_position = pos.xyz;\n    v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n    gl_Position =  projectionMatrix * pos;\n}"}},{key:"createDrawCommand",value:function(t,e,i){var n=e.context,o=new s.Cartesian3();s.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,o);var r=new s.BoundingSphere(o,t.boundingSphere.radius),a=new s.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:s.Pass.TRANSLUCENT,boundingVolume:r}),h=this,l=s.GeometryPipeline.createAttributeLocations(t);return a.vertexArray=s.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:l,bufferUsage:s.BufferUsage.STATIC_DRAW}),a.vertexArray._attributeLocations=l,a.shaderProgram=s.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(t),fragmentShaderSource:this.getFragmentShaderSource(t),attributeLocations:l}),a.renderState=s.RenderState.fromCache({blending:s.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:s.DepthFunction.LESS},cull:{enabled:!1,face:s.CullFace.BACK}}),a.uniformMap={},a.uniformMap.projectionMatrix=function(){return e.context.uniformState.projection},a.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},a.uniformMap.shininess=function(){return h.shininess||(h.shininess=0),h.shininess},a.uniformMap.emission=function(){return h.emission||(h.emission=new s.Cartesian3(.2,.2,.2)),h.emission},a.uniformMap.specular=function(){return h.specular||(h.specular=0),h.specular},a.uniformMap.isLine=function(){return t.primitiveType==s.PrimitiveType.LINES||t.primitiveType==s.PrimitiveType.LINE_STRIP},a.uniformMap.defaultColor=function(){return t.primitiveType==s.PrimitiveType.LINES||t.primitiveType==s.PrimitiveType.LINE_STRIP?(h.defaultLineColor||(h.defaultLineColor=new s.Color(1,1,0,1)),h.defaultLineColor):(h.defaultColor||(h.defaultColor=new s.Color(1,0,0,1)),h.defaultColor)},a.uniformMap.picked=function(){return h.picked||(h.picked=0),h.picked},a.uniformMap.pickedColor=function(){return h.pickedColor||(h.pickedColor=new s.Color(1,1,0,1)),h.pickedColor},a.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},a.uniformMap.glowPower=function(){return.25},a}},{key:"remove",value:function(){this._show&&(this._show=!1,this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this.hintLines&&this.viewer.entities.remove(this.hintLines))}},{key:"addToScene",value:function(){this._show||(this._show=!0,this.viewer.scene.primitives.add(this),this.updateGeometry(),this.groundAreaEntity?this.viewer.entities.add(this.groundAreaEntity):this.addGroundAreaEntity(this._groundArea),this.hintLines?this.viewer.entities.add(this.hintLines):this.addHintLines())}},{key:"destroy",value:function(t){t&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this.hintLines&&this.viewer.entities.remove(this.hintLines),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[])}},{key:"trackedEntity",get:function(){return this._trackedEntity},set:function(t){this._trackedEntity=t}},{key:"color",get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},{key:"lineColor",get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},{key:"show",get:function(){return this._show},set:function(t){t?this.addToScene():this.remove()}},{key:"outline",get:function(){return this._outline},set:function(t){this._outline=t,this.updateGeometry()}},{key:"top",get:function(){return this._topShow},set:function(t){this._topShow=t,this.updateGeometry()}},{key:"topOutline",get:function(){return this._topOutline},set:function(t){this._topOutline=t,this.updateGeometry()}},{key:"groundArea",get:function(){return this._groundArea},set:function(t){this._groundArea=t,this.addGroundAreaEntity(this._groundArea)}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle=t,this.updateGroundCircleRadius(),this.updateGeometry()}},{key:"radius",get:function(){return this._radius},set:function(t){this._radius=t,this.updateGroundCircleRadius(),this.updateGeometry()}},{key:"heading",get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t}},{key:"pitch",get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t}},{key:"roll",get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t}},{key:"position",get:function(){return this._position},set:function(t){this._position=t}}]),t}()},function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.FourPrismPrimitive=void 0;var o,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=i(0),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(a),h=i(3),l=i(1),u=new s.Cartesian3();e.FourPrismPrimitive=function(){function t(e,i){n(this,t),this.viewer=e,i=s.defaultValue(i,{}),o=e.scene.globe.ellipsoid,this._geometry=null,this._angle1=i.angle1||i.angle||10,this._angle2=i.angle2||i.angle||10,this._length=i.length||i.radius||5,this._position=i.position,this._rotation=s.defaultValue(i.rotation,{heading:0,pitch:0,roll:0}),this._trackedEntity=i.trackedEntity,this._fixedFrameTransform=s.defaultValue(i.fixedFrameTransform,s.Transforms.eastNorthUpToFixedFrame),this._reverse=s.defaultValue(i.reverse,!1),this.defaultColor=s.defaultValue(i.color,new s.Color(.0078,.7764,.8039,.2)),this.defaultLineColor=s.defaultValue(i.lineColor,new s.Color(1,1,1,.4)),this.defaultFourColor=s.defaultValue(i.fourColor,this.defaultColor),this.hintPotsNum=s.defaultValue(i.hintPotsNum,15),this._outline=s.defaultValue(i.outline,!1),this._topShow=s.defaultValue(i.top,!0),this._topOutline=s.defaultValue(i.topOutline,!0),this._topSteps=s.defaultValue(i.topSteps,8),this._modelMatrix=s.Matrix4.clone(s.Matrix4.IDENTITY),this._quaternion=new s.Quaternion(),this._translation=new s.Cartesian3(),this._scale=new s.Cartesian3(1,1,1),this._matrix=new s.Matrix4(),this._inverseMatrix=new s.Matrix4(),this._positionCartographic=new s.Cartographic(),this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],s.defaultValue(i.show,!0)&&this.addToScene()}return r(t,[{key:"getNowPosition",value:function(t){var e;return this.position instanceof s.Cartesian3?e=this.position:"function"===typeof this.position.getValue?e=this.position.getValue(t):this.position._value&&this.position._value instanceof s.Cartesian3&&(e=this.position._value),e}},{key:"computeMatrix",value:function(t,e){if(this._positionCartesian=this.getNowPosition(t),!this._positionCartesian)return this._matrix=new s.Matrix4(),this._matrix;if(this._trackedEntity&&this._trackedEntity.position){var i=this._positionCartesian,n=s.Property.getValueOrUndefined(this._trackedEntity.position,t,u);if(s.defined(n)){this._trackedEntityPosition=n;var r=wutu3d.matrix.getHeadingPitchRollForLine(i,n,o,this._fixedFrameTransform);this._rotation.heading=r.heading,this._rotation.pitch=r.pitch,this._rotation.roll=r.roll}}return this._modelMatrix=this._fixedFrameTransform(this._positionCartesian,o,this._modelMatrix),this._positionCartographic=s.Cartographic.fromCartesian(this._positionCartesian,o,this._positionCartographic),this._fixedFrameTransform(this._positionCartesian,o,this._modelMatrix),s.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=s.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),s.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),s.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix}},{key:"prepareVAO",value:function(){var t=this._reverse?-this.length:this.length,e=this.fourPir._topWidth/2,i=this.fourPir._topHeight/2,n=[],o=[],r=[],a=[],h=[],l=[],u=[],m=[],c=new s.Cartesian3(-e,-i,t),p=new s.Cartesian3(e,-i,t),d=new s.Cartesian3(-e,i,t),f=new s.Cartesian3(e,i,t);this.lbcenter=new s.Cartesian3(0,0,t),u.push(0,0,0),u.push(c.x,c.y,c.z),u.push(d.x,d.y,d.z),u.push(f.x,f.y,f.z),u.push(p.x,p.y,p.z),h.push(0,1,2),h.push(0,2,3),h.push(0,3,4),h.push(0,4,1),l.push(0,1),l.push(0,2),l.push(0,3),l.push(0,4),l.push(1,2),l.push(2,3),l.push(3,4),l.push(4,1);for(var y=this._topSteps,_=0,v=0;v<=y;v++){for(var g=s.Cartesian3.lerp(c,d,v/y,new s.Cartesian3()),C=s.Cartesian3.lerp(p,f,v/y,new s.Cartesian3()),w=[],x=0;x<=y;x++){var M=s.Cartesian3.lerp(g,C,x/y,new s.Cartesian3());n.push(M.x,M.y,M.z),o.push(1,1),w.push(_++)}m.push(w)}for(var v=1;v<m.length;v++)for(var x=1;x<m[v].length;x++){var b=m[v-1][x-1],P=m[v][x-1],A=m[v][x],E=m[v-1][x];r.push(b,P,A),r.push(b,A,E)}for(var v=0;v<m.length;v++)a.push(m[v][0]),a.push(m[v][m[v].length-1]);for(var S=m.length,v=0;v<m[0].length;v++)a.push(m[0][v]),a.push(m[S-1][v]);return{topPpositions:new Float32Array(n),topPindices:new Int32Array(r),topPsts:new Float32Array(o),topOindices:new Int32Array(a),fourPposition:new Float32Array(u),fourPindices:new Int32Array(h),fourOindices:new Int32Array(l)}}},{key:"createGeometry",value:function(t,e,i,n,o){var r={position:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new s.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},a=s.BoundingSphere.fromVertices(e),h=new s.Geometry({attributes:r,indices:t,primitiveType:n,boundingSphere:a});return h.color=o||this.defaultColor,(0,l.computeVertexNormals)(h),h}},{key:"updateGeometry",value:function(){var t=h.FourPrismGeometry.fromAnglesLength(this._angle1,this._angle2,this._length,!0);this.fourPir=t,this.vao=this.prepareVAO(),this._geometry=this.createGeometry(this.vao.fourPindices,this.vao.fourPposition,this.vao.topPsts,s.PrimitiveType.TRIANGLES,this.defaultFourColor),this._topGeometry=this.createGeometry(this.vao.topPindices,this.vao.topPpositions,this.vao.topPsts,s.PrimitiveType.TRIANGLES,this.defaultColor),this._topOutlineGeometry=this.createGeometry(this.vao.topOindices,this.vao.topPpositions,this.vao.topPsts,s.PrimitiveType.LINES,this.defaultLineColor),this._outlineGeometry=this.createGeometry(this.vao.fourOindices,this.vao.fourPposition,this.vao.topPsts,s.PrimitiveType.LINES,this.defaultLineColor),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var e=0;e<this._positions.length;e++)this._positions[e]=this._geometry.attributes.position.values[e];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))}},{key:"update",value:function(t){if(this._show){this.computeMatrix(t.time);if(t.mode===s.SceneMode.SCENE3D){if(this._geometry.boundingSphere=s.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands=[],this._drawCommands.push(this.createDrawCommand(this._geometry,t)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,t)),this._topShow){var e=this.createDrawCommand(this._topGeometry,t);if(this._drawCommands.push(e),this._topOutline){var i=this.createDrawCommand(this._topOutlineGeometry,t);this._drawCommands.push(i)}}this._drawCommands.forEach(function(e){t.commandList.push(e)}),this.hintLines&&(this.hintLines.show=!1)}else this.hintLines&&(this.hintLines.show=!0)}}},{key:"getFragmentShaderSource",value:function(t){return"\nvarying vec3 v_position;\nvarying vec3 v_normal;\nuniform float picked;\nuniform vec4  pickedColor;\nuniform vec4  defaultColor;\nuniform vec4 myColor;\nuniform float specular;\nuniform float shininess;\nuniform vec3  emission;\nvarying vec2 v_st;\nuniform bool isLine;\nuniform float glowPower;\nvoid main() {\n    vec3 positionToEyeEC = -v_position; \n    vec3 normalEC =normalize(v_normal);\n    vec4 color=defaultColor;\n    if(picked!=0.0){\n        color = pickedColor;\n    }\n    //if(v_st.x<0.5){\n    //    color.a =0.75-v_st.x; \n    //}\n    //else  {\n    //    color.a =v_st.x-0.25; \n    //}\n    czm_material material;\n    material.specular = specular;\n    material.shininess = shininess;\n    material.normal =  normalEC;\n    material.emission =emission;//vec3(0.2,0.2,0.2);\n    material.diffuse = color.rgb ;\n    if(isLine){\n        material.alpha = 1.0; \n    }\n    else{\n        material.alpha =  color.a; \n    }\n        //float glow = glowPower / abs(v_st.t  ) - (glowPower / 0.5); \n        // \n        //material.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb); \n        //if(isLine)\n        //    material.alpha = clamp(0.0, 1.0, glow) * color.a; \n         \n    if(v_st.x==0.0){ \n          gl_FragColor =color ;\n    }else { \n        gl_FragColor = czm_phong(normalize(positionToEyeEC), material) ; \n    } \n    gl_FragColor = myColor ;\n}"}},{key:"getVertexShaderSource",value:function(t){return"\n#ifdef GL_ES\n    precision highp float;\n#endif\n\nattribute vec3 position;\nattribute vec2 st;\nattribute vec3 normal;\nuniform mat4 modelViewMatrix;\nuniform mat3 normalMatrix;\nuniform mat4 projectionMatrix;\nvarying vec3 v_position;\nvarying vec3 v_normal;\nvarying vec2 v_st;\n\nvarying vec3 v_light0Direction;\n\nvoid main(void) \n{\n    vec4 pos =  czm_modelView * vec4( position,1.0);\n    v_normal =  normalMatrix *  normal;\n    v_st = st;\n    v_position = pos.xyz;\n    v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n    gl_Position =  projectionMatrix * pos;\n}"}},{key:"createDrawCommand",value:function(t,e,i){var n=e.context,o=new s.Cartesian3();s.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,o);var r=new s.BoundingSphere(o,t.boundingSphere.radius),a=new s.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:s.Pass.TRANSLUCENT,boundingVolume:r}),h=this,l=s.GeometryPipeline.createAttributeLocations(t);return a.vertexArray=s.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:l,bufferUsage:s.BufferUsage.STATIC_DRAW}),a.vertexArray._attributeLocations=l,a.shaderProgram=s.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(t),fragmentShaderSource:this.getFragmentShaderSource(t),attributeLocations:l}),a.renderState=s.RenderState.fromCache({blending:s.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:s.DepthFunction.LESS},cull:{enabled:!1,face:s.CullFace.BACK}}),a.uniformMap={},a.uniformMap.projectionMatrix=function(){return h.viewer.scene.camera.frustum.projectionMatrix},a.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},a.uniformMap.shininess=function(){return h.shininess||(h.shininess=0),h.shininess},a.uniformMap.emission=function(){return h.emission||(h.emission=new s.Cartesian3(.2,.2,.2)),h.emission},a.uniformMap.specular=function(){return h.specular||(h.specular=0),h.specular},a.uniformMap.isLine=function(){return t.primitiveType==s.PrimitiveType.LINES||t.primitiveType==s.PrimitiveType.LINE_STRIP},a.uniformMap.defaultColor=function(){return t.primitiveType==s.PrimitiveType.LINES||t.primitiveType==s.PrimitiveType.LINE_STRIP?(h.defaultLineColor||(h.defaultLineColor=new s.Color(1,1,0,1)),h.defaultLineColor):(h.defaultColor||(h.defaultColor=new s.Color(1,0,0,1)),h.defaultColor)},a.uniformMap.picked=function(){return h.picked||(h.picked=0),h.picked},a.uniformMap.pickedColor=function(){return h.pickedColor||(h.pickedColor=new s.Color(1,1,0,1)),h.pickedColor},a.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},a.uniformMap.glowPower=function(){return.25},a.uniformMap.myColor=function(){return t.color||h.defaultColor},a}},{key:"remove",value:function(){this._show&&(this._show=!1,this.viewer.scene.primitives.remove(this))}},{key:"addToScene",value:function(){this._show||(this._show=!0,this.viewer.scene.primitives.add(this),this.updateGeometry())}},{key:"destroy",value:function(t){t&&(this.viewer.scene.primitives.remove(this),this.hintLines&&this.viewer.entities.remove(this.hintLines),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[])}},{key:"trackedEntity",get:function(){return this._trackedEntity},set:function(t){this._trackedEntity=t}},{key:"color",get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},{key:"lineColor",get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},{key:"show",get:function(){return this._show},set:function(t){t?this.addToScene():this.remove()}},{key:"outline",get:function(){return this._outline},set:function(t){this._outline=t,this.updateGeometry()}},{key:"topShow",get:function(){return this._topShow},set:function(t){this._topShow=t}},{key:"topOutline",get:function(){return this._topOutline},set:function(t){this._topOutline=t,this.updateGeometry()}},{key:"angle",get:function(){return this._angle1},set:function(t){this._angle1=t,this._angle2=t,this.updateGeometry()}},{key:"angle1",get:function(){return this._angle1},set:function(t){this._angle1=t,this.updateGeometry()}},{key:"angle2",get:function(){return this._angle2},set:function(t){this._angle2=t,this.updateGeometry()}},{key:"length",get:function(){return this._length},set:function(t){this._length=t,this.updateGeometry()}},{key:"heading",get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t}},{key:"pitch",get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t}},{key:"roll",get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t}},{key:"position",get:function(){return this._position},set:function(t){this._position=t}}]),t}()},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){var i=t,n=e,o=Math.cos,r=Math.sin;return[o(-i)*o(n),r(-i)*o(n),r(n)]}function a(t,e,i,n){return t+n/i*(e-t)}function s(t,e){var i=e.findIndex(function(e){return e.fov>t});if(i>0){var n=e[i-1],o=e[i],r=(t-n.fov)/(o.fov-n.fov);return n.radius*(1-r)+o.radius*r}}function h(t,e,i,n,o,h,l){for(var u=new Float32Array((o+1)*(h+1)*3),m=0;m<o+1;++m)for(var c=0;c<h+1;++c){var p=a(i,n,h,c),d=r(a(t,e,o,m),p),f=l?s(p,l):1;u[3*(c*(o+1)+m)+0]=d[0]*f,u[3*(c*(o+1)+m)+1]=d[1]*f,u[3*(c*(o+1)+m)+2]=d[2]*f}return u}function l(t,e,i,n,o,h,l){for(var u=new Float32Array((n+1)*(o+1)*3),m=0;m<n+1;++m)for(var c=0;c<o+1;++c){var p=a(e,i,o,c),d=r(t,p),f=h?s(p,h):1,y=l?s(p,l):1,_=a(f,y,n,m);u[3*(c*(n+1)+m)+0]=d[0]*_,u[3*(c*(n+1)+m)+1]=d[1]*_,u[3*(c*(n+1)+m)+2]=d[2]*_}return u}function u(t,e){for(var i=new Uint16Array(t*e*6),n=0;n<t;++n)for(var o=0;o<e;++o){var r=o*(t+1)+n,a=o*(t+1)+n+1,s=(o+1)*(t+1)+n,h=(o+1)*(t+1)+n+1,l=6*(o*t+n);i[l+0]=r,i[l+1]=a,i[l+2]=h,i[l+3]=r,i[l+4]=h,i[l+5]=s}return i}function m(t,e,i,n){for(var o=t*i,r=e*n,a=new Uint16Array((t+1)*(2*r)+(e+1)*(2*o)+8),s=0;s<t+1;++s)for(var h=0;h<r;++h){var l=s*i;a[2*(s*r+h)+0]=h*(o+1)+l,a[2*(s*r+h)+1]=(h+1)*(o+1)+l}for(var u=(t+1)*(2*r),m=0;m<e+1;++m)for(var c=0;c<o;++c){var p=m*n;a[u+2*(c+m*o)+0]=p*(o+1)+c,a[u+2*(c+m*o)+1]=p*(o+1)+c+1}return a}Object.defineProperty(e,"__esModule",{value:!0}),e.CamberRadarPrimitive=void 0;var c=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),p=i(0),d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(p),f=i(13),y=n(f),_=i(14),v=n(_),g=(e.CamberRadarPrimitive=function(){function t(e){o(this,t),this.innerFovRadiusPairs=e.innerFovRadiusPairs,this.outerFovRadiusPairs=e.outerFovRadiusPairs,this.radius=e.radius,this.startRadius=e.startRadius,this.modelMatrix=d.defaultValue(e.modelMatrix,d.Matrix4.IDENTITY),this.startFovH=d.defaultValue(e.startFovH,d.Math.toRadians(-50)),this.endFovH=d.defaultValue(e.endFovH,d.Math.toRadians(50)),this.startFovV=d.defaultValue(e.startFovV,d.Math.toRadians(5)),this.endFovV=d.defaultValue(e.endFovV,d.Math.toRadians(85)),this.segmentH=d.defaultValue(e.segmentH,20),this.segmentV=d.defaultValue(e.segmentV,20),this.subSegmentH=d.defaultValue(e.subSegmentH,3),this.subSegmentV=d.defaultValue(e.subSegmentV,3),this.faceColor=d.defaultValue(e.faceColor,new d.Color(1,1,0,.5)),this.lineColor=d.defaultValue(e.lineColor,new d.Color(1,0,0)),this.show=d.defaultValue(e.show,!0),this._modelMatrix=d.Matrix4.clone(d.Matrix4.IDENTITY),this._startFovH=0,this._endFovH=0,this._startFovV=0,this._endFovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new d.BoundingSphere(),this._initBoundingSphere=void 0,this._command=void 0}return c(t,[{key:"_createOuterCurveCommand",value:function(t){var e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV,n=h(this._startFovH,this._endFovH,this._startFovV,this._endFovV,e,i,this._outerFovRadiusPairs),o=h(this._startFovH,this._endFovH,this._startFovV,this._endFovV,e,i,this._outerFovRadiusPairs),r=u(e,i),a=m(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV);return this._createRawCommand(t,n,o,r,a)}},{key:"_createInnerCurveCommand",value:function(t){var e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV,n=h(this._startFovH,this._endFovH,this._startFovV,this._endFovV,e,i,this._innerFovRadiusPairs),o=h(this._startFovH,this._endFovH,this._startFovV,this._endFovV,e,i,this._innerFovRadiusPairs),r=u(e,i),a=m(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV);return this._createRawCommand(t,n,o,r,a)}},{key:"_createLeftCrossSectionCommand",value:function(t){var e=this._subSegmentV*this._segmentV,i=l(this._startFovH,this._startFovV,this._endFovV,10,e,this._innerFovRadiusPairs,this._outerFovRadiusPairs),n=l(this._startFovH,this._startFovV,this._endFovV,10,e,this._innerFovRadiusPairs,this._outerFovRadiusPairs),o=u(10,e),r=m(10,this._segmentV,1,this._subSegmentV);return this._createRawCommand(t,i,n,o,r)}},{key:"_createRightCrossSectionCommand",value:function(t){var e=this._subSegmentV*this._segmentV,i=l(this._endFovH,this._startFovV,this._endFovV,10,e,this._innerFovRadiusPairs,this._outerFovRadiusPairs),n=l(this._endFovH,this._startFovV,this._endFovV,10,e,this._innerFovRadiusPairs,this._outerFovRadiusPairs),o=u(10,e),r=m(10,this._segmentV,1,this._subSegmentV);return this._createRawCommand(t,i,n,o,r)}},{key:"_createRawCommand",value:function(t,e,i,n,o){var r=this,a=d.Appearance.getDefaultRenderState(!0,!1,void 0),s=d.RenderState.fromCache(a),h=new d.ShaderSource({sources:[v.default]}),l=new d.ShaderSource({sources:[y.default]}),u={xbsjColor:function(){return r.faceColor}},m={xbsjColor:function(){return r.lineColor}},c=d.ShaderProgram.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:l,attributeLocations:g}),p=d.Buffer.createVertexBuffer({context:t,typedArray:e,usage:d.BufferUsage.STATIC_DRAW}),f=d.Buffer.createVertexBuffer({context:t,typedArray:i,usage:d.BufferUsage.STATIC_DRAW}),_=d.Buffer.createIndexBuffer({context:t,typedArray:n,usage:d.BufferUsage.STATIC_DRAW,indexDatatype:d.IndexDatatype.UNSIGNED_SHORT}),C=d.Buffer.createIndexBuffer({context:t,typedArray:o,usage:d.BufferUsage.STATIC_DRAW,indexDatatype:d.IndexDatatype.UNSIGNED_SHORT}),w=new d.VertexArray({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:d.ComponentDatatype.FLOAT},{index:1,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:d.ComponentDatatype.FLOAT}],indexBuffer:_}),x=new d.VertexArray({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:d.ComponentDatatype.FLOAT},{index:1,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:d.ComponentDatatype.FLOAT}],indexBuffer:C}),M=d.BoundingSphere.fromVertices(e);return{command:new d.DrawCommand({vertexArray:w,primitiveType:d.PrimitiveType.TRIANGLES,renderState:s,shaderProgram:c,uniformMap:u,owner:this,pass:d.Pass.TRANSLUCENT,modelMatrix:new d.Matrix4(),boundingVolume:new d.BoundingSphere(),cull:!0}),lineCommand:new d.DrawCommand({vertexArray:x,primitiveType:d.PrimitiveType.LINES,renderState:s,shaderProgram:c,uniformMap:m,owner:this,pass:d.Pass.TRANSLUCENT,modelMatrix:new d.Matrix4(),boundingVolume:new d.BoundingSphere(),cull:!0}),initBoundingSphere:M}}},{key:"update",value:function(t){var e=this;if(this.show){(this.innerFovRadiusPairs!==this._innerFovRadiusPairs||this.outerFovRadiusPairs!==this._outerFovRadiusPairs||this.startFovH!==this._startFovH||this.endFovH!==this._endFovH||this.startFovV!==this._startFovV||this.endFovV!==this._endFovV||this.segmentH!==this._segmentH||this.segmentV!==this._segmentV||this.subSegmentH!==this._subSegmentH||this.subSegmentV!==this._subSegmentV)&&(this._innerFovRadiusPairs=this.innerFovRadiusPairs,this._outerFovRadiusPairs=this.outerFovRadiusPairs,this._startFovH=this.startFovH,this._endFovH=this.endFovH,this._startFovV=this.startFovV,this._endFovV=this.endFovV,this._segmentH=this.segmentH,this._segmentV=this.segmentV,this._subSegmentH=this.subSegmentH,this._subSegmentV=this.subSegmentV,this._modelMatrix=d.clone(d.Matrix4.IDENTITY),this._destroyCommands()),d.defined(this._commands)&&0!==this._commands.length||(this._commands||(this._commands=[]),this._commands.push(this._createOuterCurveCommand(t.context)),this._commands.push(this._createLeftCrossSectionCommand(t.context)),this._commands.push(this._createRightCrossSectionCommand(t.context)),this._commands.push(this._createInnerCurveCommand(t.context))),d.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(d.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._commands.forEach(function(t){t.command.modelMatrix=d.Matrix4.IDENTITY,t.command.modelMatrix=e._modelMatrix,t.command.boundingVolume=d.BoundingSphere.transform(t.initBoundingSphere,e._modelMatrix,e._boundingSphere),t.lineCommand.modelMatrix=d.Matrix4.IDENTITY,t.lineCommand.modelMatrix=e._modelMatrix,t.lineCommand.boundingVolume=d.BoundingSphere.transform(t.initBoundingSphere,e._modelMatrix,e._boundingSphere)})),this._commands.forEach(function(e){e.command&&t.commandList.push(e.command),e.lineCommand&&t.commandList.push(e.lineCommand)})}}},{key:"isDestroyed",value:function(){return!1}},{key:"_destroyCommands",value:function(){this._commands&&this._commands.forEach(function(t){d.defined(t.command)&&(t.command.shaderProgram=t.command.shaderProgram&&t.command.shaderProgram.destroy(),t.command.vertexArray=t.command.vertexArray&&t.command.vertexArray.destroy(),t.command=void 0),d.defined(t.lineCommand)&&(t.lineCommand.shaderProgram=t.lineCommand.shaderProgram&&t.lineCommand.shaderProgram.destroy(),t.lineCommand.vertexArray=t.lineCommand.vertexArray&&t.lineCommand.vertexArray.destroy(),t.lineCommand=void 0)}),this._commands&&(this._commands.length=0)}},{key:"destroy",value:function(){return this._destroyCommands(),d.destroyObject(this)}},{key:"startRadius",get:function(){return this._startRadius},set:function(t){this._startRadius=t,this.innerFovRadiusPairs=[{fov:d.Math.toRadians(0),radius:t},{fov:d.Math.toRadians(10),radius:.9*t},{fov:d.Math.toRadians(20),radius:.8*t},{fov:d.Math.toRadians(30),radius:.7*t},{fov:d.Math.toRadians(40),radius:.6*t},{fov:d.Math.toRadians(50),radius:.5*t},{fov:d.Math.toRadians(60),radius:.4*t},{fov:d.Math.toRadians(70),radius:.3*t},{fov:d.Math.toRadians(80),radius:.1*t},{fov:d.Math.toRadians(90),radius:.01*t}]}},{key:"radius",get:function(){return this._radius},set:function(t){this._radius=t,this.outerFovRadiusPairs=[{fov:d.Math.toRadians(0),radius:t},{fov:d.Math.toRadians(10),radius:.9*t},{fov:d.Math.toRadians(20),radius:.8*t},{fov:d.Math.toRadians(30),radius:.7*t},{fov:d.Math.toRadians(40),radius:.6*t},{fov:d.Math.toRadians(50),radius:.5*t},{fov:d.Math.toRadians(60),radius:.4*t},{fov:d.Math.toRadians(70),radius:.3*t},{fov:d.Math.toRadians(80),radius:.1*t},{fov:d.Math.toRadians(90),radius:.01*t}]}}]),t}(),{position:0,normal:1})},function(t,e){t.exports="varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\n// varying vec2 v_st;\r\n\r\n// uniform sampler2D myImage;\r\nuniform vec4 xbsjColor;\r\n\r\nvoid main()\r\n{\r\n    vec3 positionToEyeEC = -v_positionEC;\r\n\r\n    vec3 normalEC = normalize(v_normalEC);\r\n    #ifdef FACE_FORWARD\r\n        normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n    #endif\r\n\r\n    czm_materialInput materialInput;\r\n    materialInput.normalEC = normalEC;\r\n    materialInput.positionToEyeEC = positionToEyeEC;\r\n    // materialInput.st = v_st;\r\n\r\n    //czm_material material = czm_getMaterial(materialInput);\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    // material.diffuse = texture2D(myImage, materialInput.st).rgb;\r\n    material.diffuse = xbsjColor.rgb;\r\n    material.alpha = xbsjColor.a;\r\n\r\n    #ifdef FLAT\r\n        gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n    #else\r\n        gl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n    #endif\r\n}"},function(t,e){t.exports="// muyao 使用double类型的position进行计算\r\n// attribute vec3 position3DHigh;\r\n// attribute vec3 position3DLow;\r\nattribute vec3 position;\r\nattribute vec3 normal;\r\n// attribute vec2 st;\r\n// attribute float batchId;\r\n\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\n// varying vec2 v_st;\r\n\r\nvoid main()\r\n{\r\n    // muyao 使用double类型的position进行计算\r\n    // vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\r\n    // v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\r\n    // v_normalEC = czm_normal * normal;                         // normal in eye coordinates\r\n    // v_st = st;\r\n    // gl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n\r\n    v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;       // position in eye coordinates\r\n    v_normalEC = czm_normal * normal;                               // normal in eye coordinates\r\n    // v_st = st;\r\n    gl_Position = czm_modelViewProjection * vec4(position, 1.0);\r\n}"}])});