@openglobus/og 0.13.8 → 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 +33 -0
- package/src/og/control/GeoImageDragControl.js +102 -75
- package/src/og/control/LayerAnimation.js +306 -38
- package/src/og/control/LayerSwitcher.js +506 -159
- package/src/og/control/Lighting.js +27 -27
- package/src/og/control/RulerSwitcher.js +69 -0
- package/src/og/control/UIhelpers.js +146 -0
- package/src/og/control/index.js +3 -1
- package/src/og/control/ruler/RulerScene.js +6 -2
- package/src/og/control/visibleExtent/Segment.js +2 -1
- package/src/og/ellipsoid/wgs84.js +1 -1
- package/src/og/entity/LabelHandler.js +5 -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 +71 -30
- package/src/og/layer/Material.js +109 -109
- package/src/og/layer/Vector.js +1 -0
- package/src/og/layer/XYZ.js +20 -12
- package/src/og/light/LightSource.js +364 -363
- package/src/og/math.js +2 -2
- package/src/og/quadTree/Node.js +7 -5
- package/src/og/renderer/Renderer.js +1 -1
- package/src/og/scene/Planet.js +103 -42
- package/src/og/segment/Segment.js +34 -56
- package/src/og/segment/Slice.js +1 -1
- package/src/og/shaders/drawnode.js +1 -1
- 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/GeoImageCreator.js +164 -161
- package/src/og/utils/Loader.js +60 -33
- 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/functionComposition.js +13 -0
- package/src/og/webgl/Handler.js +42 -41
- package/types/Object3d.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 +1 -0
- package/types/control/TouchNavigation.d.ts +1 -0
- package/types/control/UIhelpers.d.ts +13 -0
- package/types/control/index.d.ts +2 -1
- 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 +5 -1
- package/types/layer/Vector.d.ts +7 -0
- package/types/layer/WMS.d.ts +1 -0
- package/types/layer/XYZ.d.ts +8 -6
- package/types/math.d.ts +1 -1
- 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/scene/Planet.d.ts +19 -4
- 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 +3 -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
|
@@ -2,50 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
// import { QueueArray } from '../QueueArray.js';
|
|
4
4
|
import { EPSG4326 } from "../proj/EPSG4326.js";
|
|
5
|
+
import { BaseWorker } from "./BaseWorker.js";
|
|
5
6
|
|
|
6
|
-
class PlainSegmentWorker {
|
|
7
|
+
class PlainSegmentWorker extends BaseWorker {
|
|
7
8
|
constructor(numWorkers = 2) {
|
|
8
|
-
|
|
9
|
-
this._segments =
|
|
10
|
-
|
|
11
|
-
this._workerQueue = [];
|
|
12
|
-
|
|
13
|
-
var elevationProgramm = new Blob([_programm], { type: "application/javascript" });
|
|
14
|
-
|
|
15
|
-
let _this = this;
|
|
16
|
-
|
|
17
|
-
for (let i = 0; i < numWorkers; i++) {
|
|
18
|
-
let w = new Worker(URL.createObjectURL(elevationProgramm));
|
|
19
|
-
|
|
20
|
-
w.onmessage = function (e) {
|
|
21
|
-
_this._segments[e.data.id]._plainSegmentWorkerCallback(e.data);
|
|
22
|
-
|
|
23
|
-
e.data.plainVertices = null;
|
|
24
|
-
e.data.plainVerticesHigh = null;
|
|
25
|
-
e.data.plainVerticesLow = null;
|
|
26
|
-
e.data.plainNormals = null;
|
|
27
|
-
e.data.normalMapNormals = null;
|
|
28
|
-
e.data.normalMapVertices = null;
|
|
29
|
-
e.data.normalMapVerticesHigh = null;
|
|
30
|
-
e.data.normalMapVerticesLow = null;
|
|
31
|
-
|
|
32
|
-
_this._segments[e.data.id] = null;
|
|
33
|
-
delete _this._segments[e.data.id];
|
|
34
|
-
|
|
35
|
-
_this._workerQueue.unshift(this);
|
|
36
|
-
_this.check();
|
|
37
|
-
};
|
|
9
|
+
super(numWorkers, _programm);
|
|
10
|
+
this._segments = new Map();
|
|
11
|
+
}
|
|
38
12
|
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
_onMessage(e) {
|
|
14
|
+
this._segments.get(e.data.id)._plainSegmentWorkerCallback(e.data);
|
|
41
15
|
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
e.data.plainVertices = null;
|
|
17
|
+
e.data.plainVerticesHigh = null;
|
|
18
|
+
e.data.plainVerticesLow = null;
|
|
19
|
+
e.data.plainNormals = null;
|
|
20
|
+
e.data.normalMapNormals = null;
|
|
21
|
+
e.data.normalMapVertices = null;
|
|
22
|
+
e.data.normalMapVerticesHigh = null;
|
|
23
|
+
e.data.normalMapVerticesLow = null;
|
|
44
24
|
|
|
45
|
-
|
|
46
|
-
if (this._pendingQueue.length) {
|
|
47
|
-
this.make(this._pendingQueue.pop());
|
|
48
|
-
}
|
|
25
|
+
this._segments.delete(e.data.id)
|
|
49
26
|
}
|
|
50
27
|
|
|
51
28
|
setGeoid(geoid) {
|
|
@@ -68,21 +45,19 @@ class PlainSegmentWorker {
|
|
|
68
45
|
let rawfile = new Uint8Array(m.rawfile.length);
|
|
69
46
|
rawfile.set(m.rawfile);
|
|
70
47
|
|
|
71
|
-
w.postMessage(
|
|
72
|
-
{
|
|
48
|
+
w.postMessage({
|
|
73
49
|
model: model,
|
|
74
50
|
rawfile: rawfile
|
|
75
|
-
},
|
|
76
|
-
|
|
51
|
+
}, [
|
|
52
|
+
rawfile.buffer
|
|
53
|
+
]
|
|
77
54
|
);
|
|
78
55
|
});
|
|
79
56
|
} else {
|
|
80
57
|
this._workerQueue.forEach((w) => {
|
|
81
|
-
w.postMessage(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
);
|
|
58
|
+
w.postMessage({
|
|
59
|
+
model: null
|
|
60
|
+
});
|
|
86
61
|
});
|
|
87
62
|
}
|
|
88
63
|
}
|
|
@@ -92,7 +67,7 @@ class PlainSegmentWorker {
|
|
|
92
67
|
if (this._workerQueue.length) {
|
|
93
68
|
let w = this._workerQueue.pop();
|
|
94
69
|
|
|
95
|
-
this._segments
|
|
70
|
+
this._segments.set(this._id, segment);
|
|
96
71
|
|
|
97
72
|
let params = new Float64Array([
|
|
98
73
|
this._id++,
|
|
@@ -111,12 +86,11 @@ class PlainSegmentWorker {
|
|
|
111
86
|
segment.planet._heightFactor
|
|
112
87
|
]);
|
|
113
88
|
|
|
114
|
-
w.postMessage(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
89
|
+
w.postMessage({
|
|
90
|
+
params: params
|
|
91
|
+
}, [
|
|
92
|
+
params.buffer
|
|
93
|
+
]);
|
|
120
94
|
} else {
|
|
121
95
|
this._pendingQueue.push(segment);
|
|
122
96
|
}
|