@openglobus/og 0.16.3 → 0.17.0

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 (181) hide show
  1. package/README.md +1 -1
  2. package/css/og.css +24 -2
  3. package/dist/@openglobus/og.css +1 -1
  4. package/dist/@openglobus/og.esm.js +2 -2
  5. package/dist/@openglobus/og.esm.js.map +1 -1
  6. package/dist/@openglobus/og.umd.js +2 -2
  7. package/dist/@openglobus/og.umd.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/og/Clock.js +1 -5
  10. package/src/og/Events.js +0 -4
  11. package/src/og/Extent.js +5 -9
  12. package/src/og/Globe.js +92 -55
  13. package/src/og/ImageCanvas.js +12 -5
  14. package/src/og/Lock.js +44 -48
  15. package/src/og/LonLat.js +0 -4
  16. package/src/og/Object3d.js +1 -1
  17. package/src/og/Stack.js +49 -53
  18. package/src/og/astro/earth.js +112 -116
  19. package/src/og/astro/jd.js +514 -518
  20. package/src/og/astro/orbit.js +119 -123
  21. package/src/og/astro/rotation.js +36 -40
  22. package/src/og/bv/Box.js +77 -81
  23. package/src/og/bv/Sphere.js +57 -61
  24. package/src/og/camera/Camera.js +20 -7
  25. package/src/og/camera/PlanetCamera.js +8 -15
  26. package/src/og/control/Atmosphere.js +0 -4
  27. package/src/og/control/Control.js +9 -8
  28. package/src/og/control/DebugInfo.js +0 -4
  29. package/src/og/control/DrawingSwitcher.js +117 -0
  30. package/src/og/control/EarthCoordinates.js +214 -214
  31. package/src/og/control/GeoImageDragControl.js +0 -4
  32. package/src/og/control/KeyboardNavigation.js +0 -4
  33. package/src/og/control/LayerAnimation.js +0 -4
  34. package/src/og/control/LayerSwitcher.js +2 -4
  35. package/src/og/control/Lighting.js +11 -15
  36. package/src/og/control/MouseNavigation.js +0 -4
  37. package/src/og/control/MouseWheelZoomControl.js +0 -4
  38. package/src/og/control/RulerSwitcher.js +0 -4
  39. package/src/og/control/ScaleControl.js +2 -6
  40. package/src/og/control/ShowFps.js +40 -44
  41. package/src/og/control/SimpleNavigation.js +10 -10
  42. package/src/og/control/SimpleSkyBackground.js +0 -4
  43. package/src/og/control/Sun.js +0 -4
  44. package/src/og/control/ToggleWireframe.js +35 -39
  45. package/src/og/control/ZoomControl.js +0 -4
  46. package/src/og/control/drawing/DrawingControl.js +51 -0
  47. package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
  48. package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
  49. package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
  50. package/src/og/control/index.js +5 -1
  51. package/src/og/control/ruler/Ruler.js +0 -4
  52. package/src/og/control/ruler/RulerScene.js +3 -2
  53. package/src/og/control/selection/Selection.js +0 -4
  54. package/src/og/control/selection/SelectionScene.js +2 -4
  55. package/src/og/control/timeline/TimelineControl.js +4 -4
  56. package/src/og/control/timeline/TimelineModel.js +2 -2
  57. package/src/og/control/timeline/TimelineView.js +1 -0
  58. package/src/og/control/visibleExtent/Segment.js +5 -5
  59. package/src/og/control/visibleExtent/drawnode.js +0 -4
  60. package/src/og/ellipsoid/Ellipsoid.js +205 -275
  61. package/src/og/ellipsoid/wgs84.js +0 -4
  62. package/src/og/entity/BaseBillboard.js +375 -379
  63. package/src/og/entity/Billboard.js +0 -4
  64. package/src/og/entity/BillboardHandler.js +0 -4
  65. package/src/og/entity/Entity.js +22 -22
  66. package/src/og/entity/EntityCollection.js +7 -11
  67. package/src/og/entity/GeoObject.js +0 -4
  68. package/src/og/entity/GeoObjectHandler.js +0 -4
  69. package/src/og/entity/Geometry.js +5 -4
  70. package/src/og/entity/GeometryHandler.js +3 -4
  71. package/src/og/entity/Label.js +0 -4
  72. package/src/og/entity/LabelHandler.js +0 -4
  73. package/src/og/entity/PointCloud.js +0 -4
  74. package/src/og/entity/PointCloudHandler.js +122 -126
  75. package/src/og/entity/Polyline.js +4 -6
  76. package/src/og/entity/PolylineHandler.js +104 -108
  77. package/src/og/entity/Ray.js +29 -29
  78. package/src/og/entity/Strip.js +1 -1
  79. package/src/og/index.js +3 -1
  80. package/src/og/input/KeyboardHandler.js +128 -132
  81. package/src/og/input/MouseHandler.js +94 -98
  82. package/src/og/input/TouchHandler.js +59 -63
  83. package/src/og/input/input.js +44 -48
  84. package/src/og/layer/BaseGeoImage.js +5 -8
  85. package/src/og/layer/CanvasTiles.js +0 -4
  86. package/src/og/layer/GeoImage.js +0 -4
  87. package/src/og/layer/GeoTexture2d.js +0 -4
  88. package/src/og/layer/GeoVideo.js +0 -4
  89. package/src/og/layer/KML.js +1 -0
  90. package/src/og/layer/Layer.js +22 -26
  91. package/src/og/layer/Material.js +0 -4
  92. package/src/og/layer/Vector.js +23 -20
  93. package/src/og/layer/WMS.js +182 -186
  94. package/src/og/layer/XYZ.js +0 -4
  95. package/src/og/light/LightSource.js +0 -4
  96. package/src/og/math/Line2.js +28 -32
  97. package/src/og/math/Mat3.js +152 -156
  98. package/src/og/math/Ray.js +0 -4
  99. package/src/og/math/Vec2.js +0 -4
  100. package/src/og/math/Vec3.js +0 -4
  101. package/src/og/math/Vec4.js +0 -4
  102. package/src/og/math/coder.js +104 -104
  103. package/src/og/math.js +39 -7
  104. package/src/og/proj/EPSG3857.js +13 -13
  105. package/src/og/proj/Proj.js +59 -63
  106. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
  107. package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
  108. package/src/og/quadTree/EntityCollectionNode.js +12 -16
  109. package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
  110. package/src/og/quadTree/QuadTreeStrategy.js +1 -0
  111. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
  112. package/src/og/renderer/Renderer.js +109 -22
  113. package/src/og/renderer/RendererEvents.js +0 -4
  114. package/src/og/scene/Axes.js +74 -78
  115. package/src/og/scene/BaseNode.js +0 -4
  116. package/src/og/scene/Planet.js +114 -112
  117. package/src/og/scene/RenderNode.js +11 -3
  118. package/src/og/scene/SkyBox.js +104 -108
  119. package/src/og/segment/Segment.js +8 -4
  120. package/src/og/segment/SegmentLonLat.js +2 -6
  121. package/src/og/segment/segmentHelper.js +229 -225
  122. package/src/og/shaders/billboard.js +0 -4
  123. package/src/og/shaders/drawnode.js +5 -9
  124. package/src/og/shaders/geoObject.js +0 -4
  125. package/src/og/shaders/label.js +0 -4
  126. package/src/og/shaders/pickingMask.js +0 -4
  127. package/src/og/shaders/pointCloud.js +0 -4
  128. package/src/og/shaders/polyline.js +0 -4
  129. package/src/og/shaders/ray.js +0 -4
  130. package/src/og/shaders/skybox.js +0 -4
  131. package/src/og/terrain/EmptyTerrain.js +0 -4
  132. package/src/og/utils/FontAtlas.js +0 -4
  133. package/src/og/utils/GeoImageCreator.js +1 -2
  134. package/src/og/utils/NormalMapCreator.js +8 -9
  135. package/src/og/utils/VectorTileCreator.js +3 -9
  136. package/src/og/utils/shared.js +20 -1
  137. package/src/og/webgl/Framebuffer.js +0 -4
  138. package/src/og/webgl/Handler.js +45 -19
  139. package/src/og/webgl/Multisample.js +0 -4
  140. package/src/og/webgl/Program.js +0 -4
  141. package/src/og/webgl/ProgramController.js +2 -2
  142. package/types/Clock.d.ts +1 -1
  143. package/types/Extent.d.ts +5 -5
  144. package/types/Globe.d.ts +15 -1
  145. package/types/ImageCanvas.d.ts +5 -0
  146. package/types/bv/Box.d.ts +1 -1
  147. package/types/bv/Sphere.d.ts +3 -3
  148. package/types/camera/Camera.d.ts +3 -2
  149. package/types/camera/PlanetCamera.d.ts +4 -4
  150. package/types/control/DrawingSwitcher.d.ts +13 -0
  151. package/types/control/EarthCoordinates.d.ts +1 -1
  152. package/types/control/Lighting.d.ts +8 -8
  153. package/types/control/drawing/DrawingControl.d.ts +14 -0
  154. package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
  155. package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
  156. package/types/control/index.d.ts +3 -1
  157. package/types/control/ruler/RulerScene.d.ts +0 -1
  158. package/types/control/selection/SelectionScene.d.ts +0 -1
  159. package/types/ellipsoid/Ellipsoid.d.ts +50 -63
  160. package/types/entity/Entity.d.ts +3 -2
  161. package/types/entity/Geometry.d.ts +5 -0
  162. package/types/entity/Polyline.d.ts +1 -1
  163. package/types/entity/Ray.d.ts +1 -0
  164. package/types/index.d.ts +1 -0
  165. package/types/layer/BaseGeoImage.d.ts +1 -1
  166. package/types/layer/CanvasTiles.d.ts +1 -1
  167. package/types/layer/Layer.d.ts +1 -1
  168. package/types/layer/Vector.d.ts +1 -0
  169. package/types/math.d.ts +7 -0
  170. package/types/renderer/Renderer.d.ts +7 -1
  171. package/types/scene/Axes.d.ts +0 -1
  172. package/types/scene/Planet.d.ts +26 -24
  173. package/types/scene/RenderNode.d.ts +2 -0
  174. package/types/scene/SkyBox.d.ts +0 -1
  175. package/types/segment/Segment.d.ts +3 -2
  176. package/types/segment/SegmentLonLat.d.ts +0 -1
  177. package/types/utils/GeoImageCreator.d.ts +1 -1
  178. package/types/utils/NormalMapCreator.d.ts +1 -1
  179. package/types/utils/VectorTileCreator.d.ts +2 -2
  180. package/types/utils/shared.d.ts +2 -0
  181. package/types/webgl/Handler.d.ts +6 -4
