deeptwins-engine-3d 0.1.69 → 0.1.70

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.
Files changed (41) hide show
  1. package/dist/assets/Build/DeepTwins/Image/fire.png +0 -0
  2. package/dist/assets/Build/DeepTwins/Image/fountain.png +0 -0
  3. package/dist/assets/Build/DeepTwins/Image/smoke.png +0 -0
  4. package/dist/esm/analyze/LineOfSightAnalysis.d.ts +44 -0
  5. package/dist/esm/analyze/LineOfSightAnalysis.js +326 -0
  6. package/dist/esm/analyze/TerrainExcavationAnalysis.d.ts +59 -0
  7. package/dist/esm/analyze/TerrainExcavationAnalysis.js +612 -0
  8. package/dist/esm/constant.d.ts +88 -0
  9. package/dist/esm/constant.js +132 -0
  10. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.d.ts +3 -0
  11. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +56 -21
  12. package/dist/esm/drawCommand/viewShed/config.d.ts +2 -2
  13. package/dist/esm/drawCommand/viewShed/config.js +2 -2
  14. package/dist/esm/drawer/index.d.ts +1 -1
  15. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  16. package/dist/esm/index.d.ts +15 -0
  17. package/dist/esm/index.js +24 -2
  18. package/dist/esm/map/Map.d.ts +1 -0
  19. package/dist/esm/map/Map.js +18 -0
  20. package/dist/esm/particle/BaseParticle.d.ts +61 -0
  21. package/dist/esm/particle/BaseParticle.js +196 -0
  22. package/dist/esm/particle/FireParticle.d.ts +8 -0
  23. package/dist/esm/particle/FireParticle.js +65 -0
  24. package/dist/esm/particle/FountainParticle.d.ts +10 -0
  25. package/dist/esm/particle/FountainParticle.js +80 -0
  26. package/dist/esm/particle/SmokeParticle.d.ts +8 -0
  27. package/dist/esm/particle/SmokeParticle.js +65 -0
  28. package/dist/esm/particle/common.d.ts +18 -0
  29. package/dist/esm/particle/common.js +23 -0
  30. package/dist/esm/particle/index.d.ts +5 -0
  31. package/dist/esm/particle/index.js +5 -0
  32. package/dist/esm/tileLayer/CustomRasterLayer.d.ts +184 -0
  33. package/dist/esm/tileLayer/CustomRasterLayer.js +773 -0
  34. package/dist/esm/visualization/DynamicWater.d.ts +39 -0
  35. package/dist/esm/visualization/DynamicWater.js +289 -0
  36. package/dist/esm/visualization/MigrationEffect.d.ts +36 -0
  37. package/dist/esm/visualization/MigrationEffect.js +397 -0
  38. package/dist/esm/visualization/RadarScan.d.ts +39 -0
  39. package/dist/esm/visualization/RadarScan.js +333 -0
  40. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  41. package/package.json +4 -2
@@ -108,6 +108,64 @@ export declare const DEFAULT_HEATMAP_STYLE: () => {
108
108
  '.95': string;
109
109
  };
110
110
  };
