@openglobus/og 0.15.3 → 0.15.5

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 (71) hide show
  1. package/README.md +3 -7
  2. package/css/og.css +24 -15
  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/Globe.js +4 -0
  10. package/src/og/LonLat.js +207 -193
  11. package/src/og/Object3d.js +1 -1
  12. package/src/og/camera/Camera.js +4 -16
  13. package/src/og/camera/PlanetCamera.js +12 -6
  14. package/src/og/control/DebugInfo.js +263 -165
  15. package/src/og/control/KeyboardNavigation.js +153 -169
  16. package/src/og/control/MouseNavigation.js +0 -20
  17. package/src/og/control/RulerSwitcher.js +4 -1
  18. package/src/og/control/SimpleNavigation.js +123 -128
  19. package/src/og/control/heightRuler/HeightRuler.js +12 -0
  20. package/src/og/control/heightRuler/HeightRulerScene.js +224 -0
  21. package/src/og/control/heightRuler/HeightRulerSwitcher.js +15 -0
  22. package/src/og/control/index.js +2 -0
  23. package/src/og/control/ruler/RulerScene.js +106 -79
  24. package/src/og/ellipsoid/Ellipsoid.js +20 -3
  25. package/src/og/entity/Entity.js +6 -6
  26. package/src/og/entity/EntityCollection.js +4 -0
  27. package/src/og/entity/GeoObjectHandler.js +3 -0
  28. package/src/og/layer/BaseGeoImage.js +152 -16
  29. package/src/og/layer/GeoImage.js +0 -91
  30. package/src/og/layer/GeoTexture2d.js +54 -143
  31. package/src/og/layer/GeoVideo.js +6 -107
  32. package/src/og/layer/Material.js +1 -1
  33. package/src/og/layer/Vector.js +8 -6
  34. package/src/og/layer/XYZ.js +2 -2
  35. package/src/og/quadTree/EntityCollectionNode.js +8 -2
  36. package/src/og/renderer/Renderer.js +91 -94
  37. package/src/og/renderer/RendererEvents.js +39 -23
  38. package/src/og/scene/BaseNode.js +113 -113
  39. package/src/og/scene/Planet.js +20 -13
  40. package/src/og/scene/RenderNode.js +42 -9
  41. package/src/og/segment/Segment.js +38 -45
  42. package/src/og/shaders/geoObject.js +12 -10
  43. package/src/og/shaders/pickingMask.js +1 -1
  44. package/src/og/utils/GeoImageCreator.js +61 -21
  45. package/src/og/utils/VectorTileCreator.js +32 -49
  46. package/src/og/webgl/Framebuffer.js +5 -0
  47. package/types/LonLat.d.ts +8 -0
  48. package/types/camera/PlanetCamera.d.ts +1 -1
  49. package/types/control/DebugInfo.d.ts +4 -0
  50. package/types/control/SimpleNavigation.d.ts +1 -0
  51. package/types/control/heightRuler/HeightRuler.d.ts +6 -0
  52. package/types/control/heightRuler/HeightRulerScene.d.ts +23 -0
  53. package/types/control/index.d.ts +2 -1
  54. package/types/control/ruler/RulerScene.d.ts +8 -5
  55. package/types/control/selection/SelectionScene.d.ts +0 -1
  56. package/types/ellipsoid/Ellipsoid.d.ts +13 -1
  57. package/types/entity/EntityCollection.d.ts +1 -0
  58. package/types/layer/BaseGeoImage.d.ts +17 -3
  59. package/types/layer/GeoImage.d.ts +0 -8
  60. package/types/layer/GeoTexture2d.d.ts +0 -2
  61. package/types/layer/GeoVideo.d.ts +0 -8
  62. package/types/layer/XYZ.d.ts +1 -1
  63. package/types/renderer/Renderer.d.ts +12 -3
  64. package/types/scene/Axes.d.ts +1 -1
  65. package/types/scene/BaseNode.d.ts +2 -2
  66. package/types/scene/Planet.d.ts +0 -5
  67. package/types/scene/RenderNode.d.ts +16 -9
  68. package/types/scene/SkyBox.d.ts +1 -1
  69. package/types/segment/Segment.d.ts +2 -3
  70. package/types/utils/VectorTileCreator.d.ts +1 -3
  71. package/types/webgl/Framebuffer.d.ts +1 -0
@@ -4,6 +4,7 @@ import { LonLat } from '../LonLat.js';
4
4
  import * as utils from '../utils/shared.js';
