@openglobus/og 0.13.7 → 0.13.10
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.
- package/README.md +1 -1
- package/css/og.css +388 -129
- package/dist/@openglobus/og.css +1 -1
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +20 -19
- package/src/og/Globe.js +15 -16
- package/src/og/Object3d.js +417 -0
- package/src/og/arial.js +1705 -1703
- package/src/og/camera/Camera.js +640 -640
- package/src/og/control/EarthCoordinates.js +1 -1
- package/src/og/control/GeoImageDragControl.js +102 -75
- package/src/og/control/LayerAnimation.js +383 -0
- package/src/og/control/LayerSwitcher.js +506 -159
- package/src/og/control/Lighting.js +27 -27
- package/src/og/control/MouseNavigation.js +460 -460
- package/src/og/control/RulerSwitcher.js +69 -0
- package/src/og/control/Sun.js +170 -170
- package/src/og/control/UIhelpers.js +146 -0
- package/src/og/control/ZoomControl.js +0 -2
- package/src/og/control/index.js +5 -1
- package/src/og/control/ruler/Ruler.js +43 -0
- package/src/og/control/ruler/RulerScene.js +374 -0
- package/src/og/control/visibleExtent/Segment.js +3 -5
- package/src/og/ellipsoid/Ellipsoid.js +19 -0
- package/src/og/ellipsoid/wgs84.js +1 -1
- package/src/og/entity/Entity.js +1 -1
- package/src/og/entity/GeoObject.js +1 -1
- package/src/og/entity/LabelHandler.js +6 -2
- package/src/og/entity/LabelWorker.js +38 -53
- package/src/og/layer/BaseGeoImage.js +347 -312
- package/src/og/layer/CanvasTiles.js +312 -290
- package/src/og/layer/GeoImage.js +222 -214
- package/src/og/layer/GeoVideo.js +291 -291
- package/src/og/layer/Layer.js +94 -70
- package/src/og/layer/Material.js +109 -109
- package/src/og/layer/Vector.js +81 -14
- package/src/og/layer/XYZ.js +23 -11
- package/src/og/light/LightSource.js +364 -363
- package/src/og/math/Vec3.js +1 -1
- package/src/og/math.js +6 -6
- package/src/og/quadTree/Node.js +8 -6
- package/src/og/renderer/Renderer.js +2 -3
- package/src/og/res/images.js +0 -2
- package/src/og/scene/Planet.js +106 -44
- package/src/og/segment/Segment.js +34 -64
- package/src/og/segment/Slice.js +1 -1
- package/src/og/shaders/drawnode.js +1 -1
- package/src/og/shaders/label.js +30 -42
- package/src/og/terrain/GlobusTerrain.js +31 -20
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/BaseWorker.js +46 -0
- package/src/og/utils/FontAtlas.js +1 -2
- package/src/og/utils/GeoImageCreator.js +164 -161
- package/src/og/utils/Loader.js +187 -153
- package/src/og/utils/NormalMapCreator.js +403 -412
- package/src/og/utils/PlainSegmentWorker.js +29 -55
- package/src/og/utils/TerrainWorker.js +572 -589
- package/src/og/utils/VectorTileCreator.js +1 -1
- package/src/og/utils/functionComposition.js +13 -0
- package/src/og/webgl/Handler.js +42 -41
- package/src/og/webgl/ProgramController.js +143 -143
- package/types/Object3d.d.ts +22 -0
- package/types/arial.d.ts +1 -0
- package/types/camera/PlanetCamera.d.ts +4 -0
- package/types/control/GeoImageDragControl.d.ts +2 -0
- package/types/control/LayerAnimation.d.ts +73 -0
- package/types/control/LayerSwitcher.d.ts +55 -11
- package/types/control/MouseNavigation.d.ts +1 -0
- package/types/control/MouseWheelZoomControl.d.ts +1 -0
- package/types/control/Sun.d.ts +2 -1
- package/types/control/TouchNavigation.d.ts +1 -0
- package/types/control/UIhelpers.d.ts +13 -0
- package/types/control/index.d.ts +3 -1
- package/types/control/ruler/Ruler.d.ts +13 -0
- package/types/control/ruler/RulerScene.d.ts +48 -0
- package/types/ellipsoid/Ellipsoid.d.ts +8 -0
- package/types/entity/LabelHandler.d.ts +2 -0
- package/types/entity/LabelWorker.d.ts +5 -7
- package/types/layer/BaseGeoImage.d.ts +9 -1
- package/types/layer/CanvasTiles.d.ts +5 -1
- package/types/layer/GeoImage.d.ts +1 -0
- package/types/layer/GeoTexture2d.d.ts +1 -0
- package/types/layer/Layer.d.ts +28 -32
- package/types/layer/Vector.d.ts +9 -0
- package/types/layer/WMS.d.ts +1 -0
- package/types/layer/XYZ.d.ts +8 -5
- package/types/math.d.ts +2 -2
- package/types/quadTree/EntityCollectionNode.d.ts +7 -0
- package/types/quadTree/Node.d.ts +1 -2
- package/types/renderer/Renderer.d.ts +1 -1
- package/types/renderer/RendererEvents.d.ts +16 -0
- package/types/res/images.d.ts +0 -1
- package/types/scene/Planet.d.ts +21 -6
- package/types/segment/SegmentLonLat.d.ts +2 -0
- package/types/terrain/BilTerrain.d.ts +6 -0
- package/types/terrain/GlobusTerrain.d.ts +7 -0
- package/types/terrain/MapboxTerrain.d.ts +8 -0
- package/types/utils/BaseWorker.d.ts +14 -0
- package/types/utils/Loader.d.ts +4 -1
- package/types/utils/PlainSegmentWorker.d.ts +4 -6
- package/types/utils/TerrainWorker.d.ts +4 -6
- package/types/utils/functionComposition.d.ts +5 -0
- package/types/webgl/Handler.d.ts +4 -1
package/src/og/math/Vec3.js
CHANGED
|
@@ -194,7 +194,7 @@ export class Vec3 {
|
|
|
194
194
|
* @returns {Vec3} -
|
|
195
195
|
*/
|
|
196
196
|
static lerp(v1, v2, l) {
|
|
197
|
-
return Vec3(v1.x + (v2.x - v1.x) * l, v1.y + (v2.y - v1.y) * l, v1.z + (v2.z - v1.z) * l);
|
|
197
|
+
return new Vec3(v1.x + (v2.x - v1.x) * l, v1.y + (v2.y - v1.y) * l, v1.z + (v2.z - v1.z) * l);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
package/src/og/math.js
CHANGED
|
@@ -135,12 +135,12 @@ export function isPowerOfTwo(x) {
|
|
|
135
135
|
* @param {number} x - Input value.
|
|
136
136
|
* @returns {number} -
|
|
137
137
|
*/
|
|
138
|
-
export function nextHighestPowerOfTwo(x) {
|
|
138
|
+
export function nextHighestPowerOfTwo(x, maxValue = 4096) {
|
|
139
139
|
--x;
|
|
140
140
|
for (var i = 1; i < 32; i <<= 1) {
|
|
141
141
|
x = x | (x >> i);
|
|
142
142
|
}
|
|
143
|
-
return x + 1
|
|
143
|
+
return (x + 1) > maxValue ? maxValue : x + 1
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
@@ -200,15 +200,15 @@ export function mod(m, n) {
|
|
|
200
200
|
* @returns {number} -
|
|
201
201
|
*/
|
|
202
202
|
export function zeroTwoPI(a) {
|
|
203
|
-
|
|
204
|
-
if (Math.abs(
|
|
203
|
+
const res = mod(a, TWO_PI);
|
|
204
|
+
if (Math.abs(res) < EPSILON14 && Math.abs(a) > EPSILON14) {
|
|
205
205
|
return TWO_PI;
|
|
206
206
|
}
|
|
207
|
-
return
|
|
207
|
+
return res;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
* Returns 0.0 if x is smaller
|
|
211
|
+
* Returns 0.0 if x is smaller than edge and otherwise 1.0.
|
|
212
212
|
* @function
|
|
213
213
|
* @param {number} edge -
|
|
214
214
|
* @param {number} x - Value to edge.
|
package/src/og/quadTree/Node.js
CHANGED
|
@@ -75,8 +75,7 @@ class Node {
|
|
|
75
75
|
this.sideSizeLog2 = [0, 0, 0, 0];
|
|
76
76
|
this.ready = false;
|
|
77
77
|
this.neighbors = [[], [], [], []];
|
|
78
|
-
this.
|
|
79
|
-
this.equalizedNeighborGridSize = [-1, -1, -1, -1];
|
|
78
|
+
this.equalizedSideWithNodeId = [this.nodeId, this.nodeId, this.nodeId, this.nodeId];
|
|
80
79
|
this.nodes = [null, null, null, null];
|
|
81
80
|
this.segment = new SegmentPrototype(this, planet, tileZoom, extent);
|
|
82
81
|
this._cameraInside = false;
|
|
@@ -284,7 +283,7 @@ class Node {
|
|
|
284
283
|
} else if (
|
|
285
284
|
seg.terrainReady &&
|
|
286
285
|
seg.tileZoom < planet.terrain._maxNodeZoom &&
|
|
287
|
-
(!maxZoom ||
|
|
286
|
+
(!maxZoom || cam.projectedSize(seg.bsphere.center, seg.bsphere.radius) > this.planet._maxLodSize)) {
|
|
288
287
|
this.traverseNodes(cam, maxZoom, seg, stopLoading);
|
|
289
288
|
} else if (altVis) {
|
|
290
289
|
seg.passReady = maxZoom ? seg.terrainReady : false;
|
|
@@ -639,6 +638,9 @@ class Node {
|
|
|
639
638
|
let tempVertices, tempVerticesHigh, tempVerticesLow, noDataVertices;
|
|
640
639
|
|
|
641
640
|
this.appliedTerrainNodeId = pn.nodeId;
|
|
641
|
+
this.equalizedSideWithNodeId[N] = this.equalizedSideWithNodeId[E] =
|
|
642
|
+
this.equalizedSideWithNodeId[S] = this.equalizedSideWithNodeId[W] = this.appliedTerrainNodeId;
|
|
643
|
+
|
|
642
644
|
|
|
643
645
|
let gridSize = pn.segment.gridSize / dZ2,
|
|
644
646
|
gridSizeExt = pn.segment.fileGridSize / dZ2;
|
|
@@ -819,6 +821,8 @@ class Node {
|
|
|
819
821
|
seg.terrainVerticesLow = tempVerticesLow;
|
|
820
822
|
|
|
821
823
|
this.appliedTerrainNodeId = this.nodeId;
|
|
824
|
+
this.equalizedSideWithNodeId[N] = this.equalizedSideWithNodeId[E] =
|
|
825
|
+
this.equalizedSideWithNodeId[S] = this.equalizedSideWithNodeId[W] = this.appliedTerrainNodeId;
|
|
822
826
|
|
|
823
827
|
if (pn.segment.terrainExists) {
|
|
824
828
|
seg.terrainExists = true;
|
|
@@ -883,9 +887,7 @@ class Node {
|
|
|
883
887
|
clearTree() {
|
|
884
888
|
var state = this.getState();
|
|
885
889
|
|
|
886
|
-
if (state === NOTRENDERING) {
|
|
887
|
-
this.destroyBranches();
|
|
888
|
-
} else if (state === RENDERING) {
|
|
890
|
+
if (state === NOTRENDERING || state === RENDERING) {
|
|
889
891
|
this.destroyBranches();
|
|
890
892
|
} else {
|
|
891
893
|
for (var i = 0; i < this.nodes.length; i++) {
|
|
@@ -15,7 +15,6 @@ import { FontAtlas } from "../utils/FontAtlas.js";
|
|
|
15
15
|
import { TextureAtlas } from "../utils/TextureAtlas.js";
|
|
16
16
|
import * as arial from "../arial.js";
|
|
17
17
|
import { depth } from "../shaders/depth.js";
|
|
18
|
-
import { ARIAL_FONT_B64 } from "../res/images.js";
|
|
19
18
|
import { LabelWorker } from "../entity/LabelWorker.js";
|
|
20
19
|
|
|
21
20
|
let __pickingCallbackCounter__ = 0;
|
|
@@ -478,7 +477,7 @@ class Renderer {
|
|
|
478
477
|
};
|
|
479
478
|
}
|
|
480
479
|
|
|
481
|
-
this.handler.
|
|
480
|
+
this.handler.ONCANVASRESIZE = () => {
|
|
482
481
|
this.resize();
|
|
483
482
|
this.events.dispatch(this.events.resize, this.handler.canvas);
|
|
484
483
|
};
|
|
@@ -497,7 +496,7 @@ class Renderer {
|
|
|
497
496
|
|
|
498
497
|
this.outputTexture = this.screenTexture.screen;
|
|
499
498
|
|
|
500
|
-
this.fontAtlas.initFont("arial", arial.data,
|
|
499
|
+
this.fontAtlas.initFont("arial", arial.data, arial.image);
|
|
501
500
|
}
|
|
502
501
|
|
|
503
502
|
setCurrentScreen(screenName) {
|