111
+ export declare const DEFAULT_DYNAMIC_WATER_STYLE: () => {
112
+ show: boolean;
113
+ height: number;
114
+ stRotation: number;
115
+ baseWaterColor: string;
116
+ blendColor: string;
117
+ specularMap: string;
118
+ normalMap: string;
119
+ frequency: number;
120
+ animationSpeed: number;
121
+ amplitude: number;
122
+ specularIntensity: number;
123
+ fadeFactor: number;
124
+ };
125
+ export declare const DEFAULT_MIGRATION_EFFECT_STYLE: () => {
126
+ show: boolean;
127
+ arcHeight: number;
128
+ segments: number;
129
+ width: number;
130
+ lineColor: string;
131
+ duration: number;
132
+ repeat: number[];
133
+ repeatPixel: number;
134
+ mixRatio: number;
135
+ image: string;
136
+ endpoint: {
137
+ show: boolean;
138
+ showStart: boolean;
139
+ showEnd: boolean;
140
+ pixelSize: number;
141
+ startColor: string;
142
+ endColor: string;
143
+ outlineColor: string;
144
+ outlineWidth: number;
145
+ };
146
+ };
147
+ export declare const DEFAULT_RADAR_SCAN_STYLE: () => {
148
+ show: boolean;
149
+ radius: number;
150
+ xHalfAngle: number;
151
+ yHalfAngle: number;
152
+ heading: number;
153
+ pitch: number;
154
+ roll: number;
155
+ speed: number;
156
+ scanPlaneMode: string;
157
+ color: string;
158
+ lineColor: string;
159
+ scanPlaneColor: string;
160
+ slice: number;
161
+ showLateralSurfaces: boolean;
162
+ showDomeSurfaces: boolean;
163
+ showDomeLines: boolean;
164
+ showSectorLines: boolean;
165
+ showSectorSegmentLines: boolean;
166
+ showScanPlane: boolean;
167
+ showThroughEllipsoid: boolean;
168
+ };
111
169
  export declare const DEFAULT_POINT_CLUSTER_STYLE: () => {
112
170
  pixelRange: number;
113
171
  enabled: boolean;
@@ -235,6 +293,36 @@ export declare const DEFAULT_VIEWSHED_ANALYSIS_OPTIONS: () => {
235
293
  softShadows: boolean;
236
294
  size: number;
237
295
  };
296
+ export declare const DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS: () => {
297
+ position: null;
298
+ positionEnd: null;
299
+ visibleColor: string;
300
+ invisibleColor: string;
301
+ pointColor: string;
302
+ obstructionPointColor: string;
303
+ lineWidth: number;
304
+ pointPixelSize: number;
305
+ pickWidth: number;
306
+ tolerance: number;
307
+ showLine: boolean;
308
+ showPoint: boolean;
309
+ showObstructionPoint: boolean;
310
+ objectsToExclude: undefined;
311
+ };
312
+ export declare const DEFAULT_TERRAIN_EXCAVATION_ANALYSIS_OPTIONS: () => {
313
+ depth: number;
314
+ bottomHeight: undefined;
315
+ sampleTerrain: boolean;
316
+ edgeSplitNum: number;
317
+ showBottom: boolean;
318
+ showWall: boolean;
319
+ showEdge: boolean;
320
+ bottomColor: string;
321
+ wallColor: string;
322
+ edgeColor: string;
323
+ edgeWidth: number;
324
+ enabled: boolean;
325
+ };
238
326
  export declare const DEFAULT_BASE_LAYER_TYPE: any;
239
327
  export declare const DEFAULT_BASE_LAYER: any;
240
328
  export declare const LAYER_TYPE_TO_CLASS: any;
@@ -167,6 +167,76 @@ export var DEFAULT_HEATMAP_STYLE = function DEFAULT_HEATMAP_STYLE() {
167
167
  };
168
168
  };
169
169
 
170
+ // 默认动态水面样式
171
+ export var DEFAULT_DYNAMIC_WATER_STYLE = function DEFAULT_DYNAMIC_WATER_STYLE() {
172
+ return {
173
+ show: true,
174
+ height: 0,
175
+ stRotation: 0,
176
+ baseWaterColor: 'rgba(22, 92, 145, 0.7)',
177
+ blendColor: 'rgba(12, 160, 210, 0.45)',
178
+ specularMap: Cesium.Material.DefaultImageId,
179
+ normalMap: Cesium.buildModuleUrl('Assets/Textures/waterNormals.jpg'),
180
+ frequency: 1000,
181
+ animationSpeed: 0.01,
182
+ amplitude: 10,
183
+ specularIntensity: 0.7,
184
+ fadeFactor: 1
185
+ };
186
+ };
187
+
188
+ // 默认动态迁徙效果样式
189
+ export var DEFAULT_MIGRATION_EFFECT_STYLE = function DEFAULT_MIGRATION_EFFECT_STYLE() {
190
+ return {
191
+ show: true,
192
+ arcHeight: 60000,
193
+ segments: 64,
194
+ width: 4,
195
+ lineColor: '#00d9ff',
196
+ duration: 4,
197
+ repeat: [2, 1],
198
+ repeatPixel: 1000,
199
+ mixRatio: 0.65,
200
+ image: utils.getDeepTwinsFile('Image/line.png'),
201
+ endpoint: {
202
+ show: false,
203
+ showStart: true,
204
+ showEnd: true,
205
+ pixelSize: 8,
206
+ startColor: '#00d9ff',
207
+ endColor: '#ffffff',
208
+ outlineColor: '#001f33',
209
+ outlineWidth: 2
210
+ }
211
+ };
212
+ };
213
+
214
+ // 默认雷达扫描样式
215
+ export var DEFAULT_RADAR_SCAN_STYLE = function DEFAULT_RADAR_SCAN_STYLE() {
216
+ return {
217
+ show: true,
218
+ radius: 5000,
219
+ xHalfAngle: 35,
220
+ yHalfAngle: 25,
221
+ heading: 0,
222
+ pitch: 0,
223
+ roll: 0,
224
+ speed: 6,
225
+ scanPlaneMode: 'H',
226
+ color: 'rgba(0, 217, 255, 0.22)',
227
+ lineColor: 'rgba(160, 245, 255, 0.9)',
228
+ scanPlaneColor: 'rgba(0, 255, 180, 0.45)',
229
+ slice: 48,
230
+ showLateralSurfaces: true,
231
+ showDomeSurfaces: true,
232
+ showDomeLines: true,
233
+ showSectorLines: true,
234
+ showSectorSegmentLines: true,
235
+ showScanPlane: true,
236
+ showThroughEllipsoid: false
237
+ };
238
+ };
239
+
170
240
  // 默认点聚合样式
