@pirireis/webglobeplugins 0.6.47-a → 0.6.49-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.47-a",
3
+ "version": "0.6.49-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);
@@ -288,35 +288,33 @@ export default class RangeRingAngleText {
288
288
 
289
289
  }
290
290
 
291
- __realCoords(long, lat, radius, stepAngle, centerID, outBucket) {
291
+ __realCoords(longCenter, latCenter, radius, stepAngle, centerID, outBucket) {
292
+ const { globe } = this;
292
293
  const { coords, coordsZ, attribs } = outBucket;
293
- const coords_ = realCircle(this.globe, long, lat, radius, stepAngle);
294
- { // add 0
295
- const { long, lat } = coords_[0];
294
+ let i = 1;
295
+ for (let aci = stepAngle; aci < 360; aci += stepAngle) {
296
+ const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, aci);
296
297
  coords.push(long, lat);
297
298
  coordsZ.push(0);
298
- const key = this._key(centerID, 0);
299
+ const key = this._key(centerID, i); i++;
299
300
  // fidkey is the key
300
301
  attribs.push({
301
302
  "__fid__": key,
302
- "aci": "K"
303
- });
303
+ "aci": (aci).toFixed(0).toString().padStart(3, '0')
304
+ })
304
305
  }
305
306
 
306
- let aci = stepAngle;
307
307
 
308
- for (let i = 1; i < coords_.length; i++) {
309
- if (aci >= 360) break;
310
- const { long, lat } = coords_[i];
308
+ { // add 0
309
+ const { long, lat } = globe.Math.FindPointByPolar(longCenter, latCenter, radius, 0);
311
310
  coords.push(long, lat);
312
311
  coordsZ.push(0);
313
- const key = this._key(centerID, i);
312
+ const key = this._key(centerID, 0);
314
313
  // fidkey is the key
315
314
  attribs.push({
316
315
  "__fid__": key,
317
- "aci": (360 - aci).toFixed(0).toString().padStart(3, '0')
318
- })
319
- aci += stepAngle;
316
+ "aci": "K"
317
+ });
320
318
  }
321
319
  }
322
320
 
@@ -371,12 +369,13 @@ export default class RangeRingAngleText {
371
369
 
372
370
 
373
371
  const realCircle = (globe, longitude, latitude, radius, stepAngle) => {
374
- const pointsLongLat = globe.Math.GetEllipseGeo(
372
+ const pointsLongLat = globe.Math.F(
375
373
  longitude,
376
374
  latitude,
377
375
  radius,
378
376
  radius,
379
377
  0,
380
378
  stepAngle);
379
+ console.log("pointsLongLat", stepAngle, pointsLongLat)
381
380
  return pointsLongLat;
382
381
  }