@openglobus/og 0.13.10 → 0.14.1
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/LabelHandler.js +1 -4
- package/src/og/entity/LabelWorker.js +10 -13
- 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 -273
- 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/LabelWorker.d.ts +1 -1
- 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
package/src/og/webgl/Handler.js
CHANGED
|
@@ -662,18 +662,27 @@ class Handler {
|
|
|
662
662
|
this._initPrograms();
|
|
663
663
|
this._setDefaults();
|
|
664
664
|
|
|
665
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
666
|
+
this._toggleVisibilityChange(entries[0].isIntersecting === true);
|
|
667
|
+
}, { threshold: 0 });
|
|
668
|
+
this.observer.observe(this.canvas);
|
|
669
|
+
|
|
665
670
|
document.addEventListener("visibilitychange", () => {
|
|
666
|
-
|
|
667
|
-
this.start();
|
|
668
|
-
this.ONCANVASRESIZE && this.ONCANVASRESIZE();
|
|
669
|
-
this.events.dispatch(this.events.visibilitychange, true);
|
|
670
|
-
} else {
|
|
671
|
-
this.events.dispatch(this.events.visibilitychange, false);
|
|
672
|
-
this.stop();
|
|
673
|
-
}
|
|
671
|
+
this._toggleVisibilityChange(document.visibilityState === 'visible');
|
|
674
672
|
});
|
|
675
673
|
}
|
|
676
674
|
|
|
675
|
+
_toggleVisibilityChange(visibility) {
|
|
676
|
+
if (visibility) {
|
|
677
|
+
this.start();
|
|
678
|
+
this.ONCANVASRESIZE && this.ONCANVASRESIZE();
|
|
679
|
+
this.events.dispatch(this.events.visibilitychange, true);
|
|
680
|
+
} else {
|
|
681
|
+
this.events.dispatch(this.events.visibilitychange, false);
|
|
682
|
+
this.stop();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
677
686
|
/**
|
|
678
687
|
* Sets default gl render parameters. Used in init function.
|
|
679
688
|
* @private
|
|
@@ -919,6 +928,10 @@ class Handler {
|
|
|
919
928
|
}
|
|
920
929
|
}
|
|
921
930
|
|
|
931
|
+
isStopped() {
|
|
932
|
+
return !this._requestAnimationFrameId;
|
|
933
|
+
}
|
|
934
|
+
|
|
922
935
|
/**
|
|
923
936
|
* Check is gl context type equals webgl2
|
|
924
937
|
* @public
|
|
@@ -934,7 +947,7 @@ class Handler {
|
|
|
934
947
|
_animationFrameCallback() {
|
|
935
948
|
this._requestAnimationFrameId = window.requestAnimationFrame(() => {
|
|
936
949
|
this.drawFrame();
|
|
937
|
-
this._animationFrameCallback();
|
|
950
|
+
this._requestAnimationFrameId && this._animationFrameCallback();
|
|
938
951
|
});
|
|
939
952
|
}
|
|
940
953
|
|
package/types/Globe.d.ts
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
* @param {Number} [options.minEqualZoomAltitude=10000.0] - Minimal altitude since segments on the screen bacame the same zoom level
|
|
43
43
|
* @param {Number} [options.minEqualZoomCameraSlope=0.8] - Minimal camera slope above te globe where segments on the screen bacame the same zoom level
|
|
44
44
|
* @param {Number} [options.loadingBatchSize=12] -
|
|
45
|
+
* @param {Number} [options.quadTreeStrategyPrototype] - Prototype of quadTree. QuadTreeStrategy for Earth is default.
|
|
45
46
|
*/
|
|
46
47
|
export class Globe {
|
|
47
48
|
static set _staticCounter(arg: any);
|
|
@@ -64,6 +65,12 @@ export class Globe {
|
|
|
64
65
|
* @type {String}
|
|
65
66
|
*/
|
|
66
67
|
private _planetName;
|
|
68
|
+
/**
|
|
69
|
+
* quad tree type.
|
|
70
|
+
* @private
|
|
71
|
+
* @type {Number}
|
|
72
|
+
*/
|
|
73
|
+
private _quadTreeType;
|
|
67
74
|
planet: Planet;
|
|
68
75
|
sun: any;
|
|
69
76
|
_opacityCounter: number;
|
package/types/camera/Camera.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {Renderer} [renderer] - Renderer uses the camera instance.
|
|
5
5
|
* @param {Object} [options] - Camera options:
|
|
6
6
|
* @param {Object} [options.name] - Camera name.
|
|
7
|
-
* @param {number} [options.viewAngle=
|
|
7
|
+
* @param {number} [options.viewAngle=47] - Camera angle of view. Default is 47.0
|
|
8
8
|
* @param {number} [options.near=1] - Camera near plane distance. Default is 1.0
|
|
9
9
|
* @param {number} [options.far=og.math.MAX] - Camera far plane distance. Deafult is og.math.MAX
|
|
10
10
|
* @param {Vec3} [options.eye=[0,0,0]] - Camera eye position. Default (0,0,0)
|
|
@@ -95,7 +95,7 @@ export class Camera {
|
|
|
95
95
|
_pv: Vec3;
|
|
96
96
|
_pn: Vec3;
|
|
97
97
|
_peye: Vec3;
|
|
98
|
-
|
|
98
|
+
isMoving: boolean;
|
|
99
99
|
_tanViewAngle_hrad: number;
|
|
100
100
|
_tanViewAngle_hradOneByHeight: number;
|
|
101
101
|
frustums: Frustum[];
|
|
@@ -109,7 +109,7 @@ export class Camera {
|
|
|
109
109
|
* @public
|
|
110
110
|
* @param {Renderer} renderer - OpenGlobus renderer object.
|
|
111
111
|
* @param {Object} [options] - Camera options:
|
|
112
|
-
* @param {number} [options.viewAngle] - Camera angle of view.
|
|
112
|
+
* @param {number} [options.viewAngle] - Camera angle of view.
|
|
113
113
|
* @param {number} [options.near] - Camera near plane distance. Default is 1.0
|
|
114
114
|
* @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
|
|
115
115
|
* @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {RenderNode} planet - Planet render node.
|
|
6
6
|
* @param {Object} [options] - Planet camera options:
|
|
7
7
|
* @param {Object} [options.name] - Camera name.
|
|
8
|
-
* @param {number} [options.viewAngle
|
|
8
|
+
* @param {number} [options.viewAngle] - Camera angle of view.
|
|
9
9
|
* @param {number} [options.near] - Camera near plane distance. Default is 1.0
|
|
10
10
|
* @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
|
|
11
11
|
* @param {number} [options.minAltitude] - Minimal altitude for the camera. Deafult is 5
|
|
@@ -19,7 +19,7 @@ export class LayerSwitcher extends Control {
|
|
|
19
19
|
collectLayers: (planet: any) => any;
|
|
20
20
|
pickBaseLayers: (layers: any) => any;
|
|
21
21
|
pickOverlays: (layers: any) => any;
|
|
22
|
-
classifyObject: (object: any) => "Terrain Providers" | "
|
|
22
|
+
classifyObject: (object: any) => "Terrain Providers" | "Base Layers" | "Overlays";
|
|
23
23
|
sortByZIndex: (layers: any) => any;
|
|
24
24
|
serializeZIndices: (layers: any) => any;
|
|
25
25
|
normalizeOverlay: (overlay: any) => any;
|
|
@@ -11,10 +11,11 @@ export class ScaleControl extends Control {
|
|
|
11
11
|
planet: any;
|
|
12
12
|
_minWidth: number;
|
|
13
13
|
_maxWidth: number;
|
|
14
|
+
_isCenter: any;
|
|
14
15
|
_renderTemplate(): ChildNode;
|
|
15
16
|
el: ChildNode;
|
|
16
17
|
_scaleLabelEl: any;
|
|
17
|
-
|
|
18
|
+
_drawScreen(px: any): void;
|
|
18
19
|
_mPx: number;
|
|
19
20
|
currWidth: number;
|
|
20
21
|
_metersInMinSize: number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function simpleSkyBackground(options: any): SimpleSkyBackground;
|
|
2
|
+
/**
|
|
3
|
+
* Frame per second(FPS) display control.
|
|
4
|
+
* @class
|
|
5
|
+
* @extends {Control}
|
|
6
|
+
* @param {Object} [options] - Control options.
|
|
7
|
+
*/
|
|
8
|
+
export class SimpleSkyBackground extends Control {
|
|
9
|
+
_drawBackground(): void;
|
|
10
|
+
}
|
|
11
|
+
import { Control } from "./Control.js";
|
package/types/control/Sun.d.ts
CHANGED
|
@@ -114,10 +114,11 @@ export class Ellipsoid {
|
|
|
114
114
|
/**
|
|
115
115
|
* Gets Wgs84 geodetic coordiantes from cartesian ECEF.
|
|
116
116
|
* @public
|
|
117
|
-
* @param {Vec3}
|
|
117
|
+
* @param {Vec3} p - Cartesian coordinates.
|
|
118
118
|
* @returns {LonLat} -
|
|
119
119
|
*/
|
|
120
|
-
public
|
|
120
|
+
public projToSurface(p: Vec3): LonLat;
|
|
121
|
+
cartesianToLonLat(cart: any): LonLat;
|
|
121
122
|
/**
|
|
122
123
|
* Gets ellipsoid surface normal.
|
|
123
124
|
* @public
|
package/types/entity/Ray.d.ts
CHANGED
|
@@ -18,8 +18,6 @@ export class Ray {
|
|
|
18
18
|
*/
|
|
19
19
|
public readonly id: number;
|
|
20
20
|
_thickness: any;
|
|
21
|
-
_length: any;
|
|
22
|
-
_lengthHighLow: Float32Array;
|
|
23
21
|
_startPosition: any;
|
|
24
22
|
_startPositionHigh: Vec3;
|
|
25
23
|
_startPositionLow: Vec3;
|
|
@@ -80,7 +78,6 @@ export class Ray {
|
|
|
80
78
|
* @param {Vec3} position - Cartesian coordinates.
|
|
81
79
|
*/
|
|
82
80
|
public setEndPosition3v(position: Vec3): void;
|
|
83
|
-
setLength(length: any): void;
|
|
84
81
|
setThickness(thickness: any): void;
|
|
85
82
|
setColors4v(startColor: any, endColor: any): void;
|
|
86
83
|
setColorsHTML(startColor: any, endColor: any): void;
|
|
@@ -17,7 +17,6 @@ export class RayHandler {
|
|
|
17
17
|
_startPositionLowBuffer: any;
|
|
18
18
|
_endPositionHighBuffer: any;
|
|
19
19
|
_endPositionLowBuffer: any;
|
|
20
|
-
_lengthBuffer: any;
|
|
21
20
|
_thicknessBuffer: any;
|
|
22
21
|
_rgbaBuffer: any;
|
|
23
22
|
_vertexArr: any[];
|
|
@@ -25,7 +24,6 @@ export class RayHandler {
|
|
|
25
24
|
_startPositionLowArr: any[];
|
|
26
25
|
_endPositionHighArr: any[];
|
|
27
26
|
_endPositionLowArr: any[];
|
|
28
|
-
_lengthArr: any[];
|
|
29
27
|
_thicknessArr: any[];
|
|
30
28
|
_rgbaArr: any[];
|
|
31
29
|
_pickingColorBuffer: any;
|
|
@@ -54,14 +52,12 @@ export class RayHandler {
|
|
|
54
52
|
setPickingColorArr(index: any, color: any): void;
|
|
55
53
|
setRgbaArr(index: any, startColor: any, endColor: any): void;
|
|
56
54
|
setThicknessArr(index: any, thickness: any): void;
|
|
57
|
-
setLengthArr(index: any, length: any): void;
|
|
58
55
|
setVisibility(index: any, visibility: any): void;
|
|
59
56
|
setVertexArr(index: any, vertexArr: any): void;
|
|
60
57
|
createStartPositionBuffer(): void;
|
|
61
58
|
createEndPositionBuffer(): void;
|
|
62
59
|
createRgbaBuffer(): void;
|
|
63
60
|
createThicknessBuffer(): void;
|
|
64
|
-
createLengthBuffer(): void;
|
|
65
61
|
createVertexBuffer(): void;
|
|
66
62
|
createPickingColorBuffer(): void;
|
|
67
63
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -42,4 +42,9 @@ import * as entity from "./entity/index.js";
|
|
|
42
42
|
export const Entity: typeof entity.Entity;
|
|
43
43
|
import { Geoid } from "./terrain/Geoid.js";
|
|
44
44
|
import { Popup } from "./Popup.js";
|
|
45
|
-
|
|
45
|
+
import { QuadTreeStrategy } from "./quadTree/QuadTreeStrategy.js";
|
|
46
|
+
import { MarsQuadTreeStrategy } from "./quadTree/MarsQuadTreeStrategy.js";
|
|
47
|
+
import { EarthQuadTreeStrategy } from "./quadTree/EarthQuadTreeStrategy.js";
|
|
48
|
+
import { Wgs84QuadTreeStrategy } from "./quadTree/Wgs84QuadTreeStrategy.js";
|
|
49
|
+
import { quadTreeStrategyType } from "./utils/quadTreeType.js";
|
|
50
|
+
export { bv, jd, math, mercator, utils, input, layer, terrain, control, webgl, wgs84, Camera, Ellipsoid, PlanetCamera, Globe, LightSource, Renderer, Clock, Events, Extent, LonLat, scene, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, entity, Geoid, Popup, QuadTreeStrategy, MarsQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, quadTreeStrategyType };
|
package/types/layer/Layer.d.ts
CHANGED
|
@@ -158,6 +158,14 @@ export class Layer {
|
|
|
158
158
|
* @type {Events}
|
|
159
159
|
*/
|
|
160
160
|
public events: Events;
|
|
161
|
+
_ambient: Float32Array;
|
|
162
|
+
_diffuse: Float32Array;
|
|
163
|
+
_specular: Float32Array;
|
|
164
|
+
set diffuse(arg: any);
|
|
165
|
+
set ambient(arg: any);
|
|
166
|
+
set specular(arg: any);
|
|
167
|
+
set shininess(arg: any);
|
|
168
|
+
get normalMapCreator(): any;
|
|
161
169
|
get instanceName(): string;
|
|
162
170
|
get rendererEvents(): Events;
|
|
163
171
|
set opacity(arg: number);
|
package/types/math/Vec3.d.ts
CHANGED
|
@@ -151,6 +151,9 @@ export class Vec3 {
|
|
|
151
151
|
* @returns {Vec3} -
|
|
152
152
|
*/
|
|
153
153
|
static div(a: Vec3, b: Vec3): Vec3;
|
|
154
|
+
static length2(a: any): any;
|
|
155
|
+
static length(a: any): any;
|
|
156
|
+
static dot(a: any, b: any): any;
|
|
154
157
|
static get LERP_DELTA(): number;
|
|
155
158
|
constructor(x?: number, y?: number, z?: number);
|
|
156
159
|
/**
|
|
@@ -208,10 +211,10 @@ export class Vec3 {
|
|
|
208
211
|
public equal(p: Vec3): boolean;
|
|
209
212
|
/**
|
|
210
213
|
* Copy input vector's values.
|
|
211
|
-
* @param {Vec3}
|
|
214
|
+
* @param {Vec3} p - Vector to copy.
|
|
212
215
|
* @returns {Vec3} -
|
|
213
216
|
*/
|
|
214
|
-
copy(
|
|
217
|
+
copy(p: Vec3): Vec3;
|
|
215
218
|
/**
|
|
216
219
|
* Gets vector's length.
|
|
217
220
|
* @public
|
|
@@ -233,31 +236,31 @@ export class Vec3 {
|
|
|
233
236
|
/**
|
|
234
237
|
* Adds vector to the current.
|
|
235
238
|
* @public
|
|
236
|
-
* @param {Vec3}
|
|
239
|
+
* @param {Vec3} p - Point to add.
|
|
237
240
|
* @returns {Vec3} -
|
|
238
241
|
*/
|
|
239
|
-
public addA(
|
|
242
|
+
public addA(p: Vec3): Vec3;
|
|
240
243
|
/**
|
|
241
244
|
* Gets two vectors summarization.
|
|
242
245
|
* @public
|
|
243
|
-
* @param {Vec3}
|
|
246
|
+
* @param {Vec3} p - Vector to add.
|
|
244
247
|
* @returns {Vec3} Returns a sum vector.
|
|
245
248
|
*/
|
|
246
|
-
public add(
|
|
249
|
+
public add(p: Vec3): Vec3;
|
|
247
250
|
/**
|
|
248
251
|
* Subtract vector from the current.
|
|
249
252
|
* @public
|
|
250
|
-
* @param {Vec3}
|
|
253
|
+
* @param {Vec3} p - Subtract vector.
|
|
251
254
|
* @returns {Vec3} -
|
|
252
255
|
*/
|
|
253
|
-
public subA(
|
|
256
|
+
public subA(p: Vec3): Vec3;
|
|
254
257
|
/**
|
|
255
258
|
* Gets vector subtraction.
|
|
256
259
|
* @public
|
|
257
|
-
* @param {Vec3}
|
|
260
|
+
* @param {Vec3} p - Subtract vector.
|
|
258
261
|
* @return {Vec3} Returns new instance of a subtraction
|
|
259
262
|
*/
|
|
260
|
-
public sub(
|
|
263
|
+
public sub(p: Vec3): Vec3;
|
|
261
264
|
/**
|
|
262
265
|
* Scale current vector.
|
|
263
266
|
* @public
|
|
@@ -303,10 +306,10 @@ export class Vec3 {
|
|
|
303
306
|
/**
|
|
304
307
|
* Gets vectors dot production.
|
|
305
308
|
* @public
|
|
306
|
-
* @param {Vec3}
|
|
309
|
+
* @param {Vec3} a - Another vector.
|
|
307
310
|
* @returns {number} -
|
|
308
311
|
*/
|
|
309
|
-
public dot(
|
|
312
|
+
public dot(a: Vec3): number;
|
|
310
313
|
/**
|
|
311
314
|
* Gets vectors dot production.
|
|
312
315
|
* @public
|
|
@@ -380,17 +383,17 @@ export class Vec3 {
|
|
|
380
383
|
/**
|
|
381
384
|
* Gets distance to point.
|
|
382
385
|
* @public
|
|
383
|
-
* @param {Vec3}
|
|
386
|
+
* @param {Vec3} p - Distant point.
|
|
384
387
|
* @returns {number} -
|
|
385
388
|
*/
|
|
386
|
-
public distance(
|
|
389
|
+
public distance(p: Vec3): number;
|
|
387
390
|
/**
|
|
388
391
|
* Gets square distance to point.
|
|
389
392
|
* @public
|
|
390
|
-
* @param {Vec3}
|
|
393
|
+
* @param {Vec3} p - Distant point.
|
|
391
394
|
* @returns {number} -
|
|
392
395
|
*/
|
|
393
|
-
public distance2(
|
|
396
|
+
public distance2(p: Vec3): number;
|
|
394
397
|
/**
|
|
395
398
|
* Sets vector's values.
|
|
396
399
|
* @public
|
package/types/math/Vec4.d.ts
CHANGED
|
@@ -80,15 +80,14 @@ export class Vec4 {
|
|
|
80
80
|
* Converts vector to a number array.
|
|
81
81
|
* @public
|
|
82
82
|
* @returns {Array.<number>} - (exactly 4 entries)
|
|
83
|
-
* @deprecated
|
|
84
83
|
*/
|
|
85
|
-
public
|
|
84
|
+
public toArray(): Array<number>;
|
|
86
85
|
/**
|
|
87
86
|
* Converts vector to a number array.
|
|
88
87
|
* @public
|
|
89
88
|
* @returns {Array.<number>} - (exactly 4 entries)
|
|
90
89
|
*/
|
|
91
|
-
public
|
|
90
|
+
public toArray3(): Array<number>;
|
|
92
91
|
/**
|
|
93
92
|
* Sets vector's values.
|
|
94
93
|
* @public
|
package/types/math.d.ts
CHANGED
|
@@ -235,26 +235,26 @@ export const HOURS_TO_DEGREES: 15;
|
|
|
235
235
|
export const DEGREES_TO_HOURS: number;
|
|
236
236
|
/** @const */
|
|
237
237
|
export const SQRT_HALF: number;
|
|
238
|
-
export const
|
|
239
|
-
export const
|
|
240
|
-
export const
|
|
241
|
-
export const
|
|
242
|
-
export const
|
|
243
|
-
export const
|
|
244
|
-
export const
|
|
245
|
-
export const
|
|
246
|
-
export const
|
|
247
|
-
export const
|
|
248
|
-
export const
|
|
249
|
-
export const
|
|
250
|
-
export const
|
|
251
|
-
export const
|
|
252
|
-
export const
|
|
253
|
-
export const
|
|
254
|
-
export const
|
|
255
|
-
export const
|
|
256
|
-
export const
|
|
257
|
-
export const
|
|
238
|
+
export const EPS1: 0.1;
|
|
239
|
+
export const EPS2: 0.01;
|
|
240
|
+
export const EPS3: 0.001;
|
|
241
|
+
export const EPS4: 0.0001;
|
|
242
|
+
export const EPS5: 0.00001;
|
|
243
|
+
export const EPS6: 0.000001;
|
|
244
|
+
export const EPS7: 1e-7;
|
|
245
|
+
export const EPS8: 1e-8;
|
|
246
|
+
export const EPS9: 1e-9;
|
|
247
|
+
export const EPS10: 1e-10;
|
|
248
|
+
export const EPS11: 1e-11;
|
|
249
|
+
export const EPS12: 1e-12;
|
|
250
|
+
export const EPS13: 1e-13;
|
|
251
|
+
export const EPS14: 1e-14;
|
|
252
|
+
export const EPS15: 1e-15;
|
|
253
|
+
export const EPS16: 1e-16;
|
|
254
|
+
export const EPS17: 1e-17;
|
|
255
|
+
export const EPS18: 1e-18;
|
|
256
|
+
export const EPS19: 1e-19;
|
|
257
|
+
export const EPS20: 1e-20;
|
|
258
258
|
/**
|
|
259
259
|
* Equation function.
|
|
260
260
|
*/
|
package/types/quadTree/Node.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class QuadTreeStrategy {
|
|
2
|
+
constructor(options?: {});
|
|
3
|
+
name: string;
|
|
4
|
+
_planet: any;
|
|
5
|
+
projection: import("../proj/Proj.js").Proj;
|
|
6
|
+
/**
|
|
7
|
+
* grid tree list.
|
|
8
|
+
* @protected
|
|
9
|
+
* @type {quadTree.Node[]}
|
|
10
|
+
*/
|
|
11
|
+
protected _quadTreeList: quadTree.Node[];
|
|
12
|
+
destroyBranches(): void;
|
|
13
|
+
clearLayerMaterial(layer: any): void;
|
|
14
|
+
get planet(): any;
|
|
15
|
+
init(): void;
|
|
16
|
+
preRender(): void;
|
|
17
|
+
preLoad(): void;
|
|
18
|
+
collectRenderNodes(): void;
|
|
19
|
+
clear(): void;
|
|
20
|
+
get quadTreeList(): quadTree.Node[];
|
|
21
|
+
}
|
|
@@ -144,6 +144,7 @@ export class Renderer {
|
|
|
144
144
|
public fontAtlas: utils.FontAtlas;
|
|
145
145
|
_entityCollections: any[];
|
|
146
146
|
_currentOutput: string;
|
|
147
|
+
_fnScreenFrame: (() => void) | (() => void);
|
|
147
148
|
labelWorker: LabelWorker;
|
|
148
149
|
/**
|
|
149
150
|
* Sets renderer events activity.
|
|
@@ -216,7 +217,6 @@ export class Renderer {
|
|
|
216
217
|
*/
|
|
217
218
|
public initialize(): void;
|
|
218
219
|
screenDepthFramebuffer: Framebuffer;
|
|
219
|
-
_fnScreenFrame: (() => void) | (() => void);
|
|
220
220
|
screenTexture: {
|
|
221
221
|
screen: any;
|
|
222
222
|
picking: any;
|
package/types/scene/Planet.d.ts
CHANGED
|
@@ -123,12 +123,6 @@ export class Planet extends RenderNode {
|
|
|
123
123
|
*/
|
|
124
124
|
protected _renderedNodes: quadTree.Node;
|
|
125
125
|
_renderedNodesInFrustum: any[];
|
|
126
|
-
/**
|
|
127
|
-
* Created nodes cache
|
|
128
|
-
* @protected
|
|
129
|
-
* @type {quadTree.Node}
|
|
130
|
-
*/
|
|
131
|
-
protected _quadTreeNodesCacheMerc: quadTree.Node;
|
|
132
126
|
/**
|
|
133
127
|
* Current visible mercator segments tree nodes array.
|
|
134
128
|
* @protected
|
|
@@ -190,24 +184,7 @@ export class Planet extends RenderNode {
|
|
|
190
184
|
* @type {Object}
|
|
191
185
|
*/
|
|
192
186
|
protected _heightPickingFramebuffer: any;
|
|
193
|
-
|
|
194
|
-
* Mercator grid tree.
|
|
195
|
-
* @protected
|
|
196
|
-
* @type {quadTree.Node}
|
|
197
|
-
*/
|
|
198
|
-
protected _quadTree: quadTree.Node;
|
|
199
|
-
/**
|
|
200
|
-
* North grid tree.
|
|
201
|
-
* @protected
|
|
202
|
-
* @type {quadTree.Node}
|
|
203
|
-
*/
|
|
204
|
-
protected _quadTreeNorth: quadTree.Node;
|
|
205
|
-
/**
|
|
206
|
-
* South grid tree.
|
|
207
|
-
* @protected
|
|
208
|
-
* @type {quadTree.Node}
|
|
209
|
-
*/
|
|
210
|
-
protected _quadTreeSouth: quadTree.Node;
|
|
187
|
+
quadTreeStrategy: any;
|
|
211
188
|
/**
|
|
212
189
|
* Night glowing gl texture.
|
|
213
190
|
* @protected
|
|
@@ -274,6 +251,11 @@ export class Planet extends RenderNode {
|
|
|
274
251
|
_renderCompletedActivated: boolean;
|
|
275
252
|
_terrainCompleted: boolean;
|
|
276
253
|
_terrainCompletedActivated: boolean;
|
|
254
|
+
set diffuse(arg: any);
|
|
255
|
+
set ambient(arg: any);
|
|
256
|
+
set specular(arg: any);
|
|
257
|
+
set shininess(arg: any);
|
|
258
|
+
get normalMapCreator(): NormalMapCreator;
|
|
277
259
|
get layers(): Layer[];
|
|
278
260
|
/**
|
|
279
261
|
* Add the given control to the renderer of the planet scene.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export const TILEGROUP_COMMON: 0;
|
|
2
|
+
export const TILEGROUP_NORTH: 1;
|
|
3
|
+
export const TILEGROUP_SOUTH: 2;
|
|
1
4
|
/**
|
|
2
5
|
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
|
|
3
6
|
* @class
|
|
@@ -154,6 +157,7 @@ export class Segment {
|
|
|
154
157
|
_indexBuffer: any;
|
|
155
158
|
readyToEngage: boolean;
|
|
156
159
|
plainProcessing: boolean;
|
|
160
|
+
checkZoom(): boolean;
|
|
157
161
|
/**
|
|
158
162
|
* Returns entity terrain point.
|
|
159
163
|
* @public
|
|
@@ -219,10 +223,6 @@ export class Segment {
|
|
|
219
223
|
* Clear but not destroy segment data.
|
|
220
224
|
*/
|
|
221
225
|
clearSegment(): void;
|
|
222
|
-
/**
|
|
223
|
-
* Removes cache records.
|
|
224
|
-
*/
|
|
225
|
-
_freeCache(): void;
|
|
226
226
|
/**
|
|
227
227
|
* Clear and destroy all segment data.
|
|
228
228
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const POLE_PIECE_SIZE: number;
|
|
1
2
|
/**
|
|
2
3
|
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
|
|
3
4
|
* @class
|
|
@@ -9,11 +10,14 @@
|
|
|
9
10
|
*/
|
|
10
11
|
export class SegmentLonLat extends Segment {
|
|
11
12
|
_extentMerc: Extent;
|
|
13
|
+
_isNorth: boolean;
|
|
12
14
|
projectNative(coords: any): any;
|
|
13
15
|
getTerrainPoint(xyz: any, insideSegmentPosition: any, res: any, normal: any): number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
_getMaxZoom(): number;
|
|
17
|
+
_assignTileXIndexes(extent: any): void;
|
|
18
|
+
_assignTileYIndexes(extent: any): void;
|
|
16
19
|
normalMapNormalsRaw: Float32Array;
|
|
20
|
+
_freeCache(): void;
|
|
17
21
|
}
|
|
18
22
|
import { Segment } from "./Segment.js";
|
|
19
23
|
import { Extent } from "../Extent.js";
|
|
@@ -9,7 +9,8 @@ export class MapboxTerrain extends GlobusTerrain {
|
|
|
9
9
|
plainGridSize: any;
|
|
10
10
|
_imageSize: any;
|
|
11
11
|
_ctx: CanvasRenderingContext2D;
|
|
12
|
+
_imageDataCache: {};
|
|
12
13
|
_createTemporalCanvas(size: any): CanvasRenderingContext2D;
|
|
13
|
-
_createHeights(data: any, tileIndex: any, tileX: any, tileY: any, tileZoom: any, extent: any): Float32Array;
|
|
14
|
+
_createHeights(data: any, tileIndex: any, tileX: any, tileY: any, tileZoom: any, extent: any, preventChildren: any): Float32Array;
|
|
14
15
|
}
|
|
15
16
|
import { GlobusTerrain } from "./GlobusTerrain.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export namespace quadTreeStrategyType {
|
|
2
|
+
export { EarthQuadTreeStrategy as earth };
|
|
3
|
+
export { MarsQuadTreeStrategy as mars };
|
|
4
|
+
export { Wgs84QuadTreeStrategy as wgs84 };
|
|
5
|
+
}
|
|
6
|
+
import { EarthQuadTreeStrategy } from "../quadTree/EarthQuadTreeStrategy.js";
|
|
7
|
+
import { MarsQuadTreeStrategy } from "../quadTree/MarsQuadTreeStrategy.js";
|
|
8
|
+
import { Wgs84QuadTreeStrategy } from "../quadTree/Wgs84QuadTreeStrategy.js";
|
package/types/webgl/Handler.d.ts
CHANGED
|
@@ -258,6 +258,8 @@ export class Handler {
|
|
|
258
258
|
createTexture_l: any;
|
|
259
259
|
createTexture_mm: any;
|
|
260
260
|
createTexture_a: any;
|
|
261
|
+
observer: IntersectionObserver;
|
|
262
|
+
_toggleVisibilityChange(visibility: any): void;
|
|
261
263
|
/**
|
|
262
264
|
* Sets default gl render parameters. Used in init function.
|
|
263
265
|
* @private
|
|
@@ -363,7 +365,8 @@ export class Handler {
|
|
|
363
365
|
*/
|
|
364
366
|
public start(): void;
|
|
365
367
|
stop(): void;
|
|
366
|
-
_requestAnimationFrameId:
|
|
368
|
+
_requestAnimationFrameId: any;
|
|
369
|
+
isStopped(): boolean;
|
|
367
370
|
/**
|
|
368
371
|
* Check is gl context type equals webgl2
|
|
369
372
|
* @public
|