171
241
  export var DEFAULT_POINT_CLUSTER_STYLE = function DEFAULT_POINT_CLUSTER_STYLE() {
172
242
  return {
@@ -402,6 +472,68 @@ export var DEFAULT_VIEWSHED_ANALYSIS_OPTIONS = function DEFAULT_VIEWSHED_ANALYSI
402
472
  };
403
473
  };
404
474
 
475
+ // 默认通视分析
476
+ export var DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS = function DEFAULT_LINE_OF_SIGHT_ANALYSIS_OPTIONS() {
477
+ return {
478
+ position: null,
479
+ // 观察点位置
480
+ positionEnd: null,
481
+ // 目标点位置
482
+ visibleColor: '#00ff66',
483
+ // 通视线段颜色
484
+ invisibleColor: '#ff3333',
485
+ // 遮挡线段颜色
486
+ pointColor: '#ffffff',
487
+ // 起终点颜色
488
+ obstructionPointColor: '#ffd400',
489
+ // 遮挡点颜色
490
+ lineWidth: 4,
491
+ // 线宽
492
+ pointPixelSize: 10,
493
+ // 点大小
494
+ pickWidth: 3,
495
+ // 射线拾取宽度
496
+ tolerance: 1,
497
+ // 判定容差(米)
498
+ showLine: true,
499
+ // 是否显示分析线
500
+ showPoint: true,
501
+ // 是否显示起终点
502
+ showObstructionPoint: true,
503
+ // 是否显示遮挡点
504
+ objectsToExclude: undefined // 排除的场景对象
505
+ };
506
+ };
507
+
508
+ // 默认地形开挖分析
509
+ export var DEFAULT_TERRAIN_EXCAVATION_ANALYSIS_OPTIONS = function DEFAULT_TERRAIN_EXCAVATION_ANALYSIS_OPTIONS() {
510
+ return {
511
+ depth: 50,
512
+ // 开挖深度(米)
513
+ bottomHeight: undefined,
514
+ // 坑底绝对高度;不传时使用边界最低高程减去depth
515
+ sampleTerrain: true,
516
+ // 是否采样地形高程
517
+ edgeSplitNum: 8,
518
+ // 边界分段采样数
519
+ showBottom: true,
520
+ // 是否显示坑底
521
+ showWall: true,
522
+ // 是否显示侧壁
523
+ showEdge: true,
524
+ // 是否显示边界线
525
+ bottomColor: 'rgba(76, 64, 52, 0.85)',
526
+ // 坑底颜色
527
+ wallColor: 'rgba(176, 124, 72, 0.65)',
528
+ // 侧壁颜色
529
+ edgeColor: '#f8d26a',
530
+ // 裁剪边缘和边界颜色
531
+ edgeWidth: 2,
532
+ // 边缘宽度
533
+ enabled: true // 是否启用裁剪
534
+ };
535
+ };
536
+
405
537
  // 默认的底图类型
