@pirireis/webglobeplugins 0.9.11 → 0.9.12

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.
Files changed (166) hide show
  1. package/Math/angle-calculation.js +8 -8
  2. package/Math/arc.js +18 -18
  3. package/Math/bounds/line-bbox.js +78 -80
  4. package/Math/constants.js +3 -3
  5. package/Math/juction/arc-plane.js +23 -23
  6. package/Math/juction/line-sphere.js +11 -11
  7. package/Math/juction/plane-plane.js +11 -11
  8. package/Math/line.js +14 -16
  9. package/Math/methods.js +65 -70
  10. package/Math/plane.js +16 -18
  11. package/Math/quaternion.js +45 -49
  12. package/Math/utils.js +2 -2
  13. package/Math/vec3.js +42 -45
  14. package/algorithms/search-binary.js +4 -4
  15. package/altitude-locator/draw-subset-obj.js +7 -8
  16. package/altitude-locator/plugin.js +98 -114
  17. package/arrowfield/adaptor.js +3 -4
  18. package/arrowfield/index.js +2 -2
  19. package/arrowfield/plugin.js +62 -65
  20. package/bearing-line/index.js +1 -1
  21. package/bearing-line/plugin.js +200 -226
  22. package/circle-line-chain/chain-list-map.js +82 -88
  23. package/circle-line-chain/plugin.js +134 -165
  24. package/circle-line-chain/util.js +1 -1
  25. package/compass-rose/compass-rose-padding-flat.js +108 -133
  26. package/compass-rose/compass-text-writer.js +62 -70
  27. package/compass-rose/index.js +2 -2
  28. package/compassrose/compassrose.js +46 -50
  29. package/compassrose/index.js +1 -1
  30. package/heatwave/index.js +2 -2
  31. package/heatwave/isobar/objectarraylabels.js +44 -48
  32. package/heatwave/isobar/plugin.js +104 -123
  33. package/heatwave/isobar/quadtreecontours.js +76 -92
  34. package/heatwave/plugins/heatwaveglobeshell.js +69 -87
  35. package/index.js +11 -11
  36. package/package.json +1 -1
  37. package/partialrings/buffer-manager.js +32 -64
  38. package/partialrings/index.js +1 -1
  39. package/partialrings/plugin.js +48 -84
  40. package/partialrings/program.js +136 -47
  41. package/pin/pin-object-array.js +83 -86
  42. package/pin/pin-point-totem.js +21 -22
  43. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
  44. package/point-heat-map/plugin-webworker.js +40 -45
  45. package/point-heat-map/point-to-heat-map-flow.js +40 -42
  46. package/point-tracks/key-methods.js +1 -1
  47. package/point-tracks/plugin.js +137 -162
  48. package/programs/arrowfield/index.js +1 -1
  49. package/programs/arrowfield/logic.js +170 -62
  50. package/programs/arrowfield/object.js +33 -35
  51. package/programs/data2legend/density-to-legend.js +45 -21
  52. package/programs/data2legend/point-to-density-texture.js +52 -27
  53. package/programs/float2legendwithratio/index.js +1 -1
  54. package/programs/float2legendwithratio/logic.js +88 -42
  55. package/programs/float2legendwithratio/object.js +43 -46
  56. package/programs/globe-util/is-globe-moved.js +10 -11
  57. package/programs/globeshell/index.js +1 -1
  58. package/programs/globeshell/wiggle/index.js +1 -1
  59. package/programs/globeshell/wiggle/logic.js +191 -98
  60. package/programs/globeshell/wiggle/object.js +33 -35
  61. package/programs/helpers/blender/program.js +36 -19
  62. package/programs/helpers/fadeaway/index.js +1 -1
  63. package/programs/helpers/fadeaway/logic.js +35 -13
  64. package/programs/helpers/fadeaway/object.js +9 -10
  65. package/programs/helpers/index.js +1 -1
  66. package/programs/index.js +8 -8
  67. package/programs/line-on-globe/angled-line.js +91 -32
  68. package/programs/line-on-globe/circle-accurate-3d.js +82 -32
  69. package/programs/line-on-globe/circle-accurate-flat.js +108 -50
  70. package/programs/line-on-globe/circle-accurate.js +103 -33
  71. package/programs/line-on-globe/circle.js +97 -32
  72. package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
  73. package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
  74. package/programs/line-on-globe/linestrip.js +111 -45
  75. package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
  76. package/programs/line-on-globe/to-the-surface.js +58 -29
  77. package/programs/line-on-globe/util.js +1 -1
  78. package/programs/picking/pickable-renderer.js +117 -33
  79. package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
  80. package/programs/point-on-globe/element-point-glow.js +103 -35
  81. package/programs/point-on-globe/square-pixel-point.js +76 -27
  82. package/programs/programcache.js +13 -13
  83. package/programs/rings/distancering/circleflatprogram.js +63 -21
  84. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
  85. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
  86. package/programs/rings/distancering/index.js +4 -4
  87. package/programs/rings/distancering/paddyflatprogram.js +73 -20
  88. package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
  89. package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
  90. package/programs/rings/partial-ring/piece-of-pie.js +137 -35
  91. package/programs/totems/camerauniformblock.js +64 -51
  92. package/programs/totems/canvas-webglobe-info.js +48 -40
  93. package/programs/totems/gpu-selection-uniform-block.js +44 -40
  94. package/programs/totems/index.js +1 -1
  95. package/programs/two-d/pixel-padding-for-compass.js +90 -29
  96. package/programs/util.js +6 -7
  97. package/programs/vectorfields/index.js +1 -1
  98. package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
  99. package/programs/vectorfields/logics/index.js +3 -3
  100. package/programs/vectorfields/logics/pixelbased.js +91 -35
  101. package/programs/vectorfields/logics/ubo.js +31 -25
  102. package/programs/vectorfields/pingpongbuffermanager.js +30 -34
  103. package/rangerings/index.js +4 -4
  104. package/rangerings/plugin.js +202 -258
  105. package/rangerings/rangeringangletext.js +108 -120
  106. package/rangerings/ring-account.js +52 -69
  107. package/shaders/fragment-toy/firework.js +55 -1
  108. package/shaders/fragment-toy/singularity.js +55 -1
  109. package/timetracks/adaptors-line-strip.js +26 -37
  110. package/timetracks/adaptors.js +47 -61
  111. package/timetracks/index.js +4 -4
  112. package/timetracks/plugin-line-strip.js +63 -71
  113. package/timetracks/plugin.js +69 -77
  114. package/timetracks/program-line-strip.js +296 -103
  115. package/timetracks/program.js +419 -113
  116. package/timetracks/programpoint-line-strip.js +97 -44
  117. package/timetracks/programpoint.js +90 -44
  118. package/util/account/bufferoffsetmanager.js +72 -95
  119. package/util/account/index.js +1 -1
  120. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
  121. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
  122. package/util/account/single-attribute-buffer-management/index.js +3 -3
  123. package/util/account/single-attribute-buffer-management/object-store.js +29 -30
  124. package/util/account/util.js +2 -4
  125. package/util/algorithms/search-binary.js +4 -4
  126. package/util/check/get.js +5 -5
  127. package/util/check/typecheck.js +13 -15
  128. package/util/geometry/index.js +9 -11
  129. package/util/gl-util/buffer/attribute-loader.js +8 -20
  130. package/util/gl-util/buffer/index.js +1 -1
  131. package/util/gl-util/draw-options/methods.js +8 -9
  132. package/util/gl-util/uniform-block/manager.js +67 -67
  133. package/util/heatwavedatamanager/datamanager.js +56 -116
  134. package/util/heatwavedatamanager/index.js +2 -2
  135. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
  136. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
  137. package/util/index.js +6 -6
  138. package/util/interpolation/timetrack/index.js +1 -1
  139. package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
  140. package/util/interpolation/timetrack/web-worker-str.js +179 -1
  141. package/util/interpolation/timetrack/web-worker.js +4 -4
  142. package/util/jshelpers/data-filler.js +7 -7
  143. package/util/jshelpers/timefilters.js +7 -7
  144. package/util/picking/fence.js +7 -7
  145. package/util/picking/picker-displayer.js +46 -52
  146. package/util/programs/draw-texture-on-canvas.js +39 -21
  147. package/util/programs/shapesonglobe.js +104 -64
  148. package/util/programs/supersampletotextures.js +45 -39
  149. package/util/programs/texturetoglobe.js +98 -48
  150. package/util/shaderfunctions/geometrytransformations.js +322 -27
  151. package/util/shaderfunctions/nodata.js +7 -1
  152. package/util/shaderfunctions/noisefunctions.js +39 -9
  153. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  154. package/util/webglobe/rasteroverlay.js +35 -37
  155. package/util/webglobjectbuilders.js +55 -60
  156. package/util/webglobjectbuilders1.js +48 -49
  157. package/waveparticles/adaptor.js +6 -7
  158. package/waveparticles/index.js +2 -2
  159. package/waveparticles/plugin.js +79 -84
  160. package/wind/imagetovectorfieldandmagnitude.js +15 -15
  161. package/wind/index.js +4 -4
  162. package/wind/plugin.js +453 -251
  163. package/wind/vectorfieldimage.js +5 -5
  164. package/write-text/attached-text-writer.js +46 -48
  165. package/write-text/context-text.js +51 -58
  166. package/write-text/context-text3.js +69 -74
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var util_1 = require("../../util");
4
- var default_1 = /** @class */ (function () {
5
- function default_1(gl) {
3
+ const util_1 = require("../../util");
4
+ class default_1 {
5
+ constructor(gl) {
6
6
  this.gl = gl;
7
7
  // console.log("Float2LegendWithRatioProgram gl:", gl);
8
8
  this._width = 1;
@@ -10,14 +10,63 @@ var default_1 = /** @class */ (function () {
10
10
  this._blendRatio = 0.0;
11
11
  this.programWrapper = this._createProgramWrapper();
12
12
  }
13
- default_1.prototype._createProgramWrapper = function () {
14
- var vertexShaderSource = "#version 300 es\n precision highp float;\n\n in vec2 a_position;\n out vec2 v_texcoord;\n \n void main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n v_texcoord = a_position * 0.5 + 0.5;\n v_texcoord.y = 1.0 - v_texcoord.y;\n }\n ";
15
- var fragmentShaderSource = "#version 300 es\n precision highp float;\n\n in vec2 v_texcoord;\n uniform sampler2D u_float_texture0;\n uniform sampler2D u_float_texture1;\n uniform sampler2D u_color_texture;\n \n layout(std140) uniform HeatParametersBlock {\n vec2 u_color_ramp_range; // x is min, y is range ( max - min)\n vec2 u_min_max;\n float u_escape_value;\n float u_blend_ratio;\n };\n\n out vec4 outColor;\n\n void main() {\n if ( u_blend_ratio < 0.0) {\n outColor = vec4(0.0, 0.0, 0.0, 0.0);\n return;\n }\n float f0 = texture(u_float_texture0, v_texcoord).r;\n float f1 = texture(u_float_texture1, v_texcoord).r;\n // outColor = vec4(\n\n if (f0 == u_escape_value || f1 == u_escape_value) { \n outColor = vec4(0.0, 0.0, 0.0, 0.0);\n return;\n }\n float x = mix(f0, f1, u_blend_ratio);\n if ( x < u_min_max.x || x > u_min_max.y) {\n outColor = vec4(0.0, 0.0, 0.0, 0.0);\n return; \n }\n x = (x - u_color_ramp_range.x) / u_color_ramp_range.y; \n outColor = texture(u_color_texture, vec2(x, 0.5));\n }\n ";
16
- var gl = this.gl;
17
- var program = (0, util_1.createProgram)(gl, vertexShaderSource, fragmentShaderSource);
18
- var vao = gl.createVertexArray();
13
+ _createProgramWrapper() {
14
+ const vertexShaderSource = `#version 300 es
15
+ precision highp float;
16
+
17
+ in vec2 a_position;
18
+ out vec2 v_texcoord;
19
+
20
+ void main() {
21
+ gl_Position = vec4(a_position, 0.0, 1.0);
22
+ v_texcoord = a_position * 0.5 + 0.5;
23
+ v_texcoord.y = 1.0 - v_texcoord.y;
24
+ }
25
+ `;
26
+ const fragmentShaderSource = `#version 300 es
27
+ precision highp float;
28
+
29
+ in vec2 v_texcoord;
30
+ uniform sampler2D u_float_texture0;
31
+ uniform sampler2D u_float_texture1;
32
+ uniform sampler2D u_color_texture;
33
+
34
+ layout(std140) uniform HeatParametersBlock {
35
+ vec2 u_color_ramp_range; // x is min, y is range ( max - min)
36
+ vec2 u_min_max;
37
+ float u_escape_value;
38
+ float u_blend_ratio;
39
+ };
40
+
41
+ out vec4 outColor;
42
+
43
+ void main() {
44
+ if ( u_blend_ratio < 0.0) {
45
+ outColor = vec4(0.0, 0.0, 0.0, 0.0);
46
+ return;
47
+ }
48
+ float f0 = texture(u_float_texture0, v_texcoord).r;
49
+ float f1 = texture(u_float_texture1, v_texcoord).r;
50
+ // outColor = vec4(
51
+
52
+ if (f0 == u_escape_value || f1 == u_escape_value) {
53
+ outColor = vec4(0.0, 0.0, 0.0, 0.0);
54
+ return;
55
+ }
56
+ float x = mix(f0, f1, u_blend_ratio);
57
+ if ( x < u_min_max.x || x > u_min_max.y) {
58
+ outColor = vec4(0.0, 0.0, 0.0, 0.0);
59
+ return;
60
+ }
61
+ x = (x - u_color_ramp_range.x) / u_color_ramp_range.y;
62
+ outColor = texture(u_color_texture, vec2(x, 0.5));
63
+ }
64
+ `;
65
+ const gl = this.gl;
66
+ const program = (0, util_1.createProgram)(gl, vertexShaderSource, fragmentShaderSource);
67
+ const vao = gl.createVertexArray();
19
68
  gl.bindVertexArray(vao);
20
- var buffer = gl.createBuffer();
69
+ const buffer = gl.createBuffer();
21
70
  this._buffer = buffer;
22
71
  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
23
72
  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
@@ -26,16 +75,16 @@ var default_1 = /** @class */ (function () {
26
75
  1, 1,
27
76
  -1, 1
28
77
  ]), gl.STATIC_DRAW);
29
- var positionLocation = gl.getAttribLocation(program, "a_position");
78
+ const positionLocation = gl.getAttribLocation(program, "a_position");
30
79
  gl.enableVertexAttribArray(positionLocation);
31
80
  gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
32
81
  gl.bindVertexArray(null);
33
82
  this.heatParametersBlockBindingPoint = 0;
34
- var heatParametersBlockIndex = gl.getUniformBlockIndex(program, "HeatParametersBlock");
83
+ const heatParametersBlockIndex = gl.getUniformBlockIndex(program, "HeatParametersBlock");
35
84
  gl.uniformBlockBinding(program, heatParametersBlockIndex, this.heatParametersBlockBindingPoint);
36
85
  return {
37
- program: program,
38
- vao: vao,
86
+ program,
87
+ vao,
39
88
  u_float_texture0: gl.getUniformLocation(program, "u_float_texture0"),
40
89
  u_float_texture1: gl.getUniformLocation(program, "u_float_texture1"),
41
90
  u_color_texture: gl.getUniformLocation(program, "u_color_texture"),
@@ -44,13 +93,13 @@ var default_1 = /** @class */ (function () {
44
93
  u_min_max: gl.getUniformLocation(program, "u_min_max"),
45
94
  u_escape_value: gl.getUniformLocation(program, "u_escape_value")
46
95
  };
47
- };
48
- default_1.prototype.getUniformBlockManager = function () {
96
+ }
97
+ getUniformBlockManager() {
49
98
  return new HeatParametersBlockManager(this.gl);
50
- };
51
- default_1.prototype.draw = function (texture0, texture1, colorRampTexture, heatParametersBlockManager) {
52
- var _a = this, gl = _a.gl, programWrapper = _a.programWrapper;
53
- var program = programWrapper.program, u_float_texture0 = programWrapper.u_float_texture0, u_float_texture1 = programWrapper.u_float_texture1, u_color_texture = programWrapper.u_color_texture;
99
+ }
100
+ draw(texture0, texture1, colorRampTexture, heatParametersBlockManager) {
101
+ const { gl, programWrapper } = this;
102
+ const { program, u_float_texture0, u_float_texture1, u_color_texture } = programWrapper;
54
103
  gl.useProgram(program);
55
104
  gl.bindVertexArray(programWrapper.vao);
56
105
  gl.activeTexture(gl.TEXTURE1);
@@ -68,18 +117,17 @@ var default_1 = /** @class */ (function () {
68
117
  gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
69
118
  gl.bindVertexArray(null);
70
119
  heatParametersBlockManager.unbind();
71
- };
72
- default_1.prototype.free = function () {
73
- var gl = this.gl;
120
+ }
121
+ free() {
122
+ const gl = this.gl;
74
123
  gl.deleteBuffer(this._buffer);
75
124
  gl.deleteProgram(this.programWrapper.program);
76
125
  gl.deleteVertexArray(this.programWrapper.vao);
77
- };
78
- return default_1;
79
- }());
126
+ }
127
+ }
80
128
  exports.default = default_1;
81
- var HeatParametersBlockManager = /** @class */ (function () {
82
- function HeatParametersBlockManager(gl) {
129
+ class HeatParametersBlockManager {
130
+ constructor(gl) {
83
131
  this.gl = gl;
84
132
  this.buffer = gl.createBuffer();
85
133
  gl.bindBuffer(gl.UNIFORM_BUFFER, this.buffer);
@@ -92,9 +140,8 @@ var HeatParametersBlockManager = /** @class */ (function () {
92
140
  * @param {number} escape_value // value that will be ignored
93
141
  * @param {number} blend_ratio // ratio of blending between two textures
94
142
  * */
95
- HeatParametersBlockManager.prototype.update = function (_a) {
96
- var _b = _a.color_ramp_range, color_ramp_range = _b === void 0 ? null : _b, _c = _a.min_max, min_max = _c === void 0 ? null : _c, _d = _a.escape_value, escape_value = _d === void 0 ? null : _d, _e = _a.blend_ratio, blend_ratio = _e === void 0 ? null : _e;
97
- var _f = this, gl = _f.gl, buffer = _f.buffer;
143
+ update({ color_ramp_range = null, min_max = null, escape_value = null, blend_ratio = null }) {
144
+ const { gl, buffer } = this;
98
145
  gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
99
146
  if (color_ramp_range) {
100
147
  gl.bufferSubData(gl.UNIFORM_BUFFER, 0, new Float32Array(color_ramp_range));
@@ -109,17 +156,16 @@ var HeatParametersBlockManager = /** @class */ (function () {
109
156
  gl.bufferSubData(gl.UNIFORM_BUFFER, 20, new Float32Array([blend_ratio]));
110
157
  }
111
158
  gl.bindBuffer(gl.UNIFORM_BUFFER, null);
112
- };
113
- HeatParametersBlockManager.prototype.bind = function () {
114
- var _a = this, gl = _a.gl, buffer = _a.buffer;
159
+ }
160
+ bind() {
161
+ const { gl, buffer } = this;
115
162
  gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, buffer);
116
- };
117
- HeatParametersBlockManager.prototype.free = function () {
163
+ }
164
+ free() {
118
165
  this.gl.deleteBuffer(this.buffer);
119
- };
120
- HeatParametersBlockManager.prototype.unbind = function () {
121
- var gl = this.gl;
166
+ }
167
+ unbind() {
168
+ const { gl } = this;
122
169
  gl.bindBufferBase(gl.UNIFORM_BUFFER, this.heatParametersBlockBindingPoint, null);
123
- };
124
- return HeatParametersBlockManager;
125
- }());
170
+ }
171
+ }
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var logic_1 = __importDefault(require("./logic"));
7
- var programcache_1 = require("../programcache");
6
+ const logic_1 = __importDefault(require("./logic"));
7
+ const programcache_1 = require("../programcache");
8
8
  // Uniform Buffer Objects use this
9
- var DataObject = /** @class */ (function () {
10
- function DataObject(gl, _a) {
11
- var _b = _a === void 0 ? {} : _a, _c = _b.width, width = _c === void 0 ? 1 : _c, _d = _b.height, height = _d === void 0 ? 1 : _d, _e = _b.texture0, texture0 = _e === void 0 ? null : _e, _f = _b.texture1, texture1 = _f === void 0 ? null : _f, _g = _b.colorRampTexture, colorRampTexture = _g === void 0 ? null : _g, _h = _b.colorRampRange, colorRampRange = _h === void 0 ? null : _h, _j = _b.escapeValue, escapeValue = _j === void 0 ? 99999 : _j, _k = _b.blendRatio, blendRatio = _k === void 0 ? 0.0 : _k, _l = _b.minMaxEdges, minMaxEdges = _l === void 0 ? null : _l;
9
+ class DataObject {
10
+ constructor(gl, { width = 1, height = 1, texture0 = null, texture1 = null, colorRampTexture = null, colorRampRange = null, escapeValue = 99999, blendRatio = 0.0, minMaxEdges = null, } = {}) {
12
11
  this.gl = gl;
13
12
  this.programlogic = programcache_1.glProgramCache.getProgram(gl, logic_1.default);
14
13
  this.heatParametersBlockManager = this.programlogic.getUniformBlockManager();
@@ -25,14 +24,14 @@ var DataObject = /** @class */ (function () {
25
24
  color_ramp_range: colorRampRange
26
25
  });
27
26
  }
28
- DataObject.prototype._bindBlock = function () {
29
- var gl = this.gl;
30
- var program = this.programlogic.programWrapper.program;
27
+ _bindBlock() {
28
+ const gl = this.gl;
29
+ const program = this.programlogic.programWrapper.program;
31
30
  gl.uniformBlockBinding(program, gl.getUniformBlockIndex(program, 'Block'), 0);
32
- };
33
- DataObject.prototype._createColorRampTexture = function () {
34
- var gl = this.gl;
35
- var texture = gl.createTexture();
31
+ }
32
+ _createColorRampTexture() {
33
+ const { gl } = this;
34
+ const texture = gl.createTexture();
36
35
  gl.bindTexture(gl.TEXTURE_2D, texture);
37
36
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
38
37
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
@@ -40,74 +39,72 @@ var DataObject = /** @class */ (function () {
40
39
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
41
40
  gl.bindTexture(gl.TEXTURE_2D, null);
42
41
  return texture;
43
- };
44
- DataObject.prototype.setBlendRatio = function (ratio) {
42
+ }
43
+ setBlendRatio(ratio) {
45
44
  if (ratio < 0 || ratio > 1) {
46
45
  console.warn('Invalid blend ratio');
47
46
  return;
48
47
  }
49
48
  this.heatParametersBlockManager.update({ blend_ratio: ratio });
50
- };
51
- DataObject.prototype.setEscapeValue = function (value) {
49
+ }
50
+ setEscapeValue(value) {
52
51
  this.heatParametersBlockManager.update({ escape_value: value });
53
- };
54
- DataObject.prototype.setTexture0 = function (texture) {
52
+ }
53
+ setTexture0(texture) {
55
54
  this.texture0 = texture;
56
- };
57
- DataObject.prototype.setTexture1 = function (texture) {
55
+ }
56
+ setTexture1(texture) {
58
57
  this.texture1 = texture;
59
- };
60
- DataObject.prototype.setColorRampTexture = function (texture) {
58
+ }
59
+ setColorRampTexture(texture) {
61
60
  this.colorRampTexture = texture;
62
- };
63
- DataObject.prototype.setDataWidthHeight = function (width, height) {
61
+ }
62
+ setDataWidthHeight(width, height) {
64
63
  this.width = width;
65
64
  this.height = height;
66
- };
67
- DataObject.prototype.setFloatTextureData = function (data0, data1, width, height, yFlip) {
68
- if (yFlip === void 0) { yFlip = false; }
69
- var _a = this, texture0 = _a.texture0, texture1 = _a.texture1, gl = _a.gl;
65
+ }
66
+ setFloatTextureData(data0, data1, width, height, yFlip = false) {
67
+ const { texture0, texture1, gl } = this;
70
68
  gl.bindTexture(gl.TEXTURE_2D, texture0);
71
69
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, yFlip);
72
70
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data0);
73
71
  gl.bindTexture(gl.TEXTURE_2D, texture1);
74
72
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.R16F, width, height, 0, gl.RED, gl.FLOAT, data1);
75
73
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
76
- };
77
- DataObject.prototype.discard = function () {
74
+ }
75
+ discard() {
78
76
  this.heatParametersBlockManager.update({ blend_ratio: -1 });
79
- };
80
- DataObject.prototype.setColorRampTextureData = function (data, size) {
81
- var _a = this, gl = _a.gl, colorRampTexture = _a.colorRampTexture;
77
+ }
78
+ setColorRampTextureData(data, size) {
79
+ const { gl, colorRampTexture } = this;
82
80
  gl.bindTexture(gl.TEXTURE_2D, colorRampTexture);
83
81
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);
84
- };
85
- DataObject.prototype.setColorRampRange = function (min, max) {
82
+ }
83
+ setColorRampRange(min, max) {
86
84
  if (min > max) {
87
85
  console.warn('Invalid min max values');
88
86
  return;
89
87
  }
90
- var range = max - min;
88
+ const range = max - min;
91
89
  this.heatParametersBlockManager.update({ color_ramp_range: new Float32Array([min, range]) });
92
- };
93
- DataObject.prototype.setMinMaxEdges = function (min, max) {
90
+ }
91
+ setMinMaxEdges(min, max) {
94
92
  if (min)
95
93
  this.minMaxEdges[0] = min;
96
94
  if (max)
97
95
  this.minMaxEdges[1] = max;
98
96
  this.heatParametersBlockManager.update({ min_max: this.minMaxEdges });
99
- };
100
- DataObject.prototype.draw = function () {
97
+ }
98
+ draw() {
101
99
  this.programlogic.draw(this.texture0, this.texture1, this.colorRampTexture, this.heatParametersBlockManager);
102
- };
103
- DataObject.prototype.free = function () {
104
- var _a = this, gl = _a.gl, texture0 = _a.texture0, texture1 = _a.texture1, colorRampTexture = _a.colorRampTexture;
100
+ }
101
+ free() {
102
+ const { gl, texture0, texture1, colorRampTexture } = this;
105
103
  gl.deleteTexture(texture0);
106
104
  gl.deleteTexture(texture1);
107
105
  gl.deleteTexture(colorRampTexture);
108
106
  programcache_1.glProgramCache.releaseProgram(this.gl, logic_1.default);
109
107
  this.heatParametersBlockManager.free();
110
- };
111
- return DataObject;
112
- }());
108
+ }
109
+ }
113
110
  exports.default = DataObject;
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var programcache_1 = require("../programcache");
4
- var IsGlobeMoved = /** @class */ (function () {
5
- function IsGlobeMoved(globe) {
3
+ const programcache_1 = require("../programcache");
4
+ class IsGlobeMoved {
5
+ constructor(globe) {
6
6
  this.globe = globe;
7
7
  this._lastLOD = globe.api_GetCurrentLODWithDecimal();
8
8
  }
9
- IsGlobeMoved.prototype.isMoved = function () {
10
- var globe = this.globe;
9
+ isMoved() {
10
+ const globe = this.globe;
11
11
  if (globe.api_IsScreenMoving() || this._lastLOD != globe.api_GetCurrentLODWithDecimal()) {
12
12
  this._lastLOD = globe.api_GetCurrentLODWithDecimal();
13
13
  return true;
14
14
  }
15
15
  return false;
16
- };
17
- return IsGlobeMoved;
18
- }());
19
- var IsGlobeMovedCache = Object.freeze({
20
- get: function (globe) { return programcache_1.noRegisterGlobeProgramCache.getProgram(globe, IsGlobeMoved); },
21
- release: function (globe) { return programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, IsGlobeMoved); }
16
+ }
17
+ }
18
+ const IsGlobeMovedCache = Object.freeze({
19
+ get: (globe) => programcache_1.noRegisterGlobeProgramCache.getProgram(globe, IsGlobeMoved),
20
+ release: (globe) => programcache_1.noRegisterGlobeProgramCache.releaseProgram(globe, IsGlobeMoved)
22
21
  });
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GlobeShellWiggle = void 0;
7
- var wiggle_1 = __importDefault(require("./globeshell/wiggle"));
7
+ const wiggle_1 = __importDefault(require("./globeshell/wiggle"));
8
8
  exports.GlobeShellWiggle = wiggle_1.default;
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.GlobeShellWiggle = void 0;
7
- var object_1 = __importDefault(require("./object"));
7
+ const object_1 = __importDefault(require("./object"));
8
8
  exports.GlobeShellWiggle = object_1.default;