@@ -35,7 +35,7 @@ class SimpleNavigation extends Control {
35
35
  if (this._active) {
36
36
  var camera = this.camera;
37
37
  camera.slide(0, 0, -this.speed);
38
- //camera.update();
38
+ camera.update();
39
39
  }
40
40
  }
41
41
 
@@ -43,7 +43,7 @@ class SimpleNavigation extends Control {
43
43
  if (this._active) {
44
44
  var camera = this.camera;
45
45
  camera.slide(0, 0, this.speed);
46
- //camera.update();
46
+ camera.update();
47
47
  }
48
48
  }
49
49
 
@@ -51,7 +51,7 @@ class SimpleNavigation extends Control {
51
51
  if (this._active) {
52
52
  var camera = this.camera;
53
53
  camera.slide(-this.speed, 0, 0);
54
- //camera.update();
54
+ camera.update();
55
55
  }
56
56
  }
57
57
 
@@ -59,7 +59,7 @@ class SimpleNavigation extends Control {
59
59
  if (this._active) {
60
60
  var camera = this.camera;
61
61
  camera.slide(this.speed, 0, 0);
62
- //camera.update();
62
+ camera.update();
63
63
  }
64
64
  }
65
65
 
@@ -67,7 +67,7 @@ class SimpleNavigation extends Control {
67
67
  if (this._active) {
68
68
  var cam = this.camera;
69
69
  cam.pitch(0.5);
70
- //cam.update();
70
+ cam.update();
71
71
  }
72
72
  }