406
538
  export var DEFAULT_BASE_LAYER_TYPE = {
407
539
  GAO_DE_IMG: 'gd_img',
@@ -175,6 +175,9 @@ declare class RectangularSensorPrimitive {
175
175
  zoy: Cesium.Cartesian3[];
176
176
  zox: Cesium.Cartesian3[];
177
177
  };
178
+ private computeFullScanPlanePositions;
179
+ private isHemisphereAngles;
180
+ private isFullSphereAngles;
178
181
  /**
179
182
  * 计算扇面位置
180
183
  * @param primitive: any
@@ -537,22 +537,21 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
537
537
  }
538
538
  var angle;
539
539
  var matrix3Scratch = new Cesium.Matrix3();
540
+ var isFullSphere = this.isFullSphereAngles(xHalfAngle, yHalfAngle);
540
541
  if (this.scanPlaneMode == 'H') {
541
- angle = 2 * yHalfAngle * percentage - yHalfAngle;
542
+ angle = isFullSphere ? Cesium.Math.TWO_PI * percentage : 2 * yHalfAngle * percentage - yHalfAngle;
542
543
  var cosYHalfAngle = Math.cos(angle);
543
544
  var tanXHalfAngle = Math.tan(xHalfAngle);
544
- var maxX = Math.atan(cosYHalfAngle * tanXHalfAngle);
545
- this._scanePlaneXHalfAngle = maxX;
546
- this._scanePlaneYHalfAngle = angle;
547
- Cesium.Matrix3.fromRotationX(this._scanePlaneYHalfAngle, matrix3Scratch);
545
+ this._scanePlaneXHalfAngle = isFullSphere ? Math.PI : this.isHemisphereAngles(xHalfAngle, yHalfAngle) ? Cesium.Math.PI_OVER_TWO : Math.atan(cosYHalfAngle * tanXHalfAngle);
546
+ this._scanePlaneYHalfAngle = isFullSphere ? Math.PI : angle;
547
+ Cesium.Matrix3.fromRotationX(angle, matrix3Scratch);
548
548
  } else {
549
- angle = 2 * xHalfAngle * percentage - xHalfAngle;
549
+ angle = isFullSphere ? Cesium.Math.TWO_PI * percentage : 2 * xHalfAngle * percentage - xHalfAngle;
550
550
  var tanYHalfAngle = Math.tan(yHalfAngle);
551
551
  var cosXHalfAngle = Math.cos(angle);
552
- var maxY = Math.atan(cosXHalfAngle * tanYHalfAngle);
553
- this._scanePlaneXHalfAngle = angle;
554
- this._scanePlaneYHalfAngle = maxY;
555
- Cesium.Matrix3.fromRotationY(this._scanePlaneXHalfAngle, matrix3Scratch);
552
+ this._scanePlaneXHalfAngle = isFullSphere ? Math.PI : angle;
553
+ this._scanePlaneYHalfAngle = isFullSphere ? Math.PI : this.isHemisphereAngles(xHalfAngle, yHalfAngle) ? Cesium.Math.PI_OVER_TWO : Math.atan(cosXHalfAngle * tanYHalfAngle);
554
+ Cesium.Matrix3.fromRotationY(angle, matrix3Scratch);
556
555
  }
557
556
  Cesium.Matrix4.multiplyByMatrix3(this.modelMatrix, matrix3Scratch, this._computedScanPlaneModelMatrix);
558
557
  Cesium.Matrix4.multiplyByUniformScale(this._computedScanPlaneModelMatrix, this.radius, this._computedScanPlaneModelMatrix);
@@ -589,21 +588,25 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
589
588
  key: "createVertexArray",
590
589
  value: function createVertexArray(primitive, frameState) {
591
590
  var context = frameState.context;
592
- var unitSectorPositions = this.computeUnitPosition(primitive, primitive._xHalfAngle, primitive._yHalfAngle);
593
- var positions = this.computeSectorPositions(primitive, unitSectorPositions);
591
+ var isFullSphere = this.isFullSphereAngles(primitive._xHalfAngle, primitive._yHalfAngle);
592
+ var unitSectorPositions = isFullSphere ? {
593
+ zoy: [],
594
+ zox: []
595
+ } : this.computeUnitPosition(primitive, primitive._xHalfAngle, primitive._yHalfAngle);
596
+ var positions = isFullSphere ? [] : this.computeSectorPositions(primitive, unitSectorPositions);
594
597
 
595
598
  //显示扇面
596
- if (primitive.showLateralSurfaces) {
599
+ if (!isFullSphere && primitive.showLateralSurfaces) {
597
600
  primitive._sectorVA = this.createSectorVertexArray(context, positions);
598
601
  }
599
602
 
600
603
  //显示扇面线
601
- if (primitive.showSectorLines) {
604
+ if (!isFullSphere && primitive.showSectorLines) {
602
605
  primitive._sectorLineVA = this.createSectorLineVertexArray(context, positions);
603
606
  }
604
607
 
605
608
  //显示扇面圆顶面的交线
606
- if (primitive.showSectorSegmentLines) {
609
+ if (!isFullSphere && primitive.showSectorSegmentLines) {
607
610
  primitive._sectorSegmentLineVA = this.createSectorSegmentLineVertexArray(context, positions);
608
611
  }
609
612
 
@@ -619,7 +622,10 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
619
622
 
620
623
  //显示扫描面
621
624
  if (primitive.showScanPlane) {
622
- if (primitive.scanPlaneMode == 'H') {
625
+ if (isFullSphere) {
626
+ var scanPlanePositions = this.computeFullScanPlanePositions(primitive, primitive.scanPlaneMode);
627
+ primitive._scanPlaneVA = this.createScanPlaneVertexArray(context, scanPlanePositions);
628
+ } else if (primitive.scanPlaneMode == 'H') {
623
629
  var unitScanPlanePositions = this.computeUnitPosition(primitive, Cesium.Math.PI_OVER_TWO, 0);
624
630
  primitive._scanPlaneVA = this.createScanPlaneVertexArray(context, unitScanPlanePositions.zox);
625
631
  } else {
@@ -706,19 +712,20 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
706
712
  key: "createCommands",
707
713
  value: function createCommands(primitive, translucent) {
708
714
  primitive._colorCommands.length = 0;
715
+ var isFullSphere = this.isFullSphereAngles(primitive._xHalfAngle, primitive._yHalfAngle);
709
716
  var pass = translucent ? Cesium.Pass.TRANSLUCENT : Cesium.Pass.OPAQUE;
710
717
 
711
718
  //显示扇面
712
- if (primitive.showLateralSurfaces) {
719
+ if (!isFullSphere && primitive.showLateralSurfaces) {
713
720
  this.createCommand(primitive, primitive._sectorFrontCommand, primitive._sectorBackCommand, primitive._frontFaceRS, primitive._backFaceRS, primitive._sp, primitive._sectorVA, primitive._uniforms, primitive._computedModelMatrix, translucent, pass);
714
721
  }
715
722
  //显示扇面线
716
- if (primitive.showSectorLines) {
723
+ if (!isFullSphere && primitive.showSectorLines) {
717
724
  this.createCommand(primitive, primitive._sectorLineCommand, undefined, primitive._frontFaceRS, primitive._backFaceRS, primitive._sp, primitive._sectorLineVA, primitive._uniforms, primitive._computedModelMatrix, translucent, pass, true);
718
725
  }
719
726
 
720
727
  //显示扇面交接线
721
- if (primitive.showSectorSegmentLines) {
728
+ if (!isFullSphere && primitive.showSectorSegmentLines) {
722
729
  this.createCommand(primitive, primitive._sectorSegmentLineCommand, undefined, primitive._frontFaceRS, primitive._backFaceRS, primitive._sp, primitive._sectorSegmentLineVA, primitive._uniforms, primitive._computedModelMatrix, translucent, pass, true);
723
730
  }
724
731
 
@@ -749,13 +756,14 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
749
756
  key: "computeUnitPosition",
750
757
  value: function computeUnitPosition(primitive, xHalfAngle, yHalfAngle) {
751
758
  var slice = primitive.slice;
759
+ var isHemisphere = this.isHemisphereAngles(xHalfAngle, yHalfAngle);
752
760
  //以中心为角度
753
761
  var cosYHalfAngle = Math.cos(yHalfAngle);
754
762
  var tanYHalfAngle = Math.tan(yHalfAngle);
755
763
  var cosXHalfAngle = Math.cos(xHalfAngle);
756
764
  var tanXHalfAngle = Math.tan(xHalfAngle);
757
- var maxY = Math.atan(cosXHalfAngle * tanYHalfAngle);
758
- var maxX = Math.atan(cosYHalfAngle * tanXHalfAngle);
765
+ var maxY = isHemisphere ? Cesium.Math.PI_OVER_TWO : Math.atan(cosXHalfAngle * tanYHalfAngle);
766
+ var maxX = isHemisphere ? Cesium.Math.PI_OVER_TWO : Math.atan(cosYHalfAngle * tanXHalfAngle);
759
767
 
760
768
  //ZOY面单位圆
761
769
  var zoy = [];
@@ -774,6 +782,33 @@ var RectangularSensorPrimitive = /*#__PURE__*/function () {
774
782
  zox: zox
775
783
  };
776
784
  }
