@pirireis/webglobeplugins 0.15.21-alpha → 0.15.24
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/Math/arc.js +1 -2
- package/Math/circle-cdf-points.js +1 -170
- package/Math/circle.js +0 -25
- package/Math/vec3.js +1 -1
- package/altitude-locator/plugin.js +1 -1
- package/package.json +1 -1
- package/point-tracks/plugin.js +5 -6
- package/programs/line-on-globe/lines-color-instanced-flat.js +0 -1
- package/programs/point-on-globe/element-globe-surface-glow.js +0 -1
- package/programs/totems/camerauniformblock.js +7 -0
- package/programs/totems/canvas-webglobe-info.js +9 -9
- package/programs/totems/globe-changes.js +21 -14
- package/range-tools-on-terrain/bearing-line/plugin.js +2 -5
- package/range-tools-on-terrain/circle-line-chain/chain-list-map.js +4 -9
- package/range-tools-on-terrain/circle-line-chain/plugin.js +4 -2
- package/range-tools-on-terrain/range-ring/adapters.js +25 -9
- package/range-tools-on-terrain/range-ring/plugin.js +200 -5
- package/range-tools-on-terrain/range-ring/types.js +9 -1
- package/semiplugins/lightweight/line-plugin.js +33 -15
- package/semiplugins/shape-on-terrain/arc-plugin.js +162 -99
- package/semiplugins/shape-on-terrain/circle-plugin.js +170 -83
- package/semiplugins/shape-on-terrain/padding-1-degree.js +244 -63
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +1 -1
- package/util/build-strategy/static-dynamic.js +11 -1
- package/util/frame-counter-trigger.js +84 -0
- package/wind/imagetovectorfieldandmagnitude.js +23 -0
- package/wind/index.js +2 -2
- package/wind/plugin.js +30 -9
- package/write-text/context-text4.js +140 -0
- package/Math/arc-generate-points copy.js +0 -366
- package/Math/globe-util/horizon-plane.js +0 -112
- package/altitude-locator/draw-subset-obj.js +0 -16
- package/semiplugins/shape-on-terrain/derived/padding-plugin.js +0 -101
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "./types";
|
|
2
|
-
/**
|
|
3
|
-
* @param {DrawSubsetOptions} drawSubsetOptions
|
|
4
|
-
*/
|
|
5
|
-
// TODO: Draw all is an optional property for the target plugin, with this approach.
|
|
6
|
-
class DrawSubsetOptionRegistry {
|
|
7
|
-
constructor() {
|
|
8
|
-
this._drawSubsetOptions = new Map();
|
|
9
|
-
}
|
|
10
|
-
register(key, drawSubsetOptions) {
|
|
11
|
-
this._drawSubsetOptions.set(key, drawSubsetOptions);
|
|
12
|
-
}
|
|
13
|
-
unregister(key) {
|
|
14
|
-
this._drawSubsetOptions.delete(key);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { ArcOnTerrainPlugin } from "../arc-plugin";
|
|
2
|
-
const EDGE_COUNT = 5;
|
|
3
|
-
const paddingKeys = (padding) => {
|
|
4
|
-
const stepCount = padding.coverAngle / padding.stepAngle;
|
|
5
|
-
const keys = new Array(Math.ceil(stepCount));
|
|
6
|
-
for (let i = 0; i < stepCount; i++) {
|
|
7
|
-
keys[i] = padding.key + i;
|
|
8
|
-
}
|
|
9
|
-
if (keys.length > stepCount) {
|
|
10
|
-
keys[keys.length - 1] = padding.key + stepCount;
|
|
11
|
-
}
|
|
12
|
-
return keys;
|
|
13
|
-
};
|
|
14
|
-
const adapterPadding2Arc = (globe, padding) => {
|
|
15
|
-
const stepCount = padding.coverAngle / padding.stepAngle;
|
|
16
|
-
const result = new Array(Math.ceil(stepCount));
|
|
17
|
-
const fill = (i, angle) => {
|
|
18
|
-
const startPoint = globe.Math.FindPointByPolar(padding.center[0], padding.center[1], padding.outerRadius, angle);
|
|
19
|
-
const endPoint = globe.Math.FindPointByPolar(padding.center[0], padding.center[1], padding.innerRadius, angle);
|
|
20
|
-
result[i] = {
|
|
21
|
-
key: padding.key + i,
|
|
22
|
-
start: [startPoint.long, startPoint.lat],
|
|
23
|
-
end: [endPoint.long, endPoint.lat],
|
|
24
|
-
color: padding.color,
|
|
25
|
-
height: padding.height,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
for (let i = 0; i < stepCount; i++) {
|
|
29
|
-
const angle = padding.startAngle + i * padding.stepAngle;
|
|
30
|
-
fill(i, angle);
|
|
31
|
-
}
|
|
32
|
-
if (result.length > stepCount) {
|
|
33
|
-
const i = result.length - 1;
|
|
34
|
-
const angle = padding.startAngle + padding.coverAngle;
|
|
35
|
-
fill(i, angle);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
export const chargerAdaptor = (chargerInput, plugin, padding) => {
|
|
40
|
-
};
|
|
41
|
-
export class PaddingPlugin {
|
|
42
|
-
id;
|
|
43
|
-
arcPlugin;
|
|
44
|
-
globe = null;
|
|
45
|
-
_memory = new Map();
|
|
46
|
-
isFreed = false;
|
|
47
|
-
constructor(id, { variativeColorsOn = true, defaultColor = [1, 1, 1, 1], defaultHeightFromGroundIn3D = 30.0, vertexCount = EDGE_COUNT } = {}) {
|
|
48
|
-
this.id = id;
|
|
49
|
-
this.arcPlugin = new ArcOnTerrainPlugin(id, {
|
|
50
|
-
cameraAttractionIsOn: false,
|
|
51
|
-
vertexCount: vertexCount,
|
|
52
|
-
variativeColorsOn: variativeColorsOn,
|
|
53
|
-
defaultColor: defaultColor,
|
|
54
|
-
defaultHeightFromGroundIn3D: defaultHeightFromGroundIn3D,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
insertBulk(items) {
|
|
58
|
-
for (const padding of items) {
|
|
59
|
-
this.__delete(padding.key);
|
|
60
|
-
this._memory.set(padding.key, padding);
|
|
61
|
-
}
|
|
62
|
-
const arcInputs = items.flatMap(padding => adapterPadding2Arc(this.globe, padding));
|
|
63
|
-
this.arcPlugin.insertBulk(arcInputs);
|
|
64
|
-
}
|
|
65
|
-
deleteBulk(keys) {
|
|
66
|
-
const arcKeys = keys.flatMap(key => paddingKeys({ key, center: [0, 0], outerRadius: 0, innerRadius: 0, startAngle: 0, coverAngle: 0, stepAngle: 0, color: [0, 0, 0, 1] }));
|
|
67
|
-
this.arcPlugin.deleteBulk(arcKeys);
|
|
68
|
-
}
|
|
69
|
-
updateColor(key, color) {
|
|
70
|
-
// TODO: get all padding keys and update all of them
|
|
71
|
-
if (!this._memory.has(key)) {
|
|
72
|
-
console.warn(`Padding with key ${key} does not exist.`);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const keys = paddingKeys(this._memory.get(key));
|
|
76
|
-
for (let i = 0; i < keys.length; i++) {
|
|
77
|
-
this.arcPlugin.updateColor(keys[i], color);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
__delete(key) {
|
|
81
|
-
const padding = this._memory.get(key);
|
|
82
|
-
if (padding) {
|
|
83
|
-
const keys = paddingKeys(padding);
|
|
84
|
-
this.arcPlugin.deleteBulk(keys);
|
|
85
|
-
this._memory.delete(key);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
init(globe, gl) {
|
|
89
|
-
this.globe = globe;
|
|
90
|
-
this.arcPlugin.init(globe, gl);
|
|
91
|
-
}
|
|
92
|
-
draw3D() {
|
|
93
|
-
this.arcPlugin.draw3D();
|
|
94
|
-
}
|
|
95
|
-
free() {
|
|
96
|
-
if (this.isFreed)
|
|
97
|
-
return;
|
|
98
|
-
this.isFreed = true;
|
|
99
|
-
this.arcPlugin.free();
|
|
100
|
-
}
|
|
101
|
-
}
|