@openglobus/og 0.13.12 → 0.14.2
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/README.md +1 -4
- package/css/og.css +1 -1
- package/dist/@openglobus/og.css +1 -1
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/og/Globe.js +14 -4
- package/src/og/camera/Camera.js +7 -7
- package/src/og/camera/PlanetCamera.js +1 -1
- package/src/og/control/LayerSwitcher.js +48 -31
- package/src/og/control/MouseNavigation.js +2 -2
- package/src/og/control/ScaleControl.js +30 -10
- package/src/og/control/SimpleSkyBackground.js +184 -0
- package/src/og/control/Sun.js +3 -2
- package/src/og/ellipsoid/Ellipsoid.js +119 -92
- package/src/og/ellipsoid/wgs84.js +13 -13
- package/src/og/entity/Entity.js +3 -3
- package/src/og/entity/GeometryHandler.js +1341 -1337
- package/src/og/entity/Polyline.js +0 -16
- package/src/og/entity/Ray.js +0 -10
- package/src/og/entity/RayHandler.js +3 -44
- package/src/og/entity/Strip.js +1 -6
- package/src/og/index.js +106 -95
- package/src/og/layer/GeoVideo.js +1 -0
- package/src/og/layer/Layer.js +62 -3
- package/src/og/layer/XYZ.js +4 -3
- package/src/og/math/Line3.js +140 -139
- package/src/og/math/Plane.js +118 -117
- package/src/og/math/Ray.js +242 -239
- package/src/og/math/Vec3.js +56 -37
- package/src/og/math/Vec4.js +3 -4
- package/src/og/math.js +21 -21
- package/src/og/quadTree/EarthQuadTreeStrategy.js +29 -0
- package/src/og/quadTree/MarsQuadTreeStrategy.js +27 -0
- package/src/og/quadTree/Node.js +55 -218
- package/src/og/quadTree/QuadTreeStrategy.js +93 -0
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +26 -0
- package/src/og/renderer/Renderer.js +13 -12
- package/src/og/renderer/RendererEvents.js +1065 -1065
- package/src/og/scene/Planet.js +84 -280
- package/src/og/segment/Segment.js +18 -25
- package/src/og/segment/SegmentLonLat.js +34 -31
- package/src/og/segment/SegmentLonLatWgs84.js +41 -0
- package/src/og/shaders/ray.js +13 -6
- package/src/og/shaders/toneMapping.js +5 -5
- package/src/og/terrain/GlobusTerrain.js +3 -2
- package/src/og/terrain/MapboxTerrain.js +231 -52
- package/src/og/utils/quadTreeType.js +11 -0
- package/src/og/utils/shared.js +942 -942
- package/src/og/webgl/Handler.js +22 -9
- package/types/Globe.d.ts +7 -0
- package/types/camera/Camera.d.ts +3 -3
- package/types/camera/PlanetCamera.d.ts +1 -1
- package/types/control/LayerSwitcher.d.ts +1 -1
- package/types/control/ScaleControl.d.ts +2 -1
- package/types/control/SimpleSkyBackground.d.ts +11 -0
- package/types/control/Sun.d.ts +2 -1
- package/types/ellipsoid/Ellipsoid.d.ts +3 -2
- package/types/entity/Ray.d.ts +0 -3
- package/types/entity/RayHandler.d.ts +0 -4
- package/types/index.d.ts +6 -1
- package/types/layer/Layer.d.ts +8 -0
- package/types/math/Vec3.d.ts +19 -16
- package/types/math/Vec4.d.ts +2 -3
- package/types/math.d.ts +20 -20
- package/types/quadTree/EarthQuadTreeStrategy.d.ts +3 -0
- package/types/quadTree/MarsQuadTreeStrategy.d.ts +3 -0
- package/types/quadTree/Node.d.ts +0 -1
- package/types/quadTree/QuadTreeStrategy.d.ts +21 -0
- package/types/quadTree/Wgs84QuadTreeStrategy.d.ts +3 -0
- package/types/renderer/Renderer.d.ts +1 -1
- package/types/scene/Planet.d.ts +6 -24
- package/types/segment/Segment.d.ts +4 -4
- package/types/segment/SegmentLonLat.d.ts +6 -2
- package/types/segment/SegmentLonLatWgs84.d.ts +4 -0
- package/types/terrain/MapboxTerrain.d.ts +2 -1
- package/types/utils/quadTreeType.d.ts +8 -0
- package/types/webgl/Handler.d.ts +4 -1
|
@@ -1995,14 +1995,6 @@ class Polyline {
|
|
|
1995
1995
|
|
|
1996
1996
|
sh.activate();
|
|
1997
1997
|
|
|
1998
|
-
gl.enable(gl.BLEND);
|
|
1999
|
-
gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);
|
|
2000
|
-
gl.blendFuncSeparate(
|
|
2001
|
-
gl.SRC_ALPHA,
|
|
2002
|
-
gl.ONE_MINUS_SRC_ALPHA,
|
|
2003
|
-
gl.ONE,
|
|
2004
|
-
gl.ONE_MINUS_SRC_ALPHA
|
|
2005
|
-
);
|
|
2006
1998
|
gl.disable(gl.CULL_FACE);
|
|
2007
1999
|
|
|
2008
2000
|
gl.uniform1f(shu.depthOffset, ec.polygonOffsetUnits + window.POLYLINE_DEPTH_OFFSET);
|
|
@@ -2058,14 +2050,6 @@ class Polyline {
|
|
|
2058
2050
|
|
|
2059
2051
|
sh.activate();
|
|
2060
2052
|
|
|
2061
|
-
gl.enable(gl.BLEND);
|
|
2062
|
-
gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);
|
|
2063
|
-
gl.blendFuncSeparate(
|
|
2064
|
-
gl.SRC_ALPHA,
|
|
2065
|
-
gl.ONE_MINUS_SRC_ALPHA,
|
|
2066
|
-
gl.ONE,
|
|
2067
|
-
gl.ONE_MINUS_SRC_ALPHA
|
|
2068
|
-
);
|
|
2069
2053
|
gl.disable(gl.CULL_FACE);
|
|
2070
2054
|
|
|
2071
2055
|
gl.uniform1f(shu.depthOffset, this._handler._entityCollection.polygonOffsetUnits + window.POLYLINE_DEPTH_OFFSET);
|
package/src/og/entity/Ray.js
CHANGED
|
@@ -34,11 +34,6 @@ class Ray {
|
|
|
34
34
|
// Thickenss
|
|
35
35
|
this._thickness = options.thickness || 2.0;
|
|
36
36
|
|
|
37
|
-
// RTE length
|
|
38
|
-
this._length = options.length || 0.0;
|
|
39
|
-
this._lengthHighLow = new Float32Array(2);
|
|
40
|
-
doubleToTwoFloats2(this._length, this._lengthHighLow);
|
|
41
|
-
|
|
42
37
|
// RTE start position
|
|
43
38
|
this._startPosition = utils.createVector3(options.startPosition);
|
|
44
39
|
this._startPositionHigh = new Vec3();
|
|
@@ -172,11 +167,6 @@ class Ray {
|
|
|
172
167
|
);
|
|
173
168
|
}
|
|
174
169
|
|
|
175
|
-
setLength(length) {
|
|
176
|
-
this._length = length;
|
|
177
|
-
this._handler && this._handler.setLengthArr(this._handlerIndex, length);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
170
|
setThickness(thickness) {
|
|
181
171
|
this._thickness = thickness;
|
|
182
172
|
this._handler && this._handler.setThicknessArr(this._handlerIndex, thickness);
|
|
@@ -6,10 +6,9 @@ import { concatArrays, makeArrayTyped, spliceArray } from "../utils/shared.js";
|
|
|
6
6
|
const PICKINGCOLOR_BUFFER = 0;
|
|
7
7
|
const START_POSITION_BUFFER = 1;
|
|
8
8
|
const END_POSITION_BUFFER = 2;
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const VERTEX_BUFFER = 6;
|
|
9
|
+
const RGBA_BUFFER = 3;
|
|
10
|
+
const THICKNESS_BUFFER = 4;
|
|
11
|
+
const VERTEX_BUFFER = 5;
|
|
13
12
|
|
|
14
13
|
/*
|
|
15
14
|
* og.RayHandler
|
|
@@ -36,7 +35,6 @@ class RayHandler {
|
|
|
36
35
|
this._startPositionLowBuffer = null;
|
|
37
36
|
this._endPositionHighBuffer = null;
|
|
38
37
|
this._endPositionLowBuffer = null;
|
|
39
|
-
this._lengthBuffer = null;
|
|
40
38
|
this._thicknessBuffer = null;
|
|
41
39
|
this._rgbaBuffer = null;
|
|
42
40
|
|
|
@@ -45,7 +43,6 @@ class RayHandler {
|
|
|
45
43
|
this._startPositionLowArr = [];
|
|
46
44
|
this._endPositionHighArr = [];
|
|
47
45
|
this._endPositionLowArr = [];
|
|
48
|
-
this._lengthArr = [];
|
|
49
46
|
this._thicknessArr = [];
|
|
50
47
|
this._rgbaArr = [];
|
|
51
48
|
|
|
@@ -56,7 +53,6 @@ class RayHandler {
|
|
|
56
53
|
this._buffersUpdateCallbacks[VERTEX_BUFFER] = this.createVertexBuffer;
|
|
57
54
|
this._buffersUpdateCallbacks[START_POSITION_BUFFER] = this.createStartPositionBuffer;
|
|
58
55
|
this._buffersUpdateCallbacks[END_POSITION_BUFFER] = this.createEndPositionBuffer;
|
|
59
|
-
this._buffersUpdateCallbacks[LENGTH_BUFFER] = this.createLengthBuffer;
|
|
60
56
|
this._buffersUpdateCallbacks[THICKNESS_BUFFER] = this.createThicknessBuffer;
|
|
61
57
|
this._buffersUpdateCallbacks[RGBA_BUFFER] = this.createRgbaBuffer;
|
|
62
58
|
this._buffersUpdateCallbacks[PICKINGCOLOR_BUFFER] = this.createPickingColorBuffer;
|
|
@@ -124,7 +120,6 @@ class RayHandler {
|
|
|
124
120
|
this._startPositionLowArr = null;
|
|
125
121
|
this._endPositionHighArr = null;
|
|
126
122
|
this._endPositionLowArr = null;
|
|
127
|
-
this._lengthArr = null;
|
|
128
123
|
this._thicknessArr = null;
|
|
129
124
|
this._rgbaArr = null;
|
|
130
125
|
|
|
@@ -133,7 +128,6 @@ class RayHandler {
|
|
|
133
128
|
this._startPositionLowArr = new Float32Array();
|
|
134
129
|
this._endPositionHighArr = new Float32Array();
|
|
135
130
|
this._endPositionLowArr = new Float32Array();
|
|
136
|
-
this._lengthArr = new Float32Array();
|
|
137
131
|
this._thicknessArr = new Float32Array();
|
|
138
132
|
this._rgbaArr = new Float32Array();
|
|
139
133
|
|
|
@@ -150,7 +144,6 @@ class RayHandler {
|
|
|
150
144
|
gl.deleteBuffer(this._startPositionLowBuffer);
|
|
151
145
|
gl.deleteBuffer(this._endPositionHighBuffer);
|
|
152
146
|
gl.deleteBuffer(this._endPositionLowBuffer);
|
|
153
|
-
gl.deleteBuffer(this._lengthBuffer);
|
|
154
147
|
gl.deleteBuffer(this._thicknessBuffer);
|
|
155
148
|
gl.deleteBuffer(this._rgbaBuffer);
|
|
156
149
|
gl.deleteBuffer(this._vertexBuffer);
|
|
@@ -159,7 +152,6 @@ class RayHandler {
|
|
|
159
152
|
this._startPositionLowBuffer = null;
|
|
160
153
|
this._endPositionHighBuffer = null;
|
|
161
154
|
this._endPositionLowBuffer = null;
|
|
162
|
-
this._lengthBuffer = null;
|
|
163
155
|
this._thicknessBuffer = null;
|
|
164
156
|
this._rgbaBuffer = null;
|
|
165
157
|
this._vertexBuffer = null;
|
|
@@ -300,9 +292,6 @@ class RayHandler {
|
|
|
300
292
|
x = ray._thickness;
|
|
301
293
|
this._thicknessArr = concatArrays(this._thicknessArr, [x, x, x, x, x, x]);
|
|
302
294
|
|
|
303
|
-
x = ray._length;
|
|
304
|
-
this._lengthArr = concatArrays(this._lengthArr, [x, x, x, x, x, x]);
|
|
305
|
-
|
|
306
295
|
let r0 = ray._startColor.x,
|
|
307
296
|
g0 = ray._startColor.y,
|
|
308
297
|
b0 = ray._startColor.z,
|
|
@@ -439,9 +428,6 @@ class RayHandler {
|
|
|
439
428
|
0
|
|
440
429
|
);
|
|
441
430
|
|
|
442
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, this._lengthBuffer);
|
|
443
|
-
gl.vertexAttribPointer(sha.a_length, this._lengthBuffer.itemSize, gl.FLOAT, false, 0, 0);
|
|
444
|
-
|
|
445
431
|
gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
|
|
446
432
|
gl.vertexAttribPointer(sha.a_vertices, this._vertexBuffer.itemSize, gl.FLOAT, false, 0, 0);
|
|
447
433
|
|
|
@@ -492,7 +478,6 @@ class RayHandler {
|
|
|
492
478
|
|
|
493
479
|
i = ri * 6;
|
|
494
480
|
this._thicknessArr = spliceArray(this._thicknessArr, i, 6);
|
|
495
|
-
this._lengthArr = spliceArray(this._lengthArr, i, 6);
|
|
496
481
|
|
|
497
482
|
this.reindexRaysArray(ri);
|
|
498
483
|
this.refresh();
|
|
@@ -732,20 +717,6 @@ class RayHandler {
|
|
|
732
717
|
this._changedBuffers[THICKNESS_BUFFER] = true;
|
|
733
718
|
}
|
|
734
719
|
|
|
735
|
-
setLengthArr(index, length) {
|
|
736
|
-
var i = index * 6;
|
|
737
|
-
var a = this._lengthArr;
|
|
738
|
-
|
|
739
|
-
a[i] = length;
|
|
740
|
-
a[i + 1] = length;
|
|
741
|
-
a[i + 2] = length;
|
|
742
|
-
a[i + 3] = length;
|
|
743
|
-
a[i + 4] = length;
|
|
744
|
-
a[i + 5] = length;
|
|
745
|
-
|
|
746
|
-
this._changedBuffers[LENGTH_BUFFER] = true;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
720
|
setVisibility(index, visibility) {
|
|
750
721
|
var vArr;
|
|
751
722
|
if (visibility) {
|
|
@@ -839,18 +810,6 @@ class RayHandler {
|
|
|
839
810
|
);
|
|
840
811
|
}
|
|
841
812
|
|
|
842
|
-
createLengthBuffer() {
|
|
843
|
-
var h = this._renderer.handler;
|
|
844
|
-
h.gl.deleteBuffer(this._lengthBuffer);
|
|
845
|
-
this._lengthArr = makeArrayTyped(this._lengthArr);
|
|
846
|
-
this._lengthBuffer = h.createArrayBuffer(
|
|
847
|
-
this._lengthArr,
|
|
848
|
-
1,
|
|
849
|
-
this._lengthArr.length,
|
|
850
|
-
h.gl.DYNAMIC_DRAW
|
|
851
|
-
);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
813
|
createVertexBuffer() {
|
|
855
814
|
var h = this._renderer.handler;
|
|
856
815
|
h.gl.deleteBuffer(this._vertexBuffer);
|
package/src/og/entity/Strip.js
CHANGED
|
@@ -203,9 +203,6 @@ class Strip {
|
|
|
203
203
|
shu = p.uniforms;
|
|
204
204
|
|
|
205
205
|
gl.disable(gl.CULL_FACE);
|
|
206
|
-
gl.blendEquation(gl.FUNC_ADD);
|
|
207
|
-
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
208
|
-
gl.enable(gl.BLEND);
|
|
209
206
|
sh.activate();
|
|
210
207
|
|
|
211
208
|
gl.uniformMatrix4fv(shu.viewMatrix, false, r.activeCamera.getViewMatrix());
|
|
@@ -257,9 +254,7 @@ class Strip {
|
|
|
257
254
|
shu = p.uniforms;
|
|
258
255
|
|
|
259
256
|
gl.disable(gl.CULL_FACE);
|
|
260
|
-
|
|
261
|
-
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
262
|
-
gl.enable(gl.BLEND);
|
|
257
|
+
|
|
263
258
|
sh.activate();
|
|
264
259
|
|
|
265
260
|
gl.uniformMatrix4fv(shu.viewMatrix, false, r.activeCamera.getViewMatrix());
|
package/src/og/index.js
CHANGED
|
@@ -1,96 +1,107 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import * as jd from './astro/jd.js';
|
|
4
|
-
import * as math from './math.js';
|
|
5
|
-
import * as mercator from './mercator.js';
|
|
6
|
-
import * as utils from './utils/shared.js';
|
|
7
|
-
|
|
8
|
-
import * as control from './control/index.js';
|
|
9
|
-
import * as layer from './layer/index.js';
|
|
10
|
-
import * as bv from './bv/index.js';
|
|
11
|
-
import * as scene from './scene/index.js';
|
|
12
|
-
import * as entity from './entity/index.js';
|
|
13
|
-
import * as webgl from './webgl/index.js';
|
|
14
|
-
import * as terrain from './terrain/index.js';
|
|
15
|
-
|
|
16
|
-
import { Globe } from './Globe.js';
|
|
17
|
-
|
|
18
|
-
import { Geoid } from './terrain/Geoid.js';
|
|
19
|
-
|
|
20
|
-
import { input } from './input/input.js';
|
|
21
|
-
|
|
22
|
-
import { Ellipsoid, wgs84 } from './ellipsoid/index.js';
|
|
23
|
-
|
|
24
|
-
import { Camera, PlanetCamera } from './camera/index.js';
|
|
25
|
-
|
|
26
|
-
import { Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4 } from './math/index.js';
|
|
27
|
-
|
|
28
|
-
import { Renderer } from './renderer/Renderer.js';
|
|
29
|
-
|
|
30
|
-
import { LightSource } from './light/LightSource.js';
|
|
31
|
-
|
|
32
|
-
import { Clock } from './Clock.js';
|
|
33
|
-
import { Events } from './Events.js';
|
|
34
|
-
import { Extent } from './Extent.js';
|
|
35
|
-
import { LonLat } from './LonLat.js';
|
|
36
|
-
import { RenderNode } from './scene/RenderNode.js';
|
|
37
|
-
|
|
38
|
-
import { Popup } from './Popup.js';
|
|
39
|
-
|
|
40
|
-
import
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import * as jd from './astro/jd.js';
|
|
4
|
+
import * as math from './math.js';
|
|
5
|
+
import * as mercator from './mercator.js';
|
|
6
|
+
import * as utils from './utils/shared.js';
|
|
7
|
+
|
|
8
|
+
import * as control from './control/index.js';
|
|
9
|
+
import * as layer from './layer/index.js';
|
|
10
|
+
import * as bv from './bv/index.js';
|
|
11
|
+
import * as scene from './scene/index.js';
|
|
12
|
+
import * as entity from './entity/index.js';
|
|
13
|
+
import * as webgl from './webgl/index.js';
|
|
14
|
+
import * as terrain from './terrain/index.js';
|
|
15
|
+
|
|
16
|
+
import { Globe } from './Globe.js';
|
|
17
|
+
|
|
18
|
+
import { Geoid } from './terrain/Geoid.js';
|
|
19
|
+
|
|
20
|
+
import { input } from './input/input.js';
|
|
21
|
+
|
|
22
|
+
import { Ellipsoid, wgs84 } from './ellipsoid/index.js';
|
|
23
|
+
|
|
24
|
+
import { Camera, PlanetCamera } from './camera/index.js';
|
|
25
|
+
|
|
26
|
+
import { Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4 } from './math/index.js';
|
|
27
|
+
|
|
28
|
+
import { Renderer } from './renderer/Renderer.js';
|
|
29
|
+
|
|
30
|
+
import { LightSource } from './light/LightSource.js';
|
|
31
|
+
|
|
32
|
+
import { Clock } from './Clock.js';
|
|
33
|
+
import { Events } from './Events.js';
|
|
34
|
+
import { Extent } from './Extent.js';
|
|
35
|
+
import { LonLat } from './LonLat.js';
|
|
36
|
+
import { RenderNode } from './scene/RenderNode.js';
|
|
37
|
+
|
|
38
|
+
import { Popup } from './Popup.js';
|
|
39
|
+
|
|
40
|
+
import { QuadTreeStrategy } from './quadTree/QuadTreeStrategy.js';
|
|
41
|
+
import { MarsQuadTreeStrategy } from './quadTree/MarsQuadTreeStrategy.js';
|
|
42
|
+
import { EarthQuadTreeStrategy } from './quadTree/EarthQuadTreeStrategy.js';
|
|
43
|
+
import { Wgs84QuadTreeStrategy } from './quadTree/Wgs84QuadTreeStrategy.js';
|
|
44
|
+
import { quadTreeStrategyType } from './utils/quadTreeType.js';
|
|
45
|
+
|
|
46
|
+
import pkg from "../../package.json";
|
|
47
|
+
|
|
48
|
+
const { Handler } = webgl, { Control } = control;
|
|
49
|
+
const { Layer } = layer;
|
|
50
|
+
const {
|
|
51
|
+
EntityCollection,
|
|
52
|
+
Entity
|
|
53
|
+
} = entity;
|
|
54
|
+
|
|
55
|
+
const version = {
|
|
56
|
+
version: pkg.version
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
version,
|
|
61
|
+
bv,
|
|
62
|
+
jd,
|
|
63
|
+
math,
|
|
64
|
+
mercator,
|
|
65
|
+
utils,
|
|
66
|
+
input,
|
|
67
|
+
Layer,
|
|
68
|
+
layer,
|
|
69
|
+
terrain,
|
|
70
|
+
Control,
|
|
71
|
+
control,
|
|
72
|
+
webgl,
|
|
73
|
+
wgs84,
|
|
74
|
+
Camera,
|
|
75
|
+
Ellipsoid,
|
|
76
|
+
PlanetCamera,
|
|
77
|
+
Globe,
|
|
78
|
+
LightSource,
|
|
79
|
+
EntityCollection,
|
|
80
|
+
Handler,
|
|
81
|
+
Renderer,
|
|
82
|
+
Clock,
|
|
83
|
+
Events,
|
|
84
|
+
Extent,
|
|
85
|
+
LonLat,
|
|
86
|
+
scene,
|
|
87
|
+
RenderNode,
|
|
88
|
+
Line2,
|
|
89
|
+
Line3,
|
|
90
|
+
Mat3,
|
|
91
|
+
Mat4,
|
|
92
|
+
Plane,
|
|
93
|
+
Quat,
|
|
94
|
+
Ray,
|
|
95
|
+
Vec2,
|
|
96
|
+
Vec3,
|
|
97
|
+
Vec4,
|
|
98
|
+
entity,
|
|
99
|
+
Entity,
|
|
100
|
+
Geoid,
|
|
101
|
+
Popup,
|
|
102
|
+
QuadTreeStrategy,
|
|
103
|
+
MarsQuadTreeStrategy,
|
|
104
|
+
EarthQuadTreeStrategy,
|
|
105
|
+
Wgs84QuadTreeStrategy,
|
|
106
|
+
quadTreeStrategyType
|
|
96
107
|
};
|
package/src/og/layer/GeoVideo.js
CHANGED
|
@@ -156,6 +156,7 @@ class GeoVideo extends BaseGeoImage {
|
|
|
156
156
|
}
|
|
157
157
|
} else {
|
|
158
158
|
this._video = document.createElement("video");
|
|
159
|
+
this._video.crossOrigin = "Anonymous";
|
|
159
160
|
let that = this;
|
|
160
161
|
this._video.addEventListener("canplay", function () {
|
|
161
162
|
that._onCanPlay(this);
|
package/src/og/layer/Layer.js
CHANGED
|
@@ -11,6 +11,7 @@ import { Extent } from "../Extent.js";
|
|
|
11
11
|
import { LonLat } from "../LonLat.js";
|
|
12
12
|
import { Material } from "./Material.js";
|
|
13
13
|
import { Vec3 } from "../math/Vec3.js";
|
|
14
|
+
import { createColorRGB } from "../utils/shared.js";
|
|
14
15
|
|
|
15
16
|
const FADING_RATIO = 15.8;
|
|
16
17
|
|
|
@@ -208,6 +209,63 @@ class Layer {
|
|
|
208
209
|
* @type {Events}
|
|
209
210
|
*/
|
|
210
211
|
this.events = new Events(options.events ? [...EVENT_NAMES, ...options.events] : EVENT_NAMES, this);
|
|
212
|
+
|
|
213
|
+
this._ambient = null;
|
|
214
|
+
this._diffuse = null;
|
|
215
|
+
this._specular = null;
|
|
216
|
+
|
|
217
|
+
if (options.ambient) {
|
|
218
|
+
let a = utils.createColorRGB(options.ambient, new Vec3(0.2, 0.2, 0.2));
|
|
219
|
+
this._ambient = new Float32Array([a.x, a.y, a.z]);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (options.diffuse) {
|
|
223
|
+
let d = utils.createColorRGB(options.diffuse, new Vec3(0.8, 0.8, 0.8));
|
|
224
|
+
this._diffuse = new Float32Array([d.x, d.y, d.z]);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (options.specular) {
|
|
228
|
+
let s = utils.createColorRGB(options.specular, new Vec3(0.0003, 0.0003, 0.0003));
|
|
229
|
+
let shininess = options.shininess || 20.0;
|
|
230
|
+
this._specular = new Float32Array([s.x, s.y, s.z, shininess]);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
set diffuse(rgb) {
|
|
235
|
+
if (rgb) {
|
|
236
|
+
let vec = createColorRGB(rgb);
|
|
237
|
+
this._diffuse = new Float32Array(vec.toArray());
|
|
238
|
+
} else {
|
|
239
|
+
this._diffuse = null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
set ambient(rgb) {
|
|
244
|
+
if (rgb) {
|
|
245
|
+
let vec = createColorRGB(rgb);
|
|
246
|
+
this._ambient = new Float32Array(vec.toArray());
|
|
247
|
+
} else {
|
|
248
|
+
this._ambient = null;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
set specular(rgb) {
|
|
253
|
+
if (rgb) {
|
|
254
|
+
let vec = createColorRGB(rgb);
|
|
255
|
+
this._specular = new Float32Array([vec.x, vec.y, vec.y, this._specular[3]]);
|
|
256
|
+
} else {
|
|
257
|
+
this._specular = null;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
set shininess(v) {
|
|
262
|
+
if (this._specular) {
|
|
263
|
+
this._specular[3] = v;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
get normalMapCreator() {
|
|
268
|
+
return this._normalMapCreator;
|
|
211
269
|
}
|
|
212
270
|
|
|
213
271
|
static getTMS(x, y, z) {
|
|
@@ -545,9 +603,10 @@ class Layer {
|
|
|
545
603
|
let p = this._planet,
|
|
546
604
|
maxZoom = Math.max(...this._preLoadZoomLevels);
|
|
547
605
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
606
|
+
for (let i = 0, len = p.quadTreeStrategy.quadTreeList.length; i < len; i++) {
|
|
607
|
+
this._preLoadRecursive(p.quadTreeStrategy.quadTreeList[i], maxZoom);
|
|
608
|
+
}
|
|
609
|
+
|
|
551
610
|
}
|
|
552
611
|
}
|
|
553
612
|
|
package/src/og/layer/XYZ.js
CHANGED
|
@@ -9,6 +9,7 @@ import { EPSG3857 } from "../proj/EPSG3857.js";
|
|
|
9
9
|
import { Layer } from "./Layer.js";
|
|
10
10
|
import { stringTemplate } from "../utils/shared.js";
|
|
11
11
|
import { RENDERING } from "../quadTree/quadTree.js";
|
|
12
|
+
import { EPSG4326 } from "../proj/EPSG4326.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Represents an imagery tiles source provider.
|
|
@@ -143,7 +144,7 @@ class XYZ extends Layer {
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
_checkSegment(segment) {
|
|
146
|
-
return segment._projection.id === EPSG3857.id;
|
|
147
|
+
return segment._projection.id === this._planet.quadTreeStrategy.projection.id;// EPSG4326.id;// EPSG3857.id;
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
/**
|
|
@@ -251,7 +252,7 @@ class XYZ extends Layer {
|
|
|
251
252
|
applyMaterial(material, forceLoading) {
|
|
252
253
|
if (material.isReady) {
|
|
253
254
|
return material.texOffset;
|
|
254
|
-
} else if (material.segment.tileZoom
|
|
255
|
+
} else if (material.segment.tileZoom < this.minNativeZoom) {
|
|
255
256
|
material.textureNotExists();
|
|
256
257
|
} else {
|
|
257
258
|
|
|
@@ -317,7 +318,7 @@ class XYZ extends Layer {
|
|
|
317
318
|
clearMaterial(material) {
|
|
318
319
|
if (material.isReady && material.textureExists) {
|
|
319
320
|
!material.texture.default &&
|
|
320
|
-
|
|
321
|
+
material.segment.handler.gl.deleteTexture(material.texture);
|
|
321
322
|
material.texture = null;
|
|
322
323
|
|
|
323
324
|
if (material.image) {
|