785
+ }, {
786
+ key: "computeFullScanPlanePositions",
787
+ value: function computeFullScanPlanePositions(primitive, mode) {
788
+ var slice = Math.max(primitive.slice, 32);
789
+ var positions = [];
790
+ for (var i = 0; i <= slice; i++) {
791
+ var angle = Cesium.Math.TWO_PI * i / slice;
792
+ if (mode === 'H') {
793
+ positions.push(new Cesium.Cartesian3(Math.cos(angle), 0, Math.sin(angle)));
794
+ } else {
795
+ positions.push(new Cesium.Cartesian3(0, Math.cos(angle), Math.sin(angle)));
796
+ }
797
+ }
798
+ return positions;
799
+ }
800
+ }, {
801
+ key: "isHemisphereAngles",
802
+ value: function isHemisphereAngles(xHalfAngle, yHalfAngle) {
803
+ var rightAngle = Cesium.Math.PI_OVER_TWO - 1e-10;
804
+ return xHalfAngle >= rightAngle && yHalfAngle >= rightAngle;
805
+ }
806
+ }, {
807
+ key: "isFullSphereAngles",
808
+ value: function isFullSphereAngles(xHalfAngle, yHalfAngle) {
809
+ var straightAngle = Math.PI - 1e-10;
810
+ return xHalfAngle >= straightAngle && yHalfAngle >= straightAngle;
811
+ }
777
812
 
778
813
  /**
779
814
  * 计算扇面位置
@@ -12,9 +12,9 @@ export declare const sensorVS = "\nin vec4 position;\nin vec3 normal;\nout vec3
12
12
  * FS着色器
13
13
  * @returns {ShaderSource}
14
14
  */
15
- export declare const sensorFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); \n materialInput.str = pointMC / sensorRadius; \n\n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n\n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n\n czm_material material = czm_getMaterial(materialInput); \n\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC),vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for \"value\" to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and \"temp - delta\" would be \"1 - 1\" which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n{ \n\n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n if(u_type == 1.0)\n { \n return getLineColor(); \n } \n\n return getColor(u_radius, v_positionEC);\n\n}\n \nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n //vec3 pixDir = normalize(v_position); \n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle)-0.00001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)-0.00001)\n { \n discard; \n } \n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n //isOnEllipsoid = false; \n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81))\n // { \n // out_FragColor = shade(false);\n // }\n out_FragColor = shade(isOnEllipsoid);\n}\n";
15
+ export declare const sensorFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); \n materialInput.str = pointMC / sensorRadius; \n\n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n\n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n\n czm_material material = czm_getMaterial(materialInput); \n\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC),vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for \"value\" to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and \"temp - delta\" would be \"1 - 1\" which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n{ \n\n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n if(u_type == 1.0)\n { \n return getLineColor(); \n } \n\n return getColor(u_radius, v_positionEC);\n\n}\n \nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n bool isFullSphere = u_xHalfAngle >= czm_pi - 0.0001 && u_yHalfAngle >= czm_pi - 0.0001;\n //vec3 pixDir = normalize(v_position); \n if (!isFullSphere)\n {\n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle)-0.00001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)-0.00001)\n { \n discard; \n } \n }\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid && !isFullSphere)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n //isOnEllipsoid = false; \n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81))\n // { \n // out_FragColor = shade(false);\n // }\n out_FragColor = shade(isOnEllipsoid);\n}\n";
16
16
  /**
17
17
  * 扫描面FS着色器
18
18
  * @returns {ShaderSource}
19
19
  */
