@pirireis/webglobeplugins 0.15.11-alpha → 0.15.13-alpha

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.15.11-alpha",
3
+ "version": "0.15.13-alpha",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -98,6 +98,30 @@ export class BearingLinePlugin {
98
98
  };
99
99
  }
100
100
  }
101
+ setDefaultSemiPluginColor(semiPluginName, color) {
102
+ if (this._freed) {
103
+ throw new Error("Plugin has been freed, cannot set default semi plugin color.");
104
+ }
105
+ if (!this.globe) {
106
+ throw new Error("Globe is not set, cannot set default semi plugin color.");
107
+ }
108
+ switch (semiPluginName) {
109
+ case "circleOnTerrain":
110
+ this.circlePlugin.setDefaultColor(color);
111
+ break;
112
+ case "arcOnTerrain":
113
+ this.arcPlugin.setDefaultColor(color);
114
+ break;
115
+ case "line":
116
+ this.linePlugin.setDefaultColor(color);
117
+ break;
118
+ case "pieceOfPie":
119
+ this.pieceOfPiePlugin.setDefaultColor(color);
120
+ break;
121
+ default:
122
+ throw new Error(`Unknown semi plugin name: ${semiPluginName}`);
123
+ }
124
+ }
101
125
  setDoDrawVRM(drawVRM) {
102
126
  if (this._freed) {
103
127
  throw new Error("Plugin has been freed, cannot set draw VRM.");
@@ -181,6 +181,7 @@ export class CircleLineChainPlugin {
181
181
  this.circlePlugin?.deleteBulk(keys);
182
182
  this._updateTexts(chainKeys, Array.from(this._textWritersMap.keys()));
183
183
  }
184
+ this.globe?.DrawRender();
184
185
  }
185
186
  deleteNodes(keysAndNodes) {
186
187
  if (this._freed) {
@@ -47,6 +47,17 @@ export class PieceOfPiePlugin {
47
47
  this.drawMode = drawMode;
48
48
  this.globe?.DrawRender();
49
49
  }
50
+ setDefaultColor(color) {
51
+ if (this._isFreed) {
52
+ console.warn("PieceOfPiePlugin is freed, cannot set default color.");
53
+ return;
54
+ }
55
+ if (!Array.isArray(color) || color.length !== 4) {
56
+ throw new Error("Color must be an array of 4 numbers [R, G, B, A].");
57
+ }
58
+ this._uboHandler?.updateSingle("u_color", new Float32Array(color));
59
+ this.globe?.DrawRender();
60
+ }
50
61
  _createBufferManagersMap() {
51
62
  const { gl, globe, _pluginOptions } = this;
52
63
  const { bufferType, initialCapacity } = _pluginOptions;