@pirireis/webglobeplugins 0.8.24 → 0.8.26
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.
|
@@ -18,6 +18,7 @@ export default class HeatWaveGlobeShellPlugin {
|
|
|
18
18
|
minMaxEdges = { min: -99999, max: 99999 },
|
|
19
19
|
escapeValue = 99999,
|
|
20
20
|
resolution = [2056, 2056],
|
|
21
|
+
yFlip = true,
|
|
21
22
|
} = {}) {
|
|
22
23
|
this.id = id;
|
|
23
24
|
this.dataManager = dataManager;
|
|
@@ -30,7 +31,7 @@ export default class HeatWaveGlobeShellPlugin {
|
|
|
30
31
|
this._resolution = resolution;
|
|
31
32
|
|
|
32
33
|
this._colorRampData = colorRampData; // holds until init
|
|
33
|
-
|
|
34
|
+
this._yFlip = yFlip;
|
|
34
35
|
this._lastTexture0data = null;
|
|
35
36
|
this._lastTexture1data = null;
|
|
36
37
|
|
|
@@ -155,7 +156,7 @@ export default class HeatWaveGlobeShellPlugin {
|
|
|
155
156
|
this._disCarded = false;
|
|
156
157
|
this._lastTexture0data = textureData0;
|
|
157
158
|
this._lastTexture1data = textureData1;
|
|
158
|
-
this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height);
|
|
159
|
+
this.heatProgram.setFloatTextureData(textureData0, textureData1, this._dataWidthHeight.width, this._dataWidthHeight.height, this._yFlip);
|
|
159
160
|
}
|
|
160
161
|
this.drawHeat();
|
|
161
162
|
}
|
package/package.json
CHANGED
|
@@ -87,12 +87,15 @@ export default class DataObject {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
setFloatTextureData(data0, data1, width, height) {
|
|
90
|
+
setFloatTextureData(data0, data1, width, height, yFlip = false) {
|
|
91
91
|
const { texture0, texture1, gl } = this;
|
|
92
|
+
|
|
92
93
|
gl.bindTexture(gl.TEXTURE_2D, texture0);
|
|
94
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, yFlip);
|
|
93
95
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data0);
|
|
94
96
|
gl.bindTexture(gl.TEXTURE_2D, texture1);
|
|
95
97
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data1);
|
|
98
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
|
package/wind/plugin.js
CHANGED
|
@@ -630,14 +630,21 @@ export default class WindPlugin {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
-
getPointCoordinatesDataCalculator() {
|
|
634
|
-
if (!this.coordinatesDataCalculator) this._createPointCoordinatesDataCalculator();
|
|
633
|
+
getPointCoordinatesDataCalculator({ bbox = null, width = null, height = null } = {}) {
|
|
634
|
+
if (!this.coordinatesDataCalculator) this._createPointCoordinatesDataCalculator({ bbox, width, height });
|
|
635
635
|
return this.coordinatesDataCalculator;
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
|
|
639
|
-
_createPointCoordinatesDataCalculator() {
|
|
640
|
-
|
|
639
|
+
_createPointCoordinatesDataCalculator({ bbox = null, width = null, height = null } = {}) {
|
|
640
|
+
if (this.windData) {
|
|
641
|
+
this.coordinatesDataCalculator = new PointCoordinatesDataCalculator(this.windData.bbox, this.windData.width, this.windData.height);
|
|
642
|
+
} else {
|
|
643
|
+
if (!bbox || !width || !height) {
|
|
644
|
+
throw new Error("WindPlugin: windData meta info, bbox, width and height are required to create PointCoordinatesDataCalculator");
|
|
645
|
+
}
|
|
646
|
+
this.coordinatesDataCalculator = new PointCoordinatesDataCalculator(bbox, width, height);
|
|
647
|
+
}
|
|
641
648
|
this._setCoorcinatesDataCalculatorData();
|
|
642
649
|
}
|
|
643
650
|
|