20
- export declare const scanPlaneFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius; \n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n czm_material material = czm_getMaterial(materialInput); \n material.diffuse = u_color.rgb; \n material.alpha = u_color.a; \n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for value to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and temp - delta would be 1 - 1 which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n { \n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n return getColor(u_radius, v_positionEC);\n}\n\n\nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n //vec3 pixDir = normalize(v_position); \n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle) - 0.0001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)- 0.0001)\n { \n discard; \n } \n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); \n // Occluded by the ellipsoid\n if (!u_showThroughEllipsoid)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n out_FragColor = shade(isOnEllipsoid);\n}\n ";
20
+ export declare const scanPlaneFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius; \n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n czm_material material = czm_getMaterial(materialInput); \n material.diffuse = u_color.rgb; \n material.alpha = u_color.a; \n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for value to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and temp - delta would be 1 - 1 which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n { \n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n return getColor(u_radius, v_positionEC);\n}\n\n\nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n bool isFullSphere = u_xHalfAngle >= czm_pi - 0.0001 && u_yHalfAngle >= czm_pi - 0.0001;\n //vec3 pixDir = normalize(v_position); \n if (!isFullSphere)\n {\n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle) - 0.0001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)- 0.0001)\n { \n discard; \n } \n }\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); \n // Occluded by the ellipsoid\n if (!u_showThroughEllipsoid && !isFullSphere)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n out_FragColor = shade(isOnEllipsoid);\n}\n ";
@@ -13,9 +13,9 @@ export var sensorVS = "\nin vec4 position;\nin vec3 normal;\nout vec3 v_position
13
13
  * FS着色器
14
14
  * @returns {ShaderSource}
15
15
  */
