@openglobus/og 0.18.5 → 0.19.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 (38) hide show
  1. package/README.md +17 -69
  2. package/css/og.css +59 -44
  3. package/lib/@openglobus/og.css +1 -1
  4. package/lib/@openglobus/og.esm.js +1 -1
  5. package/lib/@openglobus/og.esm.js.map +1 -1
  6. package/lib/@openglobus/og.umd.js +1 -1
  7. package/lib/@openglobus/og.umd.js.map +1 -1
  8. package/lib/js/Globe.d.ts +2 -0
  9. package/lib/js/Globe.js +3 -1
  10. package/lib/js/control/DebugInfo.js +5 -0
  11. package/lib/js/control/LayerSwitcher.d.ts +18 -3
  12. package/lib/js/control/LayerSwitcher.js +111 -11
  13. package/lib/js/control/MouseNavigation.d.ts +2 -0
  14. package/lib/js/control/MouseNavigation.js +15 -15
  15. package/lib/js/control/elevationProfile/ElevationProfile.js +3 -1
  16. package/lib/js/control/elevationProfile/ElevationProfileScene.js +7 -7
  17. package/lib/js/control/heightRuler/HeightRulerScene.js +1 -1
  18. package/lib/js/control/ruler/RulerScene.js +3 -3
  19. package/lib/js/control/selection/SelectionScene.js +2 -2
  20. package/lib/js/entity/Entity.js +5 -1
  21. package/lib/js/layer/Layer.d.ts +18 -4
  22. package/lib/js/layer/Layer.js +25 -4
  23. package/lib/js/layer/XYZ.d.ts +0 -1
  24. package/lib/js/quadTree/Node.d.ts +21 -3
  25. package/lib/js/quadTree/Node.js +173 -62
  26. package/lib/js/renderer/Renderer.js +19 -16
  27. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  28. package/lib/js/renderer/RendererEvents.js +5 -0
  29. package/lib/js/scene/Planet.d.ts +29 -4
  30. package/lib/js/scene/Planet.js +198 -84
  31. package/lib/js/segment/Segment.d.ts +7 -1
  32. package/lib/js/segment/Segment.js +40 -12
  33. package/lib/js/shaders/drawnode.js +21 -2
  34. package/lib/js/shaders/geoObject.js +26 -18
  35. package/lib/js/terrain/GlobusTerrain.js +1 -1
  36. package/lib/js/utils/shared.d.ts +1 -0
  37. package/lib/js/utils/shared.js +1 -0
  38. package/package.json +2 -2
