@openglobus/og 0.14.4 → 0.15.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 (102) hide show
  1. package/css/og.css +377 -274
  2. package/dist/@openglobus/og.css +1 -1
  3. package/dist/@openglobus/og.esm.js +2 -2
  4. package/dist/@openglobus/og.esm.js.map +1 -1
  5. package/dist/@openglobus/og.umd.js +2 -2
  6. package/dist/@openglobus/og.umd.js.map +1 -1
  7. package/package.json +18 -17
  8. package/src/og/Clock.js +218 -194
  9. package/src/og/Globe.js +1 -3
  10. package/src/og/Object3d.js +104 -145
  11. package/src/og/camera/Camera.js +23 -19
  12. package/src/og/cons.js +107 -107
  13. package/src/og/control/Atmosphere.js +396 -0
  14. package/src/og/control/CompassButton.js +11 -18
  15. package/src/og/control/Control.js +187 -188
  16. package/src/og/control/GeoImageDragControl.js +84 -66
  17. package/src/og/control/LayerSwitcher.js +46 -145
  18. package/src/og/control/Lighting.js +314 -186
  19. package/src/og/control/RulerSwitcher.js +24 -19
  20. package/src/og/control/SimpleSkyBackground.js +38 -12
  21. package/src/og/control/Sun.js +2 -0
  22. package/src/og/control/ZoomControl.js +30 -42
  23. package/src/og/control/ruler/RulerScene.js +5 -23
  24. package/src/og/control/selection/Selection.js +21 -50
  25. package/src/og/control/selection/SelectionScene.js +15 -29
  26. package/src/og/control/timeline/TimelineControl.js +99 -0
  27. package/src/og/control/timeline/TimelineModel.js +133 -0
  28. package/src/og/control/timeline/TimelineView.js +449 -0
  29. package/src/og/control/timeline/timelineUtils.js +132 -0
  30. package/src/og/entity/Entity.js +30 -3
  31. package/src/og/entity/EntityCollection.js +0 -2
  32. package/src/og/entity/GeoObject.js +72 -56
  33. package/src/og/entity/GeoObjectHandler.js +487 -656
  34. package/src/og/input/input.js +3 -1
  35. package/src/og/layer/CanvasTiles.js +39 -34
  36. package/src/og/layer/Layer.js +2 -0
  37. package/src/og/layer/Material.js +1 -8
  38. package/src/og/light/LightSource.js +2 -0
  39. package/src/og/quadTree/Node.js +2 -1
  40. package/src/og/renderer/Renderer.js +26 -42
  41. package/src/og/renderer/RendererEvents.js +4 -4
  42. package/src/og/scene/Planet.js +276 -59
  43. package/src/og/scene/RenderNode.js +27 -12
  44. package/src/og/segment/Segment.js +0 -5
  45. package/src/og/shaders/atmos.js +332 -0
  46. package/src/og/shaders/drawnode.js +475 -109
  47. package/src/og/shaders/geoObject.js +96 -51
  48. package/src/og/shaders/polyline.js +212 -17
  49. package/src/og/shaders/utils.js +88 -0
  50. package/src/og/terrain/GlobusTerrain.js +2 -2
  51. package/src/og/ui/Button.js +106 -0
  52. package/src/og/ui/ButtonGroup.js +57 -0
  53. package/src/og/ui/Dialog.js +242 -0
  54. package/src/og/ui/Slider.js +144 -0
  55. package/src/og/ui/ToggleButton.js +51 -0
  56. package/src/og/ui/View.js +190 -0
  57. package/src/og/utils/shared.js +51 -33
  58. package/src/og/webgl/Framebuffer.js +308 -387
  59. package/src/og/webgl/Handler.js +68 -21
  60. package/src/og/webgl/Multisample.js +8 -0
  61. package/types/Clock.d.ts +7 -2
  62. package/types/Object3d.d.ts +14 -3
  63. package/types/camera/Camera.d.ts +15 -14
  64. package/types/control/Atmosphere.d.ts +15 -0
  65. package/types/control/CompassButton.d.ts +1 -2
  66. package/types/control/GeoImageDragControl.d.ts +7 -1
  67. package/types/control/LayerSwitcher.d.ts +4 -5
  68. package/types/control/Lighting.d.ts +32 -7
  69. package/types/control/SimpleSkyBackground.d.ts +4 -0
  70. package/types/control/ZoomControl.d.ts +0 -1
  71. package/types/control/ruler/RulerScene.d.ts +0 -1
  72. package/types/control/selection/Selection.d.ts +2 -4
  73. package/types/control/selection/SelectionScene.d.ts +0 -1
  74. package/types/entity/Entity.d.ts +8 -0
  75. package/types/entity/GeoObject.d.ts +28 -22
  76. package/types/entity/GeoObjectHandler.d.ts +16 -56
  77. package/types/input/input.d.ts +2 -0
  78. package/types/layer/CanvasTiles.d.ts +1 -0
  79. package/types/layer/Layer.d.ts +1 -0
  80. package/types/math/Plane.d.ts +1 -1
  81. package/types/renderer/Renderer.d.ts +7 -1
  82. package/types/scene/Planet.d.ts +20 -2
  83. package/types/scene/RenderNode.d.ts +2 -1
  84. package/types/segment/Segment.d.ts +1 -1
  85. package/types/shaders/atmos.d.ts +4 -0
  86. package/types/shaders/drawnode.d.ts +3 -2
  87. package/types/shaders/utils.d.ts +1 -0
  88. package/types/terrain/GlobusTerrain.d.ts +1 -1
  89. package/types/ui/Button.d.ts +21 -0
  90. package/types/ui/Dialog.d.ts +41 -0
  91. package/types/ui/Slider.d.ts +30 -0
  92. package/types/ui/ToggleButton.d.ts +10 -0
  93. package/types/ui/View.d.ts +32 -0
  94. package/types/utils/shared.d.ts +16 -14
  95. package/types/webgl/Framebuffer.d.ts +2 -5
  96. package/types/webgl/Handler.d.ts +11 -9
  97. package/types/webgl/Multisample.d.ts +2 -0
  98. package/src/og/ajax.js +0 -204
  99. package/src/og/entity/Object3d.js +0 -504
  100. package/types/ajax.d.ts +0 -24
  101. /package/src/og/{control → ui}/UIhelpers.js +0 -0
  102. /package/types/{control → ui}/UIhelpers.d.ts +0 -0