16
- export var sensorFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); \n materialInput.str = pointMC / sensorRadius; \n\n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n\n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n\n czm_material material = czm_getMaterial(materialInput); \n\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC),vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for \"value\" to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and \"temp - delta\" would be \"1 - 1\" which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n{ \n\n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n if(u_type == 1.0)\n { \n return getLineColor(); \n } \n\n return getColor(u_radius, v_positionEC);\n\n}\n \nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n //vec3 pixDir = normalize(v_position); \n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle)-0.00001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)-0.00001)\n { \n discard; \n } \n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n //isOnEllipsoid = false; \n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81))\n // { \n // out_FragColor = shade(false);\n // }\n out_FragColor = shade(isOnEllipsoid);\n}\n";
16
+ export var sensorFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); \n materialInput.str = pointMC / sensorRadius; \n\n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n\n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n\n czm_material material = czm_getMaterial(materialInput); \n\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC),vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for \"value\" to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and \"temp - delta\" would be \"1 - 1\" which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n{ \n\n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n if(u_type == 1.0)\n { \n return getLineColor(); \n } \n\n return getColor(u_radius, v_positionEC);\n\n}\n \nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n bool isFullSphere = u_xHalfAngle >= czm_pi - 0.0001 && u_yHalfAngle >= czm_pi - 0.0001;\n //vec3 pixDir = normalize(v_position); \n if (!isFullSphere)\n {\n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle)-0.00001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)-0.00001)\n { \n discard; \n } \n }\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid && !isFullSphere)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n //isOnEllipsoid = false; \n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81))\n // { \n // out_FragColor = shade(false);\n // }\n out_FragColor = shade(isOnEllipsoid);\n}\n";
17
17
  /**
18
18
  * 扫描面FS着色器
19
19
  * @returns {ShaderSource}
20
20
  */
21
- export var scanPlaneFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius; \n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n czm_material material = czm_getMaterial(materialInput); \n material.diffuse = u_color.rgb; \n material.alpha = u_color.a; \n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for value to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and temp - delta would be 1 - 1 which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n { \n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n return getColor(u_radius, v_positionEC);\n}\n\n\nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n //vec3 pixDir = normalize(v_position); \n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle) - 0.0001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)- 0.0001)\n { \n discard; \n } \n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); \n // Occluded by the ellipsoid\n if (!u_showThroughEllipsoid)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n out_FragColor = shade(isOnEllipsoid);\n}\n ";
21
+ export var scanPlaneFS = "\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{ \n czm_materialInput materialInput; \n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; \n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius; \n vec3 positionToEyeEC = -v_positionEC; \n materialInput.positionToEyeEC = positionToEyeEC; \n vec3 normalEC = normalize(v_normalEC); \n materialInput.normalEC = u_normalDirection * normalEC; \n czm_material material = czm_getMaterial(materialInput); \n material.diffuse = u_color.rgb; \n material.alpha = u_color.a; \n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon)\n{ \n float width = getIntersectionWidth(); \n float tolerance = width * epsilon;\n #ifdef GL_OES_standard_derivatives \n float delta = max(abs(dFdx(value)), abs(dFdy(value))); \n float pixels = width * delta; \n float temp = abs(value); \n // There are a couple things going on here. \n // First we test the value at the current fragment to see if it is within the tolerance. \n // We also want to check if the value of an adjacent pixel is within the tolerance, \n // but we don't want to admit points that are obviously not on the surface. \n // For example, if we are looking for value to be close to 0, but value is 1 and the adjacent value is 2, \n // then the delta would be 1 and temp - delta would be 1 - 1 which is zero even though neither of \n // the points is close to zero. \n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n #else \n return abs(value) < tolerance;\n #endif\n}\n\n\nvec4 shade(bool isOnBoundary)\n { \n if (u_showIntersection && isOnBoundary) \n { \n return getIntersectionColor(); \n } \n return getColor(u_radius, v_positionEC);\n}\n\n\nfloat ellipsoidSurfaceFunction(vec3 point)\n{ \n vec3 scaled = czm_ellipsoidInverseRadii * point; \n return dot(scaled, scaled) - 1.0;\n}\n\n\nvoid main()\n{ \n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates \n bool isFullSphere = u_xHalfAngle >= czm_pi - 0.0001 && u_yHalfAngle >= czm_pi - 0.0001;\n //vec3 pixDir = normalize(v_position); \n if (!isFullSphere)\n {\n float positionX = v_position.x; \n float positionY = v_position.y; \n float positionZ = v_position.z; \n vec3 zDir = vec3(0.0, 0.0, 1.0); \n vec3 lineX = vec3(positionX, 0 ,positionZ); \n vec3 lineY = vec3(0, positionY, positionZ); \n float resX = dot(normalize(lineX), zDir); \n if(resX < cos(u_xHalfAngle) - 0.0001)\n { \n discard; \n } \n float resY = dot(normalize(lineY), zDir); \n if(resY < cos(u_yHalfAngle)- 0.0001)\n { \n discard; \n } \n }\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); \n // Occluded by the ellipsoid\n if (!u_showThroughEllipsoid && !isFullSphere)\n { \n // Discard if in the ellipsoid \n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. \n if (ellipsoidValue < 0.0) \n { \n discard; \n } \n // Discard if in the sensor's shadow \n if (inSensorShadow(sensorVertexWC, v_positionWC)) \n { \n discard; \n } \n } \n // Notes: Each surface functions should have an associated tolerance based on the floating point error. \n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); \n out_FragColor = shade(isOnEllipsoid);\n}\n ";
@@ -7,7 +7,7 @@ export declare const MULTI_POINT_SHAPE_TYPES: {
7
7
  readonly PINCER_ARROW: "pincerArrow";
8
8
  readonly SECTOR: "sector";
9
9
  };
