@openglobus/og 0.11.5 → 0.11.6

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 (145) hide show
  1. package/package.json +5 -7
  2. package/src/og/Clock.js +6 -10
  3. package/src/og/Events.js +5 -7
  4. package/src/og/Extent.js +73 -32
  5. package/src/og/ImageCanvas.js +18 -15
  6. package/src/og/LonLat.js +13 -10
  7. package/src/og/Popup.js +18 -17
  8. package/src/og/QueueArray.js +3 -4
  9. package/src/og/Rectangle.js +4 -6
  10. package/src/og/Stack.js +2 -4
  11. package/src/og/ajax.js +20 -14
  12. package/src/og/astro/earth.js +21 -15
  13. package/src/og/bv/Box.js +2 -3
  14. package/src/og/bv/Sphere.js +10 -7
  15. package/src/og/camera/Frustum.js +19 -12
  16. package/src/og/camera/PlanetCamera.js +0 -1
  17. package/src/og/control/CompassButton.js +1 -2
  18. package/src/og/control/Control.js +7 -9
  19. package/src/og/control/DebugInfo.js +0 -1
  20. package/src/og/control/KeyboardNavigation.js +9 -9
  21. package/src/og/control/LayerSwitcher.js +21 -20
  22. package/src/og/control/SegmentBoundVisualization.js +5 -6
  23. package/src/og/control/ShowFps.js +12 -7
  24. package/src/og/control/SimpleNavigation.js +5 -7
  25. package/src/og/control/Sun.js +22 -12
  26. package/src/og/control/ToggleWireframe.js +3 -3
  27. package/src/og/control/TouchNavigation.js +43 -32
  28. package/src/og/control/ZoomControl.js +40 -24
  29. package/src/og/ellipsoid/Ellipsoid.js +148 -56
  30. package/src/og/ellipsoid/wgs84.js +3 -3
  31. package/src/og/entity/BaseBillboard.js +65 -14
  32. package/src/og/entity/Billboard.js +9 -5
  33. package/src/og/entity/BillboardHandler.js +310 -64
  34. package/src/og/entity/Entity.js +39 -1
  35. package/src/og/entity/EntityCollection.js +47 -24
  36. package/src/og/entity/GeoObject.js +228 -0
  37. package/src/og/entity/GeoObjectHandler.js +910 -0
  38. package/src/og/entity/GeometryHandler.js +595 -123
  39. package/src/og/entity/Label.js +53 -18
  40. package/src/og/entity/LabelHandler.js +42 -244
  41. package/src/og/entity/LabelWorker.js +213 -0
  42. package/src/og/entity/Object3d.js +504 -0
  43. package/src/og/entity/PointCloud.js +76 -28
  44. package/src/og/entity/PointCloudHandler.js +5 -5
  45. package/src/og/entity/Ray.js +49 -16
  46. package/src/og/entity/Strip.js +72 -43
  47. package/src/og/entity/StripHandler.js +23 -23
  48. package/src/og/layer/BaseGeoImage.js +50 -19
  49. package/src/og/layer/CanvasTiles.js +16 -16
  50. package/src/og/layer/GeoImage.js +6 -6
  51. package/src/og/layer/KML.js +55 -33
  52. package/src/og/layer/Layer.js +3 -3
  53. package/src/og/layer/Vector.js +94 -48
  54. package/src/og/layer/WMS.js +33 -16
  55. package/src/og/light/LightSource.js +19 -12
  56. package/src/og/math/Mat3.js +24 -12
  57. package/src/og/math/Mat4.js +603 -603
  58. package/src/og/math/Plane.js +19 -18
  59. package/src/og/math/Ray.js +17 -12
  60. package/src/og/math/Vec2.js +24 -14
  61. package/src/og/math/Vec3.js +60 -30
  62. package/src/og/math/coder.js +7 -7
  63. package/src/og/proj/EPSG3857.js +3 -3
  64. package/src/og/proj/EPSG4326.js +3 -3
  65. package/src/og/proj/Proj.js +2 -4
  66. package/src/og/quadTree/Node.js +31 -17
  67. package/src/og/renderer/Renderer.js +23 -6
  68. package/src/og/renderer/RendererEvents.js +1 -1
  69. package/src/og/scene/BaseNode.js +2 -3
  70. package/src/og/scene/Planet.js +2 -2
  71. package/src/og/scene/RenderNode.js +15 -8
  72. package/src/og/shaders/geoObject.js +211 -0
  73. package/src/og/shaders/pointCloud.js +41 -41
  74. package/src/og/shaders/shape.js +12 -18
  75. package/src/og/shaders/skybox.js +36 -36
  76. package/src/og/shapes/BaseShape.js +107 -35
  77. package/src/og/shapes/Icosphere.js +25 -10
  78. package/src/og/shapes/Sphere.js +8 -11
  79. package/src/og/utils/TextureAtlas.js +16 -18
  80. package/src/og/utils/shared.js +1 -1
  81. package/src/og/webgl/Handler.js +68 -49
  82. package/src/og/webgl/Multisample.js +44 -16
  83. package/src/og/webgl/Program.js +78 -33
  84. package/src/og/webgl/callbacks.js +3 -3
  85. package/types/Deferred.d.ts +1 -1
  86. package/types/Events.d.ts +2 -2
  87. package/types/Extent.d.ts +1 -1
  88. package/types/Rectangle.d.ts +1 -1
  89. package/types/ajax.d.ts +1 -1
  90. package/types/bv/Box.d.ts +1 -1
  91. package/types/bv/Sphere.d.ts +1 -1
  92. package/types/camera/Camera.d.ts +5 -5
  93. package/types/camera/Frustum.d.ts +6 -6
  94. package/types/camera/PlanetCamera.d.ts +8 -8
  95. package/types/control/Control.d.ts +1 -1
  96. package/types/control/EarthCoordinates.d.ts +1 -1
  97. package/types/control/Sun.d.ts +1 -1
  98. package/types/entity/BaseBillboard.d.ts +15 -8
  99. package/types/entity/Entity.d.ts +24 -9
  100. package/types/entity/EntityCollection.d.ts +15 -9
  101. package/types/entity/GeoObject.d.ts +111 -0
  102. package/types/entity/GeoObjectHandler.d.ts +77 -0
  103. package/types/entity/Geometry.d.ts +1 -1
  104. package/types/entity/GeometryHandler.d.ts +1 -1
  105. package/types/entity/Label.d.ts +3 -3
  106. package/types/entity/LabelHandler.d.ts +2 -0
  107. package/types/entity/LabelWorker.d.ts +9 -0
  108. package/types/entity/PointCloud.d.ts +1 -1
  109. package/types/entity/Polyline.d.ts +5 -5
  110. package/types/entity/Ray.d.ts +1 -1
  111. package/types/entity/Strip.d.ts +1 -1
  112. package/types/layer/BaseGeoImage.d.ts +3 -3
  113. package/types/layer/CanvasTiles.d.ts +5 -5
  114. package/types/layer/GeoImage.d.ts +1 -1
  115. package/types/layer/GeoVideo.d.ts +1 -1
  116. package/types/layer/Layer.d.ts +5 -5
  117. package/types/layer/Vector.d.ts +9 -9
  118. package/types/layer/XYZ.d.ts +3 -3
  119. package/types/light/LightSource.d.ts +7 -7
  120. package/types/math/Plane.d.ts +1 -1
  121. package/types/math/Ray.d.ts +1 -1
  122. package/types/math/Vec2.d.ts +34 -34
  123. package/types/math/Vec3.d.ts +1 -1
  124. package/types/math/Vec4.d.ts +1 -1
  125. package/types/math/coder.d.ts +1 -1
  126. package/types/math.d.ts +1 -1
  127. package/types/proj/Proj.d.ts +2 -2
  128. package/types/quadTree/Node.d.ts +1 -1
  129. package/types/renderer/Renderer.d.ts +12 -10
  130. package/types/renderer/RendererEvents.d.ts +1 -1
  131. package/types/scene/BaseNode.d.ts +4 -4
  132. package/types/scene/Planet.d.ts +40 -40
  133. package/types/scene/RenderNode.d.ts +9 -9
  134. package/types/segment/Segment.d.ts +9 -9
  135. package/types/shaders/geoObject.d.ts +3 -0
  136. package/types/shapes/BaseShape.d.ts +5 -5
  137. package/types/terrain/EmptyTerrain.d.ts +2 -2
  138. package/types/terrain/GlobusTerrain.d.ts +4 -4
  139. package/types/utils/TextureAtlas.d.ts +4 -4
  140. package/types/utils/shared.d.ts +9 -9
  141. package/types/webgl/Framebuffer.d.ts +1 -1
  142. package/types/webgl/Handler.d.ts +16 -7
  143. package/types/webgl/Multisample.d.ts +2 -2
  144. package/types/webgl/Program.d.ts +6 -0
  145. package/types/webgl/ProgramController.d.ts +1 -1