@@ -127,6 +127,8 @@ class Handler {
127
127
 
128
128
  this.transparentTexture = null;
129
129
 
130
+ this.defaultTexture = null;
131
+
130
132
  this.framebufferStack = new Stack();
131
133
 
132
134
  this.createTexture = {
@@ -285,9 +287,9 @@ class Handler {
285
287
  * @param {Object} image - Image or Canvas object.
286
288
  * @returns {Object} - WebGL texture object.
287
289
  */
288
- createTexture_n_webgl1(image, internalFormat) {
289
- var gl = this.gl;
290
- var texture = gl.createTexture();
290
+ createTexture_n_webgl1(image, internalFormat, texture) {
291
+ let gl = this.gl;
292
+ texture = texture || gl.createTexture();
291
293
  gl.bindTexture(gl.TEXTURE_2D, texture);
292
294
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
293
295
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
@@ -305,13 +307,11 @@ class Handler {
305
307
  * @param {Object} image - Image or Canvas object.
306
308
  * @returns {Object} - WebGL texture object.
307
309
  */
308
- createTexture_l_webgl1(image, internalFormat) {
310
+ createTexture_l_webgl1(image, internalFormat, texture) {
309
311
  let gl = this.gl;
310
- let texture = gl.createTexture();
312
+ texture = texture || gl.createTexture();
311
313
  gl.bindTexture(gl.TEXTURE_2D, texture);
312
-
313
314
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
314
-
315
315
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
316
316
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
317
317
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@@ -326,9 +326,9 @@ class Handler {
326
326
  * @param {Object} image - Image or Canvas object.
327
327
  * @returns {Object} - WebGL texture object.
328
328
  */
329
- createTexture_mm_webgl1(image, internalFormat) {
329
+ createTexture_mm_webgl1(image, internalFormat, texture) {
330
330
  let gl = this.gl;
331
- let texture = gl.createTexture();
331
+ texture = texture || gl.createTexture();
332
332
  gl.bindTexture(gl.TEXTURE_2D, texture);
333
333
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
334
334
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
@@ -346,9 +346,9 @@ class Handler {
346
346
  * @param {Object} image - Image or Canvas object.
347
347
  * @returns {Object} - WebGL texture object.
348
348
  */
349
- createTexture_a_webgl1(image, internalFormat) {
349
+ createTexture_a_webgl1(image, internalFormat, texture) {
350
350
  let gl = this.gl;
351
- let texture = gl.createTexture();
351
+ texture = texture || gl.createTexture();
352
352
  gl.bindTexture(gl.TEXTURE_2D, texture);
353
353
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
354
354
  gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat || gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
@@ -367,9 +367,9 @@ class Handler {
367
367
  * @param {Object} image - Image or Canvas object.
368
368
  * @returns {Object} - WebGL texture object.
369
369
  */
370
- createTexture_n_webgl2(image, internalFormat) {
371
- var gl = this.gl;
372
- var texture = gl.createTexture();
370
+ createTexture_n_webgl2(image, internalFormat, texture) {
371
+ let gl = this.gl;
372
+ texture = texture || gl.createTexture();
373
373
  gl.bindTexture(gl.TEXTURE_2D, texture);
374
374
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
375
375
  //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
@@ -389,9 +389,9 @@ class Handler {
389
389
  * @param {Object} image - Image or Canvas object.
390
390
  * @returns {Object} - WebGL texture object.
391
391
  */
392
- createTexture_l_webgl2(image, internalFormat) {
392
+ createTexture_l_webgl2(image, internalFormat, texture) {
393
393
  let gl = this.gl;
394
- let texture = gl.createTexture();
394
+ texture = texture || gl.createTexture();
395
395
  gl.bindTexture(gl.TEXTURE_2D, texture);
396
396
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
397
397
  //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
@@ -411,11 +411,10 @@ class Handler {
411
411
  * @param {Object} image - Image or Canvas object.
412
412
  * @returns {Object} - WebGL texture object.
413
413
  */
414
- createTexture_mm_webgl2(image, internalFormat) {
414
+ createTexture_mm_webgl2(image, internalFormat, texture) {
415
415
  let gl = this.gl;
416
- let texture = gl.createTexture();
416
+ texture = texture || gl.createTexture();
417
417
  gl.bindTexture(gl.TEXTURE_2D, texture);
418
- //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
419
418
  //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
420
419
  gl.texStorage2D(gl.TEXTURE_2D, MAX_LEVELS, internalFormat || gl.RGBA8, image.width, image.height);
421
420
  gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, gl.RGBA, gl.UNSIGNED_BYTE, image);
@@ -433,9 +432,9 @@ class Handler {
433
432
  * @param {Object} image - Image or Canvas object.
434
433
  * @returns {Object} - WebGL texture object.
435
434
  */
436
- createTexture_a_webgl2(image, internalFormat) {
435
+ createTexture_a_webgl2(image, internalFormat, texture) {
437
436
  let gl = this.gl;
438
- let texture = gl.createTexture();
437
+ texture = texture || gl.createTexture();
439
438
  gl.bindTexture(gl.TEXTURE_2D, texture);
440
439
  //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
441
440
  //gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
@@ -624,10 +623,12 @@ class Handler {
624
623
  this._params.extensions.push("OES_element_index_uint");
625
624
  this._params.extensions.push("WEBGL_depth_texture");
626
625
  this._params.extensions.push("ANGLE_instanced_arrays");
626
+ //this._params.extensions.push("WEBGL_draw_buffers");
627
627
  //this._params.extensions.push("EXT_frag_depth");
628
628
  } else {
629
629
  this._params.extensions.push("EXT_color_buffer_float");
630
630
  this._params.extensions.push("OES_texture_float_linear");
631
+ //this._params.extensions.push("WEBGL_draw_buffers");
631
632
  }
632
633
 
633
634
  let i = this._params.extensions.length;
@@ -702,6 +703,9 @@ class Handler {
702
703
  this.createDefaultTexture({ color: "rgba(0,0,0,0.0)" }, (t) => {
703
704
  this.transparentTexture = t;
704
705
  });
706
+ this.createDefaultTexture({ color: "rgba(255, 255, 255, 1.0)" }, (t) => {
707
+ this.defaultTexture = t;
708
+ });
705
709
  }
706
710
 
707
711
  /**
@@ -986,6 +990,12 @@ class Handler {
986
990
  }
987
991
  }
988
992
 
993
+ deleteTexture(texture) {
994
+ if (texture && !texture.default) {
995
+ this.gl.deleteTexture(texture);
996
+ }
997
+ }
998
+
989
999
  /**
990
1000
  * @public
991
1001
  */
@@ -1001,6 +1011,9 @@ class Handler {
1001
1011
  gl.deleteTexture(this.transparentTexture);
1002
1012
  this.transparentTexture = null;
1003
1013
 
1014
+ gl.deleteTexture(this.defaultTexture);
1015
+ this.defaultTexture = null;
1016
+
1004
1017
  this.framebufferStack = null;
1005
1018
  this.framebufferStack = new Stack();
1006
1019
 
@@ -1077,6 +1090,40 @@ class Handler {
1077
1090
  }
1078
1091
  }
1079
1092
  }
1093
+
1094
+ // var loadTextureData = function(textureName, callback) {
1095
+ // const xhr = new XMLHttpRequest();
1096
+ // xhr.open('GET', textureName);
1097
+ // xhr.responseType = 'arraybuffer';
1098
+ // xhr.onload = (event) => {
1099
+ // const data = new DataView(xhr.response);
1100
+ // const array =
1101
+ // new Float32Array(data.byteLength / Float32Array.BYTES_PER_ELEMENT);
1102
+ // for (var i = 0; i < array.length; ++i) {
1103
+ // array[i] = data.getFloat32(i * Float32Array.BYTES_PER_ELEMENT, true);
1104
+ // }
1105
+ // callback(array);
1106
+ // };
1107
+ // xhr.send();
1108
+ // }
1109
+
1110
+ // loadTextureData('transmittance.dat', (data) => {
1111
+ //
1112
+ // let gl = this.renderer.handler.gl;
1113
+ //
1114
+ // const texture = gl.createTexture();
1115
+ // gl.activeTexture(gl.TEXTURE0);
1116
+ // gl.bindTexture(gl.TEXTURE_2D, texture);
1117
+ // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
1118
+ // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
1119
+ // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1120
+ // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1121
+ // gl.texImage2D(gl.TEXTURE_2D, 0, gl.getExtension('OES_texture_float_linear') ? gl.RGBA32F : gl.RGBA16F,
1122
+ // TRANSMITTANCE_TEXTURE_WIDTH, TRANSMITTANCE_TEXTURE_HEIGHT, 0, gl.RGBA,
1123
+ // gl.FLOAT, data);
1124
+ //
1125
+ // this.transmittanceTextureBrn = texture;
1126
+ // });
1080
1127
  }
1081
1128
 
1082
1129
  export { Handler };
@@ -81,6 +81,14 @@ export class Multisample {
81
81
  this.renderbuffers = new Array(this._size);
82
82
  }
83
83
 
84
+ get width() {
85
+ return this._width;
86
+ }
87
+
88
+ get height() {
89
+ return this._height;
90
+ }
91
+
84
92
  destroy() {
85
93
  var gl = this.handler.gl;
86
94
 
package/types/Clock.d.ts CHANGED
@@ -51,7 +51,8 @@ export class Clock {
51
51
  * @public
52
52
  * @type {number}
53
53
  */
54
- public multiplier: number;
54
+ public _multiplier: number;
55
+ _running: number;
55
56
  /**
56
57
  * Animation frame delta time.
57
58
  * @public
@@ -89,6 +90,10 @@ export class Clock {
89
90
  * @param {Clock} clock - Clock instance to compare.
90
91
  * @returns {boolean} - Returns true if a clock is the same instance.
91
92
  */
92
- public equal(clock: Clock): boolean;
93
+ public isEqual(clock: Clock): boolean;
94
+ start(): void;
95
+ set multiplier(arg: number);
96
+ get multiplier(): number;
97
+ stop(): void;
93
98
  }
94
99
  import { Events } from "./Events.js";
@@ -1,4 +1,5 @@
1
1
  export class Object3d {
2
+ static centering(verts: any): void;
2
3
  static scale(vertices: any, s: any): void;
3
4
  static centroid(vertices: any): number[];
4
5
  static translate(vertices: any, v: any): void;
@@ -11,12 +12,22 @@ export class Object3d {
11
12
  constructor(data: any);
12
13
  _name: any;
13
14
  _vertices: any;
14
- _texCoords: any[];
15
+ _numVertices: number;
16
+ _texCoords: any;
17
+ /**
18
+ * Image src.
19
+ * @protected
20
+ * @type {string}
21
+ */
22
+ protected _src: string;
15
23
  color: any[] | Float32Array;
16
- _indexes: any;
24
+ _indices: any;
17
25
  _normals: any;
26
+ get src(): string;
18
27
  get name(): any;
19
28
  get vertices(): any;
20
29
  get normals(): any;
21
- get indexes(): any;
30
+ get indices(): any;
31
+ get texCoords(): any;
32
+ get numVertices(): number;
22
33
  }
@@ -61,18 +61,18 @@ export class Camera {
61
61
  * @type {Number}
62
62
  */
63
63
  protected _viewAngle: number;
64
- /**
65
- * Camera normal matrix.
66
- * @protected
67
- * @type {Mat3}
68
- */
69
- protected _normalMatrix: Mat3;
70
64
  /**
71
65
  * Camera view matrix.
72
66
  * @protected
73
67
  * @type {Mat4}
74
68
  */
75
69
  protected _viewMatrix: Mat4;
70
+ /**
71
+ * Camera normal matrix.
72
+ * @protected
73
+ * @type {Mat3}
74
+ */
75
+ protected _normalMatrix: Mat3;
76
76
  /**
77
77
  * Camera right vector.
78
78
  * @protected
@@ -102,7 +102,8 @@ export class Camera {
102
102
  nearFarArr: any[];
103
103
  frustumColors: any[];
104
104
  FARTHEST_FRUSTUM_INDEX: number;
105
- _currentFrustum: number;
105
+ currentFrustumIndex: number;
106
+ isFirstPass: boolean;
106
107
  checkMoveEnd(): void;
107
108
  /**
108
109
  * Camera initialization.
@@ -264,18 +265,18 @@ export class Camera {
264
265
  * @returns {number} - Size factor.
265
266
  */
266
267
  public projectedSize(p: Vec3, r: Vec3): number;
267
- /**
268
- * Returns normal matrix.
269
- * @public
270
- * @returns {Mat3} - Normal matrix.
271
- */
272
- public getNormalMatrix(): Mat3;
273
268
  /**
274
269
  * Returns model matrix.
275
270
  * @public
276
271
  * @returns {Mat4} - View matrix.
277
272
  */
278
273
  public getViewMatrix(): Mat4;
274
+ /**
275
+ * Returns normal matrix.
276
+ * @public
277
+ * @returns {Mat3} - Normal matrix.
278
+ */
279
+ public getNormalMatrix(): Mat3;
279
280
  setCurrentFrustum(k: any): void;
280
281
  getCurrentFrustum(): number;
281
282
  get frustum(): Frustum;
@@ -306,7 +307,7 @@ export class Camera {
306
307
  }
307
308
  import { Events } from "../Events.js";
308
309
  import { Vec3 } from "../math/Vec3.js";
309
- import { Mat3 } from "../math/Mat3.js";
310
310
  import { Mat4 } from "../math/Mat4.js";
311
+ import { Mat3 } from "../math/Mat3.js";
311
312
  import { Frustum } from "./Frustum.js";
312
313
  import { Vec2 } from "../math/Vec2.js";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Frame per second(FPS) display control.
3
+ * @class
4
+ * @extends {Control}
5
+ * @param {Object} [options] - Control options.
6
+ */
7
+ export class Atmosphere extends Control {
8
+ _transmittanceBuffer: Framebuffer;
9
+ _scatteringBuffer: Framebuffer;
10
+ opacity: number;
11
+ _drawAtmosphereTextures(): void;
12
+ _drawBackground(): void;
13
+ }
14
+ import { Control } from "./Control.js";
15
+ import { Framebuffer } from "../webgl/index.js";
@@ -6,8 +6,7 @@ export function compassButton(options: any): CompassButton;
6
6
  * @params {Object} [options] - Control options.
7
7
  */
8
8
  export class CompassButton extends Control {
9
- planet: any;
10
- compassSvg: any;
9
+ constructor(options?: {});
11
10
  _heading: any;
12
11
  _svg: any;
13
12
  _onClick(): void;
@@ -2,7 +2,13 @@ export class GeoImageDragControl extends Control {
2
2
  constructor(options?: {});
3
3
  _cornerIndex: number;
4
4
  _catchCorner: boolean;
5
- createDraggerButton(): void;
5
+ _toggleBtn: ToggleButton;
6
6
  _bindLayer(layer: any): void;
7
+ _unbindLayer(layer: any): void;
8
+ _onLUp(ms: any): void;
9
+ _onLDown(ms: any): void;
10
+ _onMouseLeave(): void;
11
+ _onMouseMove(ms: any): void;
7
12
  }
8
13
  import { Control } from "./Control.js";
14
+ import { ToggleButton } from "../ui/ToggleButton.js";
@@ -6,13 +6,12 @@
6
6
  * @param {Object} [options] - Control options.
7
7
  */
8
8
  export class LayerSwitcher extends Control {
9
- static set numSwitches(arg: any);
10
- static get numSwitches(): any;
11
9
  constructor(options?: {});
12
10
  switcherDependent: any;
13
11
  expandedSections: any;
14
- switcherInMenu: any;
15
12
  docListener: any;
13
+ dialog: Dialog;
14
+ _menuBtn: ToggleButton;
16
15
  setupSwitcher(): void;
17
16
  planetDataBasic(): {
18
17
  collectTerrains: (planet: any) => any[];
@@ -53,13 +52,13 @@ export class LayerSwitcher extends Control {
53
52
  getUserPrefs(): {
54
53
  switcherDependency: any;
55
54
  sectionsOpening: any;
56
- btnInMenu: any;
57
55
  };
58
56
  buildBasicDOM(): {
59
57
  $mainContainer: any;
60
- whereClickHandler: (e: any) => void;
61
58
  };
62
59
  buildRecords(myData: any, $mainContainer: any, depth: any, createLastDropZone: any): void;
63
60
  removeRecords(): void;
64
61
  }
65
62
  import { Control } from "./Control.js";
63
+ import { Dialog } from "../ui/Dialog.js";
64
+ import { ToggleButton } from "../ui/ToggleButton.js";
@@ -1,16 +1,41 @@
1
- export function lighting(options: any): Lighting;
2
- /**
3
- * Helps to setup lighting.
4
- * @class
5
- * @extends {Control}
6
- * @param {Object} [options] -
7
- */
8
1
  export class Lighting extends Control {
9
2
  constructor(options?: {});
10
3
  _selectedLayer: any;
4
+ _toggleBtn: ToggleButton;
5
+ _dialog: Dialog;
6
+ _panel: View;
7
+ _atmosphereMaxOpacity: Slider;
8
+ _atmosphereMinOpacity: Slider;
9
+ _gamma: Slider;
10
+ _exposure: Slider;
11
+ _night: Slider;
12
+ _opacity: Slider;
13
+ _diffuse_r: Slider;
14
+ _diffuse_g: Slider;
15
+ _diffuse_b: Slider;
16
+ _ambient_r: Slider;
17
+ _ambient_g: Slider;
18
+ _ambient_b: Slider;
19
+ _specular_r: Slider;
20
+ _specular_g: Slider;
21
+ _specular_b: Slider;
22
+ _shininess: Slider;
11
23
  bindLayer(layer: any): void;
24
+ $atmosphereOpacity: Element;
25
+ $gamma: Element;
26
+ $exposure: Element;
27
+ $opacity: Element;
28
+ $diffuse: Element;
29
+ $ambient: Element;
30
+ $specular: Element;
31
+ $night: Element;
32
+ _update(): void;
12
33
  _fetchLayers(): void;
13
34
  _onLayerAdd(e: any): void;
14
35
  _onLayerRemove(e: any): void;
15
36
  }
16
37
  import { Control } from "./Control.js";
38
+ import { ToggleButton } from "../ui/ToggleButton.js";
39
+ import { Dialog } from "../ui/Dialog.js";
40
+ import { View } from "../ui/View.js";
41
+ import { Slider } from "../ui/Slider.js";
@@ -6,6 +6,10 @@ export function simpleSkyBackground(options: any): SimpleSkyBackground;
6
6
  * @param {Object} [options] - Control options.
7
7
  */
8
8
  export class SimpleSkyBackground extends Control {
9
+ _colorOne: Float32Array;
10
+ _colorTwo: Float32Array;
11
+ set colorOne(arg: any);
12
+ set colorTwo(arg: any);
9
13
  _drawBackground(): void;
10
14
  }
11
15
  import { Control } from "./Control.js";
@@ -7,7 +7,6 @@ export function zoomControl(options: any): ZoomControl;
7
7
  */
8
8
  export class ZoomControl extends Control {
9
9
  _keyLock: Key;
10
- planet: any;
11
10
  _move: number;
12
11
  /**
13
12
  * Planet zoom in.
@@ -37,7 +37,6 @@ export class RulerScene extends RenderNode {
37
37
  _drawLine(startLonLat: any, endLonLat: any, startPos: any): void;
38
38
  _onMouseMove(e: any): void;
39
39
  clear(): void;
40
- getScale(cart: any): number;
41
40
  frame(): void;
42
41
  get ellipsoid(): any;
43
42
  }
@@ -3,7 +3,6 @@
3
3
  * @class
4
4
  * @extends {Control}
5
5
  * @param {Object} [options] - Control options.
6
- * @param {Array} [options.activationIconClasses] - array with a list of classes to change the button icons
7
6
  * @param {boolean} [options.ignoreTerrain=false].
8
7
  * @param {function} options.onSelect - callback (extent) => {} where extent is selected extent array [minLon,minLat,maxLon,maxLat]
9
8
  * @param {boolean} [options.autoSelectionHide=false] - clear selection rectangle after passing extent to callback
@@ -12,7 +11,6 @@
12
11
  * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css">
13
12
  *
14
13
  * new Selection({
15
- * activationIconClasses: ['bi', 'bi-bounding-box-circles'],
16
14
  * ignoreTerrain: false,
17
15
  * autoSelectionHide:true,
18
16
  * onSelect: (extent) => {
@@ -42,10 +40,10 @@
42
40
  */
43
41
  export class Selection extends Control {
44
42
  constructor(options?: {});
45
- _activationIconClasses: any;
46
43
  _selectorScene: SelectionScene;
44
+ _toggleBtn: ToggleButton;
47
45
  set ignoreTerrain(arg: any);
48
- createSelectorButton(): void;
49
46
  }
50
47
  import { Control } from "../Control.js";
51
48
  import { SelectionScene } from "./SelectionScene.js";
49
+ import { ToggleButton } from "../../ui/ToggleButton.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
- getScale(cart: any): number;
30
29
  frame(): void;
31
30
  get ellipsoid(): any;
32
31
  }
@@ -233,6 +233,14 @@ export class Entity {
233
233
  * @param {LonLat} lonlat - WGS84 coordinates.
234
234
  */
235
235
  public setLonLat(lonlat: LonLat): void;
236
+ /**
237
+ * Sets geodetic coordinates of the entity point object.
238
+ * @public
239
+ * @param {number} lon - Longitude.
240
+ * @param {number} lat - Latitude
241
+ * @param {number} [height] - Height
242
+ */
243
+ public setLonLat2(lon: number, lat: number, height?: number): void;
236
244
  /**
237
245
  * Sets entity altitude over the planet.
238
246
  * @public
@@ -4,9 +4,15 @@
4
4
  * @param {og.Vec3} [options.position] - Geo object position.
5
5
  */
6
6
  export class GeoObject {
7
- constructor(options: any);
8
- scale: any;
9
- scaleByDistance: Float32Array;
7
+ constructor(options?: {});
8
+ tag: any;
9
+ instanced: boolean;
10
+ /**
11
+ * Entity instance that holds this geo object.
12
+ * @protected
13
+ * @type {Entity}
14
+ */
15
+ protected _entity: Entity;
10
16
  /**
11
17
  * Geo object center cartesian position.
12
18
  * @protected
@@ -18,8 +24,7 @@ export class GeoObject {
18
24
  _pitch: any;
19
25
  _yaw: any;
20
26
  _roll: any;
21
- _planet: any;
22
- _lonLatAlt: LonLat;
27
+ _scale: any;
23
28
  /**
24
29
  * RGBA color.
25
30
  * @protected
@@ -29,15 +34,19 @@ export class GeoObject {
29
34
  _direction: Vec3;
30
35
  _handler: any;
31
36
  _handlerIndex: number;
32
- _vertices: any;
33
- _normals: any;
34
- _indices: any;
35
- instanced: any;
36
- tag: any;
37
- _indicesCount: any;
38
- _verticesCount: number;
39
- get planet(): any;
40
- get renderer(): any;
37
+ _tagData: any;
38
+ _tagDataIndex: number;
39
+ _object3d: any;
40
+ getPosition(): og.Vec3;
41
+ getPitch(): any;
42
+ getYaw(): any;
43
+ getRoll(): any;
44
+ getDirection(): Vec3;
45
+ get object3d(): any;
46
+ get vertices(): any;
47
+ get normals(): any;
48
+ get texCoords(): any;
49
+ get indices(): any;
41
50
  /**
42
51
  * Sets geo object opacity.
43
52
  * @public
@@ -45,7 +54,7 @@ export class GeoObject {
45
54
  */
46
55
  public setOpacity(a: number): void;
47
56
  /**
48
- * Sets RGBA color. Each channel from 0.0 to 1.0.
57
+ * Sets color.
49
58
  * @public
50
59
  * @param {number} r - Red.
51
60
  * @param {number} g - Green.
@@ -54,7 +63,7 @@ export class GeoObject {
54
63
  */
55
64
  public setColor(r: number, g: number, b: number, a: number): void;
56
65
  /**
57
- * Sets RGBA color. Each channel from 0.0 to 1.0.
66
+ * Sets color.
58
67
  * @public
59
68
  * @param {og.Vec4} color - RGBA vector.
60
69
  */
@@ -67,14 +76,13 @@ export class GeoObject {
67
76
  public setVisibility(visibility: boolean): void;
68
77
  _visibility: boolean;
69
78
  /**
70
- * Returns geo object visibility.
79
+ * Returns geo object visibility.
71
80
  * @public
72
81
  * @returns {boolean}
73
82
  */
74
83
  public getVisibility(): boolean;
75
- setLonLat(lon: any, lat: any, alt: any): void;
76
84
  /**
77
- * Sets geoObject position.
85
+ * Sets geo object position.
78
86
  * @public
79
87
  * @param {number} x - X coordinate.
80
88
  * @param {number} y - Y coordinate.
@@ -82,7 +90,7 @@ export class GeoObject {
82
90
  */
83
91
  public setPosition(x: number, y: number, z: number): void;
84
92
  /**
85
- * Sets billboard position.
93
+ * Sets geo object position.
86
94
  * @public
87
95
  * @param {og.Vec3} position - Cartesian coordinates.
88
96
  */
@@ -97,7 +105,6 @@ export class GeoObject {
97
105
  * @public
98
106
  */
99
107
  public remove(): void;
100
- _entity: any;
101
108
  /**
102
109
  * Sets billboard picking color.
103
110
  * @public
@@ -108,5 +115,4 @@ export class GeoObject {
108
115
  _qNorthFrame: Quat;
109
116
  }
110
117
  import { Vec3 } from "../math/index.js";
111
- import { LonLat } from "../LonLat.js";
112
118
  import { Quat } from "../math/index.js";