73
73
 
@@ -75,7 +75,7 @@ class SimpleNavigation extends Control {
75
75
  if (this._active) {
76
76
  var cam = this.camera;
77
77
  cam.pitch(-0.5);
78
- //cam.update();
78
+ cam.update();
79
79
  }
80
80
  }
81
81
 
@@ -83,7 +83,7 @@ class SimpleNavigation extends Control {
83
83
  if (this._active) {
84
84
  var cam = this.camera;
85
85
  cam.yaw(0.5);
86
- //cam.update();
86
+ cam.update();
87
87
  }
88
88
  }
89
89
 
@@ -91,7 +91,7 @@ class SimpleNavigation extends Control {
91
91
  if (this._active) {
92
92
  var cam = this.camera;
93
93
  cam.yaw(-0.5);
94
- //cam.update();
94
+ cam.update();
95
95
  }
96
96
  }
97
97
 
@@ -99,7 +99,7 @@ class SimpleNavigation extends Control {
99
99
  if (this._active) {
100
100
  var cam = this.camera;
101
101
  cam.roll(-0.5);
102
- //cam.update();
102
+ cam.update();
103
103
  }
104
104
  }
105
105
 
@@ -107,7 +107,7 @@ class SimpleNavigation extends Control {
107
107
  if (this._active) {
108
108
  var cam = this.camera;
109
109
  cam.roll(0.5);
110
- //cam.update();
110
+ cam.update();
111
111
  }
112
112
  }
