cesium_dev_kit 1.0.56 → 1.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ class Controller {
54
54
  init({
55
55
  containerId,
56
56
  viewerConfig,
57
- extreaConfig,
57
+ extraConfig,
58
58
  MapImageryList
59
59
  }) {
60
60
  const mapID = containerId;
@@ -103,13 +103,13 @@ class Controller {
103
103
 
104
104
  vConfig = Object.assign(vConfig, viewerConfig); // 后台接口配置 融合替换 默认配置
105
105
  const viewer = new Cesium$1.Viewer(mapID, vConfig);
106
- if (!extreaConfig['logo']) {
106
+ if (!extraConfig['logo']) {
107
107
  const cC = viewer.cesiumWidget.creditContainer;
108
108
  cC.style.display = 'none'; // 影藏logo
109
109
  }
110
110
 
111
111
  // 是否开启深度参数
112
- if (extreaConfig['depthTest']) {
112
+ if (extraConfig['depthTest']) {
113
113
  // 设置开启深度检测
114
114
  viewer.scene.globe.depthTestAgainstTerrain = true;
115
115
  }
@@ -1709,6 +1709,7 @@ Shaders.prototype = {
1709
1709
  uniform vec4 u_scanCenterEC;\n\
1710
1710
  uniform vec3 u_scanPlaneNormalEC;\n\
1711
1711
  uniform vec3 u_scanLineNormalEC;\n\
1712
+ out vec4 myOutputColor;\n\
1712
1713
  uniform float u_radius;\n\
1713
1714
  uniform vec4 u_scanColor;\n\
1714
1715
  \n\
@@ -1747,7 +1748,7 @@ Shaders.prototype = {
1747
1748
  }\n\
1748
1749
  \n\
1749
1750
  void main(){\n\
1750
- gl_FragColor = texture(colorTexture, v_textureCoordinates);\n\
1751
+ myOutputColor = texture(colorTexture, v_textureCoordinates);\n\
1751
1752
  float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n\
1752
1753
  vec4 viewPos = toEye(v_textureCoordinates, depth);\n\
1753
1754
  vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n\
@@ -1764,9 +1765,9 @@ Shaders.prototype = {
1764
1765
  f = pow(f, float(' + options.width + '));\n\
1765
1766
  }\n\
1766
1767
  if(float(' + options.border + ') > 0.0){\n\
1767
- gl_FragColor = mix(gl_FragColor, u_scanColor, f + f0);\n\
1768
+ myOutputColor = mix(myOutputColor, u_scanColor, f + f0);\n\
1768
1769
  } else {\n\
1769
- gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n\
1770
+ myOutputColor = mix(myOutputColor, u_scanColor, f);\n\
1770
1771
  }\n\
1771
1772
  }\n\
1772
1773
  }\n\
@@ -1782,6 +1783,7 @@ Shaders.prototype = {
1782
1783
  uniform vec4 u_scanCenterEC;\n\
1783
1784
  uniform vec3 u_scanPlaneNormalEC;\n\
1784
1785
  uniform float u_radius;\n\
1786
+ out vec4 myOutputColor;\n\
1785
1787
  uniform vec4 u_scanColor;\n\
1786
1788
  \n\
1787
1789
  vec4 toEye(in vec2 uv, in float depth){\n\
@@ -1806,7 +1808,7 @@ Shaders.prototype = {
1806
1808
  }\n\
1807
1809
  \n\
1808
1810
  void main(){\n\
1809
- gl_FragColor = texture(colorTexture, v_textureCoordinates);\n\
1811
+ myOutputColor = texture(colorTexture, v_textureCoordinates);\n\
1810
1812
  float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n\
1811
1813
  vec4 viewPos = toEye(v_textureCoordinates, depth);\n\
1812
1814
  vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n\
@@ -1814,7 +1816,7 @@ Shaders.prototype = {
1814
1816
  if(dis < u_radius){\n\
1815
1817
  float f = 1.0 - abs(u_radius - dis) / u_radius;\n\
1816
1818
  f = pow(f, float(' + options.border + '));\n\
1817
- gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n\
1819
+ myOutputColor = mix(myOutputColor, u_scanColor, f);\n\
1818
1820
  }\n\
1819
1821
  }\n\
1820
1822
  ';
@@ -1940,7 +1942,7 @@ Base.prototype = {
1940
1942
  //黑夜特效
1941
1943
  setDarkEffect: function (options) {
1942
1944
  options = options || {};
1943
- var fs = 'uniform sampler2D colorTexture;\n' + 'in vec2 v_textureCoordinates;\n' + 'uniform float scale;\n' + 'uniform vec3 offset;\n' + 'void main() {\n' + ' // vec4 color = texture(colorTexture, v_textureCoordinates);\n' + ' vec4 color = texture(colorTexture, v_textureCoordinates);\n' + ' // float gray = 0.2989*color.r+0.5870*color.g+0.1140*color.b;\n' + ' // gl_FragColor = vec4(gray,gray,2.0*(gray+1.0), 1.0);\n' + ' gl_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n' + '}\n';
1945
+ var fs = 'uniform sampler2D colorTexture;\n' + 'out vec4 myOutputColor;\n' + 'in vec2 v_textureCoordinates;\n' + 'uniform float scale;\n' + 'uniform vec3 offset;\n' + 'void main() {\n' + ' // vec4 color = texture(colorTexture, v_textureCoordinates);\n' + ' vec4 color = texture(colorTexture, v_textureCoordinates);\n' + ' // float gray = 0.2989*color.r+0.5870*color.g+0.1140*color.b;\n' + ' // gl_FragColor = vec4(gray,gray,2.0*(gray+1.0), 1.0);\n' + ' myOutputColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n' + '}\n';
1944
1946
  return this._viewer.scene.postProcessStages.add(new Cesium$4.PostProcessStage({
1945
1947
  name: 'darkEffect',
1946
1948
  fragmentShader: fs,
@@ -1955,7 +1957,7 @@ Base.prototype = {
1955
1957
  // 场景蓝光
1956
1958
  setBlurBloom: function (options) {
1957
1959
  if (this._viewer && options) {
1958
- var fs = 'uniform float height;\n' + 'uniform float width;\n' + 'uniform sampler2D colorTexture1;\n' + '\n' + 'in vec2 v_textureCoordinates;\n' + '\n' + 'const int SAMPLES = 9;\n' + 'void main()\n' + '{\n' + 'vec2 st = v_textureCoordinates;\n' + 'float wr = float(1.0 / width);\n' + 'float hr = float(1.0 / height);\n' + 'vec4 result = vec4(0.0);\n' + 'int count = 0;\n' + 'for(int i = -SAMPLES; i <= SAMPLES; ++i){\n' + 'for(int j = -SAMPLES; j <= SAMPLES; ++j){\n' + 'vec2 offset = vec2(float(i) * wr, float(j) * hr);\n' + 'result += texture(colorTexture1, st + offset);\n' + '}\n' + '}\n' + 'result = result / float(count);\n' + 'gl_FragColor = result;\n' + '}\n';
1960
+ var fs = 'uniform float height;\n' + 'uniform float width;\n' + 'out vec4 myOutputColor;\n' + 'uniform sampler2D colorTexture1;\n' + '\n' + 'in vec2 v_textureCoordinates;\n' + '\n' + 'const int SAMPLES = 9;\n' + 'void main()\n' + '{\n' + 'vec2 st = v_textureCoordinates;\n' + 'float wr = float(1.0 / width);\n' + 'float hr = float(1.0 / height);\n' + 'vec4 result = vec4(0.0);\n' + 'int count = 0;\n' + 'for(int i = -SAMPLES; i <= SAMPLES; ++i){\n' + 'for(int j = -SAMPLES; j <= SAMPLES; ++j){\n' + 'vec2 offset = vec2(float(i) * wr, float(j) * hr);\n' + 'result += texture(colorTexture1, st + offset);\n' + '}\n' + '}\n' + 'result = result / float(count);\n' + 'gmyOutputColor = result;\n' + '}\n';
1959
1961
  return this._viewer.scene.postProcessStages.add(new Cesium$4.PostProcessStage({
1960
1962
  name: 'blur_x_direction',
1961
1963
  fragmentShader: fs,
@@ -1971,6 +1973,7 @@ Base.prototype = {
1971
1973
  setRainEffect: function () {
1972
1974
  if (this._viewer) {
1973
1975
  var fs = 'uniform sampler2D colorTexture;\n\
1976
+ out vec4 myOutputColor;\n\
1974
1977
  in vec2 v_textureCoordinates;\n\
1975
1978
  \n\
1976
1979
  float hash(float x){\n\
@@ -1989,7 +1992,7 @@ Base.prototype = {
1989
1992
  float v=1.-sin(hash(floor(uv.x*100.))*2.);\n\
1990
1993
  float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n\
1991
1994
  c*=v*b;\n\
1992
- gl_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n\
1995
+ myOutputColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n\
1993
1996
  }\n\
1994
1997
  ';
1995
1998
  return this._viewer.scene.postProcessStages.add(new Cesium$4.PostProcessStage({
@@ -2003,6 +2006,7 @@ Base.prototype = {
2003
2006
  if (this._viewer) {
2004
2007
  var fs = 'uniform sampler2D colorTexture;\n\
2005
2008
  in vec2 v_textureCoordinates;\n\
2009
+ out vec4 myOutputColor;\n\
2006
2010
  \n\
2007
2011
  float snow(vec2 uv,float scale){\n\
2008
2012
  float time = czm_frameNumber / 60.0;\n\
@@ -2034,7 +2038,7 @@ Base.prototype = {
2034
2038
  c+=snow(uv,6.);\n\
2035
2039
  c+=snow(uv,5.);\n\
2036
2040
  finalColor=(vec3(c));\n\
2037
- gl_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n\
2041
+ myOutputColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n\
2038
2042
  \n\
2039
2043
  }\n\
2040
2044
  ';
@@ -2047,7 +2051,7 @@ Base.prototype = {
2047
2051
  // 雾天
2048
2052
  setFogEffect: function () {
2049
2053
  if (this._viewer) {
2050
- var fs = 'float getDistance(sampler2D depthTexture, vec2 texCoords) \n' + '{ \n' + ' float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n' + ' if (depth == 0.0) { \n' + ' return czm_infinity; \n' + ' } \n' + ' vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n' + ' return -eyeCoordinate.z / eyeCoordinate.w; \n' + '} \n' + 'float interpolateByDistance(vec4 nearFarScalar, float distance) \n' + '{ \n' + ' float startDistance = nearFarScalar.x; \n' + ' float startValue = nearFarScalar.y; \n' + ' float endDistance = nearFarScalar.z; \n' + ' float endValue = nearFarScalar.w; \n' + ' float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n' + ' return mix(startValue, endValue, t); \n' + '} \n' + 'vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n' + '{ \n' + ' return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n' + '} \n' + 'uniform sampler2D colorTexture; \n' + 'uniform sampler2D depthTexture; \n' + 'uniform vec4 fogByDistance; \n' + 'uniform vec4 fogColor; \n' + 'in vec2 v_textureCoordinates; \n' + 'void main(void) \n' + '{ \n' + ' float distance = getDistance(depthTexture, v_textureCoordinates); \n' + ' vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n' + ' float blendAmount = interpolateByDistance(fogByDistance, distance); \n' + ' vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n' + ' gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n' + '} \n';
2054
+ var fs = 'float getDistance(sampler2D depthTexture, vec2 texCoords) \n' + '{ \n' + ' float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n' + ' if (depth == 0.0) { \n' + ' return czm_infinity; \n' + ' } \n' + ' vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n' + ' return -eyeCoordinate.z / eyeCoordinate.w; \n' + '} \n' + 'float interpolateByDistance(vec4 nearFarScalar, float distance) \n' + '{ \n' + ' float startDistance = nearFarScalar.x; \n' + ' float startValue = nearFarScalar.y; \n' + ' float endDistance = nearFarScalar.z; \n' + ' float endValue = nearFarScalar.w; \n' + ' float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n' + ' return mix(startValue, endValue, t); \n' + '} \n' + 'vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n' + '{ \n' + ' return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n' + '} \n' + 'uniform sampler2D colorTexture; \n' + 'uniform sampler2D depthTexture; \n' + 'uniform vec4 fogByDistance; \n' + 'uniform vec4 fogColor; \n' + 'in vec2 v_textureCoordinates; \n' + 'out vec4 myOutputColor;\n' + 'void main(void) \n' + '{ \n' + ' float distance = getDistance(depthTexture, v_textureCoordinates); \n' + ' vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n' + ' float blendAmount = interpolateByDistance(fogByDistance, distance); \n' + ' vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n' + ' myOutputColor = alphaBlend(finalFogColor, sceneColor); \n' + '} \n';
2051
2055
  return this._viewer.scene.postProcessStages.add(new Cesium$4.PostProcessStage({
2052
2056
  fragmentShader: fs,
2053
2057
  uniforms: {
@@ -2636,11 +2640,12 @@ Base.prototype = {
2636
2640
  ShaderSource = Cesium$4.ShaderSource;
2637
2641
  //片元着色器,直接从源码复制
2638
2642
  var SkyBoxFS = 'uniform samplerCube u_cubeMap;\n\
2643
+ out vec4 myOutputColor;\n\
2639
2644
  in vec3 v_texCoord;\n\
2640
2645
  void main()\n\
2641
2646
  {\n\
2642
2647
  vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n\
2643
- gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n\
2648
+ myOutputColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n\
2644
2649
  }\n\
2645
2650
  ';
2646
2651
 
@@ -3244,7 +3249,7 @@ Math3d.prototype = {
3244
3249
  result.push(ellipsoid.cartesianToCartographic(updatedPositions[j]));
3245
3250
  }
3246
3251
  callback(result);
3247
- }).otherwise(function (error) {
3252
+ }).catch(function (error) {
3248
3253
  console.log(error);
3249
3254
  });
3250
3255
  }
@@ -3479,6 +3484,7 @@ Primitive.prototype = {
3479
3484
  Pass = Cesium$6.Pass,
3480
3485
  Appearance = Cesium$6.Appearance,
3481
3486
  BufferUsage = Cesium$6.BufferUsage,
3487
+ VertexLayout = Cesium$6.VertexLayout,
3482
3488
  Color = Cesium$6.Color,
3483
3489
  VertexArray = Cesium$6.VertexArray,
3484
3490
  buildModuleUrl = Cesium$6.buildModuleUrl,
@@ -3505,7 +3511,7 @@ Primitive.prototype = {
3505
3511
  this._color = defaultValue(options.color, new Color(1.0, 1.0, 0.0, 0.8));
3506
3512
  this._scale = defaultValue(options.scale, new Cartesian3(10, 10, 15));
3507
3513
  this._texture = undefined;
3508
- this._imageUrl = buildModuleUrl(defaultStatic);
3514
+ this._imageUrl = defaultStatic;
3509
3515
  this._modelMatrix = computeModelMatrix(this);
3510
3516
  this._height = computeHeight(this);
3511
3517
  createTexture(this);
@@ -3704,7 +3710,7 @@ Primitive.prototype = {
3704
3710
 
3705
3711
  //创建顶点着色器
3706
3712
  const creaateVertexShader = function () {
3707
- var vertexShader = `
3713
+ var vertexShader = `#version 300 es
3708
3714
  in vec3 position;
3709
3715
  in vec3 normal;
3710
3716
  in vec2 st;
@@ -3715,10 +3721,10 @@ Primitive.prototype = {
3715
3721
  out vec4 v_pickColor;
3716
3722
  void main()
3717
3723
  {
3718
- v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz; // position in eye coordinates
3719
- v_normalEC = czm_normal * normal; // normal in eye coordinates
3724
+ v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;
3725
+ v_normalEC = czm_normal * normal;
3720
3726
  v_st = st;
3721
- //v_pickColor = czm_batchTable_pickColor(batchId);
3727
+ // v_pickColor = czm_batchTable_pickColor(batchId);
3722
3728
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
3723
3729
  }
3724
3730
  `;
@@ -3727,13 +3733,14 @@ Primitive.prototype = {
3727
3733
 
3728
3734
  //创建片源着色器
3729
3735
  const createFragmentShader = function () {
3730
- var fragmentShader = `
3731
- in vec3 v_positionEC;
3732
- in vec3 v_normalEC;
3733
- in vec2 v_st;
3734
- uniform vec4 color;
3735
- in vec4 v_pickColor;
3736
- uniform sampler2D myImage;
3736
+ var fragmentShader = `#version 300 es
3737
+ in vec3 v_positionEC;
3738
+ in vec3 v_normalEC;
3739
+ in vec2 v_st;
3740
+ layout(location=2) out vec4 my_fragColor;
3741
+ uniform vec4 color;
3742
+ in vec4 v_pickColor;
3743
+ uniform sampler2D myImage;
3737
3744
  void main()
3738
3745
  {
3739
3746
  vec3 positionToEyeEC = -v_positionEC;
@@ -3751,12 +3758,12 @@ Primitive.prototype = {
3751
3758
  float dt_a12 = sin(dt_a11);
3752
3759
  float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;
3753
3760
  vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));
3754
- material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4 ;
3761
+ material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;
3755
3762
  material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);
3756
3763
  #ifdef FLAT
3757
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
3764
+ my_fragColor = vec4(material.diffuse + material.emission, material.alpha);
3758
3765
  #else
3759
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
3766
+ my_fragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
3760
3767
  #endif
3761
3768
  }
3762
3769
  `;
@@ -3822,10 +3829,10 @@ Primitive.prototype = {
3822
3829
  this._handler = new Cesium$6.ScreenSpaceEventHandler(this._viewer.scene.canvas);
3823
3830
  this._xyzState = false;
3824
3831
  this._xyzPid = undefined;
3825
- this._build();
3832
+ this._builds();
3826
3833
  }
3827
3834
  XyzAxisPrimitive.prototype = {
3828
- _build() {
3835
+ _builds() {
3829
3836
  this._createAxisXYZ();
3830
3837
  this._bindHandler();
3831
3838
  },
@@ -4096,9 +4103,10 @@ Primitive.prototype = {
4096
4103
  }\n\
4097
4104
  ';
4098
4105
  const ViewshedLineFS = 'uniform vec4 u_bgColor;\n\
4106
+ out vec4 myOutputColor;\n\
4099
4107
  void main()\n\
4100
4108
  {\n\
4101
- gl_FragColor = u_bgColor;\n\
4109
+ myOutputColor = u_bgColor;\n\
4102
4110
  }\n\
4103
4111
  ';
4104
4112
  function ShadowPrimitive(options) {
@@ -4468,7 +4476,7 @@ Primitive.prototype = {
4468
4476
  }));
4469
4477
  },
4470
4478
  getVSPolylie: function () {
4471
- return 'in vec3 position3DHigh;\
4479
+ return 'in vec3 position3DHigh; \
4472
4480
  in vec3 position3DLow;\
4473
4481
  in vec4 color;\
4474
4482
  out vec4 v_color;\
@@ -4484,12 +4492,13 @@ Primitive.prototype = {
4484
4492
  ';
4485
4493
  },
4486
4494
  getFSPolyline: function () {
4487
- return 'in vec4 v_color;\
4495
+ return 'in vec4 v_color; \
4496
+ layout(location=2) out vec4 myOutputColor;\
4488
4497
  void main()\
4489
4498
  {\
4490
4499
  float d = distance(gl_PointCoord, vec2(0.5,0.5));\
4491
4500
  if(d < 0.5){\
4492
- gl_FragColor = v_color;\
4501
+ myOutputColor = v_color;\
4493
4502
  }else{\
4494
4503
  discard;\
4495
4504
  }\
@@ -4680,6 +4689,7 @@ Primitive.prototype = {
4680
4689
  WaterPrimitive.prototype.getFS = function () {
4681
4690
  return 'in vec3 v_positionMC;\n\
4682
4691
  in vec3 v_positionEC;\n\
4692
+ out vec4 myOutputColor;\n\
4683
4693
  in vec2 v_st;\n\
4684
4694
  \n\
4685
4695
  void main()\n\
@@ -4698,10 +4708,10 @@ Primitive.prototype = {
4698
4708
  materialInput.positionToEyeEC = positionToEyeEC;\n\
4699
4709
  czm_material material = czm_getMaterial(materialInput);\n\
4700
4710
  #ifdef FLAT\n\
4701
- gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n\
4711
+ myOutputColor = vec4(material.diffuse + material.emission, material.alpha);\n\
4702
4712
  #else\n\
4703
- gl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n\
4704
- gl_FragColor.a = 0.5;\n\
4713
+ myOutputColor = czm_phong(normalize(positionToEyeEC), material);\n\
4714
+ myOutputColor.a = 0.5;\n\
4705
4715
  #endif\n\
4706
4716
  }\n\
4707
4717
  ';
@@ -4837,13 +4847,14 @@ Primitive.prototype = {
4837
4847
  };
4838
4848
  TexturePrimitive.prototype.getFS = function () {
4839
4849
  return 'in vec2 v_st;\
4850
+ out vec4 myOutputColor;\
4840
4851
  void main()\
4841
4852
  {\
4842
4853
  czm_materialInput materialInput;\
4843
4854
  czm_material material=czm_getMaterial(materialInput,v_st);\
4844
4855
  vec4 color=vec4(material.diffuse + material.emission,material.alpha);\
4845
4856
  if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0);\
4846
- gl_FragColor =color;\
4857
+ myOutputColor =color;\
4847
4858
  }\
4848
4859
  ';
4849
4860
  };
@@ -11309,10 +11320,11 @@ Plugin.prototype = {
11309
11320
  //片元着色器,直接从源码复制
11310
11321
  var SkyBoxFS = 'uniform samplerCube u_cubeMap;\n\
11311
11322
  in vec3 v_texCoord;\n\
11323
+ out vec4 myOutputColor;\n\
11312
11324
  void main()\n\
11313
11325
  {\n\
11314
11326
  vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n\
11315
- gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n\
11327
+ myOutputColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n\
11316
11328
  }\n\
11317
11329
  ';
11318
11330
 
@@ -13555,6 +13567,665 @@ function getCatesian3FromPX$2(px, viewer) {
13555
13567
  return cartesian;
13556
13568
  }
13557
13569
 
13570
+ let Cesium$i = null;
13571
+ /**
13572
+ * 外部插件模块
13573
+ * @param {*} viewer
13574
+ */
13575
+ function RadarPlugin(viewer, cesiumGlobal, defaultStatic) {
13576
+ if (viewer) {
13577
+ this._viewer = viewer;
13578
+ Cesium$i = cesiumGlobal;
13579
+ this._installPlugin();
13580
+ }
13581
+ }
13582
+ RadarPlugin.prototype = {
13583
+ // 安装插件
13584
+ _installPlugin: function () {
13585
+ this._installCounputeVertex();
13586
+ this._installCylinderGeometry();
13587
+ this._installRadarPrimitive();
13588
+ },
13589
+ _installCylinderGeometry: function () {
13590
+ function n(t) {
13591
+ this.length = t.length, this.topRadius = t.topRadius, this.bottomRadius = t.bottomRadius, this.slices = t.slices ? t.slices : 64, this.zReverse = t.zReverse;
13592
+ }
13593
+ var s = new Cesium$i.Cartesian2(),
13594
+ u = new Cesium$i.Cartesian3(),
13595
+ l = new Cesium$i.Ray();
13596
+ n._createGeometry = function (t) {
13597
+ var e = t.length,
13598
+ i = t.topRadius,
13599
+ n = t.bottomRadius,
13600
+ r = t.slices,
13601
+ a = 2 * Math.PI / (r - 1),
13602
+ u = t.zReverse,
13603
+ l = [],
13604
+ h = [],
13605
+ d = [],
13606
+ m = [],
13607
+ f = [n, i],
13608
+ p = [0, u ? -e : e],
13609
+ c = 0,
13610
+ _ = Math.atan2(n - i, e),
13611
+ g = s;
13612
+ g.z = Math.sin(_);
13613
+ for (var v = Math.cos(_), y = 0; y < p.length; y++) {
13614
+ m[y] = [];
13615
+ for (var C = f[y], w = 0; w < r; w++) {
13616
+ m[y].push(c++);
13617
+ var x = a * w,
13618
+ A = C * Math.cos(x),
13619
+ b = C * Math.sin(x);
13620
+ l.push(A, b, p[y]), A = v * Math.cos(x), b = v * Math.sin(x), h.push(A, b, g.z), d.push(y / (p.length - 1), 0);
13621
+ }
13622
+ }
13623
+ for (var M = [], y = 1; y < p.length; y++) for (var w = 1; w < r; w++) {
13624
+ var P = m[y - 1][w - 1],
13625
+ S = m[y][w - 1],
13626
+ F = m[y][w],
13627
+ E = m[y - 1][w];
13628
+ M.push(F), M.push(E), M.push(P), M.push(F), M.push(P), M.push(S), w == m[y].length - 1 && (P = m[y - 1][w], S = m[y][w], F = m[y][0], E = m[y - 1][0], M.push(F), M.push(E), M.push(P), M.push(F), M.push(P), M.push(S));
13629
+ }
13630
+ M = new Int16Array(M), l = new Float32Array(l), h = new Float32Array(h), d = new Float32Array(d);
13631
+ var T = {
13632
+ position: new Cesium$i.GeometryAttribute({
13633
+ componentDatatype: Cesium$i.ComponentDatatype.DOUBLE,
13634
+ componentsPerAttribute: 3,
13635
+ values: l
13636
+ }),
13637
+ normal: new Cesium$i.GeometryAttribute({
13638
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13639
+ componentsPerAttribute: 3,
13640
+ values: h
13641
+ }),
13642
+ st: new Cesium$i.GeometryAttribute({
13643
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13644
+ componentsPerAttribute: 2,
13645
+ values: d
13646
+ })
13647
+ },
13648
+ R = Cesium$i.BoundingSphere.fromVertices(l),
13649
+ G = new Cesium$i.Geometry({
13650
+ attributes: T,
13651
+ indices: M,
13652
+ primitiveType: Cesium$i.PrimitiveType.TRIANGLES,
13653
+ boundingSphere: R
13654
+ });
13655
+ return l = [], M = [], d = [], G;
13656
+ };
13657
+ n.createGeometry = function (t, e) {
13658
+ if (!e) return n._createGeometry(t);
13659
+ Cesium$i.Matrix4.multiplyByPoint(e, Cesium$i.Cartesian3.ZERO, u), u.clone(l.origin);
13660
+ var i = t.length,
13661
+ r = t.topRadius,
13662
+ s = (t.bottomRadius, t.slices),
13663
+ h = 2 * Math.PI / (s - 1),
13664
+ d = t.zReverse,
13665
+ m = [],
13666
+ f = [],
13667
+ p = [],
13668
+ c = [],
13669
+ _ = [0, d ? -i : i],
13670
+ g = 0,
13671
+ g = 0;
13672
+ m.push(0, 0, 0), f.push(1, 1), g++;
13673
+ for (var v = new Cesium$i.Cartesian3(), y = r / 15, C = 0; C < 16; C++) {
13674
+ for (var w = y * C, x = [], A = 0; A < s; A++) {
13675
+ var b = h * A,
13676
+ M = w * Math.cos(b),
13677
+ P = w * Math.sin(b);
13678
+ v.x = M, v.y = P, v.z = _[1];
13679
+ var S = (0, Cesium$i.Scene.extend2Earth)(v, e, l);
13680
+ S ? (x.push(g), m.push(M, P, _[1]), f.push(C / 15, 1), g++) : (S = u, x.push(-1));
13681
+ }
13682
+ c.push(x);
13683
+ }
13684
+ for (var F, E, T = [0, c.length - 1], R = 0; R < T.length; R++) for (var C = T[R], A = 1; A < c[C].length; A++) F = c[C][A - 1], E = c[C][A], F >= 0 && E >= 0 && p.push(0, F, E);
13685
+ m = new Float32Array(m), p = new Int32Array(p), f = new Float32Array(f);
13686
+ var G = {
13687
+ position: new Cesium$i.GeometryAttribute({
13688
+ componentDatatype: Cesium$i.ComponentDatatype.DOUBLE,
13689
+ componentsPerAttribute: 3,
13690
+ values: m
13691
+ }),
13692
+ st: new Cesium$i.GeometryAttribute({
13693
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13694
+ componentsPerAttribute: 2,
13695
+ values: f
13696
+ })
13697
+ },
13698
+ V = Cesium$i.BoundingSphere.fromVertices(m),
13699
+ D = new Cesium$i.Geometry({
13700
+ attributes: G,
13701
+ indices: p,
13702
+ primitiveType: Cesium$i.PrimitiveType.TRIANGLES,
13703
+ boundingSphere: V
13704
+ });
13705
+ return (0, Cesium$i.Scene.computeVertexNormals)(D), m = [], p = [], D;
13706
+ };
13707
+ n.createOutlineGeometry = function (t) {
13708
+ var e = t.length,
13709
+ i = t.topRadius,
13710
+ n = t.bottomRadius,
13711
+ r = t.slices,
13712
+ a = 2 * Math.PI / (r - 1),
13713
+ u = t.zReverse,
13714
+ l = [],
13715
+ h = [],
13716
+ d = [],
13717
+ m = [],
13718
+ f = [n, i],
13719
+ p = [0, u ? -e : e],
13720
+ c = 0,
13721
+ _ = Math.atan2(n - i, e),
13722
+ g = s;
13723
+ g.z = Math.sin(_);
13724
+ for (var v = Math.cos(_), y = 0; y < p.length; y++) {
13725
+ m[y] = [];
13726
+ for (var C = f[y], w = 0; w < r; w++) {
13727
+ m[y].push(c++);
13728
+ var x = a * w,
13729
+ A = C * Math.cos(x),
13730
+ b = C * Math.sin(x);
13731
+ l.push(A, b, p[y]), A = v * Math.cos(x), b = v * Math.sin(x), h.push(A, b, g.z), d.push(y / (p.length - 1), 0);
13732
+ }
13733
+ }
13734
+ for (var M = [], y = 1; y < p.length; y++) for (var w = 1; w < r; w += 1) {
13735
+ var P = m[y - 1][w - 1],
13736
+ S = m[y][w - 1];
13737
+ m[y][w], m[y - 1][w];
13738
+ w % 8 == 1 && M.push(P, S);
13739
+ }
13740
+ M = new Int16Array(M), l = new Float32Array(l), h = new Float32Array(h), d = new Float32Array(d);
13741
+ var F = {
13742
+ position: new Cesium$i.GeometryAttribute({
13743
+ componentDatatype: Cesium$i.ComponentDatatype.DOUBLE,
13744
+ componentsPerAttribute: 3,
13745
+ values: l
13746
+ }),
13747
+ normal: new Cesium$i.GeometryAttribute({
13748
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13749
+ componentsPerAttribute: 3,
13750
+ values: h
13751
+ }),
13752
+ st: new Cesium$i.GeometryAttribute({
13753
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13754
+ componentsPerAttribute: 2,
13755
+ values: d
13756
+ })
13757
+ },
13758
+ E = Cesium$i.BoundingSphere.fromVertices(l),
13759
+ T = new Cesium$i.Geometry({
13760
+ attributes: F,
13761
+ indices: M,
13762
+ primitiveType: Cesium$i.PrimitiveType.LINES,
13763
+ boundingSphere: E
13764
+ });
13765
+ return l = [], M = [], d = [], T;
13766
+ };
13767
+ n.fromAngleAndLength = function (t, e, i) {
13768
+ return t = Cesium$i.Math.toRadians(t), new n({
13769
+ topRadius: Math.tan(t) * e / 2,
13770
+ bottomRadius: 0,
13771
+ length: e,
13772
+ zReverse: i
13773
+ });
13774
+ };
13775
+ Cesium$i.Scene.CylinderGeometry = n;
13776
+ },
13777
+ /**
13778
+ * 相控雷达
13779
+ */
13780
+ _installRadarPrimitive: function () {
13781
+ var r;
13782
+ function n(t, e) {
13783
+ e = e || {}, r = t.scene.globe.ellipsoid, this._geometry = null, this._angle = e.angle, this._radius = e.radius ? e.radius : 5, this._position = e.position, this._rotation = e.rotation ? e.rotation : {
13784
+ heading: 0,
13785
+ pitch: 0,
13786
+ roll: 0
13787
+ }, this._trackedEntity = e.trackedEntity, this.defaultColor = e.color ? e.color : Cesium$i.Color.YELLOW, this.defaultLineColor = e.lineColor ? e.lineColor : this.defaultColor, this._show = Cesium$i.defaultValue(e.show, !0), this._outline = Cesium$i.defaultValue(e.outline, !1), this._topShow = Cesium$i.defaultValue(e.top, !0), this._topOutline = Cesium$i.defaultValue(e.topOutline, !0), this._modelMatrix = Cesium$i.Matrix4.clone(Cesium$i.Matrix4.IDENTITY), this._quaternion = new Cesium$i.Quaternion(), this._translation = new Cesium$i.Cartesian3(), this._scale = new Cesium$i.Cartesian3(1, 1, 1), this._matrix = new Cesium$i.Matrix4(), this._inverseMatrix = new Cesium$i.Matrix4(), this._positionCartographic = new Cesium$i.Cartographic(), this._positionCartesian = null, this._drawCommands = [], this._outlinePositions = [], this.viewer = t, this.viewer.scene.primitives.add(this), this.updateGeometry(), this._groundArea = Cesium$i.defaultValue(e.groundArea, !1), this.addGroundAreaEntity(this._groundArea);
13788
+ }
13789
+ Object.defineProperties(n.prototype, {
13790
+ trackedEntity: {
13791
+ get: function () {
13792
+ return this._trackedEntity;
13793
+ },
13794
+ set: function (t) {
13795
+ this._trackedEntity = t;
13796
+ }
13797
+ },
13798
+ color: {
13799
+ get: function () {
13800
+ return this.defaultColor;
13801
+ },
13802
+ set: function (t) {
13803
+ this.defaultColor = t;
13804
+ }
13805
+ },
13806
+ lineColor: {
13807
+ get: function () {
13808
+ return this.defaultLineColor;
13809
+ },
13810
+ set: function (t) {
13811
+ this.defaultLineColor = t;
13812
+ }
13813
+ },
13814
+ show: {
13815
+ get: function () {
13816
+ return this._show;
13817
+ },
13818
+ set: function (t) {
13819
+ this._show = t;
13820
+ }
13821
+ },
13822
+ outline: {
13823
+ get: function () {
13824
+ return this._outline;
13825
+ },
13826
+ set: function (t) {
13827
+ this._outline = t, this.updateGeometry();
13828
+ }
13829
+ },
13830
+ top: {
13831
+ get: function () {
13832
+ return this._topShow;
13833
+ },
13834
+ set: function (t) {
13835
+ this._topShow = t, this.updateGeometry();
13836
+ }
13837
+ },
13838
+ topOutline: {
13839
+ get: function () {
13840
+ return this._topOutline;
13841
+ },
13842
+ set: function (t) {
13843
+ this._topOutline = t, this.updateGeometry();
13844
+ }
13845
+ },
13846
+ groundArea: {
13847
+ get: function () {
13848
+ return this._groundArea;
13849
+ },
13850
+ set: function (t) {
13851
+ this._groundArea = t, this.addGroundAreaEntity(this._groundArea);
13852
+ }
13853
+ },
13854
+ angle: {
13855
+ get: function () {
13856
+ return this._angle;
13857
+ },
13858
+ set: function (t) {
13859
+ this._angle = t, this.updateGroundCircleRadius(), this.updateGeometry();
13860
+ }
13861
+ },
13862
+ radius: {
13863
+ get: function () {
13864
+ return this._radius;
13865
+ },
13866
+ set: function (t) {
13867
+ this._radius = t, this.updateGroundCircleRadius(), this.updateGeometry();
13868
+ }
13869
+ },
13870
+ heading: {
13871
+ get: function () {
13872
+ return this._rotation.heading;
13873
+ },
13874
+ set: function (t) {
13875
+ this._rotation.heading = t;
13876
+ }
13877
+ },
13878
+ pitch: {
13879
+ get: function () {
13880
+ return this._rotation.pitch;
13881
+ },
13882
+ set: function (t) {
13883
+ this._rotation.pitch = t;
13884
+ }
13885
+ },
13886
+ roll: {
13887
+ get: function () {
13888
+ return this._rotation.roll;
13889
+ },
13890
+ set: function (t) {
13891
+ this._rotation.roll = t;
13892
+ }
13893
+ },
13894
+ position: {
13895
+ get: function () {
13896
+ return this._position;
13897
+ },
13898
+ set: function (t) {
13899
+ this._position = t;
13900
+ }
13901
+ }
13902
+ });
13903
+ n.prototype.updateGroundCircleRadius = function () {
13904
+ this._ground_radius = this._radius * Math.cos(Cesium$i.Math.toRadians(this._angle));
13905
+ };
13906
+ n.prototype.addGroundAreaEntity = function (t) {
13907
+ if (t && !this.groundAreaEntity) {
13908
+ var e = this;
13909
+ this.updateGroundCircleRadius(), this.groundAreaEntity = viewer.entities.add({
13910
+ position: this._position,
13911
+ ellipse: {
13912
+ show: 0 === this._rotation.pitch && 0 === this._rotation.roll,
13913
+ semiMinorAxis: new Cesium$i.CallbackProperty(function (t) {
13914
+ return e._ground_radius;
13915
+ }, !1),
13916
+ semiMajorAxis: new Cesium$i.CallbackProperty(function (t) {
13917
+ return e._ground_radius;
13918
+ }, !1),
13919
+ material: this.defaultColor
13920
+ },
13921
+ polyline: {
13922
+ show: this._trackedEntityPosition && (0 !== this._rotation.pitch || 0 !== this._rotation.roll),
13923
+ positions: new Cesium$i.CallbackProperty(function (t) {
13924
+ return e._trackedEntityPosition ? Cesium$i.Cartesian3.distance(e._position, e._trackedEntityPosition) > e._radius ? [] : [e._position, e._trackedEntityPosition] : [];
13925
+ }, !1),
13926
+ followSurface: !1,
13927
+ material: new Cesium$i.PolylineDashMaterialProperty({
13928
+ color: Cesium$i.Color.CYAN
13929
+ }),
13930
+ width: 1
13931
+ }
13932
+ });
13933
+ }
13934
+ };
13935
+ var l = new Cesium$i.Cartesian3();
13936
+ n.prototype.computeMatrix = function (t, e) {
13937
+ if (this._positionCartesian || (this._positionCartesian = new Cesium$i.Cartesian3()), this.position instanceof Cesium$i.Cartesian3 ? this._positionCartesian = this.position : "function" == typeof this.position.getValue ? this._positionCartesian = this.position.getValue(t) : this.position._value && this.position._value instanceof Cesium$i.Cartesian3 && (this._positionCartesian = this.position._value), this._trackedEntity && this._trackedEntity.position) {
13938
+ var i = this._positionCartesian,
13939
+ n = Cesium$i.Property.getValueOrUndefined(this._trackedEntity.position, t, l);
13940
+ if (n) {
13941
+ this._trackedEntityPosition = n;
13942
+ var o = mars3d.matrix.getHeadingPitchRollForLine(i, n, r);
13943
+ this._rotation.heading = o.heading, this._rotation.pitch = o.pitch, this._rotation.roll = o.roll;
13944
+ }
13945
+ }
13946
+ return this._modelMatrix = Cesium$i.Transforms.eastNorthUpToFixedFrame(this._positionCartesian, r, this._modelMatrix), this._positionCartographic = Cesium$i.Cartographic.fromCartesian(this._positionCartesian, r, this._positionCartographic), Cesium$i.Transforms.eastNorthUpToFixedFrame(this._positionCartesian, r, this._modelMatrix), Cesium$i.Quaternion.fromHeadingPitchRoll(this._rotation, this._quaternion), this._matrix = Cesium$i.Matrix4.fromTranslationQuaternionRotationScale(this._translation, this._quaternion, this._scale, this._matrix), Cesium$i.Matrix4.multiplyTransformation(this._modelMatrix, this._matrix, this._matrix), Cesium$i.Matrix4.inverseTransformation(this._matrix, this._inverseMatrix), this._matrix;
13947
+ };
13948
+ n.prototype.getTopGeometry = function () {
13949
+ for (var t = this.radius, e = [], i = [], n = [], r = [], o = 90 - parseInt(this.angle), s = o < 1 ? o / 8 : 1, l = 2 * Math.PI / 127, h = 0, d = this.angle; d < 91; d += s) {
13950
+ var m = Cesium$i.Math.toRadians(d < 90 ? d : 90);
13951
+ m = Math.cos(m) * t;
13952
+ for (var f = [], p = 0; p < 128; p++) {
13953
+ var c = l * p,
13954
+ _ = m * Math.cos(c),
13955
+ g = m * Math.sin(c),
13956
+ v = Math.sqrt(t * t - _ * _ - g * g);
13957
+ e.push(_, g, v), i.push(1, 1), f.push(h++);
13958
+ }
13959
+ r.push(f);
13960
+ }
13961
+ for (var d = 1; d < r.length; d++) for (var p = 1; p < r[d].length; p++) {
13962
+ var y = r[d - 1][p - 1],
13963
+ C = r[d][p - 1],
13964
+ w = r[d][p],
13965
+ x = r[d - 1][p];
13966
+ n.push(y, C, w), n.push(y, w, x);
13967
+ }
13968
+ e = new Float32Array(e), n = new Int32Array(n), i = new Float32Array(i);
13969
+ var A = {
13970
+ position: new Cesium$i.GeometryAttribute({
13971
+ componentDatatype: Cesium$i.ComponentDatatype.DOUBLE,
13972
+ componentsPerAttribute: 3,
13973
+ values: e
13974
+ }),
13975
+ st: new Cesium$i.GeometryAttribute({
13976
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
13977
+ componentsPerAttribute: 2,
13978
+ values: i
13979
+ })
13980
+ },
13981
+ b = Cesium$i.BoundingSphere.fromVertices(e),
13982
+ M = new Cesium$i.Geometry({
13983
+ attributes: A,
13984
+ indices: n,
13985
+ primitiveType: Cesium$i.PrimitiveType.TRIANGLES,
13986
+ boundingSphere: b
13987
+ });
13988
+ return (0, Cesium$i.Scene.computeVertexNormals)(M), M;
13989
+ };
13990
+ n.prototype.getTopOutlineGeometry = function () {
13991
+ for (var t = this.radius, e = [], i = [], n = [], r = [], o = 90 - parseInt(this.angle), s = o < 1 ? o / 8 : 1, l = 2 * Math.PI / 127, h = 0, d = this.angle; d < 91; d += s) {
13992
+ var m = Cesium$i.Math.toRadians(d < 90 ? d : 90);
13993
+ m = Math.cos(m) * t;
13994
+ for (var f = [], p = 0; p < 128; p++) {
13995
+ var c = l * p,
13996
+ _ = m * Math.cos(c),
13997
+ g = m * Math.sin(c),
13998
+ v = Math.sqrt(t * t - _ * _ - g * g);
13999
+ e.push(_, g, v), i.push(1, 1), f.push(h++);
14000
+ }
14001
+ r.push(f);
14002
+ }
14003
+ for (var d = 1; d < r.length; d++) for (var p = 1; p < r[d].length; p++) {
14004
+ var y = r[d - 1][p - 1],
14005
+ C = r[d][p - 1],
14006
+ w = r[d][p];
14007
+ r[d - 1][p];
14008
+ p % 8 == 1 && n.push(y, C), d % 8 == 1 && n.push(C, w);
14009
+ }
14010
+ e = new Float32Array(e), n = new Int32Array(n), i = new Float32Array(i);
14011
+ var x = {
14012
+ position: new Cesium$i.GeometryAttribute({
14013
+ componentDatatype: Cesium$i.ComponentDatatype.DOUBLE,
14014
+ componentsPerAttribute: 3,
14015
+ values: e
14016
+ }),
14017
+ st: new Cesium$i.GeometryAttribute({
14018
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
14019
+ componentsPerAttribute: 2,
14020
+ values: i
14021
+ })
14022
+ },
14023
+ A = Cesium$i.BoundingSphere.fromVertices(e),
14024
+ b = new Cesium$i.Geometry({
14025
+ attributes: x,
14026
+ indices: n,
14027
+ primitiveType: Cesium$i.PrimitiveType.LINES,
14028
+ boundingSphere: A
14029
+ });
14030
+ return (0, Cesium$i.Scene.computeVertexNormals)(b), b;
14031
+ };
14032
+ n.prototype.updateGeometry = function () {
14033
+ this._geometry = Cesium$i.Scene.CylinderGeometry.createGeometry(new Cesium$i.Scene.CylinderGeometry({
14034
+ topRadius: this._radius * Math.cos(Cesium$i.Math.toRadians(this.angle)),
14035
+ bottomRadius: 0,
14036
+ length: this._radius * Math.sin(Cesium$i.Math.toRadians(this.angle))
14037
+ })), this._topGeometry = this.getTopGeometry(), this._topOutlineGeometry = this.getTopOutlineGeometry(), this._outlineGeometry = Cesium$i.Scene.CylinderGeometry.createOutlineGeometry(new Cesium$i.Scene.CylinderGeometry({
14038
+ topRadius: this._radius * Math.cos(Cesium$i.Math.toRadians(this.angle)),
14039
+ bottomRadius: 0,
14040
+ slices: 128,
14041
+ length: this._radius * Math.sin(Cesium$i.Math.toRadians(this.angle))
14042
+ })), this._positions = new Float32Array(this._geometry.attributes.position.values.length);
14043
+ for (var t = 0; t < this._positions.length; t++) this._positions[t] = this._geometry.attributes.position.values[t];
14044
+ this._drawCommands && this._drawCommands.length && (this._drawCommands.forEach(function (t) {
14045
+ t.vertexArray = t.vertexArray && t.vertexArray.destroy();
14046
+ }), this._drawCommands.splice(0, this._drawCommands.length));
14047
+ };
14048
+ n.prototype.update = function (t) {
14049
+ if (this._show) {
14050
+ this.computeMatrix(t.time);
14051
+ t.mode === Cesium$i.SceneMode.SCENE3D ? (this._geometry.boundingSphere = Cesium$i.BoundingSphere.fromVertices(this._geometry.attributes.position.values), this._drawCommands && this._drawCommands.length || (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) {
14052
+ t.commandList.push(e);
14053
+ }), this.groundAreaEntity && (this.groundAreaEntity.ellipse.show = this._groundArea && 0 === this._rotation.pitch && 0 === this._rotation.roll, this.groundAreaEntity.polyline.show = !1)) : (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));
14054
+ }
14055
+ };
14056
+ n.prototype.getFragmentShaderSource = function (t) {
14057
+ return "#version 300 es\n\
14058
+ in vec3 v_position;\n\
14059
+ in vec3 v_normal; \n\
14060
+ uniform float picked; \n\
14061
+ uniform vec4 pickedColor; \n\
14062
+ uniform vec4 defaultColor; \n\
14063
+ uniform float specular; \n\
14064
+ uniform float shininess; \n\
14065
+ uniform vec3 emission; \n\
14066
+ in vec2 v_st; \n\
14067
+ uniform bool isLine; \n\
14068
+ uniform float glowPower; \n\
14069
+ layout(location=2) out vec4 pc_FragColor; \n\
14070
+ void main() { \n\
14071
+ vec3 positionToEyeEC = -v_position; \n\
14072
+ vec3 normalEC = normalize(v_normal); \n\
14073
+ vec4 color = defaultColor; \n\
14074
+ if (picked != 0.0) { \n\
14075
+ color = pickedColor; \n\
14076
+ } \n\
14077
+ czm_material material; \n\
14078
+ material.specular = specular; \n\
14079
+ material.shininess = shininess; \n\
14080
+ material.normal = normalEC; \n\
14081
+ material.emission = emission;//vec3(0.2,0.2,0.2);\n\
14082
+ material.diffuse = color.rgb ;\n\
14083
+ if(isLine){\n\
14084
+ material.alpha = 1.0; \n\
14085
+ }\n\
14086
+ else{ \n\
14087
+ material.alpha = color.a; \n\
14088
+ }\n\
14089
+ if(v_st.x==0.0){ \n\
14090
+ pc_FragColor =color ;\n\
14091
+ }else { \n\
14092
+ pc_FragColor = czm_phong(normalize(positionToEyeEC), material) ; \n\
14093
+ } \n\
14094
+ }";
14095
+ };
14096
+ n.prototype.getVertexShaderSource = function (t) {
14097
+ return "#version 300 es\n\
14098
+ #ifdef GL_ES\n\
14099
+ precision highp float;\n\
14100
+ #endif\n\n\
14101
+ in vec3 position;\n\
14102
+ in vec2 st;\n\
14103
+ in vec3 normal;\n\
14104
+ uniform mat4 modelViewMatrix;\n\
14105
+ uniform mat3 normalMatrix;\n\
14106
+ uniform mat4 projectionMatrix;\n\
14107
+ out vec3 v_position;\n\
14108
+ out vec3 v_normal;\n\
14109
+ out vec2 v_st;\n\n\
14110
+ out vec3 v_light0Direction;\n\n\
14111
+ void main(void) \n\
14112
+ {\n\
14113
+ vec4 pos = modelViewMatrix * vec4( position,1.0);\n\
14114
+ v_normal = normalMatrix * normal;\n\
14115
+ v_st = st;\n\
14116
+ v_position = pos.xyz;\n\
14117
+ v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n\
14118
+ gl_Position = projectionMatrix * pos;\n\
14119
+ }";
14120
+ };
14121
+ n.prototype.createDrawCommand = function (t, e, i) {
14122
+ var n = e.context,
14123
+ r = new Cesium$i.Cartesian3();
14124
+ Cesium$i.Matrix4.multiplyByPoint(this._matrix, t.boundingSphere.center, r);
14125
+ var o = new Cesium$i.BoundingSphere(r, t.boundingSphere.radius),
14126
+ s = new Cesium$i.DrawCommand({
14127
+ modelMatrix: i || this._matrix,
14128
+ owner: this,
14129
+ primitiveType: t.primitiveType,
14130
+ pass: Cesium$i.Pass.TRANSLUCENT,
14131
+ boundingVolume: o
14132
+ }),
14133
+ u = this,
14134
+ l = Cesium$i.GeometryPipeline.createAttributeLocations(t);
14135
+ return s.vertexArray = Cesium$i.VertexArray.fromGeometry({
14136
+ context: n,
14137
+ geometry: t,
14138
+ attributeLocations: l,
14139
+ bufferUsage: Cesium$i.BufferUsage.STATIC_DRAW
14140
+ }), s.vertexArray._attributeLocations = l, s.shaderProgram = Cesium$i.ShaderProgram.replaceCache({
14141
+ context: n,
14142
+ vertexShaderSource: this.getVertexShaderSource(t),
14143
+ fragmentShaderSource: this.getFragmentShaderSource(t),
14144
+ attributeLocations: l
14145
+ }), s.renderState = Cesium$i.RenderState.fromCache({
14146
+ blending: Cesium$i.BlendingState.ALPHA_BLEND,
14147
+ depthTest: {
14148
+ enabled: !0,
14149
+ func: Cesium$i.DepthFunction.LESS
14150
+ },
14151
+ cull: {
14152
+ enabled: !1,
14153
+ face: Cesium$i.CullFace.BACK
14154
+ }
14155
+ }), s.uniformMap = {}, s.uniformMap.projectionMatrix = function () {
14156
+ return e.context.uniformState.projection;
14157
+ }, s.uniformMap.modelViewMatrix = function () {
14158
+ return e.context.uniformState.modelView;
14159
+ }, s.uniformMap.shininess = function () {
14160
+ return u.shininess || (u.shininess = 0), u.shininess;
14161
+ }, s.uniformMap.emission = function () {
14162
+ return u.emission || (u.emission = new Cesium$i.Cartesian3(.2, .2, .2)), u.emission;
14163
+ }, s.uniformMap.specular = function () {
14164
+ return u.specular || (u.specular = 0), u.specular;
14165
+ }, s.uniformMap.isLine = function () {
14166
+ return t.primitiveType == Cesium$i.PrimitiveType.LINES || t.primitiveType == Cesium$i.PrimitiveType.LINE_STRIP;
14167
+ }, s.uniformMap.defaultColor = function () {
14168
+ return t.primitiveType == Cesium$i.PrimitiveType.LINES || t.primitiveType == Cesium$i.PrimitiveType.LINE_STRIP ? (u.defaultLineColor || (u.defaultLineColor = new Cesium$i.Color(1, 1, 0, 1)), u.defaultLineColor) : (u.defaultColor || (u.defaultColor = new Cesium$i.Color(1, 0, 0, 1)), u.defaultColor);
14169
+ }, s.uniformMap.picked = function () {
14170
+ return u.picked || (u.picked = 0), u.picked;
14171
+ }, s.uniformMap.pickedColor = function () {
14172
+ return u.pickedColor || (u.pickedColor = new Cesium$i.Color(1, 1, 0, 1)), u.pickedColor;
14173
+ }, s.uniformMap.normalMatrix = function () {
14174
+ return e.context.uniformState.normal;
14175
+ }, s.uniformMap.glowPower = function () {
14176
+ return .25;
14177
+ }, s;
14178
+ };
14179
+ n.prototype.remove = function () {
14180
+ this.viewer.scene.primitives.remove(this), this.groundAreaEntity && this.viewer.entities.remove(this.groundAreaEntity);
14181
+ };
14182
+ n.prototype.addToScene = function () {
14183
+ this.viewer.scene.primitives.add(this), this.groundAreaEntity && this.viewer.entities.add(this.groundAreaEntity);
14184
+ };
14185
+ n.prototype.destroy = function (t) {
14186
+ t && (this.viewer.scene.primitives.remove(this), this.groundAreaEntity && this.viewer.entities.remove(this.groundAreaEntity), this._drawCommands.forEach(function (t) {
14187
+ t.vertexArray = t.vertexArray && t.vertexArray.destroy();
14188
+ }), this._drawCommands = []);
14189
+ };
14190
+ Cesium$i.Scene.RadarPrimitiveRight = n;
14191
+ },
14192
+ _installCounputeVertex: function () {
14193
+ function n(t) {
14194
+ var e = t.indices,
14195
+ i = t.attributes,
14196
+ n = e.length;
14197
+ if (i.position) {
14198
+ var o = i.position.values;
14199
+ if (void 0 === i.normal) i.normal = new Cesium$i.GeometryAttribute({
14200
+ componentDatatype: Cesium$i.ComponentDatatype.FLOAT,
14201
+ componentsPerAttribute: 3,
14202
+ values: new Float32Array(o.length)
14203
+ });else for (var a = i.normal.values, s = 0; s < n; s++) a[s] = 0;
14204
+ for (var u, l, h, d = i.normal.values, m = new Cesium$i.Cartesian3(), f = new Cesium$i.Cartesian3(), p = new Cesium$i.Cartesian3(), c = new Cesium$i.Cartesian3(), _ = new Cesium$i.Cartesian3(), s = 0; s < n; s += 3) u = 3 * e[s + 0], l = 3 * e[s + 1], h = 3 * e[s + 2], Cesium$i.Cartesian3.fromArray(o, u, m), Cesium$i.Cartesian3.fromArray(o, l, f), Cesium$i.Cartesian3.fromArray(o, h, p), Cesium$i.Cartesian3.subtract(p, f, c), Cesium$i.Cartesian3.subtract(m, f, _), Cesium$i.Cartesian3.cross(c, _, c), d[u] += c.x, d[u + 1] += c.y, d[u + 2] += c.z, d[l] += c.x, d[l + 1] += c.y, d[l + 2] += c.z, d[h] += c.x, d[h + 1] += c.y, d[h + 2] += c.z;
14205
+ r(t), i.normal.needsUpdate = !0;
14206
+ }
14207
+ return t;
14208
+ }
14209
+ function r(t) {
14210
+ for (var e, i, n, r, o = t.attributes.normal.values, a = 0; a < o.length; a += 3) e = o[a], i = o[a + 1], n = o[a + 2], r = 1 / Math.sqrt(e * e + i * i + n * n), o[a] = e * r, o[a + 1] = i * r, o[a + 2] = n * r;
14211
+ }
14212
+ function o(t, e, i, n) {
14213
+ n = n || Cesium$i.Ellipsoid.WGS84, Cesium$i.Matrix4.multiplyByPoint(e, t, a), Cesium$i.Cartesian3.subtract(a, i.origin, i.direction), Cesium$i.Cartesian3.normalize(i.direction, i.direction);
14214
+ var r = Cesium$i.IntersectionTests.rayEllipsoid(i, n),
14215
+ o = null;
14216
+ if (r && (o = Cesium$i.Ray.getPoint(i, r.start)), o) try {
14217
+ Cesium$i.Cartographic.fromCartesian(o, null, s);
14218
+ } catch (t) {
14219
+ return null;
14220
+ }
14221
+ return o;
14222
+ }
14223
+ var a = new Cesium$i.Cartesian3(),
14224
+ s = (new Cesium$i.Ray(), new Cesium$i.Cartographic());
14225
+ Cesium$i.Scene.computeVertexNormals = n, Cesium$i.Scene.extend2Earth = o;
14226
+ }
14227
+ };
14228
+
13558
14229
  const prototypeExtends = function (viewer, cesiumGlobal, defaultStatic) {
13559
14230
  function _inner(parents, children) {
13560
14231
  var curr = null;
@@ -13587,15 +14258,21 @@ function initCesium({
13587
14258
  cesiumGlobal,
13588
14259
  containerId,
13589
14260
  viewerConfig = {},
13590
- extreaConfig = {},
14261
+ extraConfig = {},
13591
14262
  MapImageryList = [],
13592
14263
  defaultStatic
13593
14264
  }) {
14265
+ if (!cesiumGlobal) {
14266
+ throw 'Missing cesiumGlobal parameter, please check the calling function initCesium.';
14267
+ }
14268
+ if (!containerId) {
14269
+ throw 'Missing containerId parameter, please check the calling function initCesium.';
14270
+ }
13594
14271
  const initCom = new Controller(cesiumGlobal);
13595
14272
  const _viewer = initCom.init({
13596
14273
  containerId,
13597
14274
  viewerConfig,
13598
- extreaConfig,
14275
+ extraConfig,
13599
14276
  MapImageryList
13600
14277
  });
13601
14278
 
@@ -13616,6 +14293,8 @@ function initCesium({
13616
14293
  const _attackArrowObj = new AttackArrow(_viewer, cesiumGlobal);
13617
14294
  const _straightArrowObj = new StraightArrow(_viewer, cesiumGlobal);
13618
14295
  const _pincerArrowObj = new PincerArrow(_viewer, cesiumGlobal);
14296
+ // 初始化相控相关对象
14297
+ new RadarPlugin(_viewer, cesiumGlobal, defaultStatic);
13619
14298
  return {
13620
14299
  viewer: _viewer,
13621
14300
  material: _material,