10
- export declare const MULTI_POINT_SHAPES: ("polygon" | "polyline" | "attackArrow" | "pincerArrow" | "sector" | "curve")[];
10
+ export declare const MULTI_POINT_SHAPES: ("polygon" | "polyline" | "attackArrow" | "curve" | "pincerArrow" | "sector")[];
11
11
  declare class Drawer implements DrawContext {
12
12
  private readonly _mapContext;
13
13
  private readonly _drawContext;
@@ -15,7 +15,7 @@ export default class BaseSource {
15
15
  remove(): void;
16
16
  setData(data: any): this | undefined;
17
17
  _toDestroy(): void;
18
- static analysisSourceType(data: any): "other" | "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "clampedPolygonGrid";
18
+ static analysisSourceType(data: any): "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "clampedPolygonGrid" | "other";
19
19
  static wktToGeoJon(wkt: string): any;
20
20
  static geoJsonToGeoCartesian3Array(geoJson: any): any[];
21
21
  static handleFeaturePoint(feature: any): any;
@@ -4,6 +4,7 @@ export declare class DeepTwinsEngine3D {
4
4
  static Map: any;
5
5
  static GroundSkyBox: any;
6
6
  static RasterLayer: any;
7
+ static CustomRasterLayer: any;
7
8
  static WmsLayer: any;
8
9
  static WmtsLayer: any;
9
10
  static ArcGisLayer: any;
@@ -11,6 +12,10 @@ export declare class DeepTwinsEngine3D {
11
12
  static FactorLayer: any;
12
13
  static DeepTwins: any;
13
14
  static WeatherEffects: any;
15
+ static BaseParticle: any;
16
+ static FireParticle: any;
17
+ static SmokeParticle: any;
18
+ static FountainParticle: any;
14
19
  static Drawer: any;
15
20
  static Measure: any;
16
21
  static Rotate: any;
@@ -30,7 +35,10 @@ export declare class DeepTwinsEngine3D {
30
35
  static VolumeCloud: any;
31
36
  static Heatmap2d: any;
32
37
  static Heatmap3d: any;
38
+ static DynamicWater: any;
39
+ static MigrationEffect: any;
33
40
  static PointCluster: any;
41
+ static RadarScan: any;
34
42
  static PositionProperty: any;
35
43
  static Frustum: any;
36
44
  static GridDraw: any;
@@ -61,12 +69,19 @@ export declare class DeepTwinsEngine3D {
61
69
  static DistanceDisplayCondition: any;
62
70
  static BoundingRectangle: any;
63
71
  static SplitDirection: any;
72
+ static ParticleEmitter: any;
73
+ static ParticleBurst: any;
74
+ static CircleEmitter: any;
75
+ static ConeEmitter: any;
76
+ static SphereEmitter: any;
64
77
  static ImageGlowingMaterialProperty: any;
65
78
  static SubmergenceAnalysis: any;
66
79
  static SunLightAnalysis: any;
67
80
  static KmlDataSource: any;
68
81
  static Compass: any;
69
82
  static ViewshedAnalysis: any;
83
+ static LineOfSightAnalysis: any;
84
+ static TerrainExcavationAnalysis: any;
70
85
  static VisitLayer: any;
71
86
  static PoiLayer: any;
72
87
  static FlightPlanning: any;