5
5
  import { Framebuffer } from '../webgl/Framebuffer.js';
6
6
  import { Program } from '../webgl/Program.js';
7
+ import { doubleToTwoFloats2 } from "../math/coder.js";
7
8
 
8
9
  export class GeoImageCreator {
9
10
 
@@ -32,35 +33,67 @@ export class GeoImageCreator {
32
33
  * @return{WebGLBuffer} Grid coordinates buffer.
33
34
  */
34
35
  createGridBuffer(c, toMerc) {
35
- var gs = this._gridSize;
36
+ let gs = this._gridSize;
36
37
 
37
- var v03 = new LonLat((c[3].lon - c[0].lon) / gs, (c[3].lat - c[0].lat) / gs),
38
+ let v03 = new LonLat((c[3].lon - c[0].lon) / gs, (c[3].lat - c[0].lat) / gs),
38
39
  v12 = new LonLat((c[2].lon - c[1].lon) / gs, (c[2].lat - c[1].lat) / gs),
39
40
  v01 = new LonLat((c[1].lon - c[0].lon) / gs, (c[1].lat - c[0].lat) / gs),
40
41
  v32 = new LonLat((c[2].lon - c[3].lon) / gs, (c[2].lat - c[3].lat) / gs);
41
42
 
42
- var grid = new Float32Array((gs + 1) * (gs + 1) * 2);
43
- var k = 0;
43
+ const size = (gs + 1) * (gs + 1) * 2,
44
+ halfSize = size / 2;
45
+
46
+ let gridHigh = new Float32Array(size),
47
+ gridLow = new Float32Array(size);
48
+
49
+ let lonLatArr = new Array(halfSize);
50
+
51
+ let kh = 0,
52
+ kl = 0,
53
+ k = 0;
54
+
55
+ let tempArr = new Float32Array(2);
56
+
44
57
  for (let i = 0; i <= gs; i++) {
45
- var P03i = new LonLat(c[0].lon + i * v03.lon, c[0].lat + i * v03.lat),
58
+
59
+ let P03i = new LonLat(c[0].lon + i * v03.lon, c[0].lat + i * v03.lat),
46
60
  P12i = new LonLat(c[1].lon + i * v12.lon, c[1].lat + i * v12.lat);
61
+
47
62
  for (let j = 0; j <= gs; j++) {
48
- var P01j = new LonLat(c[0].lon + j * v01.lon, c[0].lat + j * v01.lat),
63
+ let P01j = new LonLat(c[0].lon + j * v01.lon, c[0].lat + j * v01.lat),
49
64
  P32j = new LonLat(c[3].lon + j * v32.lon, c[3].lat + j * v32.lat);
50
- var xx = utils.getLinesIntersectionLonLat(P03i, P12i, P01j, P32j);
51
- grid[k++] = xx.lon;
52
- grid[k++] = xx.lat;
65
+ let xx = utils.getLinesIntersectionLonLat(P03i, P12i, P01j, P32j);
66
+ doubleToTwoFloats2(xx.lon, tempArr);
67
+ gridHigh[kh++] = tempArr[0];
68
+ gridLow[kl++] = tempArr[1];
69
+ doubleToTwoFloats2(xx.lat, tempArr);
70
+ gridHigh[kh++] = tempArr[0];
71
+ gridLow[kl++] = tempArr[1];
72
+
73
+ lonLatArr[k++] = xx;
53
74
  }
54
75
  }
55
76
 
56
77
  if (toMerc) {
57
- for (let i = 0; i < grid.length; i += 2) {
58
- let c = new LonLat(grid[i], grid[i + 1]).forwardMercator();
59
- grid[i] = c.lon;
60
- grid[i + 1] = c.lat;
78
+ for (let i = 0; i < halfSize; i++) {
79
+ let c = lonLatArr[i].forwardMercator();
80
+ doubleToTwoFloats2(c.lon, tempArr);
81
+ gridHigh[i * 2] = tempArr[0];
82
+ gridLow[i * 2] = tempArr[1];
83
+
84
+ doubleToTwoFloats2(c.lat, tempArr);
85
+ gridHigh[i * 2 + 1] = tempArr[0];
86
+ gridLow[i * 2 + 1] = tempArr[1];
87
+
88
+ //grid[i] = c.lon;
89
+ //grid[i + 1] = c.lat;
61
90
  }
62
91
  }
63
- return this._planet.renderer.handler.createArrayBuffer(grid, 2, grid.length / 2);
92
+
93
+ return [
94
+ this._planet.renderer.handler.createArrayBuffer(gridHigh, 2, halfSize),
95
+ this._planet.renderer.handler.createArrayBuffer(gridLow, 2, halfSize)
96
+ ];
64
97
  }
65
98
 
66
99
  frame() {
@@ -133,20 +166,27 @@ export class GeoImageCreator {
133
166
  this._planet.renderer.handler.addProgram(new Program("geoImageTransform", {
134
167
  uniforms: {
135
168
  sourceTexture: "sampler2d",
136
- extentParams: "vec4",
169
+ extentParamsHigh: "vec4",
170
+ extentParamsLow: "vec4",
137
171
  isFullExtent: "bool"
138
172
  },
139
173
  attributes: {
140
- corners: "vec2",
174
+ cornersHigh: "vec2",
175
+ cornersLow: "vec2",
141
176
  texCoords: "vec2"
142
177
  },
143
- vertexShader: `attribute vec2 corners;
178
+ vertexShader:
179
+ `attribute vec2 cornersHigh;
180
+ attribute vec2 cornersLow;
144
181
  attribute vec2 texCoords;
145
- varying vec2 v_texCoords;
146
- uniform vec4 extentParams;
147
- void main() {
182
+ uniform vec4 extentParamsHigh;
183
+ uniform vec4 extentParamsLow;
184
+ varying vec2 v_texCoords;
185
+ void main() {
148
186
  v_texCoords = texCoords;
149
- gl_Position = vec4((-1.0 + (corners - extentParams.xy) * extentParams.zw) * vec2(1.0, -1.0), 0.0, 1.0);
187
+ vec2 highDiff = cornersHigh - extentParamsHigh.xy;
188
+ vec2 lowDiff = cornersLow - extentParamsLow.xy;
189
+ gl_Position = vec4((-1.0 + (highDiff + lowDiff) * extentParamsHigh.zw) * vec2(1.0, -1.0), 0.0, 1.0);
150
190
  }`,
151
191
  fragmentShader:
152
192
  `precision highp float;
@@ -5,23 +5,23 @@
5
5
  'use strict';
6
6
 
7
7
  import { doubleToTwoFloats2 } from '../math/coder.js';
8
- import * as quadTree from '../quadTree/quadTree.js';
8
+ import { RENDERING } from '../quadTree/quadTree.js';
9
9
  import { Framebuffer } from '../webgl/Framebuffer.js';
10
10
  import { Program } from '../webgl/Program.js';
11
11
 
12
12
  let tempArr = new Float32Array(2);
13
13
 
14
+ const MAX_FRAME_TIME = 25.0;
15
+
14
16
  export class VectorTileCreator {
15
17
 
16
- constructor(planet, maxFrames = 5, width = 256, height = 256) {
18
+ constructor(planet, width = 512, height = 512) {
17
19
 
18
20
  this._width = width;
19
21
  this._height = height;
20
22
  this._handler = planet.renderer.handler;
21
23
  this._planet = planet;
22
24
  this._framebuffer = null;
23
- this.MAX_FRAMES = maxFrames;
24
- this._currentFrame = 0;
25
25
  this._queue = [];
26
26
  this._initialize();
27
27
  }
@@ -193,44 +193,38 @@ export class VectorTileCreator {
193
193
 
194
194
  frame() {
195
195
  if (this._planet.layerLock.isFree() && this._queue.length) {
196
- var h = this._handler,
196
+ let h = this._handler,
197
197
  gl = h.gl;
198
198
 
199
199
  gl.disable(gl.CULL_FACE);
200
200
  gl.disable(gl.DEPTH_TEST);
201
201
 
202
- // gl.enable(gl.BLEND);
203
- // gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);
204
- // gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
205
-
206
- var hLine = h.programs.vectorTileLineRasterization,
202
+ let hLine = h.programs.vectorTileLineRasterization,
207
203
  hPoly = h.programs.vectorTilePolygonRasterization;
208
204
 
209
- var _w = this._width,
205
+ let _w = this._width,
210
206
  _h = this._height,
211
207
  width = _w,
212
208
  height = _h,
213
209
  _w2 = width << 1,
214
210
  _h2 = height << 1;
215
211
 
216
- var pickingMask = null,
217
- texture = null;
218
-
219
212
  // var prevLayerId = -1;
220
213
 
221
- var extentParamsHigh = new Float32Array(4);
222
- var extentParamsLow = new Float32Array(4);
214
+ let extentParamsHigh = new Float32Array(4);
215
+ let extentParamsLow = new Float32Array(4);
223
216
 
224
- var f = this._framebuffer.activate();
217
+ let f = this._framebuffer.activate();
225
218
 
226
- var deltaTime = 0,
219
+ let deltaTime = 0,
227
220
  startTime = window.performance.now();
228
221
 
229
- while (this._planet.layerLock.isFree() && this._queue.length && deltaTime < 0.25) {
230
- var material = this._queue.shift();
231
- if (material.isLoading && material.segment.node.getState() === quadTree.RENDERING) {
222
+ while (this._queue.length && deltaTime < MAX_FRAME_TIME) {
223
+ let material = this._queue.shift();
224
+ if (material.isLoading && material.segment.node.getState() === RENDERING) {
225
+ let pickingEnabled = material.layer._pickingEnabled;
232
226
 
233
- if (material.segment.tileZoom <= 3) {
227
+ if (material.segment.tileZoom < 4) {
234
228
  width = _w2;
235
229
  height = _h2;
236
230
  } else {
@@ -238,7 +232,10 @@ export class VectorTileCreator {
238
232
  height = _h;
239
233
  }
240
234
 
241
- texture = material._updateTexture || h.createEmptyTexture_l(width, height);
235
+ let texture = material._updateTexture || h.createEmptyTexture_l(width, height);
236
+ let pickingMask = pickingEnabled ? material._updatePickingMask || h.createEmptyTexture_n(width, height) : null;
237
+
238
+ material.applyTexture(texture, pickingMask);
242
239
 
243
240
  f.setSize(width, height);
244
241
 
@@ -247,7 +244,7 @@ export class VectorTileCreator {
247
244
  gl.clearColor(0.0, 0.0, 0.0, 0.0);
248
245
  gl.clear(gl.COLOR_BUFFER_BIT);
249
246
 
250
- var extent = material.segment.getExtentMerc();
247
+ let extent = material.segment.getExtentMerc();
251
248
 
252
249
  doubleToTwoFloats2(extent.southWest.lon, tempArr);
253
250
  extentParamsHigh[0] = tempArr[0];
@@ -261,11 +258,11 @@ export class VectorTileCreator {
261
258
  extentParamsHigh[3] = 2.0 / extent.getHeight();
262
259
 
263
260
  hPoly.activate();
264
- var sh = hPoly._program;
265
- var sha = sh.attributes,
261
+ let sh = hPoly._program;
262
+ let sha = sh.attributes,
266
263
  shu = sh.uniforms;
267
264
 
268
- var geomHandler = material.layer._geometryHandler;
265
+ let geomHandler = material.layer._geometryHandler;
269
266
 
270
267
  //=========================================
271
268
  //Polygon rendering
@@ -287,26 +284,16 @@ export class VectorTileCreator {
287
284
  gl.drawElements(gl.TRIANGLES, geomHandler._polyIndexesBuffer.numItems, gl.UNSIGNED_INT, 0);
288
285
 
289
286
  //Polygon picking PASS
290
- if (material.layer._pickingEnabled) {
291
- if (!material.pickingReady) {
292
- if (material._updatePickingMask) {
293
- pickingMask = material._updatePickingMask;
294
- } else {
295
- pickingMask = h.createEmptyTexture_n(width, height);
296
- }
297
-
298
- f.bindOutputTexture(pickingMask);
287
+ if (pickingEnabled) {
288
+ f.bindOutputTexture(pickingMask);
299
289
 
300
- gl.clearColor(0.0, 0.0, 0.0, 0.0);
301
- gl.clear(gl.COLOR_BUFFER_BIT);
290
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
291
+ gl.clear(gl.COLOR_BUFFER_BIT);
302
292
 
303
- gl.bindBuffer(gl.ARRAY_BUFFER, geomHandler._polyPickingColorsBuffer);
304
- gl.vertexAttribPointer(sha.colors, geomHandler._polyPickingColorsBuffer.itemSize, gl.FLOAT, false, 0, 0);
293
+ gl.bindBuffer(gl.ARRAY_BUFFER, geomHandler._polyPickingColorsBuffer);
294
+ gl.vertexAttribPointer(sha.colors, geomHandler._polyPickingColorsBuffer.itemSize, gl.FLOAT, false, 0, 0);
305
295
 
306
- gl.drawElements(gl.TRIANGLES, geomHandler._polyIndexesBuffer.numItems, gl.UNSIGNED_INT, 0);
307
- } else {
308
- pickingMask = material.pickingMask;
309
- }
296
+ gl.drawElements(gl.TRIANGLES, geomHandler._polyIndexesBuffer.numItems, gl.UNSIGNED_INT, 0);
310
297
  }
311
298
 
312
299
  //=========================================
@@ -379,22 +366,18 @@ export class VectorTileCreator {
379
366
  gl.uniform1f(shu.alpha, 1.0);
380
367
  gl.drawElements(gl.TRIANGLE_STRIP, geomHandler._lineIndexesBuffer.numItems, gl.UNSIGNED_INT, 0);
381
368
 
382
- if (material.layer._pickingEnabled && !material.pickingReady) {
369
+ if (pickingEnabled) {
383
370
  f.bindOutputTexture(pickingMask);
384
371
  gl.uniform1f(shu.thicknessOutline, 8);
385
372
  gl.bindBuffer(gl.ARRAY_BUFFER, geomHandler._linePickingColorsBuffer);
386
373
  gl.vertexAttribPointer(sha.color, geomHandler._linePickingColorsBuffer.itemSize, gl.FLOAT, false, 0, 0);
387
374
  gl.drawElements(gl.TRIANGLE_STRIP, geomHandler._lineIndexesBuffer.numItems, gl.UNSIGNED_INT, 0);
388
375
  }
389
-
390
- material.applyTexture(texture, pickingMask);
391
-
392
376
  } else {
393
377
  material.isLoading = false;
394
378
  }
395
379
 
396
380
  deltaTime = window.performance.now() - startTime;
397
- // prevLayerId = material.layer._id;
398
381
  }
399
382
 
400
383
  gl.enable(gl.DEPTH_TEST);
@@ -214,6 +214,11 @@ export class Framebuffer {
214
214
  }
215
215
  }
216
216
 
217
+ checkStatus() {
218
+ let gl = this.handler.gl;
219
+ return gl.checkFramebufferStatus(gl.FRAMEBUFFER);
220
+ }
221
+
217
222
  /**
218
223
  * Returns framebuffer completed.
219
224
  * @public
package/types/LonLat.d.ts CHANGED
@@ -29,6 +29,14 @@ export class LonLat {
29
29
  * @returns {LonLat} -
30
30
  */
31
31
  static forwardMercator(lon: number, lat: number, height?: number): LonLat;
32
+ /**
33
+ * Converts degrees to mercator coordinates.
34
+ * @static
35
+ * @param {LonLat} lonLat - Input geodetic degree coordinates
36
+ * @param {LonLat} res - Output mercator coordinates
37
+ * @returns {LonLat} - Output mercator coordinates
38
+ */
39
+ static forwardMercatorRes(lonLat: LonLat, res: LonLat): LonLat;
32
40
  /**
33
41
  * Converts mercator to degrees coordinates.
34
42
  * @static
@@ -215,7 +215,7 @@ export class PlanetCamera extends Camera {
215
215
  * @public
216
216
  */
217
217
  public checkFly(): void;
218
- checkTerrainCollision(): void;
218
+ checkTerrainCollision(): Vec3;
219
219
  getSurfaceVisibleDistance(d: any): number;
220
220
  getHeading(): number;
221
221
  isVisible(poi: any): boolean;
@@ -8,8 +8,12 @@ export function debugInfo(options: any): DebugInfo;
8
8
  export class DebugInfo extends Control {
9
9
  el: HTMLDivElement;
10
10
  _watch: any;
11
+ _toggleBtn: ToggleButton;
12
+ _dialog: Dialog;
11
13
  addWatches(watches: any): void;
12
14
  addWatch(watch: any): void;
13
15
  _frame(): void;
14
16
  }
15
17
  import { Control } from "./Control.js";
18
+ import { ToggleButton } from "../ui/ToggleButton.js";
19
+ import { Dialog } from "../ui/Dialog.js";
@@ -9,6 +9,7 @@ export function simpleNavigation(options: any): SimpleNavigation;
9
9
  * @param {Object} [options] - Control options.
10
10
  */
11
11
  export class SimpleNavigation extends Control {
12
+ constructor(options?: {});
12
13
  camera: any;
13
14
  speed: any;
14
15
  onCameraMoveForward(): void;
@@ -0,0 +1,6 @@
1
+ export class HeightRuler extends Ruler {
2
+ constructor(options: any);
3
+ _rulerScene: HeightRulerScene;
4
+ }
5
+ import { Ruler } from "../ruler/Ruler.js";
6
+ import { HeightRulerScene } from "./HeightRulerScene.js";
@@ -0,0 +1,23 @@
1
+ export class HeightRulerScene extends RulerScene {
2
+ _geoRulerLayer: Vector;
3
+ get deltaLabel(): Entity;
4
+ get startLabel(): Entity;
5
+ get endLabel(): Entity;
6
+ get corners(): Entity[];
7
+ get startCorner(): Entity;
8
+ get endCorner(): Entity;
9
+ get startCornerLonLat(): import("../../LonLat.js").LonLat;
10
+ get startCornerHeight(): number;
11
+ get endCornerLonLat(): import("../../LonLat.js").LonLat;
12
+ get endCornerHeight(): number;
13
+ get maxHeightCornerLonLat(): import("../../LonLat.js").LonLat;
14
+ get minHeightCornerLonLat(): import("../../LonLat.js").LonLat;
15
+ get deltaHeight(): number;
16
+ _updateHeightRaysAndLabels(): Promise<void>;
17
+ _rayH: Entity;
18
+ _rayV: Entity;
19
+ _heightLabels: Entity[];
20
+ }
21
+ import { RulerScene } from "../ruler/RulerScene.js";
22
+ import { Vector } from "../../layer/Vector.js";
23
+ import { Entity } from "../../entity/Entity.js";
@@ -17,7 +17,8 @@ import { ZoomControl } from "./ZoomControl.js";
17
17
  import { MouseWheelZoomControl } from "./MouseWheelZoomControl.js";
18
18
  import { Lighting } from "./Lighting.js";
19
19
  import { Ruler } from "./ruler/Ruler.js";
20
+ import { HeightRuler } from "./heightRuler/HeightRuler.js";
20
21
  import { SimpleSkyBackground } from "./SimpleSkyBackground.js";
21
22
  import { Selection } from "./selection/Selection.js";
22
23
  import { LayerAnimation } from "./LayerAnimation.js";
23
- export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, ScaleControl, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, SimpleSkyBackground, Selection, LayerAnimation };
24
+ export { Control, CompassButton, DebugInfo, EarthNavigation, EarthCoordinates, GeoImageDragControl, KeyboardNavigation, LayerSwitcher, MouseNavigation, ToggleWireframe, TouchNavigation, SimpleNavigation, ShowFps, ScaleControl, Sun, ZoomControl, MouseWheelZoomControl, Lighting, Ruler, HeightRuler, SimpleSkyBackground, Selection, LayerAnimation };
@@ -1,3 +1,4 @@
1
+ export function distanceFormat(v: any): string;
1
2
  export class RulerScene extends RenderNode {
2
3
  constructor(options?: {});
3
4
  _ignoreTerrain: any;
@@ -9,14 +10,16 @@ export class RulerScene extends RenderNode {
9
10
  _startPos: any;
10
11
  _startClick: Vec2;
11
12
  _heading: number;
12
- _propsLabel: Entity;
13
- _trackEntity: Entity;
14
- _cornerEntity: Entity[];
15
13
  _trackLayer: Vector;
14
+ _labelLayer: Vector;
16
15
  _cornersLayer: Vector;
17
16
  set ignoreTerrain(arg: any);
18
17
  bindPlanet(planet: any): void;
18
+ _createCorners(): void;
19
+ _cornerEntity: Entity[];
19
20
  init(): void;
21
+ _propsLabel: Entity;
22
+ _trackEntity: Entity;
20
23
  _activate(): void;
21
24
  _onLclick_: any;
22
25
  _onMouseMove_: any;
@@ -39,10 +42,10 @@ export class RulerScene extends RenderNode {
39
42
  _drawLine(startLonLat: any, endLonLat: any, startPos: any): void;
40
43
  _onMouseMove(e: any): void;
41
44
  clear(): void;
42
- frame(): void;
45
+ isCornersPositionChanged(): boolean;
43
46
  get ellipsoid(): any;
44
47
  }
45
48
  import { RenderNode } from "../../scene/RenderNode.js";
46
49
  import { Vec2 } from "../../math/Vec2.js";
47
- import { Entity } from "../../entity/Entity.js";
48
50
  import { Vector } from "../../layer/Vector.js";
51
+ import { Entity } from "../../entity/Entity.js";
@@ -26,7 +26,6 @@ export class SelectionScene extends RenderNode {
26
26
  _drawLine(startLonLat: any, endLonLat: any, startPos: any): void;
27
27
  _onMouseMove(e: any): void;
28
28
  clear(): void;
29
- frame(): void;
30
29
  get ellipsoid(): any;
31
30
  }
32
31
  import { RenderNode } from "../../scene/RenderNode.js";
@@ -118,7 +118,19 @@ export class Ellipsoid {
118
118
  * @returns {LonLat} -
119
119
  */
120
120
  public projToSurface(p: Vec3): LonLat;
121
- cartesianToLonLat(cart: any): LonLat;
121
+ /**
122
+ * Converts 3d cartesian coordinates to geodetic
123
+ * @param {Vec3} cart - Cartesian coordiantes
124
+ * @returns {LonLat} - Geodetic coordinates
125
+ */
126
+ cartesianToLonLat(cart: Vec3): LonLat;
127
+ /**
128
+ * Converts 3d cartesian coordinates to geodetic
129
+ * @param {Vec3} cart - Cartesian coordiantes
130
+ * @param {LonLat} res - Link geodetic coordinates variable
131
+ * @returns {LonLat} - Geodetic coordinates
132
+ */
133
+ cartesianToLonLatRes(cart: Vec3, res: LonLat): LonLat;
122
134
  /**
123
135
  * Gets ellipsoid surface normal.
124
136
  * @public
@@ -194,6 +194,7 @@ export class EntityCollection {
194
194
  * @param {number} [farInvisible] - Entity visibility distance.
195
195
  */
196
196
  public setScaleByDistance(near: number, far: number, farInvisible?: number): void;
197
+ appendChildEntity(entity: any): void;
197
198
  _addRecursively(entity: any): void;
198
199
  /**
199
200
  * Adds entity to the collection and returns collection.
@@ -12,7 +12,12 @@ export class BaseGeoImage extends Layer {
12
12
  _sourceTexture: any;
13
13
  _materialTexture: any;
14
14
  _gridBuffer: any;
15
- _extentWgs84Params: number[];
15
+ _extentWgs84Params: any;
16
+ _extentWgs84ParamsHigh: Float32Array;
17
+ _extentWgs84ParamsLow: Float32Array;
18
+ _extentMercParams: any;
19
+ _extentMercParamsHigh: Float32Array;
20
+ _extentMercParamsLow: Float32Array;
16
21
  _refreshFrame: boolean;
17
22
  _frameCreated: boolean;
18
23
  _sourceCreated: boolean;
@@ -26,7 +31,7 @@ export class BaseGeoImage extends Layer {
26
31
  /**
27
32
  * rendering function pointer
28
33
  */
29
- rendering: any;
34
+ rendering: (() => void) | (() => void);
30
35
  get isIdle(): boolean;
31
36
  addTo(planet: any): BaseGeoImage;
32
37
  _onLoadend_: any;
@@ -65,7 +70,8 @@ export class BaseGeoImage extends Layer {
65
70
  */
66
71
  protected _createFrame(): void;
67
72
  _cornersMerc: any[];
68
- _extentMercParams: number[];
73
+ _gridBufferHigh: any;
74
+ _gridBufferLow: any;
69
75
  /**
70
76
  * @virtual
71
77
  * @param {Material} material - GeoImage material.
@@ -96,6 +102,14 @@ export class BaseGeoImage extends Layer {
96
102
  * @returns {Number} Frame height.
97
103
  */
98
104
  public get getFrameHeight(): number;
105
+ /**
106
+ * Method depends on GeoImage instance
107
+ * @virtual
108
+ * @private
109
+ */
110
+ private _createSourceTexture;
111
+ _renderingProjType1(): void;
112
+ _renderingProjType0(): void;
99
113
  }
100
114
  import { Layer } from "./Layer.js";
101
115
  import { Extent } from "../Extent.js";
@@ -29,12 +29,6 @@ export class GeoImage extends BaseGeoImage {
29
29
  * @param {Image} image - Image object.
30
30
  */
31
31
  public setImage(image: new (width?: number, height?: number) => HTMLImageElement): void;
32
- /**
33
- * Creates source gl texture.
34
- * @virtual
35
- * @protected
36
- */
37
- protected _createSourceTexture(): void;
38
32
  /**
39
33
  * @private
40
34
  * @param {Image} img
@@ -47,7 +41,5 @@ export class GeoImage extends BaseGeoImage {
47
41
  * @param {Material} material - GeoImage planet material.
48
42
  */
49
43
  public loadMaterial(material: Material): void;
50
- _renderingProjType1(): void;
51
- _renderingProjType0(): void;
52
44
  }
53
45
  import { BaseGeoImage } from "./BaseGeoImage.js";
@@ -3,7 +3,5 @@ export class GeoTexture2d extends BaseGeoImage {
3
3
  bindTexture(texture: any): void;
4
4
  setSize(width: any, height: any): void;
5
5
  abortMaterialLoading(material: any): void;
6
- _renderingProjType1(): void;
7
- _renderingProjType0(): void;
8
6
  }
9
7
  import { BaseGeoImage } from "./BaseGeoImage.js";
@@ -28,12 +28,6 @@ export class GeoVideo extends BaseGeoImage {
28
28
  * @param {Object} video - HTML5 video element object.
29
29
  */
30
30
  public setVideoElement(video: any): void;
31
- /**
32
- * Creates or refresh source video GL texture.
33
- * @virtual
34
- * @protected
35
- */
36
- protected _createSourceTexture(): void;
37
31
  /**
38
32
  * @private
39
33
  */
@@ -49,7 +43,5 @@ export class GeoVideo extends BaseGeoImage {
49
43
  * @param {Material} material - GeoImage planet material.
50
44
  */
51
45
  public loadMaterial(material: Material): void;
52
- _renderingProjType1(): void;
53
- _renderingProjType0(): void;
54
46
  }
55
47
  import { BaseGeoImage } from "./BaseGeoImage.js";
@@ -33,7 +33,7 @@ export class XYZ extends Layer {
33
33
  * @param {string} name - Layer name.
34
34
  * @param {*} options
35
35
  */
36
- constructor(name: string, options: any);
36
+ constructor(name: string, options?: any);
37
37
  /**
38
38
  * Tile url source template.
39
39
  * @public
@@ -1,5 +1,5 @@
1
1
  export class Renderer {
2
- constructor(handler: any, params: any);
2
+ constructor(handler: any, params?: {});
3
3
  /**
4
4
  * Div element with WebGL canvas. Assigned in Globe class.
5
5
  * @public
@@ -138,7 +138,9 @@ export class Renderer {
138
138
  * @param {Number} id - Handler id to remove.
139
139
  */
140
140
  removePickingCallback(id: number): void;
141
- getPickingObjectByColor(r: any, g: any, b: any): any;
141
+ getPickingObject(r: any, g: any, b: any): any;
142
+ getPickingObjectArr(arr: any): any;
143
+ getPickingObject3v(vec: any): any;
142
144
  /**
143
145
  * Assign picking color to the object.
144
146
  * @public
@@ -240,7 +242,14 @@ export class Renderer {
240
242
  * @public
241
243
  * @param {Array<og.EntityCollection>} ec - Entity collection array.
242
244
  */
243
- public _drawEntityCollections(): void;
245
+ public _drawOpaqueEntityCollections(): void;
246
+ /**
247
+ * Draws entity collections.
248
+ * @public
249
+ * @param {Array<og.EntityCollection>} ec - Entity collection array.
250
+ */
251
+ public _drawTransparentEntityCollections(): void;
252
+ _clearEntityCollectionQueue(): void;
244
253
  /**
245
254
  * Draw nodes.
246
255
  * @public
@@ -1,9 +1,9 @@
1
1
  export class Axes extends RenderNode {
2
+ constructor(size: any);
2
3
  size: any;
3
4
  axesBuffer: any;
4
5
  axesColorBuffer: any;
5
6
  init(): void;
6
- frame(): void;
7
7
  createAxisBuffer(gridSize: any): void;
8
8
  axisBuffer: any;
9
9
  axisColorBuffer: any;
@@ -16,9 +16,9 @@ export class BaseNode {
16
16
  /**
17
17
  * Top scene tree node pointer.
18
18
  * @public
19
- * @type {RenderNode}
19
+ * @type {BaseNode}
20
20
  */
21
- public topNode: RenderNode;
21
+ public topNode: BaseNode;
22
22
  _dictionary: BaseNode[];
23
23
  /**
24
24
  * Children nodes.