@@ -68,18 +68,22 @@ export const geo_object = () => new Program("geo_object", {
68
68
  vColor = aColor;
69
69
  vTexCoords = aTexCoord;
70
70
 
71
- float roll = aPitchRoll.y;
71
+ float cos_roll = cos(aPitchRoll.y);
72
+ float sin_roll = sin(aPitchRoll.y);
73
+
72
74
  mat3 rotZ = mat3(
73
- vec3(cos(roll), sin(roll), 0.0),
74
- vec3(-sin(roll), cos(roll), 0.0),
75
+ vec3(cos_roll, sin_roll, 0.0),
76
+ vec3(-sin_roll, cos_roll, 0.0),
75
77
  vec3(0.0, 0.0, 1.0)
76
78
  );
77
79
 
78
- float pitch = aPitchRoll.x;
80
+ float cos_pitch = cos(aPitchRoll.x);
81
+ float sin_pitch = sin(aPitchRoll.x);
82
+
79
83
  mat3 rotX = mat3(
80
84
  vec3(1.0, 0.0, 0.0),
81
- vec3(0.0, cos(pitch), sin(pitch)),
82
- vec3(0.0, -sin(pitch), cos(pitch))
85
+ vec3(0.0, cos_pitch, sin_pitch),
86
+ vec3(0.0, -sin_pitch, cos_pitch)
83
87
  );
84
88
 
85
89
  vec3 position = aPositionHigh + aPositionLow;
@@ -200,19 +204,23 @@ export const geo_object_picking = () => new Program("geo_object_picking", {
200
204
 
201
205
  vColor = aPickingColor;
202
206
 
203
- float roll = aPitchRoll.y;
204
- mat3 rotZ = mat3(
205
- vec3(cos(roll), sin(roll), 0.0),
206
- vec3(-sin(roll), cos(roll), 0.0),
207
- vec3(0.0, 0.0, 1.0)
208
- );
209
-
210
- float pitch = aPitchRoll.x;
211
- mat3 rotX = mat3(
212
- vec3(1.0, 0.0, 0.0),
213
- vec3(0.0, cos(pitch), sin(pitch)),
214
- vec3(0.0, -sin(pitch), cos(pitch))
207
+ float cos_roll = cos(aPitchRoll.y);
208
+ float sin_roll = sin(aPitchRoll.y);
209
+
210
+ mat3 rotZ = mat3(
211
+ vec3(cos_roll, sin_roll, 0.0),
212
+ vec3(-sin_roll, cos_roll, 0.0),
213
+ vec3(0.0, 0.0, 1.0)
215
214
  );
215
+
216
+ float cos_pitch = cos(aPitchRoll.x);
217
+ float sin_pitch = sin(aPitchRoll.x);
218
+
219
+ mat3 rotX = mat3(
220
+ vec3(1.0, 0.0, 0.0),
221
+ vec3(0.0, cos_pitch, sin_pitch),
222
+ vec3(0.0, -sin_pitch, cos_pitch)
223
+ );
216
224
 
217
225
  vec3 position = aPositionHigh + aPositionLow;
218
226
  vec3 cameraPosition = eyePositionHigh + eyePositionLow;
@@ -47,7 +47,7 @@ class GlobusTerrain extends EmptyTerrain {
47
47
  this.name = name || "openglobus";
48
48
  this.url = options.url || "https://{s}.srtm3.openglobus.org/{z}/{y}/{x}.ddm";
49
49
  this.gridSizeByZoom = options.gridSizeByZoom || [
50
- 64, 32, 32, 16, 16, 8, 8, 8, 8, 16, 16, 16, 16, 32, 32, 16, 8, 4, 2, 2, 2, 2, 2, 2
50
+ 64, 32, 32, 16, 16, 8, 8, 8, 16, 16, 16, 32, 32, 32, 32, 16, 8, 4, 2, 2, 2, 2, 2, 2
51
51
  ];
52
52
  this._heightFactor = options.heightFactor != undefined ? options.heightFactor : 1.0;
53
53
  this.noDataValues = options.noDataValues || [];
@@ -78,6 +78,7 @@ export declare function binarySearchFast(arr: number[] | TypedArray, x: number):
78
78
  */
79
79
  export declare function binarySearch(ar: any[], el: any, compare_fn: Function): number;
80
80
  /**
81
+ * @todo: replace any with generic
81
82
  * Binary insertion that uses binarySearch algorithm.
82
83
  * @param {any[]} ar - The sorted array to insert.
83
84
  * @param {any} el - The item to insert.
@@ -292,6 +292,7 @@ export function binarySearch(ar, el, compare_fn) {
292
292
  return -m - 1;
293
293
  }
294
294
  /**
295
+ * @todo: replace any with generic
295
296
  * Binary insertion that uses binarySearch algorithm.
296
297
  * @param {any[]} ar - The sorted array to insert.
297
298
  * @param {any} el - The item to insert.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openglobus/og",
3
- "version": "0.18.5",
3
+ "version": "0.19.0",
4
4
  "description": "[openglobus](https://www.openglobus.org/) is a javascript/typescript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers, and 3D objects. It uses the WebGL technology, open source, and completely free.",
5
5
  "directories": {
6
6
  "example": "./sandbox"
@@ -47,7 +47,7 @@
47
47
  "jsdoc": "^4.0.2",
48
48
  "lint-staged": "^14.0.1",
49
49
  "local-web-server": "^5.3.0",
50
- "postcss": "^8.4.29",
50
+ "postcss": "^8.4.31",
51
51
  "prettier": "^3.0.3",
52
52
  "rollup": "^3.29.2",
53
53
  "rollup-plugin-copy": "^3.5.0",