113
113
  }
@@ -1,7 +1,3 @@
1
- /**
2
- * @module og/control/SimpleSkyBackground
3
- */
4
-
5
1
  "use strict";
6
2
 
7
3
  import { htmlColorToRgb } from "../utils/shared.js";
@@ -1,7 +1,3 @@
1
- /**
2
- * @module og/control/Sun
3
- */
4
-
5
1
  "use strict";
6
2
 
7
3
  import { getSunPosition } from "../astro/earth.js";
@@ -1,39 +1,35 @@
1
- /**
2
- * @module og/control/ToggleWireframe
3
- */
4
-
5
- "use strict";
6
-
7
- import { input } from "../input/input.js";
8
- import { Control } from "./Control.js";
9
-
10
- /**
11
- * Planet GL draw mode(TRIANGLE_STRIP/LINE_STRING) changer.
12
- * @class
13
- * @extends {Control}
14
- * @param {Object} [options] - Control options.
15
- */
16
- class ToggleWireframe extends Control {
17
- constructor(options = {}) {
18
- super(options);
19
- this._isActive = options.isActive || false;
20
- }
21
-
22
- oninit() {
23
- this.renderer.events.on("charkeypress", input.KEY_X, this.toogleWireframe, this);
24
- if (this._isActive) {
25
- this.planet.setDrawMode(this.renderer.handler.gl.LINE_STRIP);
26
- }
27
- }
28
-
29
- toogleWireframe(e) {
30
- if (this.planet.drawMode === this.renderer.handler.gl.LINE_STRIP) {
31
- this.planet.setDrawMode(this.renderer.handler.gl.TRIANGLE_STRIP);
32
- } else {
33
- this.planet.setDrawMode(this.renderer.handler.gl.LINE_STRIP);
34
- }
35
- }
36
- }
37
-
38
- export { ToggleWireframe };
39
-
1
+ "use strict";
2
+
3
+ import { input } from "../input/input.js";
4
+ import { Control } from "./Control.js";
5
+
6
+ /**
7
+ * Planet GL draw mode(TRIANGLE_STRIP/LINE_STRING) changer.
8
+ * @class
9
+ * @extends {Control}
10
+ * @param {Object} [options] - Control options.
11
+ */
12
+ class ToggleWireframe extends Control {
13
+ constructor(options = {}) {
14
+ super(options);
15
+ this._isActive = options.isActive || false;
16
+ }
17
+
18
+ oninit() {
19
+ this.renderer.events.on("charkeypress", input.KEY_X, this.toogleWireframe, this);
20
+ if (this._isActive) {
21
+ this.planet.setDrawMode(this.renderer.handler.gl.LINE_STRIP);
22
+ }
23
+ }
24
+
25
+ toogleWireframe(e) {
26
+ if (this.planet.drawMode === this.renderer.handler.gl.LINE_STRIP) {
27
+ this.planet.setDrawMode(this.renderer.handler.gl.TRIANGLE_STRIP);
28
+ } else {
29
+ this.planet.setDrawMode(this.renderer.handler.gl.LINE_STRIP);
30
+ }
31
+ }
32
+ }
33
+
34
+ export { ToggleWireframe };
35
+
@@ -1,7 +1,3 @@
1
- /**
2
- * @module og/control/ZoomControl
3
- */
4
-
5
1
  "use strict";
6
2
 
