@pirireis/webglobeplugins 0.6.46-a → 0.6.48-a

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.
@@ -10,7 +10,7 @@ import { GlobeShellWiggle, Float2LegendWithRatio } from "../../programs";
10
10
  * @param dataWidthHeight : {width: number, height: number}
11
11
  * @param options : {bbox: number[], minMaxEdges: {min: number, max: number}, escapeValue: number, resolution: number[], meshPartition: number[]}
12
12
  */
13
- export default class Plugin {
13
+ export default class HeatWaveGlobeShellPlugin {
14
14
  constructor(id, dataManager, colorRampData, dataWidthHeight,
15
15
  {
16
16
  bbox = [-180, -90, 180, 90],
@@ -143,12 +143,15 @@ export default class Plugin {
143
143
 
144
144
  _updateData(ratio, textureData0 = null, textureData1 = null) {
145
145
  if (!textureData0 || !textureData1) {
146
- this.isAble = false;
146
+ if (this._disCarded) return;
147
+ this.heatProgram.discard();
148
+ this.drawHeat();
149
+ this._disCarded = true;
147
150
  return;
148
151
  };
149
152
  this.heatProgram.setBlendRatio(ratio);
150
153
  if (this._lastTexture0data !== textureData0 || this._lastTexture1data !== textureData1) {
151
- this.isAble = true;
154
+ this._disCarded = false;
152
155
  this._lastTexture0data = textureData0;
153
156
  this._lastTexture1data = textureData1;
154
157
  this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height);
@@ -166,7 +169,7 @@ export default class Plugin {
166
169
 
167
170
  draw3D() {
168
171
  if (!this._isOn) return;
169
- if (!this.isAble) return;
172
+ // if (!this.isAble) return;
170
173
  this.gl.disable(this.gl.DEPTH_TEST);
171
174
  this.globeShell.draw();
172
175
  this.gl.enable(this.gl.DEPTH_TEST);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.6.46-a",
3
+ "version": "0.6.48-a",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -46,7 +46,10 @@ export default class {
46
46
  out vec4 outColor;
47
47
 
48
48
  void main() {
49
-
49
+ if ( u_blend_ratio < 0.0) {
50
+ outColor = vec4(0.0, 0.0, 0.0, 0.0);
51
+ return;
52
+ }
50
53
  float f0 = texture(u_float_texture0, v_texcoord).r;
51
54
  float f1 = texture(u_float_texture1, v_texcoord).r;
52
55
  // outColor = vec4(
@@ -96,6 +96,11 @@ export default class {
96
96
  }
97
97
 
98
98
 
99
+ discard() {
100
+ this.heatParametersBlockManager.update({ blend_ratio: -1 });
101
+ }
102
+
103
+
99
104
  setColorRampTextureData(data, size) {
100
105
  const { gl, colorRampTexture } = this;
101
106
  gl.bindTexture(gl.TEXTURE_2D, colorRampTexture);
@@ -104,6 +104,7 @@ export default class RangeRingAngleText {
104
104
  if (this._centerCollection.has(centerID)) {
105
105
  this._fillDeleteBucket(centerID, deleteBucket);
106
106
  }
107
+
107
108
  const maxRadius = rings.reduce((acc, { radius }) => Math.max(acc, radius), 0);
108
109
  const textHide_ = _hideAll ? ENUM_TEXT_HIDE.HIDE : textHide;
109
110
  const show = hide !== ENUM_HIDE.HIDE && textHide_ === ENUM_TEXT_HIDE.SHOW;
@@ -289,7 +290,6 @@ export default class RangeRingAngleText {
289
290
 
290
291
  __realCoords(long, lat, radius, stepAngle, centerID, outBucket) {
291
292
  const { coords, coordsZ, attribs } = outBucket;
292
-
293
293
  const coords_ = realCircle(this.globe, long, lat, radius, stepAngle);
294
294
  { // add 0
295
295
  const { long, lat } = coords_[0];
@@ -303,8 +303,7 @@ export default class RangeRingAngleText {
303
303
  });
304
304
  }
305
305
 
306
- const _stepAngle = this.globe.Units.AngleUtoDeg(stepAngle)
307
- let aci = _stepAngle;
306
+ let aci = stepAngle;
308
307
 
309
308
  for (let i = 1; i < coords_.length; i++) {
310
309
  if (aci >= 360) break;
@@ -317,7 +316,7 @@ export default class RangeRingAngleText {
317
316
  "__fid__": key,
318
317
  "aci": (360 - aci).toFixed(0).toString().padStart(3, '0')
319
318
  })
320
- aci += _stepAngle;
319
+ aci += stepAngle;
321
320
  }
322
321
  }
323
322
 
@@ -339,8 +338,7 @@ export default class RangeRingAngleText {
339
338
  const stepAngle = centerMap.get("stepAngle");
340
339
  const { coords, coordsZ, attribs } = outDeleteBucket;
341
340
  let i = 0;
342
- const _stepAngle = this.globe.Units.AngleUtoDeg(stepAngle)
343
- for (let aci = 0; aci < 360; aci += _stepAngle) {
341
+ for (let aci = 0; aci < 360; aci += stepAngle) {
344
342
  const key = this._key(centerID, i++);
345
343
  coords.push(0, 0);
346
344
  coordsZ.push(0);
package/wind/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import WindPlugin from "./plugin";
2
2
  import createVectorFieldImage from "./vectorfieldimage";
3
3
  import imageToMagnitude from "./imagetovectorfieldandmagnitude";
4
-
5
- export { createVectorFieldImage, imageToMagnitude, WindPlugin };
4
+ import { createImageFromBase64 } from "../util/webglobjectbuilders";
5
+ export { createVectorFieldImage, imageToMagnitude, WindPlugin, createImageFromBase64 };
6
6
 
7
7
  // TODO: image resmindeki degerlerden ruzgar siddetinin magnitudunun hesaplanip float32array donderen bir fonksiyonun yazilmasi gerekiyor