@@ -2,20 +2,13 @@
2
2
  * @module og/webgl/Program
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import { callbacks } from './callbacks.js';
8
- import { cons } from '../cons.js';
9
- import { typeStr } from './types.js';
7
+ import { callbacks } from "./callbacks.js";
8
+ import { cons } from "../cons.js";
9
+ import { typeStr, types } from "./types.js";
10
10
 
11
- const itemTypes = [
12
- "BYTE",
13
- "SHORT",
14
- "UNSIGNED_BYTE",
15
- "UNSIGNED_SHORT",
16
- "FLOAT",
17
- "HALF_FLOAT"
18
- ];
11
+ const itemTypes = ["BYTE", "SHORT", "UNSIGNED_BYTE", "UNSIGNED_SHORT", "FLOAT", "HALF_FLOAT"];
19
12
 
20
13
  /**
21
14
  * Represents more comfortable using WebGL shader program.
@@ -46,9 +39,11 @@ class Program {
46
39
  */
47
40
  this._attributes = {};
48
41
  for (let t in material.attributes) {
49
- if (typeof (material.attributes[t]) === "string" ||
50
- typeof (material.attributes[t]) === "number") {
51
- this._attributes[t] = { 'type': material.attributes[t] };
42
+ if (
43
+ typeof material.attributes[t] === "string" ||
44
+ typeof material.attributes[t] === "number"
45
+ ) {
46
+ this._attributes[t] = { type: material.attributes[t] };
52
47
  } else {
53
48
  this._attributes[t] = material.attributes[t];
54
49
  }
@@ -61,9 +56,11 @@ class Program {
61
56
  */
62
57
  this._uniforms = {};
63
58
  for (let t in material.uniforms) {
64
- if (typeof (material.uniforms[t]) === "string" ||
65
- typeof (material.uniforms[t]) === "number") {
66
- this._uniforms[t] = { 'type': material.uniforms[t] };
59
+ if (
60
+ typeof material.uniforms[t] === "string" ||
61
+ typeof material.uniforms[t] === "number"
62
+ ) {
63
+ this._uniforms[t] = { type: material.uniforms[t] };
67
64
  } else {
68
65
  this._uniforms[t] = material.uniforms[t];
69
66
  }
@@ -117,6 +114,13 @@ class Program {
117
114
  * @type {Array.<Object>}
118
115
  */
119
116
  this._attribArrays = [];
117
+
118
+ /**
119
+ * Program attributes divisor.
120
+ * @private
121
+ * @type {Array.<Object>}
122
+ */
123
+ this._attribDivisor = [];
120
124
  }
121
125
 
122
126
  /**
@@ -128,7 +132,14 @@ class Program {
128
132
  static bindBuffer(program, variable) {
129
133
  var gl = program.gl;
130
134
  gl.bindBuffer(gl.ARRAY_BUFFER, variable.value);
131
- gl.vertexAttribPointer(variable._pName, variable.value.itemSize, variable.itemType, variable.normalized, 0, 0);
135
+ gl.vertexAttribPointer(
136
+ variable._pName,
137
+ variable.value.itemSize,
138
+ variable.itemType,
139
+ variable.normalized,
140
+ 0,
141
+ 0
142
+ );
132
143
  }
133
144
 
134
145
  /**
@@ -196,7 +207,9 @@ class Program {
196
207
  this.gl.shaderSource(shader, src);
197
208
  this.gl.compileShader(shader);
198
209
  if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
199
- cons.logErr("og/Program/Program:" + this.name + " - " + this.gl.getShaderInfoLog(shader) + ".");
210
+ cons.logErr(
211
+ "og/Program/Program:" + this.name + " - " + this.gl.getShaderInfoLog(shader) + "."
212
+ );
200
213
  return false;
201
214
  }
202
215
  return true;
@@ -237,9 +250,9 @@ class Program {
237
250
  disableAttribArrays() {
238
251
  var gl = this.gl;
239
252
  var a = this._attribArrays;
240
- var i = a.length;
241
- while (i--) {
253
+ for (let i = 0, len = a.length; i < len; i++) {
242
254
  gl.disableVertexAttribArray(a[i]);
255
+ gl.vertexAttribDivisor(a[i], 0);
243
256
  }
244
257
  }
245
258
 
@@ -250,9 +263,10 @@ class Program {
250
263
  enableAttribArrays() {
251
264
  var gl = this.gl;
252
265
  var a = this._attribArrays;
253
- var i = a.length;
254
- while (i--) {
266
+ var d = this._attribDivisor;
267
+ for (let i = 0, len = a.length; i < len; i++) {
255
268
  gl.enableVertexAttribArray(a[i]);
269
+ gl.vertexAttribDivisor(a[i], d[i]);
256
270
  }
257
271
  }
258
272
 
@@ -280,7 +294,13 @@ class Program {
280
294
  gl.linkProgram(this._p);
281
295
 
282
296
  if (!gl.getProgramParameter(this._p, gl.LINK_STATUS)) {
283
- cons.logErr("og/Program/Program:" + this.name + " - couldn't initialise shaders. " + gl.getProgramInfoLog(this._p) + ".");
297
+ cons.logErr(
298
+ "og/Program/Program:" +
299
+ this.name +
300
+ " - couldn't initialise shaders. " +
301
+ gl.getProgramInfoLog(this._p) +
302
+ "."
303
+ );
284
304
  gl.deleteProgram(this._p);
285
305
  return;
286
306
  }
@@ -293,25 +313,47 @@ class Program {
293
313
 
294
314
  this._attributes[a]._callback = Program.bindBuffer;
295
315
 
296
- let itemTypeStr = this._attributes[a].itemType ? this._attributes[a].itemType.trim().toUpperCase() : "FLOAT";
316
+ let itemTypeStr = this._attributes[a].itemType
317
+ ? this._attributes[a].itemType.trim().toUpperCase()
318
+ : "FLOAT";
319
+
297
320
  if (itemTypes.indexOf(itemTypeStr) == -1) {
298
- cons.logErr(`og/Program/Program: ${this.name}- attribute '${a}', item type ${this._attributes[a].itemType} not exists.`);
321
+ cons.logErr(
322
+ `og/Program/Program: ${this.name}- attribute '${a}', item type ${this._attributes[a].itemType} not exists.`
323
+ );
299
324
  this._attributes[a].itemType = gl.FLOAT;
300
325
  } else {
301
326
  this._attributes[a].itemType = gl[itemTypeStr];
302
327
  }
303
328
 
304
329
  this._attributes[a].normalized = this._attributes[a].normalized || false;
330
+ this._attributes[a].divisor = this._attributes[a].divisor || 0;
305
331
 
306
332
  this._p[a] = gl.getAttribLocation(this._p, a);
307
333
 
308
334
  if (this._p[a] == undefined) {
309
- cons.logErr("og/Program/Program:" + this.name + " - attribute '" + a + "' is not exists.");
335
+ cons.logErr(
336
+ "og/Program/Program:" + this.name + " - attribute '" + a + "' is not exists."
337
+ );
310
338
  gl.deleteProgram(this._p);
311
339
  return;
312
340
  }
313
341
 
314
- this._attribArrays.push(this._p[a]);
342
+ let type = this._attributes[a].type;
343
+ if (typeof type === "string") {
344
+ type = typeStr[type.trim().toLowerCase()];
345
+ }
346
+
347
+ let d = this._attributes[a].divisor;
348
+ if (type === types.MAT4) {
349
+ let loc = this._p[a];
350
+ this._attribArrays.push(loc, loc + 1, loc + 2, loc + 3);
351
+ this._attribDivisor.push(d, d, d, d);
352
+ } else {
353
+ this._attribArrays.push(this._p[a]);
354
+ this._attribDivisor.push(d);
355
+ }
356
+
315
357
  gl.enableVertexAttribArray(this._p[a]);
316
358
 
317
359
  this._attributes[a]._pName = this._p[a];
@@ -321,8 +363,9 @@ class Program {
321
363
  for (var u in this._uniforms) {
322
364
  //this.uniforms[u]._name = u;
323
365
 
324
- if (typeof (this._uniforms[u].type) === "string") {
325
- this._uniforms[u]._callback = callbacks.u[typeStr[this._uniforms[u].type.trim().toLowerCase()]];
366
+ if (typeof this._uniforms[u].type === "string") {
367
+ this._uniforms[u]._callback =
368
+ callbacks.u[typeStr[this._uniforms[u].type.trim().toLowerCase()]];
326
369
  } else {
327
370
  this._uniforms[u]._callback = callbacks.u[this._uniforms[u].type];
328
371
  }
@@ -331,7 +374,9 @@ class Program {
331
374
  this._p[u] = gl.getUniformLocation(this._p, u);
332
375
 
333
376
  if (this._p[u] == undefined) {
334
- cons.logErr("og/Program/Program:" + this.name + " - uniform '" + u + "' is not exists.");
377
+ cons.logErr(
378
+ "og/Program/Program:" + this.name + " - uniform '" + u + "' is not exists."
379
+ );
335
380
  gl.deleteProgram(this._p);
336
381
  return;
337
382
  }
@@ -348,4 +393,4 @@ class Program {
348
393
  }
349
394
  }
350
395
 
351
- export { Program };
396
+ export { Program };
@@ -93,6 +93,6 @@ callbacks.a[types.VEC3] = function (program, variable) {
93
93
  program.gl.vertexAttrib3fv(variable._pName, variable.value);
94
94
  };
95
95
 
96
- callbacks.a[types.VEC4] = function (program, variable) {
97
- program.gl.vertexAttrib4fv(variable._pName, variable.value);
98
- };
96
+ //callbacks.a[types.VEC4] = function (program, variable) {
97
+ // program.gl.vertexAttrib4fv(variable._pName, variable.value);
98
+ //};
@@ -2,5 +2,5 @@ export function Deferred(): void;
2
2
  export class Deferred {
3
3
  resolve: any;
4
4
  reject: any;
5
- promise: Promise<any>;
5
+ promise: any;
6
6
  }
package/types/Events.d.ts CHANGED
@@ -49,14 +49,14 @@ export class Events {
49
49
  * @param {eventCallback} callback - Event callback function.
50
50
  * @param {Object} sender - Event callback function owner.
51
51
  */
52
- public on(name: string, callback: any, sender: any, priority?: number): void;
52
+ public on(name: string, callback: eventCallback, sender: any, priority?: number): void;
53
53
  /**
54
54
  * Stop listening event name with specified callback function.
55
55
  * @public
56
56
  * @param {string} name - Event name.
57
57
  * @param {eventCallback} callback - Attached event callback.
58
58
  */
59
- public off(name: string, callback: any): void;
59
+ public off(name: string, callback: eventCallback): void;
60
60
  /**
61
61
  * Dispatch event.
62
62
  * @public
package/types/Extent.d.ts CHANGED
@@ -160,7 +160,7 @@ export class Extent {
160
160
  * @param {Ellipsoid} ellipsoid - Ellipsoid.
161
161
  * @return {Array.<number>} Cartesian 3d coordinate array. (exactly 6 entries)
162
162
  */
163
- public getCartesianBounds(ellipsoid: any): Array<number>;
163
+ public getCartesianBounds(ellipsoid: Ellipsoid): Array<number>;
164
164
  toString(): string;
165
165
  }
166
166
  import { LonLat } from "./LonLat.js";
@@ -5,7 +5,7 @@
5
5
  * @param {number} [top] - Top coordinate. 0 - default.
6
6
  * @param {number} [right] - Right coordinate. 0 - default.
7
7
  * @param {number} [bottom] - Bottom coordinate. 0 - default.
8
- */
8
+ */
9
9
  export class Rectangle {
10
10
  /**
11
11
  * @param {number} [left] - Left coordinate. 0 - default.
package/types/ajax.d.ts CHANGED
@@ -20,5 +20,5 @@ export namespace ajax {
20
20
  data?: any;
21
21
  sender?: any;
22
22
  responseType?: string;
23
- }): any;
23
+ }): ajax.Xhr;
24
24
  }
package/types/bv/Box.d.ts CHANGED
@@ -25,6 +25,6 @@ export class Box {
25
25
  * @param {Ellipsoid} ellipsoid - Ellipsoid.
26
26
  * @param {Extent} extent - Geodetic extent.
27
27
  */
28
- setFromExtent(ellipsoid: any, extent: any): void;
28
+ setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
29
29
  }
30
30
  import { Vec3 } from "../math/Vec3.js";
@@ -33,6 +33,6 @@ export class Sphere {
33
33
  * @param {Ellipsoid} ellipsoid - Ellipsoid.
34
34
  * @param {Extent} extent - Geodetic extent.
35
35
  */
36
- setFromExtent(ellipsoid: any, extent: any): void;
36
+ setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
37
37
  }
38
38
  import { Vec3 } from "../math/Vec3.js";
@@ -18,13 +18,13 @@ export class Camera {
18
18
  * @param {Renderer} [renderer] - Renderer uses the camera instance.
19
19
  * @param {Object} [options] - Camera options:
20
20
  */
21
- constructor(renderer?: any, options?: any);
21
+ constructor(renderer?: Renderer, options?: any);
22
22
  /**
23
23
  * Assigned renderer
24
24
  * @public
25
25
  * @type {Renderer}
26
26
  */
27
- public renderer: any;
27
+ public renderer: Renderer;
28
28
  /**
29
29
  * Camera events handler
30
30
  * @public
@@ -159,7 +159,7 @@ export class Camera {
159
159
  * @param {nnumber} angle - Camera's view angle
160
160
  * @param {number} aspect - Screen aspect ration
161
161
  */
162
- public _setProj(angle: any, aspect: number): void;
162
+ public _setProj(angle: nnumber, aspect: number): void;
163
163
  _projSizeConst: number;
164
164
  /**
165
165
  * Sets camera view angle in degrees
@@ -239,7 +239,7 @@ export class Camera {
239
239
  * @param {Vec3} center - Point that the camera rotates around
240
240
  * @param {Vecto3} [up] - Camera up vector
241
241
  */
242
- public rotateAround(angle: number, isArc: boolean, center: Vec3, up?: any): void;
242
+ public rotateAround(angle: number, isArc: boolean, center: Vec3, up?: Vecto3): void;
243
243
  /**
244
244
  * Rotates camera around center point by horizontal.
245
245
  * @public
@@ -249,7 +249,7 @@ export class Camera {
249
249
  * @param {Vec3} center - Point that the camera rotates around.
250
250
  * @param {Vec3} [up] - Camera up vector.
251
251
  */
252
- public rotateHorizontal(angle: number, isArc: any, center: Vec3, up?: Vec3): void;
252
+ public rotateHorizontal(angle: number, isArc: boolaen, center: Vec3, up?: Vec3): void;
253
253
  /**
254
254
  * Rotates camera around center point by vecrtical.
255
255
  * @param {number} angle - Rotation angle in radians.
@@ -85,7 +85,7 @@ export class Frustum {
85
85
  * @param {number} near - Near camera distance.
86
86
  * @param {number} far - Far camera distance.
87
87
  */
88
- public setProjectionMatrix(angle: any, aspect: number, near: number, far: number): void;
88
+ public setProjectionMatrix(angle: nnumber, aspect: number, near: number, far: number): void;
89
89
  /**
90
90
  * Camera's projection matrix values.
91
91
  * @public
@@ -98,14 +98,14 @@ export class Frustum {
98
98
  * @param {Vec3} point - Cartesian point.
99
99
  * @returns {boolean} -
100
100
  */
101
- public containsPoint(point: any): boolean;
101
+ public containsPoint(point: Vec3): boolean;
102
102
  /**
103
103
  * Returns true if the frustum contains a bonding sphere, but bottom plane exclude.
104
104
  * @public
105
105
  * @param {Sphere} sphere - Bounding sphere.
106
106
  * @returns {boolean} -
107
107
  */
108
- public containsSphereBottomExc(sphere: any): boolean;
108
+ public containsSphereBottomExc(sphere: Sphere): boolean;
109
109
  containsSphereButtom(sphere: any): boolean;
110
110
  /**
111
111
  * Returns true if the frustum contains a bonding sphere.
@@ -113,7 +113,7 @@ export class Frustum {
113
113
  * @param {Sphere} sphere - Bounding sphere.
114
114
  * @returns {boolean} -
115
115
  */
116
- public containsSphere(sphere: any): boolean;
116
+ public containsSphere(sphere: Sphere): boolean;
117
117
  /**
118
118
  * Returns true if the frustum contains a bonding sphere.
119
119
  * @public
@@ -121,13 +121,13 @@ export class Frustum {
121
121
  * @param {number} radius - Sphere radius.
122
122
  * @returns {boolean} -
123
123
  */
124
- public containsSphere2(center: any, radius: number): boolean;
124
+ public containsSphere2(center: Vec3, radius: number): boolean;
125
125
  /**
126
126
  * Returns true if the frustum contains a bounding box.
127
127
  * @public
128
128
  * @param {Box} box - Bounding box.
129
129
  * @returns {boolean} -
130
130
  */
131
- public containsBox(box: any): boolean;
131
+ public containsBox(box: Box): boolean;
132
132
  }
133
133
  import { Mat4 } from "../math/Mat4.js";
@@ -19,13 +19,13 @@ export class PlanetCamera extends Camera {
19
19
  * @param {RenderNode} planet - Planet render node.
20
20
  * @param {Object} [options] - Planet camera options:
21
21
  */
22
- constructor(planet: any, options?: any);
22
+ constructor(planet: RenderNode, options?: any);
23
23
  /**
24
24
  * Assigned camera's planet.
25
25
  * @public
26
26
  * @type {Planet}
27
27
  */
28
- public planet: any;
28
+ public planet: Planet;
29
29
  /**
30
30
  * Minimal alltitude that camera can reach over the terrain.
31
31
  * @public
@@ -67,7 +67,7 @@ export class PlanetCamera extends Camera {
67
67
  * @protected
68
68
  * @type {quadTree.Node}
69
69
  */
70
- protected _insideSegment: any;
70
+ protected _insideSegment: quadTree.Node;
71
71
  /**
72
72
  * Coordinates that depends on what segment class we are fling over.
73
73
  * It can be WGS84 or Mercator coordinates. Gets in og.quadTree.Node
@@ -122,13 +122,13 @@ export class PlanetCamera extends Camera {
122
122
  * @param {Number} height - Camera height
123
123
  * @returns {Vec3}
124
124
  */
125
- public getExtentPosition(extent: any, height: number): Vec3;
125
+ public getExtentPosition(extent: Extent, height: number): Vec3;
126
126
  /**
127
127
  * View current extent.
128
128
  * @public
129
129
  * @param {Extent} extent - Current extent.
130
130
  */
131
- public viewExtent(extent: any, height: any): void;
131
+ public viewExtent(extent: Extent, height: any): void;
132
132
  /**
133
133
  * Flies to the current extent.
134
134
  * @public
@@ -139,7 +139,7 @@ export class PlanetCamera extends Camera {
139
139
  * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
140
140
  * @param [frameCallback]
141
141
  */
142
- public flyExtent(extent: any, height: any, up?: Vec3, ampl?: number, completeCallback?: any, startCallback?: any, frameCallback?: any): void;
142
+ public flyExtent(extent: Extent, height: any, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
143
143
  viewDistance(cartesian: any, distance?: number): void;
144
144
  flyDistance(cartesian: any, distance: number, ampl: number, completeCallback: any, startCallback: any, frameCallback: any): void;
145
145
  /**
@@ -153,7 +153,7 @@ export class PlanetCamera extends Camera {
153
153
  * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
154
154
  * @param [frameCallback]
155
155
  */
156
- public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: any, startCallback?: any, frameCallback?: any): void;
156
+ public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
157
157
  _frameCallback: any;
158
158
  /**
159
159
  * Flies to the geo coordiantes.
@@ -165,7 +165,7 @@ export class PlanetCamera extends Camera {
165
165
  * @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
166
166
  * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
167
167
  */
168
- public flyLonLat(lonlat: LonLat, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: any, startCallback?: any): void;
168
+ public flyLonLat(lonlat: LonLat, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback): void;
169
169
  /**
170
170
  * Breaks the flight.
171
171
  * @public
@@ -25,7 +25,7 @@ export class Control {
25
25
  * @public
26
26
  * @type {Renderer}
27
27
  */
28
- public renderer: any;
28
+ public renderer: Renderer;
29
29
  /**
30
30
  * Auto activation flag.
31
31
  * @public
@@ -33,7 +33,7 @@ export class EarthCoordinates extends Control {
33
33
  * @public
34
34
  * @type {Vec3}
35
35
  */
36
- public position: any;
36
+ public position: Vec3;
37
37
  /**
38
38
  * Sets coordinates capturing type.
39
39
  * @public
@@ -11,7 +11,7 @@ export class Sun extends Control {
11
11
  * @public
12
12
  * @type {Planet}
13
13
  */
14
- public planet: any;
14
+ public planet: Planet;
15
15
  /**
16
16
  * Sunlight position placed in the camera eye.
17
17
  * @private
@@ -39,7 +39,7 @@ export class BaseBillboard {
39
39
  * @protected
40
40
  * @type {Vec4}
41
41
  */
42
- protected _color: any;
42
+ protected _color: Vec4;
43
43
  /**
44
44
  * Cartesian aligned axis vector.
45
45
  * @protected
@@ -51,7 +51,7 @@ export class BaseBillboard {
51
51
  * @protected
52
52
  * @type {math.Vecto3}
53
53
  */
54
- protected _offset: any;
54
+ protected _offset: math.Vecto3;
55
55
  /**
56
56
  * Billboard visibility.
57
57
  * @protected
@@ -63,19 +63,26 @@ export class BaseBillboard {
63
63
  * @protected
64
64
  * @type {Entity}
65
65
  */
66
- protected _entity: any;
66
+ protected _entity: Entity;
67
67
  /**
68
68
  * Handler that stores and renders this billboard object.
69
69
  * @protected
70
70
  * @type {BillboardHandler}
71
71
  */
72
- protected _handler: any;
72
+ protected _handler: BillboardHandler;
73
73
  /**
74
74
  * Billboard handler array index.
75
75
  * @protected
76
76
  * @type {number}
77
77
  */
78
78
  protected _handlerIndex: number;
79
+ /**
80
+ * An indication that the object is ready to draw
81
+ * @protected
82
+ * @type {number}
83
+ */
84
+ protected _isReady: number;
85
+ _lockId: number;
79
86
  /**
80
87
  * Sets billboard position.
81
88
  * @public
@@ -109,7 +116,7 @@ export class BaseBillboard {
109
116
  * @public
110
117
  * @param {Vec2} offset - Offset size.
111
118
  */
112
- public setOffset3v(offset: any): void;
119
+ public setOffset3v(offset: Vec2): void;
113
120
  /**
114
121
  * Returns billboard screen space offset size.
115
122
  * @public
@@ -148,7 +155,7 @@ export class BaseBillboard {
148
155
  * @public
149
156
  * @param {Vec4} color - RGBA vector.
150
157
  */
151
- public setColor4v(color: any): void;
158
+ public setColor4v(color: Vec4): void;
152
159
  /**
153
160
  * Sets billboard color.
154
161
  * @public
@@ -160,7 +167,7 @@ export class BaseBillboard {
160
167
  * @public
161
168
  * @returns {Vec4}
162
169
  */
163
- public getColor(): any;
170
+ public getColor(): Vec4;
164
171
  /**
165
172
  * Sets billboard visibility.
166
173
  * @public
@@ -186,7 +193,7 @@ export class BaseBillboard {
186
193
  * @public
187
194
  * @param {math.Vecto3} alignedAxis - Vector to align.
188
195
  */
189
- public setAlignedAxis3v(alignedAxis: any): void;
196
+ public setAlignedAxis3v(alignedAxis: math.Vecto3): void;
190
197
  /**
191
198
  * Returns aligned vector.
192
199
  * @public