7
3
  import { Key } from "../Lock.js";
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ import { Control } from "../Control.js";
4
+ import { PolygonDrawingScene } from "./PolygonDrawingScene.js";
5
+ import { LineStringDrawingScene } from "./LineStringDrawingScene.js";
6
+
7
+ /**
8
+ * Activate drawing
9
+ * @class
10
+ * @extends {Control}
11
+ * @param {Object} [options] - Control options.
12
+ */
13
+ class DrawingControl extends Control {
14
+ constructor(options = {}) {
15
+ super(options);
16
+
17
+ this._drawingScene = new LineStringDrawingScene({
18
+ name: `drawingScene:${this._id}`
19
+ });
20
+ }
21
+
22
+ activatePolygonDrawing(){
23
+ this.deactivate();
24
+ this._drawingScene = new PolygonDrawingScene({
25
+ name: `drawingScene:${this._id}`
26
+ });
27
+ this.activate();
28
+ }
29
+
30
+ activateLineStringDrawing() {
31
+ this.deactivate();
32
+ this._drawingScene = new LineStringDrawingScene({
33
+ name: `drawingScene:${this._id}`
34
+ });
35
+ this.activate();
36
+ }
37
+
38
+ oninit() {
39
+ }
40
+
41
+ onactivate() {
42
+ this._drawingScene.bindPlanet(this.planet);
43
+ this.renderer.addNode(this._drawingScene);
44
+ }
45
+
46
+ ondeactivate() {
47
+ this.renderer.removeNode(this._drawingScene);
48
+ }
49
+ }
50
+
51
+ export { DrawingControl };
@@ -0,0 +1,203 @@
1
+ import {
2
+ OUTLINE_ALT,
3
+ CORNER_OPTIONS,
4
+ NUM_SEGMENTS,
5
+ OUTLINE_OPTIONS,
6
+ CENTER_OPTIONS,
7
+ PolygonDrawingScene
8
+ } from "./PolygonDrawingScene.js";
9
+ import { Entity } from "../../entity/Entity.js";
10
+ import { Line3, Vec2, Vec3 } from "../../math/index.js";
11
+ import * as math from "../../math.js";
12
+ import { GeometryType } from "../../entity/Geometry.js";
13
+
14
+ class LineStringDrawingScene extends PolygonDrawingScene {
15
+ constructor(props) {
16
+ super(props);
17
+ }
18
+
19
+ get geometryType() {
20
+ return "LineString";
21
+ }
22
+
23
+ _addNew(cart) {
24
+ this._appendCart(cart);
25
+ }
26
+
27
+ _appendCart(cart) {
28
+ let corners = this._cornerLayer.getEntities();
29
+
30
+ let segNum = corners.length - 1;
31
+ let prevCorn = corners[segNum];
32
+
33
+ let corner = new Entity({
34
+ geoObject: CORNER_OPTIONS,
35
+ });
36
+
37
+ corner.setCartesian3v(cart);
38
+ corner.addTo(this._cornerLayer);
39
+ this._checkTerrainCollision(corner);
40
+
41
+ if (prevCorn) {
42
+
43
+ let prevCart = prevCorn.getCartesian();
44
+
45
+ let vecPrev = corner.getCartesian().sub(prevCart);
46
+
47
+ let distPrev = vecPrev.length();
48
+
49
+ vecPrev.normalize();
50
+
51
+ let prevPath = [];
52
+
53
+ for (let i = 0; i <= NUM_SEGMENTS; i++) {
54
+ let p = vecPrev.scaleTo(i * distPrev / NUM_SEGMENTS).addA(prevCart);
55
+ prevPath.push(p);
56
+ }
57
+
58
+ let entity = new Entity({
59
+ polyline: {
60
+ path3v: [prevPath],
61
+ isClosed: false,
62
+ properties: {
63
+ index: segNum + 1
64
+ },
65
+ ...OUTLINE_OPTIONS
66
+ }
67
+ });
68
+ entity.polyline.altitude = OUTLINE_ALT;
69
+ this._outlineLayer.add(entity);
70
+
71
+ let prevCenterCart = vecPrev.scaleTo(distPrev * 0.5).addA(prevCart);
72
+
73
+ let center = new Entity({
74
+ geoObject: CENTER_OPTIONS,
75
+ });
76
+ center.setCartesian3v(prevCenterCart);
77
+ center.addTo(this._centerLayer);
78
+ this._checkTerrainCollision(center);
79
+
80
+ }
81
+ }
82
+
83
+ _clearGhostPointer() {
84
+ this._ghostOutlineLayer.getEntities()[0].polyline.clear();
85
+ }
86
+
87
+ _moveCorner(indexCurrent, indexPrev, indexCenter) {
88
+ let corners = this._cornerLayer.getEntities();
89
+ if (corners.length == 0) return;
90
+ if (corners.length == 1) {
91
+ indexCurrent = indexPrev = indexCenter = 0;
92
+ }
93
+ let cartCurr = corners[indexCurrent].getCartesian();
94
+ let vecCurr = this._pickedCorner.getCartesian().sub(cartCurr);
95
+ let distCurr = vecCurr.length();
96
+ vecCurr.normalize();
97
+
98
+ let path = [];
99
+ for (let i = 0; i <= NUM_SEGMENTS; i++) {
100
+ let p = vecCurr.scaleTo(i * distCurr / NUM_SEGMENTS).addA(cartCurr);
101
+ path.push(p);
102
+ }
103
+
104
+ let entities = this._outlineLayer.getEntities();
105
+
106
+ let prevPolyline = entities[indexPrev].polyline;
107
+
108
+ prevPolyline.setPath3v([path]);
109
+
110
+ //
111
+ // Move center points
112
+ let centers = this._centerLayer.getEntities();
113
+ let center = centers[indexCenter];
114
+
115
+ if (center) {
116
+ let centerCart = vecCurr.scaleTo(distCurr * 0.5).addA(cartCurr);
117
+ center.setCartesian3v(centerCart);
118
+ this._checkTerrainCollision(center);
119
+ }
120
+ }
121
+
122
+ _moveCornerPoint(e) {
123
+ let d = new Vec2(e.x, e.y).sub(this._startClick),
124
+ p = this._startPos.add(d);
125
+
126
+ let groundCoords = this._planet.getCartesianFromPixelTerrain(p);
127
+
128
+ if (groundCoords) {
129
+
130
+ this._pickedCorner.setCartesian3v(groundCoords);
131
+
132
+ let corners = this._cornerLayer.getEntities();
133
+
134
+ if (corners.length) {
135
+ let ind = this._pickedCorner.layerIndex;
136
+ let size = corners.length;
137
+
138
+ if (ind === 0) {
139
+ this._moveCorner(ind + 1, ind + 1, ind);
140
+ } else if (ind === corners.length - 1) {
141
+ this._moveCorner(ind - 1, ind, ind - 1);
142
+ } else {
143
+ this._moveCorner(ind + 1, ind + 1, ind);
144
+ this._moveCorner(ind - 1, ind, ind - 1);
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ _updateGhostOutlinePointer(groundPos) {
151
+
152
+ let corners = this._cornerLayer.getEntities();
153
+ let size = corners.length;
154
+
155
+ if (size > 0) {
156
+
157
+ let ind = size - 1;
158
+
159
+ this._insertCornerIndex = ind;
160
+
161
+ let cartPrev = corners[ind].getCartesian();
162
+
163
+ let vecPrev = this._ghostCorner.getCartesian().sub(cartPrev);
164
+
165
+ let distPrev = vecPrev.length();
166
+
167
+ vecPrev.normalize();
168
+
169
+ let pathPrev = [];
170
+
171
+ for (let i = 0; i <= NUM_SEGMENTS; i++) {
172
+ let p = vecPrev.scaleTo(i * distPrev / NUM_SEGMENTS).addA(cartPrev);
173
+ pathPrev.push(p);
174
+ }
175
+
176
+ let entities = this._ghostOutlineLayer.getEntities();
177
+
178
+ let prevPolyline = entities[0].polyline;
179
+
180
+ prevPolyline.setPath3v([pathPrev]);
181
+ }
182
+ }
183
+
184
+ _initGhostLayerPointer() {
185
+ this._ghostOutlineLayer.setEntities([
186
+ new Entity({
187
+ polyline: {
188
+ path3v: [],
189
+ isClosed: false,
190
+ ...OUTLINE_OPTIONS
191
+ },
192
+ properties: {
193
+ index: 0
194
+ }
195
+ }),
196
+ this._ghostCorner
197
+ ]);
198
+
199
+ this._ghostOutlineLayer.getEntities()[0].polyline.altitude = OUTLINE_ALT;
200
+ }
201
+ }
202
+
203
+ export { LineStringDrawingScene };