@pirireis/webglobeplugins 0.8.5 → 0.8.7
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/bearing-line/plugin.js +51 -43
- package/circle-line-chain/plugin.js +52 -44
- package/compass-rose/compass-rose-padding-flat.js +3 -0
- package/compassrose/compassrose.js +1 -8
- package/heatwave/isobar/plugin.js +4 -1
- package/heatwave/isobar/quadtreecontours.js +0 -2
- package/heatwave/plugins/heatwaveglobeshell.js +2 -0
- package/package.json +1 -1
- package/partialrings/goals.md +2 -0
- package/partialrings/plugin.js +2 -1
- package/point-glow-line-to-earth/draw-subset-obj.js +27 -0
- package/point-glow-line-to-earth/keymethod.js +0 -0
- package/point-glow-line-to-earth/plugin.js +439 -0
- package/point-glow-line-to-earth/types.js +26 -0
- package/point-heat-map/index.js +0 -3
- package/point-heat-map/plugin-webworker.js +4 -9
- package/point-heat-map/point-to-heat-map-flow.js +0 -6
- package/point-tracks/plugin.js +42 -17
- package/programs/arrowfield/logic.js +6 -4
- package/programs/arrowfield/object.js +1 -1
- package/programs/float2legendwithratio/object.js +5 -4
- package/programs/globe-util/is-globe-moved.js +27 -0
- package/programs/globeshell/wiggle/logic.js +3 -7
- package/programs/globeshell/wiggle/object.js +1 -2
- package/programs/line-on-globe/circle-accurate-3d.js +16 -23
- package/programs/line-on-globe/circle-accurate-flat.js +21 -21
- package/programs/line-on-globe/lines-color-instanced-flat.js +6 -7
- package/programs/line-on-globe/naive-accurate-flexible.js +239 -0
- package/programs/line-on-globe/to-the-surface.js +129 -0
- package/programs/picking/pickable-renderer.js +216 -0
- package/programs/point-on-globe/element-globe-surface-glow.js +168 -0
- package/programs/point-on-globe/element-point-glow.js +184 -0
- package/programs/point-on-globe/square-pixel-point.js +8 -7
- package/programs/programcache.js +9 -0
- package/programs/rings/partial-ring/piece-of-pie.js +1 -1
- package/programs/totems/camerauniformblock.js +23 -2
- package/rangerings/plugin.js +9 -6
- package/shaders/fragment-toy/firework.js +55 -0
- package/shaders/fragment-toy/singularity.js +59 -0
- package/types.js +16 -0
- package/util/account/single-attribute-buffer-management/buffer-manager.js +2 -6
- package/util/account/util.js +17 -7
- package/util/check/typecheck.js +11 -0
- package/util/gl-util/buffer/integrate-buffer.js +74 -0
- package/util/gl-util/draw-options/client.js +59 -0
- package/util/gl-util/draw-options/methods.js +46 -0
- package/util/gl-util/draw-options/types.js +18 -0
- package/util/gl-util/uniform-block/manager.js +176 -0
- package/util/gl-util/uniform-block/roadmap.md +70 -0
- package/util/gl-util/uniform-block/shader.js +0 -0
- package/util/gl-util/uniform-block/types.js +7 -0
- package/util/jshelpers/equality.js +17 -0
- package/util/picking/picker-displayer.js +1 -1
- package/util/programs/shapesonglobe.js +17 -19
- package/util/shaderfunctions/geometrytransformations.js +27 -63
- package/bearing-line/roadmap.md +0 -15
- package/point-heat-map/plugin.js +0 -132
- package/programs/line-on-globe/naive-accurate.js +0 -221
- package/programs/line-on-globe/to-the-origin.js +0 -164
- package/util/jshelpers/timemethods.js +0 -19
- /package/{programs/point-on-globe/element-draw-glow.js → point-glow-line-to-earth/adaptors.js} +0 -0
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { CameraUniformBlockString, CameraUniformBlockTotem } from "../totems";
|
|
2
|
-
import { pointsOnSphereBetween, POLE, R_3D, mercatorXYToGLPosition, cartesian3DToGLPosition } from "../../util/shaderfunctions/geometrytransformations";
|
|
3
|
-
import { createProgram } from "../../util";
|
|
4
|
-
import { noRegisterGlobeProgramCache, globeProgramCache } from "../programcache";
|
|
5
|
-
import { programCache } from "../rings/distancering/circleflatprogram";
|
|
6
|
-
|
|
7
|
-
const GLOBE_MIDPOINT_COUNT = 30;
|
|
8
|
-
|
|
9
|
-
const vertexShader = `#version 300 es
|
|
10
|
-
precision highp float;
|
|
11
|
-
${R_3D}
|
|
12
|
-
${CameraUniformBlockString}
|
|
13
|
-
${pointsOnSphereBetween}
|
|
14
|
-
${mercatorXYToGLPosition}
|
|
15
|
-
${cartesian3DToGLPosition}
|
|
16
|
-
|
|
17
|
-
in vec2 start_position;
|
|
18
|
-
in vec3 start_position3d;
|
|
19
|
-
in vec2 end_position;
|
|
20
|
-
in vec3 end_position3d;
|
|
21
|
-
in float dash_ratio;
|
|
22
|
-
in vec4 color;
|
|
23
|
-
in float dash_opacity;
|
|
24
|
-
out vec4 v_color;
|
|
25
|
-
out vec2 v_limp;
|
|
26
|
-
out float interpolation;
|
|
27
|
-
out float v_dash_ratio;
|
|
28
|
-
out float v_dash_opacity;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
void main() {
|
|
32
|
-
vec2 longLat;
|
|
33
|
-
if (is3D) {
|
|
34
|
-
interpolation = float(gl_VertexID) / ${GLOBE_MIDPOINT_COUNT - 1}.0;
|
|
35
|
-
vec3 cartesian;
|
|
36
|
-
if ( length( start_position3d - end_position3d) < 4.4){
|
|
37
|
-
cartesian = mix( start_position3d, end_position3d, interpolation);
|
|
38
|
-
} else {
|
|
39
|
-
cartesian = pointsOnSphereBetween(start_position3d, end_position3d, interpolation) * length(end_position3d);
|
|
40
|
-
}
|
|
41
|
-
gl_Position = cartesian3DToGLPosition(cartesian);
|
|
42
|
-
v_limp = vec2(0.0, 0.0);
|
|
43
|
-
} else {
|
|
44
|
-
if ( distance( start_position, end_position) > 30000000.0) { return; }
|
|
45
|
-
interpolation = float(gl_VertexID);
|
|
46
|
-
if (gl_VertexID % 2 == 0) {
|
|
47
|
-
longLat = start_position;
|
|
48
|
-
} else {
|
|
49
|
-
longLat = end_position;
|
|
50
|
-
}
|
|
51
|
-
v_limp = longLat;
|
|
52
|
-
gl_Position = mercatorXYToGLPosition(longLat);
|
|
53
|
-
}
|
|
54
|
-
// if ( gl_VertexID % 2 == 0) {v_color = color;}
|
|
55
|
-
// else {v_color = vec4(0.0, 0.0, 0.0, 0.0);}
|
|
56
|
-
v_color = color;
|
|
57
|
-
v_dash_ratio = dash_ratio;
|
|
58
|
-
v_dash_opacity = dash_opacity;
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
const fragmentShader = `#version 300 es
|
|
63
|
-
${POLE}
|
|
64
|
-
precision highp float;
|
|
65
|
-
uniform float opacity;
|
|
66
|
-
in vec4 v_color;
|
|
67
|
-
out vec4 color;
|
|
68
|
-
in float interpolation;
|
|
69
|
-
in float v_dash_ratio;
|
|
70
|
-
in vec2 v_limp;
|
|
71
|
-
in float v_dash_opacity;
|
|
72
|
-
void main() {
|
|
73
|
-
if (v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE) { discard; }
|
|
74
|
-
color = v_color;
|
|
75
|
-
color.a *= opacity;
|
|
76
|
-
if ( v_dash_ratio >= 1.0 ) { return; }
|
|
77
|
-
if (interpolation > 0.95) { return; }
|
|
78
|
-
if (fract(interpolation / (2.0 * v_dash_ratio)) < 0.5) { color.a *= v_dash_opacity; }
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
`;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class Logic {
|
|
85
|
-
|
|
86
|
-
constructor(globe) {
|
|
87
|
-
this.globe = globe;
|
|
88
|
-
this.gl = globe.gl;
|
|
89
|
-
this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
90
|
-
this._lastOpacity = 1.0;
|
|
91
|
-
const { gl, program } = this;
|
|
92
|
-
{
|
|
93
|
-
// assign attribute locations
|
|
94
|
-
gl.bindAttribLocation(program, 0, "start_position");
|
|
95
|
-
gl.bindAttribLocation(program, 1, "start_position3d");
|
|
96
|
-
gl.bindAttribLocation(program, 2, "end_position");
|
|
97
|
-
gl.bindAttribLocation(program, 3, "end_position3d");
|
|
98
|
-
gl.bindAttribLocation(program, 4, "dash_ratio");
|
|
99
|
-
gl.bindAttribLocation(program, 5, "color");
|
|
100
|
-
gl.bindAttribLocation(program, 6, "dash_opacity");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
this._opacityLocation = gl.getUniformLocation(program, "opacity");
|
|
105
|
-
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
106
|
-
gl.useProgram(program);
|
|
107
|
-
gl.uniform1f(this._opacityLocation, this._lastOpacity);
|
|
108
|
-
gl.useProgram(currentProgram);
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
this.cameraBlockBindingPoint = 0;
|
|
113
|
-
const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
114
|
-
this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
115
|
-
gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
draw(vao, length, opacity) {
|
|
122
|
-
const { gl, program, globe, cameraBlockTotem, cameraBlockBindingPoint } = this;
|
|
123
|
-
gl.useProgram(program);
|
|
124
|
-
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
125
|
-
gl.bindVertexArray(vao);
|
|
126
|
-
if (opacity !== this._lastOpacity) {
|
|
127
|
-
gl.uniform1f(this._opacityLocation, opacity);
|
|
128
|
-
this._lastOpacity = opacity;
|
|
129
|
-
}
|
|
130
|
-
const drawCount = globe.api_GetCurrentGeometry() === 0 ? GLOBE_MIDPOINT_COUNT : 2;
|
|
131
|
-
gl.drawArraysInstanced(gl.LINE_STRIP, 0, drawCount, length);
|
|
132
|
-
gl.bindVertexArray(null);
|
|
133
|
-
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
//
|
|
137
|
-
createVAO(
|
|
138
|
-
startPotisionBufferObj, startPotision3DBufferObj,
|
|
139
|
-
endPositionBufferObj, endPosition3DBufferObj,
|
|
140
|
-
dashRatioBufferObj,
|
|
141
|
-
dashOpacityBufferObj,
|
|
142
|
-
colorBufferObj) {
|
|
143
|
-
const { gl } = this;
|
|
144
|
-
const vao = gl.createVertexArray();
|
|
145
|
-
gl.bindVertexArray(vao);
|
|
146
|
-
{
|
|
147
|
-
const { buffer, stride = 0, offset = 0 } = startPotisionBufferObj;
|
|
148
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
149
|
-
gl.enableVertexAttribArray(0);
|
|
150
|
-
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
|
|
151
|
-
gl.vertexAttribDivisor(0, 1);
|
|
152
|
-
}
|
|
153
|
-
{
|
|
154
|
-
const { buffer, stride = 0, offset = 0 } = startPotision3DBufferObj;
|
|
155
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
156
|
-
gl.enableVertexAttribArray(1);
|
|
157
|
-
gl.vertexAttribPointer(1, 3, gl.FLOAT, false, stride, offset);
|
|
158
|
-
gl.vertexAttribDivisor(1, 1);
|
|
159
|
-
}
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
const { buffer, stride = 0, offset = 0 } = endPositionBufferObj;
|
|
163
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
164
|
-
gl.enableVertexAttribArray(2);
|
|
165
|
-
gl.vertexAttribPointer(2, 2, gl.FLOAT, false, stride, offset);
|
|
166
|
-
gl.vertexAttribDivisor(2, 1);
|
|
167
|
-
}
|
|
168
|
-
{
|
|
169
|
-
|
|
170
|
-
const { buffer, stride = 0, offset = 0 } = endPosition3DBufferObj;
|
|
171
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
172
|
-
gl.enableVertexAttribArray(3);
|
|
173
|
-
gl.vertexAttribPointer(3, 3, gl.FLOAT, false, stride, offset);
|
|
174
|
-
gl.vertexAttribDivisor(3, 1);
|
|
175
|
-
}
|
|
176
|
-
{
|
|
177
|
-
const { buffer, stride = 0, offset = 0 } = dashRatioBufferObj;
|
|
178
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
179
|
-
gl.enableVertexAttribArray(4);
|
|
180
|
-
gl.vertexAttribPointer(4, 1, gl.FLOAT, false, stride, offset);
|
|
181
|
-
gl.vertexAttribDivisor(4, 1);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
{
|
|
185
|
-
const { buffer, stride = 0, offset = 0 } = colorBufferObj;
|
|
186
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
187
|
-
gl.enableVertexAttribArray(5);
|
|
188
|
-
gl.vertexAttribPointer(5, 4, gl.FLOAT, false, stride, offset);
|
|
189
|
-
gl.vertexAttribDivisor(5, 1);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
{
|
|
193
|
-
const { buffer, stride = 0, offset = 0 } = dashOpacityBufferObj;
|
|
194
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
195
|
-
gl.enableVertexAttribArray(6);
|
|
196
|
-
gl.vertexAttribPointer(6, 1, gl.FLOAT, false, stride, offset);
|
|
197
|
-
gl.vertexAttribDivisor(6, 1);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
gl.bindVertexArray(null);
|
|
201
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
202
|
-
return vao;
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
free() {
|
|
208
|
-
if (this.isFreed) return;
|
|
209
|
-
programCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
210
|
-
this.gl.deleteProgram(this.program);
|
|
211
|
-
this.isFreed = true;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
export const LineOnGlobeCache = Object.freeze({
|
|
218
|
-
get: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
219
|
-
release: (globe) => { return noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
220
|
-
});
|
|
221
|
-
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { createProgram } from "../../util";
|
|
2
|
-
import { longLatRadToCartesian3DWithR, cartesian3DToGLPosition, R_3D } from "../../util/shaderfunctions/geometrytransformations";
|
|
3
|
-
import { CameraUniformBlockString, CameraUniformBlockTotemCache } from "../totems";
|
|
4
|
-
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Creates beams from long, lat, radian coordinates to origin on global view.
|
|
8
|
-
* Ojects with hight, float over terrain and does not propose information of their actual coordinates.
|
|
9
|
-
* You start drawing after zoom level 9-10
|
|
10
|
-
* Does not work on mercator.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const vertexShaderSource = `#version 300 es
|
|
15
|
-
precision highp float;
|
|
16
|
-
${CameraUniformBlockString}
|
|
17
|
-
${R_3D}
|
|
18
|
-
${longLatRadToCartesian3DWithR}
|
|
19
|
-
${cartesian3DToGLPosition}
|
|
20
|
-
|
|
21
|
-
in vec3 position3d;
|
|
22
|
-
in vec4 rgba;
|
|
23
|
-
uniform float origin_r;
|
|
24
|
-
flat out vec4 v_rgba;
|
|
25
|
-
out float interpolation_value;
|
|
26
|
-
|
|
27
|
-
void main() {
|
|
28
|
-
if (!is3D) {return;}
|
|
29
|
-
vec3 cartesian;
|
|
30
|
-
if(gl_VertexID == 0) {
|
|
31
|
-
cartesian = normalize( position3d) * R_3D;
|
|
32
|
-
interpolation_value = 1.0;
|
|
33
|
-
} else {
|
|
34
|
-
cartesian = position3d;
|
|
35
|
-
interpolation_value = 0.0;
|
|
36
|
-
}
|
|
37
|
-
gl_Position = cartesian3DToGLPosition(cartesian);
|
|
38
|
-
v_rgba = rgba;
|
|
39
|
-
gl_PointSize = 10.0; // for testing
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
const fragmentShaderSource = `#version 300 es
|
|
44
|
-
precision highp float;
|
|
45
|
-
|
|
46
|
-
uniform float plugin_opacity;
|
|
47
|
-
in float interpolation_value;
|
|
48
|
-
flat in vec4 v_rgba;
|
|
49
|
-
out vec4 color;
|
|
50
|
-
void main(){
|
|
51
|
-
if ( fract( interpolation_value * 30.0) < 0.5) {discard;}
|
|
52
|
-
color = vec4(
|
|
53
|
-
v_rgba.rgb * 1.2,
|
|
54
|
-
v_rgba.a * plugin_opacity
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
}`;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class Logic {
|
|
61
|
-
constructor(globe) {
|
|
62
|
-
this.globe = globe;
|
|
63
|
-
this.gl = globe.gl;
|
|
64
|
-
this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
|
|
65
|
-
this._lastOpacity = 1.0;
|
|
66
|
-
this._lastOriginR = 6378.137 - 1;
|
|
67
|
-
const { gl, program } = this;
|
|
68
|
-
{
|
|
69
|
-
gl.bindAttribLocation(program, 0, "position3d");
|
|
70
|
-
gl.bindAttribLocation(program, 1, "rgba");
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
{
|
|
74
|
-
this._opacityLocation = gl.getUniformLocation(program, "plugin_opacity");
|
|
75
|
-
this._originRLocation = gl.getUniformLocation(program, "origin_r")
|
|
76
|
-
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
77
|
-
gl.useProgram(program);
|
|
78
|
-
gl.uniform1f(this._opacityLocation, this._lastOpacity);
|
|
79
|
-
gl.uniform1f(this._originRLocation, this._lastOriginR);
|
|
80
|
-
gl.useProgram(currentProgram);
|
|
81
|
-
}
|
|
82
|
-
{
|
|
83
|
-
this.cameraBlockBindingPoint = 0;
|
|
84
|
-
const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
85
|
-
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
86
|
-
gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
draw(vao, length, opacity, originR = null) {
|
|
91
|
-
const { gl, program, globe, cameraBlockTotem, cameraBlockBindingPoint } = this;
|
|
92
|
-
const is3D = globe.api_GetCurrentGeometry() == 0;
|
|
93
|
-
if (!is3D) return;
|
|
94
|
-
const lod = globe.api_GetCurrentLODWithDecimal()
|
|
95
|
-
if (lod < 12) return;
|
|
96
|
-
gl.useProgram(program);
|
|
97
|
-
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
98
|
-
gl.bindVertexArray(vao);
|
|
99
|
-
if (opacity !== this._lastOpacity) {
|
|
100
|
-
gl.uniform1f(this._opacityLocation, opacity);
|
|
101
|
-
this._checkOpacity(opacity);
|
|
102
|
-
this._lastOpacity = opacity;
|
|
103
|
-
}
|
|
104
|
-
if (originR !== null && originR !== this._lastOriginR) {
|
|
105
|
-
this._checkOriginR(originR);
|
|
106
|
-
gl.uniform1f(this._originRLocation, originR);
|
|
107
|
-
this._lastOriginR = originR;
|
|
108
|
-
}
|
|
109
|
-
gl.drawArraysInstanced(gl.LINE_STRIP, 0, 2, length);
|
|
110
|
-
gl.drawArraysInstanced(gl.POINTS, 0, 2, length);
|
|
111
|
-
gl.bindVertexArray(null);
|
|
112
|
-
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
_checkOpacity(opacity) {
|
|
116
|
-
if (opacity < 0.0 || opacity > 1) throw RangeError("Opacity should be between 0 and 1");
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
_checkOriginR(r) {
|
|
121
|
-
if (r < 0.0 || r > 6378.137 - 0.3) throw RangeError("r should be between 0 and 6378.137 - 0.3");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
createVAO(potision3dBufferObj, colorBufferObj) {
|
|
125
|
-
const { gl } = this;
|
|
126
|
-
const vao = gl.createVertexArray();
|
|
127
|
-
gl.bindVertexArray(vao);
|
|
128
|
-
{
|
|
129
|
-
const { buffer, stride = 0, offset = 0 } = potision3dBufferObj;
|
|
130
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
131
|
-
gl.enableVertexAttribArray(0);
|
|
132
|
-
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, stride, offset);
|
|
133
|
-
gl.vertexAttribDivisor(0, 1);
|
|
134
|
-
}
|
|
135
|
-
{
|
|
136
|
-
const { buffer, stride = 0, offset = 0 } = colorBufferObj;
|
|
137
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
138
|
-
gl.enableVertexAttribArray(1);
|
|
139
|
-
gl.vertexAttribPointer(1, 4, gl.FLOAT, false, stride, offset);
|
|
140
|
-
gl.vertexAttribDivisor(1, 1);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
gl.bindVertexArray(null);
|
|
144
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
145
|
-
return vao;
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
free() {
|
|
151
|
-
if (this.isFreed) return;
|
|
152
|
-
CameraUniformBlockTotemCache.release(this.globe);
|
|
153
|
-
this.isFreed = true;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const LineToTheOriginCache = Object.freeze({
|
|
158
|
-
get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
|
|
159
|
-
release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
export {
|
|
163
|
-
LineToTheOriginCache
|
|
164
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function instantDebounce(func, delay) {
|
|
2
|
-
let timeout = null;
|
|
3
|
-
let lastArgs = null;
|
|
4
|
-
return function (arguments) {
|
|
5
|
-
if (timeout) {
|
|
6
|
-
lastArgs = arguments;
|
|
7
|
-
return;
|
|
8
|
-
} else {
|
|
9
|
-
func(...arguments);
|
|
10
|
-
timeout = setTimeout(() => {
|
|
11
|
-
if (lastArgs) {
|
|
12
|
-
func(...lastArgs);
|
|
13
|
-
lastArgs = null;
|
|
14
|
-
}
|
|
15
|
-
timeout = null;
|
|
16
|
-
}, delay);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
/package/{programs/point-on-globe/element-draw-glow.js → point-glow-line-to-earth/adaptors.js}
RENAMED
|
File without changes
|