@openglobus/og 0.20.2 → 0.20.4
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 -1
- package/css/og.css +55 -23
- package/lib/@openglobus/js/Globe.d.ts +3 -0
- package/lib/@openglobus/js/control/Atmosphere.d.ts +27 -3
- package/lib/@openglobus/js/control/AtmosphereConfig.d.ts +59 -0
- package/lib/@openglobus/js/control/index.d.ts +29 -29
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +4 -0
- package/lib/@openglobus/js/entity/GeoObject.d.ts +7 -3
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +5 -8
- package/lib/@openglobus/js/layer/Vector.d.ts +5 -0
- package/lib/@openglobus/js/math/Quat.d.ts +1 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +6 -0
- package/lib/@openglobus/js/shaders/atmos.d.ts +19 -3
- package/lib/@openglobus/js/shaders/drawnode.d.ts +2 -1
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +2 -0
- package/lib/@openglobus/js/webgl/Handler.d.ts +3 -1
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Globe.d.ts +3 -0
- package/lib/js/Globe.js +4 -1
- package/lib/js/control/Atmosphere.d.ts +27 -3
- package/lib/js/control/Atmosphere.js +109 -43
- package/lib/js/control/AtmosphereConfig.d.ts +59 -0
- package/lib/js/control/AtmosphereConfig.js +348 -0
- package/lib/js/control/DebugInfo.js +5 -4
- package/lib/js/control/Lighting.js +13 -5
- package/lib/js/control/index.d.ts +29 -29
- package/lib/js/control/index.js +29 -29
- package/lib/js/entity/EntityCollection.d.ts +4 -0
- package/lib/js/entity/EntityCollection.js +7 -0
- package/lib/js/entity/GeoObject.d.ts +7 -3
- package/lib/js/entity/GeoObject.js +31 -16
- package/lib/js/entity/GeoObjectHandler.d.ts +5 -8
- package/lib/js/entity/GeoObjectHandler.js +34 -63
- package/lib/js/layer/Layer.js +2 -2
- package/lib/js/layer/Vector.d.ts +5 -0
- package/lib/js/layer/Vector.js +16 -1
- package/lib/js/math/Quat.d.ts +1 -0
- package/lib/js/math/Quat.js +4 -0
- package/lib/js/renderer/RendererEvents.js +1 -3
- package/lib/js/scene/Planet.d.ts +6 -0
- package/lib/js/scene/Planet.js +25 -11
- package/lib/js/shaders/atmos.d.ts +19 -3
- package/lib/js/shaders/atmos.js +40 -26
- package/lib/js/shaders/drawnode.d.ts +2 -1
- package/lib/js/shaders/drawnode.js +15 -12
- package/lib/js/shaders/geoObject.js +22 -71
- package/lib/js/terrain/GlobusRgbTerrain.js +2 -2
- package/lib/js/terrain/GlobusTerrain.d.ts +2 -0
- package/lib/js/terrain/GlobusTerrain.js +2 -0
- package/lib/js/ui/Slider.js +3 -3
- package/lib/js/webgl/Handler.d.ts +3 -1
- package/lib/js/webgl/Handler.js +38 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
English | [简体中文](README_CN.md) | [Portuguese-BR](README_pt-BR.md)
|
|
7
7
|
|
|
8
|
-
[
|
|
8
|
+
[openglobus](https://www.openglobus.org/) is a typescript/javascript library designed to display interactive 3D maps and other geospatial data at a
|
|
9
9
|
scale from planet to bee.
|
|
10
10
|
|
|
11
11
|
It supports various high-resolution terrain providers, imagery layers, renders thousands of 3D objects, provides
|
package/css/og.css
CHANGED
|
@@ -140,19 +140,33 @@ input {
|
|
|
140
140
|
visibility: hidden !important;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
position:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
.og-options-container {
|
|
144
|
+
position: relative;
|
|
145
|
+
padding: 12px;
|
|
146
|
+
height: calc(100% - 30px);
|
|
147
|
+
color: #b6b6b6;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.og-option {
|
|
151
|
+
width: 100%;
|
|
152
|
+
position: relative;
|
|
153
|
+
display: inline-block;
|
|
154
|
+
flex-direction: row;
|
|
155
|
+
padding-bottom: 7px;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: left;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.og-option .og-slider {
|
|
162
|
+
width: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.og-option .og-slider .og-slider-label,
|
|
166
|
+
.og-option .og-color-label {
|
|
167
|
+
width: 100px;
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
}
|
|
156
170
|
|
|
157
171
|
.og-ddialog {
|
|
158
172
|
position: absolute;
|
|
@@ -620,20 +634,15 @@ input {
|
|
|
620
634
|
position: relative;
|
|
621
635
|
}
|
|
622
636
|
|
|
637
|
+
.og-emptyline,
|
|
623
638
|
.og-lighing .og-lighting-emptyline {
|
|
624
639
|
width: 100%;
|
|
625
640
|
padding: 3px;
|
|
626
641
|
}
|
|
627
642
|
|
|
628
|
-
.og-
|
|
643
|
+
.og-emptyline-2 {
|
|
629
644
|
width: 100%;
|
|
630
|
-
|
|
631
|
-
display: inline-block;
|
|
632
|
-
flex-direction: row;
|
|
633
|
-
padding-bottom: 7px;
|
|
634
|
-
text-overflow: ellipsis;
|
|
635
|
-
align-items: center;
|
|
636
|
-
justify-content: left;
|
|
645
|
+
padding: 5px;
|
|
637
646
|
}
|
|
638
647
|
|
|
639
648
|
.og-lighing .og-slider {
|
|
@@ -717,6 +726,28 @@ input {
|
|
|
717
726
|
pointer-events: none;
|
|
718
727
|
}
|
|
719
728
|
|
|
729
|
+
|
|
730
|
+
/*
|
|
731
|
+
==========================
|
|
732
|
+
Atmosphere Config
|
|
733
|
+
==========================
|
|
734
|
+
*/
|
|
735
|
+
.og-atmosphere_button {
|
|
736
|
+
position: absolute;
|
|
737
|
+
left: 10px;
|
|
738
|
+
top: 230px;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.og-atmosphere.og-options-container .og-slider-label {
|
|
742
|
+
width: 300px;
|
|
743
|
+
overflow: hidden;
|
|
744
|
+
height: 20px;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.og-atmosphere.og-options-container .og-slider input{
|
|
748
|
+
width: 87px;
|
|
749
|
+
}
|
|
750
|
+
|
|
720
751
|
/*
|
|
721
752
|
==========================
|
|
722
753
|
TIMELINE
|
|
@@ -838,7 +869,7 @@ TIMELINE
|
|
|
838
869
|
display: flex;
|
|
839
870
|
flex-direction: row;
|
|
840
871
|
width: 200px;
|
|
841
|
-
height: 20px
|
|
872
|
+
/*height: 20px;*/
|
|
842
873
|
}
|
|
843
874
|
|
|
844
875
|
.og-slider .og-slider-label {
|
|
@@ -850,12 +881,13 @@ TIMELINE
|
|
|
850
881
|
display: flex;
|
|
851
882
|
align-items: center;
|
|
852
883
|
text-align: left;
|
|
884
|
+
margin-right: 5px;
|
|
853
885
|
}
|
|
854
886
|
|
|
855
887
|
.og-slider .og-slider-panel {
|
|
856
888
|
position: relative;
|
|
857
889
|
width: 100%;
|
|
858
|
-
height:
|
|
890
|
+
height: 20px;
|
|
859
891
|
background-color: var(--grey1);
|
|
860
892
|
z-index: 1;
|
|
861
893
|
}
|
|
@@ -9,6 +9,7 @@ import { Sun } from "./control/Sun";
|
|
|
9
9
|
import { HTMLDivElementExt, Renderer } from "./renderer/Renderer";
|
|
10
10
|
import { RenderNode } from "./scene/RenderNode";
|
|
11
11
|
import { Extent } from "./Extent";
|
|
12
|
+
import { IAtmosphereParams } from "./control/Atmosphere";
|
|
12
13
|
export interface IGlobeParams {
|
|
13
14
|
attributionContainer?: HTMLElement;
|
|
14
15
|
target?: string | HTMLElement;
|
|
@@ -43,6 +44,7 @@ export interface IGlobeParams {
|
|
|
43
44
|
autoActivate?: boolean;
|
|
44
45
|
fontsSrc?: string;
|
|
45
46
|
resourcesSrc?: string;
|
|
47
|
+
atmosphereParameters?: IAtmosphereParams;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Creates a WebGL context with globe.
|
|
@@ -94,6 +96,7 @@ export interface IGlobeParams {
|
|
|
94
96
|
* @param {number} [options.dpi] - Device pixel ratio. Default is current screen DPI.
|
|
95
97
|
* @param {boolean} [options.atmosphereEnabled] - Enables atmosphere effect.
|
|
96
98
|
* @param {boolean} [options.transtitionOpacityEnabled] - Enables terrain smooth opacity transition effect.
|
|
99
|
+
* @param {IAtmosphereParams} [options.atmosphereParameters] - Atmosphere model parameters.
|
|
97
100
|
*/
|
|
98
101
|
declare class Globe {
|
|
99
102
|
static __counter__: number;
|
|
@@ -1,16 +1,40 @@
|
|
|
1
|
+
import { AtmosphereParameters } from "../shaders/atmos";
|
|
1
2
|
import { Framebuffer } from "../webgl/Framebuffer";
|
|
2
3
|
import { Control, IControlParams } from "./Control";
|
|
3
|
-
|
|
4
|
+
import { NumberArray3 } from '../math/Vec3';
|
|
5
|
+
export interface IAtmosphereParams extends IControlParams {
|
|
6
|
+
height?: number;
|
|
7
|
+
rayleighScale?: number;
|
|
8
|
+
mieScale?: number;
|
|
9
|
+
groundAlbedo?: number;
|
|
10
|
+
bottomRadius?: number;
|
|
11
|
+
rayleighScatteringCoefficient?: NumberArray3;
|
|
12
|
+
mieScatteringCoefficient?: number;
|
|
13
|
+
mieExtinctionCoefficient?: number;
|
|
14
|
+
ozoneAbsorptionCoefficient?: NumberArray3;
|
|
15
|
+
sunAngularRadius?: number;
|
|
16
|
+
sunIntensity?: number;
|
|
17
|
+
ozoneDensityHeight?: number;
|
|
18
|
+
ozoneDensityWide?: number;
|
|
4
19
|
}
|
|
5
20
|
export declare class Atmosphere extends Control {
|
|
6
21
|
_transmittanceBuffer: Framebuffer | null;
|
|
7
22
|
_scatteringBuffer: Framebuffer | null;
|
|
8
23
|
opacity: number;
|
|
24
|
+
protected _parameters: AtmosphereParameters;
|
|
9
25
|
constructor(options?: IAtmosphereParams);
|
|
26
|
+
setParameters(parameters: AtmosphereParameters): void;
|
|
27
|
+
get parameters(): AtmosphereParameters;
|
|
28
|
+
initPlanetAtmosphereShader(): void;
|
|
10
29
|
oninit(): void;
|
|
30
|
+
initLookupTexturesShaders(): void;
|
|
31
|
+
initBackgroundShader(): void;
|
|
32
|
+
removeBackgroundShader(): void;
|
|
33
|
+
removeLookupTexturesShaders(): void;
|
|
11
34
|
onactivate(): void;
|
|
12
35
|
ondeactivate(): void;
|
|
13
|
-
protected
|
|
36
|
+
protected _initLookupTextures(): void;
|
|
37
|
+
protected _renderLookupTextures(): void;
|
|
38
|
+
drawLookupTextures(): void;
|
|
14
39
|
protected _drawBackground(): void;
|
|
15
40
|
}
|
|
16
|
-
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Control, IControlParams } from "./Control";
|
|
2
|
+
import { Dialog } from '../ui/Dialog';
|
|
3
|
+
import { Slider } from "../ui/Slider";
|
|
4
|
+
import { ToggleButton } from "../ui/ToggleButton";
|
|
5
|
+
import { View } from '../ui/View';
|
|
6
|
+
import { AtmosphereParameters } from "../shaders/atmos";
|
|
7
|
+
interface IAtmosphereConfigParams extends IControlParams {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Helps to set up atmosphere parameters.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AtmosphereConfig extends Control {
|
|
13
|
+
protected _toggleBtn: ToggleButton;
|
|
14
|
+
protected _dialog: Dialog<null>;
|
|
15
|
+
protected _panel: View<null>;
|
|
16
|
+
$maxOpacity: HTMLElement | null;
|
|
17
|
+
$minOpacity: HTMLElement | null;
|
|
18
|
+
$rayleight: HTMLElement | null;
|
|
19
|
+
$mie: HTMLElement | null;
|
|
20
|
+
$height: HTMLElement | null;
|
|
21
|
+
$bottomRadius: HTMLElement | null;
|
|
22
|
+
$mieScatteringCoefficient: HTMLElement | null;
|
|
23
|
+
$mieExtinctionCoefficient: HTMLElement | null;
|
|
24
|
+
$rayleighScatteringCoefficientA: HTMLElement | null;
|
|
25
|
+
$rayleighScatteringCoefficientB: HTMLElement | null;
|
|
26
|
+
$rayleighScatteringCoefficientC: HTMLElement | null;
|
|
27
|
+
$ozoneAbsorptionCoefficientA: HTMLElement | null;
|
|
28
|
+
$ozoneAbsorptionCoefficientB: HTMLElement | null;
|
|
29
|
+
$ozoneAbsorptionCoefficientC: HTMLElement | null;
|
|
30
|
+
$sunAngularRadius: HTMLElement | null;
|
|
31
|
+
$sunIntensity: HTMLElement | null;
|
|
32
|
+
$groundAlbedo: HTMLElement | null;
|
|
33
|
+
$ozoneDensityHeight: HTMLElement | null;
|
|
34
|
+
$ozoneDensityWide: HTMLElement | null;
|
|
35
|
+
protected _maxOpacity: Slider;
|
|
36
|
+
protected _minOpacity: Slider;
|
|
37
|
+
protected _rayleight: Slider;
|
|
38
|
+
protected _mie: Slider;
|
|
39
|
+
protected _height: Slider;
|
|
40
|
+
protected _bottomRadius: Slider;
|
|
41
|
+
protected _mieScatteringCoefficient: Slider;
|
|
42
|
+
protected _mieExtinctionCoefficient: Slider;
|
|
43
|
+
protected _rayleighScatteringCoefficientA: Slider;
|
|
44
|
+
protected _rayleighScatteringCoefficientB: Slider;
|
|
45
|
+
protected _rayleighScatteringCoefficientC: Slider;
|
|
46
|
+
protected _ozoneAbsorptionCoefficientA: Slider;
|
|
47
|
+
protected _ozoneAbsorptionCoefficientB: Slider;
|
|
48
|
+
protected _ozoneAbsorptionCoefficientC: Slider;
|
|
49
|
+
protected _sunAngularRadius: Slider;
|
|
50
|
+
protected _sunIntensity: Slider;
|
|
51
|
+
protected _groundAlbedo: Slider;
|
|
52
|
+
protected _ozoneDensityHeight: Slider;
|
|
53
|
+
protected _ozoneDensityWide: Slider;
|
|
54
|
+
protected _parameters: AtmosphereParameters;
|
|
55
|
+
constructor(options?: IAtmosphereConfigParams);
|
|
56
|
+
oninit(): void;
|
|
57
|
+
protected _update(): void;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export
|
|
1
|
+
export * from "./CompassButton";
|
|
2
|
+
export * from "./Control";
|
|
3
|
+
export * from "./DebugInfo";
|
|
4
|
+
export * from "./DrawingSwitcher";
|
|
5
|
+
export * from "./EarthCoordinates";
|
|
6
|
+
export * from "./EarthNavigation";
|
|
7
|
+
export * from "./GeoImageDragControl";
|
|
8
|
+
export * from "./KeyboardNavigation";
|
|
9
|
+
export * from "./LayerAnimation";
|
|
10
|
+
export * from "./LayerSwitcher";
|
|
11
|
+
export * from "./Lighting";
|
|
12
|
+
export * from "./MouseNavigation";
|
|
13
|
+
export * from "./MouseWheelZoomControl";
|
|
14
|
+
export * from "./RulerSwitcher";
|
|
15
|
+
export * from "./ScaleControl";
|
|
16
|
+
export * from "./ShowFps";
|
|
17
|
+
export * from "./SimpleNavigation";
|
|
18
|
+
export * from "./SimpleSkyBackground";
|
|
19
|
+
export * from "./Sun";
|
|
20
|
+
export * from "./ToggleWireframe";
|
|
21
|
+
export * from "./TouchNavigation";
|
|
22
|
+
export * from "./ZoomControl";
|
|
23
|
+
export * from "./drawing/DrawingControl";
|
|
24
|
+
export * from "./heightRuler/HeightRuler";
|
|
25
|
+
export * from "./ruler/Ruler";
|
|
26
|
+
export * from "./selection/Selection";
|
|
27
|
+
export * from "./timeline/TimelineControl";
|
|
28
|
+
export * from "./elevationProfile/ElevationProfileControl";
|
|
29
|
+
export * from "./AtmosphereConfig";
|
|
@@ -21,6 +21,7 @@ interface IEntityCollectionParams {
|
|
|
21
21
|
scaleByDistance?: NumberArray3;
|
|
22
22
|
pickingScale?: number;
|
|
23
23
|
opacity?: number;
|
|
24
|
+
useLighting?: boolean;
|
|
24
25
|
entities?: Entity[];
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -184,8 +185,11 @@ declare class EntityCollection {
|
|
|
184
185
|
*/
|
|
185
186
|
_layer?: Vector;
|
|
186
187
|
_quadNode?: EntityCollectionNode;
|
|
188
|
+
_useLighting: number;
|
|
187
189
|
constructor(options?: IEntityCollectionParams);
|
|
188
190
|
get id(): number;
|
|
191
|
+
get useLighting(): boolean;
|
|
192
|
+
set useLighting(f: boolean);
|
|
189
193
|
isEqual(ec: EntityCollection): boolean;
|
|
190
194
|
/**
|
|
191
195
|
* Sets collection visibility.
|
|
@@ -45,6 +45,9 @@ declare class GeoObject {
|
|
|
45
45
|
protected _pitch: number;
|
|
46
46
|
protected _yaw: number;
|
|
47
47
|
protected _roll: number;
|
|
48
|
+
protected _pitchRad: number;
|
|
49
|
+
protected _yawRad: number;
|
|
50
|
+
protected _rollRad: number;
|
|
48
51
|
protected _scale: Vec3;
|
|
49
52
|
/**
|
|
50
53
|
* RGBA color.
|
|
@@ -52,7 +55,8 @@ declare class GeoObject {
|
|
|
52
55
|
* @type {Vec4}
|
|
53
56
|
*/
|
|
54
57
|
_color: Vec4;
|
|
55
|
-
|
|
58
|
+
_qRot: Quat;
|
|
59
|
+
protected _direction: Vec3;
|
|
56
60
|
_handler: GeoObjectHandler | null;
|
|
57
61
|
_handlerIndex: number;
|
|
58
62
|
_tagData: InstanceData | null;
|
|
@@ -68,7 +72,6 @@ declare class GeoObject {
|
|
|
68
72
|
getPitch(): number;
|
|
69
73
|
getYaw(): number;
|
|
70
74
|
getRoll(): number;
|
|
71
|
-
getDirection(): Vec3;
|
|
72
75
|
get object3d(): Object3d;
|
|
73
76
|
get vertices(): number[];
|
|
74
77
|
get normals(): number[];
|
|
@@ -147,6 +150,7 @@ declare class GeoObject {
|
|
|
147
150
|
* @param {Vec3} color - Picking color.
|
|
148
151
|
*/
|
|
149
152
|
setPickingColor3v(color: Vec3): void;
|
|
150
|
-
|
|
153
|
+
updateRotation(): void;
|
|
154
|
+
getDirection(): Vec3;
|
|
151
155
|
}
|
|
152
156
|
export { GeoObject };
|
|
@@ -4,6 +4,7 @@ import { GeoObject } from "./GeoObject";
|
|
|
4
4
|
import { Planet } from "../scene/Planet";
|
|
5
5
|
import { Vec3 } from "../math/Vec3";
|
|
6
6
|
import { Vec4 } from "../math/Vec4";
|
|
7
|
+
import { Quat } from "../math/Quat";
|
|
7
8
|
import { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
8
9
|
import { Object3d } from "../Object3d";
|
|
9
10
|
declare class InstanceData {
|
|
@@ -14,24 +15,22 @@ declare class InstanceData {
|
|
|
14
15
|
_texture: WebGLTextureExt | null;
|
|
15
16
|
_textureSrc: string | null;
|
|
16
17
|
_objectSrc?: string;
|
|
17
|
-
_pitchRollArr: number[] | TypedArray;
|
|
18
18
|
_sizeArr: number[] | TypedArray;
|
|
19
19
|
_vertexArr: number[] | TypedArray;
|
|
20
20
|
_positionHighArr: number[] | TypedArray;
|
|
21
21
|
_positionLowArr: number[] | TypedArray;
|
|
22
|
-
|
|
22
|
+
_qRotArr: number[] | TypedArray;
|
|
23
23
|
_rgbaArr: number[] | TypedArray;
|
|
24
24
|
_normalsArr: number[] | TypedArray;
|
|
25
25
|
_indicesArr: number[] | TypedArray;
|
|
26
26
|
_pickingColorArr: number[] | TypedArray;
|
|
27
27
|
_visibleArr: number[] | TypedArray;
|
|
28
28
|
_texCoordArr: number[] | TypedArray;
|
|
29
|
-
_pitchRollBuffer: WebGLBufferExt | null;
|
|
30
29
|
_sizeBuffer: WebGLBufferExt | null;
|
|
31
30
|
_vertexBuffer: WebGLBufferExt | null;
|
|
32
31
|
_positionHighBuffer: WebGLBufferExt | null;
|
|
33
32
|
_positionLowBuffer: WebGLBufferExt | null;
|
|
34
|
-
|
|
33
|
+
_qRotBuffer: WebGLBufferExt | null;
|
|
35
34
|
_rgbaBuffer: WebGLBufferExt | null;
|
|
36
35
|
_normalsBuffer: WebGLBufferExt | null;
|
|
37
36
|
_indicesBuffer: WebGLBufferExt | null;
|
|
@@ -45,13 +44,12 @@ declare class InstanceData {
|
|
|
45
44
|
clear(): void;
|
|
46
45
|
_deleteBuffers(): void;
|
|
47
46
|
createVertexBuffer(): void;
|
|
48
|
-
createPitchRollBuffer(): void;
|
|
49
47
|
createVisibleBuffer(): void;
|
|
50
48
|
createSizeBuffer(): void;
|
|
51
49
|
createTexCoordBuffer(): void;
|
|
52
50
|
createPositionBuffer(): void;
|
|
53
51
|
createRgbaBuffer(): void;
|
|
54
|
-
|
|
52
|
+
createQRotBuffer(): void;
|
|
55
53
|
createNormalsBuffer(): void;
|
|
56
54
|
createIndicesBuffer(): void;
|
|
57
55
|
createPickingColorBuffer(): void;
|
|
@@ -84,12 +82,11 @@ declare class GeoObjectHandler {
|
|
|
84
82
|
drawPicking(): void;
|
|
85
83
|
protected _pickingPASS(): void;
|
|
86
84
|
_loadDataTagTexture(tagData: InstanceData): Promise<void>;
|
|
87
|
-
|
|
85
|
+
setQRotArr(tagData: InstanceData, tagDataIndex: number, qRot: Quat): void;
|
|
88
86
|
setVisibility(tagData: InstanceData, tagDataIndex: number, visibility: boolean): void;
|
|
89
87
|
setPositionArr(tagData: InstanceData, tagDataIndex: number, positionHigh: Vec3, positionLow: Vec3): void;
|
|
90
88
|
setRgbaArr(tagData: InstanceData, tagDataIndex: number, rgba: Vec4): void;
|
|
91
89
|
setPickingColorArr(tagData: InstanceData, tagDataIndex: number, color: Vec3): void;
|
|
92
|
-
setPitchRollArr(tagData: InstanceData, tagDataIndex: number, pitch: number, roll: number): void;
|
|
93
90
|
setScaleArr(tagData: InstanceData, tagDataIndex: number, scale: Vec3): void;
|
|
94
91
|
protected _updateTag(dataTag: InstanceData): void;
|
|
95
92
|
update(): void;
|
|
@@ -19,6 +19,7 @@ export interface IVectorParams extends ILayerParams {
|
|
|
19
19
|
pickingScale?: number;
|
|
20
20
|
scaleByDistance?: NumberArray3;
|
|
21
21
|
labelMaxLetters?: number;
|
|
22
|
+
useLighting?: boolean;
|
|
22
23
|
}
|
|
23
24
|
type VectorEventsList = [
|
|
24
25
|
"draw",
|
|
@@ -44,6 +45,7 @@ export type VectorEventsType = EventsHandler<VectorEventsList> & EventsHandler<L
|
|
|
44
45
|
* First index - near distance to the entity, after entity becomes full scale.
|
|
45
46
|
* Second index - far distance to the entity, when entity becomes zero scale.
|
|
46
47
|
* Third index - far distance to the entity, when entity becomes invisible.
|
|
48
|
+
* Use [1.0, 1.0, 1.0] for real sized objects
|
|
47
49
|
* @param {number} [options.nodeCapacity=30] - Maximum entities quantity in the tree node. Rendering optimization parameter. 30 is default.
|
|
48
50
|
* @param {boolean} [options.async=true] - Asynchronous vector data handling before rendering. True for optimization huge data.
|
|
49
51
|
* @param {boolean} [options.clampToGround = false] - Clamp vector data to the ground.
|
|
@@ -121,7 +123,10 @@ declare class Vector extends Layer {
|
|
|
121
123
|
polygonOffsetUnits: number;
|
|
122
124
|
_secondPASS: EntityCollectionNode[];
|
|
123
125
|
protected _labelMaxLetters: number;
|
|
126
|
+
protected _useLighting: boolean;
|
|
124
127
|
constructor(name?: string | null, options?: IVectorParams);
|
|
128
|
+
get useLighting(): boolean;
|
|
129
|
+
set useLighting(f: boolean);
|
|
125
130
|
get labelMaxLetters(): number;
|
|
126
131
|
get instanceName(): string;
|
|
127
132
|
protected _bindPicking(): void;
|
|
@@ -118,6 +118,7 @@ export declare class Quat {
|
|
|
118
118
|
* @returns {Quat} -
|
|
119
119
|
*/
|
|
120
120
|
static getRotationBetweenVectorsUp(source: Vec3, dest: Vec3, up: Vec3): Quat;
|
|
121
|
+
static setFromEulerAngles(pitch: number, yaw: number, roll: number): Quat;
|
|
121
122
|
/**
|
|
122
123
|
* Returns true if the components are zero.
|
|
123
124
|
* @public
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Atmosphere, IAtmosphereParams } from "../control/Atmosphere";
|
|
1
2
|
import { Control } from "../control/Control";
|
|
2
3
|
import { EventsHandler } from "../Events";
|
|
3
4
|
import { EmptyTerrain } from "../terrain/EmptyTerrain";
|
|
@@ -25,6 +26,7 @@ import { VectorTileCreator } from "../utils/VectorTileCreator";
|
|
|
25
26
|
import { WebGLBufferExt, WebGLTextureExt, IDefaultTextureParams } from "../webgl/Handler";
|
|
26
27
|
import { Program } from "../webgl/Program";
|
|
27
28
|
import { Segment } from "../segment/Segment";
|
|
29
|
+
import { AtmosphereParameters } from "../shaders/atmos";
|
|
28
30
|
export interface IPlanetParams {
|
|
29
31
|
name?: string;
|
|
30
32
|
ellipsoid?: Ellipsoid;
|
|
@@ -45,6 +47,7 @@ export interface IPlanetParams {
|
|
|
45
47
|
maxLoadingRequests?: number;
|
|
46
48
|
atmosphereEnabled?: boolean;
|
|
47
49
|
transitionOpacityEnabled?: boolean;
|
|
50
|
+
atmosphereParameters?: IAtmosphereParams;
|
|
48
51
|
}
|
|
49
52
|
export type PlanetEventsList = [
|
|
50
53
|
"draw",
|
|
@@ -324,6 +327,7 @@ export declare class Planet extends RenderNode {
|
|
|
324
327
|
_prevNodes: Map<number, Node>;
|
|
325
328
|
_currNodes: Map<number, Node>;
|
|
326
329
|
protected _transitionOpacityEnabled: boolean;
|
|
330
|
+
protected _atmosphere: Atmosphere;
|
|
327
331
|
constructor(options?: IPlanetParams);
|
|
328
332
|
/**
|
|
329
333
|
* Returns true if current terrain data set is loaded
|
|
@@ -422,6 +426,8 @@ export declare class Planet extends RenderNode {
|
|
|
422
426
|
* @param {EmptyTerrain} terrain - Terrain provider.
|
|
423
427
|
*/
|
|
424
428
|
setTerrain(terrain: EmptyTerrain): void;
|
|
429
|
+
initAtmosphereShader(atmosParams?: AtmosphereParameters): void;
|
|
430
|
+
get atmosphereControl(): Atmosphere;
|
|
425
431
|
protected _initializeAtmosphere(): void;
|
|
426
432
|
protected _initializeShaders(): void;
|
|
427
433
|
protected _onLayerLoadend(layer: Layer): void;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { Program } from '../webgl/Program';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
import { NumberArray3 } from "../math/Vec3";
|
|
3
|
+
export interface AtmosphereParameters {
|
|
4
|
+
ATMOS_HEIGHT: number;
|
|
5
|
+
RAYLEIGH_SCALE: number;
|
|
6
|
+
MIE_SCALE: number;
|
|
7
|
+
GROUND_ALBEDO: number;
|
|
8
|
+
BOTTOM_RADIUS: number;
|
|
9
|
+
rayleighScatteringCoefficient: NumberArray3;
|
|
10
|
+
mieScatteringCoefficient: number;
|
|
11
|
+
mieExtinctionCoefficient: number;
|
|
12
|
+
ozoneAbsorptionCoefficient: NumberArray3;
|
|
13
|
+
SUN_ANGULAR_RADIUS: number;
|
|
14
|
+
SUN_INTENSITY: number;
|
|
15
|
+
ozoneDensityHeight: number;
|
|
16
|
+
ozoneDensityWide: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const COMMON: (atmosParams?: AtmosphereParameters) => string;
|
|
19
|
+
export declare function transmittance(atmosParams?: AtmosphereParameters): Program;
|
|
20
|
+
export declare function scattering(atmosParams?: AtmosphereParameters): Program;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AtmosphereParameters } from "./atmos";
|
|
1
2
|
import { Program } from "../webgl/Program";
|
|
2
3
|
export declare function drawnode_screen_nl(): Program;
|
|
3
4
|
export declare function drawnode_screen_wl_webgl1NoAtmos(): Program;
|
|
4
5
|
export declare function drawnode_screen_wl_webgl2NoAtmos(): Program;
|
|
5
|
-
export declare function drawnode_screen_wl_webgl2Atmos(): Program;
|
|
6
|
+
export declare function drawnode_screen_wl_webgl2Atmos(atmosParams?: AtmosphereParameters): Program;
|
|
6
7
|
export declare function drawnode_colorPicking(): Program;
|
|
7
8
|
export declare function drawnode_heightPicking(): Program;
|
|
8
9
|
export declare function drawnode_depth(): Program;
|
|
@@ -56,6 +56,7 @@ export interface IDefaultTextureParams {
|
|
|
56
56
|
* @param {Array.<string>} [params.extensions] - Additional WebGL extension list. Available by default: EXT_texture_filter_anisotropic.
|
|
57
57
|
*/
|
|
58
58
|
declare class Handler {
|
|
59
|
+
protected _throttledDrawFrame: () => void;
|
|
59
60
|
/**
|
|
60
61
|
* Events.
|
|
61
62
|
* @public
|
|
@@ -158,6 +159,7 @@ declare class Handler {
|
|
|
158
159
|
resizeObserver?: ResizeObserver;
|
|
159
160
|
protected _requestAnimationFrameId: number;
|
|
160
161
|
constructor(canvasTarget: string | HTMLCanvasElement | undefined, params?: IHandlerParameters);
|
|
162
|
+
set frameDelay(delay: number);
|
|
161
163
|
isInitialized(): boolean;
|
|
162
164
|
protected _createCanvas(): void;
|
|
163
165
|
/**
|
|
@@ -431,7 +433,7 @@ declare class Handler {
|
|
|
431
433
|
* Draw single frame.
|
|
432
434
|
* @public
|
|
433
435
|
*/
|
|
434
|
-
drawFrame()
|
|
436
|
+
drawFrame: () => void;
|
|
435
437
|
/**
|
|
436
438
|
* Clearing gl frame.
|
|
437
439
|
* @public
|