@pirireis/webglobeplugins 0.8.17 → 0.8.19

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.ts CHANGED
@@ -97,7 +97,6 @@ export class Arc {
97
97
  return null; // no intersection
98
98
  }
99
99
 
100
-
101
100
  const [A, B] = (() => {
102
101
  Vector3D.crossVectors(...intersectionPoints, _AxB);
103
102
  if (_AxB.dot(this._AxB) >= 0) {
@@ -110,8 +109,8 @@ export class Arc {
110
109
 
111
110
  Vector3D.crossVectors(this.pointA, A, _A_x_otherA);
112
111
  Vector3D.crossVectors(this.pointA, B, _A_x_otherB);
113
-
114
- // think as this.pointA is on Vector3D(0, 0, 1) on some space
112
+ // think as this.pointA is on y=1 on a x-y space. this.pointB is on the x>0 part of the space.
113
+ // any point on x<0 is outside. Any point y<this._dot is outside.
115
114
  const _yA = this.pointA.dot(A);
116
115
  const _yB = this.pointA.dot(B);
117
116
 
@@ -126,13 +125,14 @@ export class Arc {
126
125
  return null; // no intersection
127
126
  }
128
127
 
129
-
130
- const results: [Vector3D, Vector3D] = [_xA < 0 ? this.pointA.clone() : A, _yB <= this._dot ? this.pointB.clone() : B];
131
-
128
+ const resultPoints: [Vector3D, Vector3D] = [
129
+ _xA < 0 ? this.pointA.clone() : A,
130
+ _yB <= this._dot ? this.pointB.clone() : B
131
+ ];
132
132
  if (target === null) {
133
- target = new Arc(...results);
133
+ target = new Arc(...resultPoints);
134
134
  } else {
135
- target.setFromUnitVectors(...results);
135
+ target.setFromUnitVectors(...resultPoints);
136
136
  }
137
137
 
138
138
  return target;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.8.17",
3
+ "version": "0.8.19",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT"
@@ -48,6 +48,7 @@ export default class RangeRingAngleText {
48
48
  label.vAlignment = 2;
49
49
  label.hAlignment = 2;
50
50
  label.size = 17;
51
+ // eslint-disable-next-line
51
52
  label.text = "`${aci}`"
52
53
 
53
54
  return style;
@@ -163,7 +164,7 @@ export default class RangeRingAngleText {
163
164
 
164
165
  /**
165
166
  *
166
- * @param {Array<{centerID:string, hide: bool}} centerHides
167
+ * @param {Array<{centerID:string, hide: bool}>} centerHides
167
168
  */
168
169
  updateCentersHide(centerHides) {
169
170
  if (this._hideAll) {
@@ -20,7 +20,7 @@ const MAX_PIXELS_ON_DIMENSION = 2200;
20
20
 
21
21
 
22
22
  export default class Plugin {
23
- constructor(id, { fadeOpacity = 0.83, opacity = 0.75, minLon = -180, minLat = -90, maxLon = 180, maxLat = 90, patricleCount = 8000, dataWidth, dataHeight, drawTextureMaxPixelOnDimension = MAX_PIXELS_ON_DIMENSION } = {}) {
23
+ constructor(id, { dataWidth, dataHeight, fadeOpacity = 0.83, opacity = 0.75, minLon = -180, minLat = -90, maxLon = 180, maxLat = 90, patricleCount = 8000, flipY = true, drawTextureMaxPixelOnDimension = MAX_PIXELS_ON_DIMENSION } = {}) {
24
24
 
25
25
  this.id = id;
26
26
  this.globe = null;
@@ -31,6 +31,7 @@ export default class Plugin {
31
31
  this._rgVectorFieldTexture = null;
32
32
  this.globeShellWiggle = null;
33
33
  this.waveUbo = null;
34
+ this._flipY = flipY;
34
35
  this._drawTextureResolution = {};
35
36
  this._frameBuffer = null;
36
37
  this._fadeOpacity = fadeOpacity;
@@ -84,6 +85,7 @@ export default class Plugin {
84
85
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
85
86
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
86
87
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
88
+
87
89
  gl.bindTexture(gl.TEXTURE_2D, null);
88
90
  return texture;
89
91
  }
@@ -145,7 +147,7 @@ export default class Plugin {
145
147
  }
146
148
 
147
149
  _createRGTexture() {
148
- const { gl, _dataWidth, _dataHeight } = this;
150
+ const { gl, _dataWidth, _dataHeight, } = this;
149
151
  const texture = gl.createTexture();
150
152
  // R32F
151
153
  gl.bindTexture(gl.TEXTURE_2D, texture);
@@ -154,8 +156,8 @@ export default class Plugin {
154
156
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
155
157
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
156
158
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
157
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
158
-
159
+ // gl.pixelStorei(gl.UNPACK_FLIP_X_WEBGL, this._flipX);
160
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, this._flipY);
159
161
  gl.bindTexture(gl.TEXTURE_2D, null);
160
162
  return texture;
161
163
  }
@@ -186,11 +188,12 @@ export default class Plugin {
186
188
  }
187
189
 
188
190
 
189
- setVectorFieldData(data, dataWidth = null, dataHeight = null) {
191
+ setVectorFieldData(data, { dataWidth = null, dataHeight = null } = {}) {
190
192
  if (dataWidth !== null && dataHeight !== null) {
191
193
  this._dataWidth = dataWidth;
192
194
  this._dataHeight = dataHeight;
193
195
  }
196
+
194
197
  const { gl, _dataWidth, _dataHeight } = this;
195
198
  gl.bindTexture(gl.TEXTURE_2D, this._rgVectorFieldTexture);
196
199
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RG32F, _dataWidth, _dataHeight, 0, gl.RG, gl.FLOAT, data);