@openglobus/og 0.15.1 → 0.15.3
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 +10 -4
- package/css/og.css +44 -45
- 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 +12 -12
- package/src/og/Clock.js +1 -1
- package/src/og/Events.js +1 -1
- package/src/og/Extent.js +1 -1
- package/src/og/Globe.js +3 -5
- package/src/og/Popup.js +38 -63
- package/src/og/astro/earth.js +2 -2
- package/src/og/astro/rotation.js +2 -2
- package/src/og/bv/Box.js +1 -0
- package/src/og/bv/index.js +1 -1
- package/src/og/camera/Camera.js +4 -4
- package/src/og/camera/PlanetCamera.js +26 -6
- package/src/og/camera/index.js +1 -1
- package/src/og/control/Atmosphere.js +3 -8
- package/src/og/control/CompassButton.js +4 -5
- package/src/og/control/EarthCoordinates.js +3 -2
- package/src/og/control/EarthNavigation.js +0 -1
- package/src/og/control/GeoImageDragControl.js +2 -2
- package/src/og/control/KeyboardNavigation.js +3 -2
- package/src/og/control/LayerAnimation.js +2 -2
- package/src/og/control/LayerSwitcher.js +5 -4
- package/src/og/control/Lighting.js +106 -35
- package/src/og/control/MouseNavigation.js +4 -4
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/RulerSwitcher.js +4 -3
- package/src/og/control/ScaleControl.js +2 -2
- package/src/og/control/ShowFps.js +2 -1
- package/src/og/control/SimpleNavigation.js +2 -1
- package/src/og/control/SimpleSkyBackground.js +2 -2
- package/src/og/control/Sun.js +8 -1
- package/src/og/control/ToggleWireframe.js +2 -1
- package/src/og/control/TouchNavigation.js +4 -3
- package/src/og/control/ZoomControl.js +6 -5
- package/src/og/control/index.js +10 -10
- package/src/og/control/ruler/RulerScene.js +19 -11
- package/src/og/control/selection/Selection.js +1 -1
- package/src/og/control/selection/SelectionScene.js +5 -8
- package/src/og/control/timeline/TimelineControl.js +3 -4
- package/src/og/control/timeline/TimelineModel.js +2 -2
- package/src/og/control/timeline/TimelineView.js +10 -5
- package/src/og/control/visibleExtent/Segment.js +5 -5
- package/src/og/control/visibleExtent/VisibleExtent.js +1 -1
- package/src/og/ellipsoid/Ellipsoid.js +3 -3
- package/src/og/entity/BaseBillboard.js +2 -2
- package/src/og/entity/BillboardHandler.js +10 -2
- package/src/og/entity/Entity.js +10 -51
- package/src/og/entity/EntityCollection.js +3 -20
- package/src/og/entity/GeoObject.js +2 -4
- package/src/og/entity/GeoObjectHandler.js +12 -11
- package/src/og/entity/Geometry.js +2 -2
- package/src/og/entity/GeometryHandler.js +2 -2
- package/src/og/entity/Label.js +2 -2
- package/src/og/entity/LabelHandler.js +7 -5
- package/src/og/entity/Polyline.js +8 -7
- package/src/og/entity/Ray.js +1 -2
- package/src/og/entity/RayHandler.js +4 -0
- package/src/og/entity/Strip.js +8 -5
- package/src/og/entity/index.js +1 -1
- package/src/og/index.core.js +4 -4
- package/src/og/index.js +4 -4
- package/src/og/index.webgl.js +3 -3
- package/src/og/layer/BaseGeoImage.js +2 -2
- package/src/og/layer/GeoImage.js +2 -2
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/Layer.js +3 -3
- package/src/og/layer/Vector.js +7 -11
- package/src/og/layer/WMS.js +2 -1
- package/src/og/layer/XYZ.js +2 -4
- package/src/og/math/Line3.js +0 -1
- package/src/og/math/Plane.js +0 -1
- package/src/og/math/Ray.js +0 -1
- package/src/og/math/Vec2.js +62 -62
- package/src/og/math/Vec3.js +1 -1
- package/src/og/math/Vec4.js +1 -1
- package/src/og/math/index.js +1 -1
- package/src/og/proj/EPSG3857.js +1 -1
- package/src/og/proj/EPSG4326.js +1 -1
- package/src/og/quadTree/EarthQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/MarsQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/Node.js +1 -1
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +4 -4
- package/src/og/quadTree/index.js +2 -2
- package/src/og/renderer/Renderer.js +196 -77
- package/src/og/renderer/RendererEvents.js +35 -10
- package/src/og/scene/Axes.js +2 -2
- package/src/og/scene/Planet.js +47 -75
- package/src/og/scene/RenderNode.js +2 -13
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/scene/index.js +2 -2
- package/src/og/segment/Segment.js +5 -5
- package/src/og/segment/SegmentLonLatWgs84.js +2 -3
- package/src/og/shaders/drawnode.js +5 -1
- package/src/og/shaders/geoObject.js +2 -6
- package/src/og/shaders/pickingMask.js +31 -0
- package/src/og/shaders/polyline.js +212 -212
- package/src/og/terrain/BilTerrain.js +4 -4
- package/src/og/terrain/GlobusTerrain.js +7 -7
- package/src/og/terrain/MapboxTerrain.js +2 -2
- package/src/og/terrain/index.js +2 -2
- package/src/og/ui/Button.js +5 -4
- package/src/og/ui/Dialog.js +3 -6
- package/src/og/ui/Slider.js +29 -3
- package/src/og/ui/View.js +5 -5
- package/src/og/ui/icons.js +3 -0
- package/src/og/utils/FontAtlas.js +2 -2
- package/src/og/utils/GeoImageCreator.js +0 -1
- package/src/og/utils/NormalMapCreator.js +6 -5
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/VectorTileCreator.js +4 -4
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Framebuffer.js +3 -1
- package/src/og/webgl/Handler.js +77 -62
- package/src/og/webgl/Multisample.js +18 -7
- package/src/og/webgl/Program.js +2 -2
- package/src/og/webgl/index.js +2 -2
- package/types/Popup.d.ts +8 -21
- package/types/camera/PlanetCamera.d.ts +1 -0
- package/types/control/Sun.d.ts +1 -0
- package/types/control/ruler/RulerScene.d.ts +4 -3
- package/types/entity/Entity.d.ts +2 -19
- package/types/entity/EntityCollection.d.ts +0 -7
- package/types/math/Vec2.d.ts +95 -95
- package/types/renderer/Renderer.d.ts +28 -16
- package/types/scene/Planet.d.ts +2 -7
- package/types/shaders/pickingMask.d.ts +2 -0
- package/types/ui/Slider.d.ts +3 -0
- package/types/ui/View.d.ts +1 -0
- package/types/ui/icons.d.ts +1 -0
- package/types/webgl/Framebuffer.d.ts +1 -0
- package/types/webgl/Handler.d.ts +3 -2
- package/src/og/entity/ShapeHandler.js +0 -99
- package/src/og/shaders/shape.js +0 -135
- package/src/og/shapes/BaseShape.js +0 -557
- package/src/og/shapes/Icosphere.js +0 -179
- package/src/og/shapes/Sphere.js +0 -100
- package/types/entity/ShapeHandler.d.ts +0 -22
- package/types/shaders/shape.d.ts +0 -4
- package/types/shapes/BaseShape.d.ts +0 -250
- package/types/shapes/Sphere.d.ts +0 -41
package/types/math/Vec2.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @function
|
|
4
4
|
* @param {number} [x] - First cvalue.
|
|
5
5
|
* @param {number} [y] - Second value.
|
|
6
|
-
* @returns {
|
|
6
|
+
* @returns {Vec2}
|
|
7
7
|
*/
|
|
8
|
-
export function vec2(x?: number, y?: number):
|
|
8
|
+
export function vec2(x?: number, y?: number): Vec2;
|
|
9
9
|
/**
|
|
10
10
|
* Class represents a 3d vector.
|
|
11
11
|
* @class
|
|
@@ -26,67 +26,67 @@ export class Vec2 {
|
|
|
26
26
|
/**
|
|
27
27
|
* Returns summary vector.
|
|
28
28
|
* @static
|
|
29
|
-
* @param {
|
|
30
|
-
* @param {
|
|
31
|
-
* @returns {
|
|
29
|
+
* @param {Vec2} a - First vector.
|
|
30
|
+
* @param {Vec2} b - Second vector.
|
|
31
|
+
* @returns {Vec2} - Summary vector.
|
|
32
32
|
*/
|
|
33
|
-
static add(a:
|
|
33
|
+
static add(a: Vec2, b: Vec2): Vec2;
|
|
34
34
|
/**
|
|
35
35
|
* Returns two vectors subtraction.
|
|
36
36
|
* @static
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {
|
|
39
|
-
* @returns {
|
|
37
|
+
* @param {Vec2} a - First vector.
|
|
38
|
+
* @param {Vec2} b - Second vector.
|
|
39
|
+
* @returns {Vec2} - Vectors subtraction.
|
|
40
40
|
*/
|
|
41
|
-
static sub(a:
|
|
41
|
+
static sub(a: Vec2, b: Vec2): Vec2;
|
|
42
42
|
/**
|
|
43
43
|
* Returns scaled vector.
|
|
44
44
|
* @static
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {Vec2} a - Input vector.
|
|
46
46
|
* @param {number} scale - Scale value.
|
|
47
|
-
* @returns {
|
|
47
|
+
* @returns {Vec2}
|
|
48
48
|
*/
|
|
49
|
-
static scale(a:
|
|
49
|
+
static scale(a: Vec2, scale: number): Vec2;
|
|
50
50
|
/**
|
|
51
51
|
* Returns two vectors production.
|
|
52
52
|
* @static
|
|
53
|
-
* @param {
|
|
54
|
-
* @param {
|
|
55
|
-
* @returns {
|
|
53
|
+
* @param {Vec2} a - First vector.
|
|
54
|
+
* @param {Vec2} b - Second vector.
|
|
55
|
+
* @returns {Vec2}
|
|
56
56
|
*/
|
|
57
|
-
static mul(a:
|
|
57
|
+
static mul(a: Vec2, b: Vec2): Vec2;
|
|
58
58
|
/**
|
|
59
59
|
* Returns vector components division product one to another.
|
|
60
60
|
* @static
|
|
61
|
-
* @param {
|
|
62
|
-
* @param {
|
|
63
|
-
* @returns {
|
|
61
|
+
* @param {Vec2} a - First vector.
|
|
62
|
+
* @param {Vec2} b - Second vector.
|
|
63
|
+
* @returns {Vec2}
|
|
64
64
|
*/
|
|
65
|
-
static div(a:
|
|
65
|
+
static div(a: Vec2, b: Vec2): Vec2;
|
|
66
66
|
/**
|
|
67
67
|
* Get projection of the first vector to the second.
|
|
68
68
|
* @static
|
|
69
|
-
* @param {
|
|
70
|
-
* @param {
|
|
71
|
-
* @returns {
|
|
69
|
+
* @param {Vec2} b - First vector.
|
|
70
|
+
* @param {Vec2} a - Second vector.
|
|
71
|
+
* @returns {Vec2}
|
|
72
72
|
*/
|
|
73
|
-
static proj_b_to_a(b:
|
|
73
|
+
static proj_b_to_a(b: Vec2, a: Vec2): Vec2;
|
|
74
74
|
/**
|
|
75
75
|
* Gets angle between two vectors.
|
|
76
76
|
* @static
|
|
77
|
-
* @param {
|
|
78
|
-
* @param {
|
|
77
|
+
* @param {Vec2} a - First vector.
|
|
78
|
+
* @param {Vec2} b - Second vector.
|
|
79
79
|
* @returns {number}
|
|
80
80
|
*/
|
|
81
|
-
static angle(a:
|
|
81
|
+
static angle(a: Vec2, b: Vec2): number;
|
|
82
82
|
/**
|
|
83
83
|
* Makes vectors normalized and orthogonal to each other.
|
|
84
84
|
* @static
|
|
85
|
-
* @param {
|
|
86
|
-
* @param {
|
|
87
|
-
* @returns {
|
|
85
|
+
* @param {Vec2} normal - Normal vector.
|
|
86
|
+
* @param {Vec2} tangent - Tangent vector.
|
|
87
|
+
* @returns {Vec2}
|
|
88
88
|
*/
|
|
89
|
-
static orthoNormalize(normal:
|
|
89
|
+
static orthoNormalize(normal: Vec2, tangent: Vec2): Vec2;
|
|
90
90
|
static get LERP_DELTA(): number;
|
|
91
91
|
constructor(x?: number, y?: number);
|
|
92
92
|
/**
|
|
@@ -108,22 +108,22 @@ export class Vec2 {
|
|
|
108
108
|
/**
|
|
109
109
|
* Returns clone vector.
|
|
110
110
|
* @public
|
|
111
|
-
* @returns {
|
|
111
|
+
* @returns {Vec2}
|
|
112
112
|
*/
|
|
113
|
-
public clone():
|
|
113
|
+
public clone(): Vec2;
|
|
114
114
|
/**
|
|
115
115
|
* Compares with vector. Returns true if it equals another.
|
|
116
116
|
* @public
|
|
117
|
-
* @param {
|
|
117
|
+
* @param {Vec2} p - Vector to compare.
|
|
118
118
|
* @returns {boolean}
|
|
119
119
|
*/
|
|
120
|
-
public equal(p:
|
|
120
|
+
public equal(p: Vec2): boolean;
|
|
121
121
|
/**
|
|
122
122
|
* Copy input vector's values.
|
|
123
|
-
* @param {
|
|
124
|
-
* @returns {
|
|
123
|
+
* @param {Vec2} point2 - Vector to copy.
|
|
124
|
+
* @returns {Vec2}
|
|
125
125
|
*/
|
|
126
|
-
copy(point2:
|
|
126
|
+
copy(point2: Vec2): Vec2;
|
|
127
127
|
/**
|
|
128
128
|
* Gets vector's length.
|
|
129
129
|
* @public
|
|
@@ -139,73 +139,73 @@ export class Vec2 {
|
|
|
139
139
|
/**
|
|
140
140
|
* Adds vector to the current.
|
|
141
141
|
* @public
|
|
142
|
-
* @param {
|
|
143
|
-
* @returns {
|
|
142
|
+
* @param {Vec2}
|
|
143
|
+
* @returns {Vec2}
|
|
144
144
|
*/
|
|
145
|
-
public addA(v: any):
|
|
145
|
+
public addA(v: any): Vec2;
|
|
146
146
|
/**
|
|
147
147
|
* Summarize two vectors.
|
|
148
148
|
* @public
|
|
149
|
-
* @param {
|
|
150
|
-
* @returns {
|
|
149
|
+
* @param {Vec2}
|
|
150
|
+
* @returns {Vec2}
|
|
151
151
|
*/
|
|
152
|
-
public add(v: any):
|
|
152
|
+
public add(v: any): Vec2;
|
|
153
153
|
/**
|
|
154
154
|
* Subtract vector from the current where results saved on the current instance.
|
|
155
155
|
* @public
|
|
156
|
-
* @param {
|
|
157
|
-
* @returns {
|
|
156
|
+
* @param {Vec2} v - Subtract vector.
|
|
157
|
+
* @returns {Vec2}
|
|
158
158
|
*/
|
|
159
|
-
public subA(v:
|
|
159
|
+
public subA(v: Vec2): Vec2;
|
|
160
160
|
/**
|
|
161
161
|
* Subtract vector from the current.
|
|
162
162
|
* @public
|
|
163
|
-
* @param {
|
|
164
|
-
* @returns {
|
|
163
|
+
* @param {Vec2} v - Subtract vector.
|
|
164
|
+
* @returns {Vec2}
|
|
165
165
|
*/
|
|
166
|
-
public sub(v:
|
|
166
|
+
public sub(v: Vec2): Vec2;
|
|
167
167
|
/**
|
|
168
168
|
* Scale current vector.
|
|
169
169
|
* @public
|
|
170
170
|
* @param {number} scale - Scale value.
|
|
171
|
-
* @returns {
|
|
171
|
+
* @returns {Vec2}
|
|
172
172
|
*/
|
|
173
|
-
public scale(scale: number):
|
|
173
|
+
public scale(scale: number): Vec2;
|
|
174
174
|
/**
|
|
175
175
|
* Scale current vector to another instance.
|
|
176
176
|
* @public
|
|
177
177
|
* @param {number} scale - Scale value.
|
|
178
|
-
* @returns {
|
|
178
|
+
* @returns {Vec2}
|
|
179
179
|
*/
|
|
180
|
-
public scaleTo(scale: number):
|
|
180
|
+
public scaleTo(scale: number): Vec2;
|
|
181
181
|
/**
|
|
182
182
|
* Multiply current vector object to another and store result in the current instance.
|
|
183
183
|
* @public
|
|
184
|
-
* @param {
|
|
185
|
-
* @returns {
|
|
184
|
+
* @param {Vec2} vec - Multiply vector.
|
|
185
|
+
* @returns {Vec2}
|
|
186
186
|
*/
|
|
187
|
-
public mulA(vec:
|
|
187
|
+
public mulA(vec: Vec2): Vec2;
|
|
188
188
|
/**
|
|
189
189
|
* Multiply current vector object to another and returns new vector instance.
|
|
190
190
|
* @public
|
|
191
|
-
* @param {
|
|
192
|
-
* @returns {
|
|
191
|
+
* @param {Vec2} vec - Multiply vector.
|
|
192
|
+
* @returns {Vec2}
|
|
193
193
|
*/
|
|
194
|
-
public mul(vec:
|
|
194
|
+
public mul(vec: Vec2): Vec2;
|
|
195
195
|
/**
|
|
196
196
|
* Divide current vector's components to another. Results stores in the current vector object.
|
|
197
197
|
* @public
|
|
198
|
-
* @param {
|
|
199
|
-
* @returns {
|
|
198
|
+
* @param {Vec2}
|
|
199
|
+
* @returns {Vec2}
|
|
200
200
|
*/
|
|
201
|
-
public divA(vec: any):
|
|
201
|
+
public divA(vec: any): Vec2;
|
|
202
202
|
/**
|
|
203
203
|
* Gets vectors dot production.
|
|
204
204
|
* @public
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {Vec2} v - Another vector.
|
|
206
206
|
* @returns {number}
|
|
207
207
|
*/
|
|
208
|
-
public dot(v:
|
|
208
|
+
public dot(v: Vec2): number;
|
|
209
209
|
/**
|
|
210
210
|
* Gets vectors dot production.
|
|
211
211
|
* @public
|
|
@@ -216,28 +216,28 @@ export class Vec2 {
|
|
|
216
216
|
/**
|
|
217
217
|
* Gets vectors cross production.
|
|
218
218
|
* @public
|
|
219
|
-
* @param {
|
|
220
|
-
* @returns {
|
|
219
|
+
* @param {Vec2} v - Another vector.
|
|
220
|
+
* @returns {Vec2}
|
|
221
221
|
*/
|
|
222
|
-
public cross(v:
|
|
222
|
+
public cross(v: Vec2): Vec2;
|
|
223
223
|
/**
|
|
224
224
|
* Sets vector to zero.
|
|
225
225
|
* @public
|
|
226
|
-
* @returns {
|
|
226
|
+
* @returns {Vec2}
|
|
227
227
|
*/
|
|
228
|
-
public clear():
|
|
228
|
+
public clear(): Vec2;
|
|
229
229
|
/**
|
|
230
230
|
* Returns normalized vector.
|
|
231
231
|
* @public
|
|
232
|
-
* @returns {
|
|
232
|
+
* @returns {Vec2}
|
|
233
233
|
*/
|
|
234
|
-
public normal():
|
|
234
|
+
public normal(): Vec2;
|
|
235
235
|
/**
|
|
236
236
|
* Normalize current vector.
|
|
237
237
|
* @public
|
|
238
|
-
* @returns {
|
|
238
|
+
* @returns {Vec2}
|
|
239
239
|
*/
|
|
240
|
-
public normalize():
|
|
240
|
+
public normalize(): Vec2;
|
|
241
241
|
/**
|
|
242
242
|
* Converts vector to a number array.
|
|
243
243
|
* @public
|
|
@@ -247,63 +247,63 @@ export class Vec2 {
|
|
|
247
247
|
/**
|
|
248
248
|
* Gets distance to point.
|
|
249
249
|
* @public
|
|
250
|
-
* @param {
|
|
250
|
+
* @param {Vec2} p - Distant point.
|
|
251
251
|
* @returns {number}
|
|
252
252
|
*/
|
|
253
|
-
public distance(p:
|
|
253
|
+
public distance(p: Vec2): number;
|
|
254
254
|
/**
|
|
255
255
|
* Sets vector's values.
|
|
256
256
|
* @public
|
|
257
257
|
* @param {number} x - Value X.
|
|
258
258
|
* @param {number} y - Value Y.
|
|
259
|
-
* @returns {
|
|
259
|
+
* @returns {Vec2}
|
|
260
260
|
*/
|
|
261
|
-
public set(x: number, y: number):
|
|
261
|
+
public set(x: number, y: number): Vec2;
|
|
262
262
|
/**
|
|
263
263
|
* Negate current vector.
|
|
264
264
|
* @public
|
|
265
|
-
* @returns {
|
|
265
|
+
* @returns {Vec2}
|
|
266
266
|
*/
|
|
267
|
-
public negate():
|
|
267
|
+
public negate(): Vec2;
|
|
268
268
|
/**
|
|
269
269
|
* Negate current vector to another instance.
|
|
270
270
|
* @public
|
|
271
|
-
* @returns {
|
|
271
|
+
* @returns {Vec2}
|
|
272
272
|
*/
|
|
273
|
-
public negateTo():
|
|
273
|
+
public negateTo(): Vec2;
|
|
274
274
|
/**
|
|
275
275
|
* Gets projected point coordinates of the current vector on the ray.
|
|
276
276
|
* @public
|
|
277
|
-
* @param {
|
|
278
|
-
* @param {
|
|
279
|
-
* @returns {
|
|
277
|
+
* @param {Vec2} pos - Ray position.
|
|
278
|
+
* @param {Vec2} direction - Ray direction.
|
|
279
|
+
* @returns {Vec2}
|
|
280
280
|
*/
|
|
281
|
-
public projToRay(pos:
|
|
281
|
+
public projToRay(pos: Vec2, direction: Vec2): Vec2;
|
|
282
282
|
/**
|
|
283
283
|
* Gets angle between two vectors.
|
|
284
284
|
* @public
|
|
285
|
-
* @param {
|
|
285
|
+
* @param {Vec2} a - Another vector.
|
|
286
286
|
* @returns {number}
|
|
287
287
|
*/
|
|
288
|
-
public angle(a:
|
|
288
|
+
public angle(a: Vec2): number;
|
|
289
289
|
/**
|
|
290
290
|
* Returns two vectors linear interpolation.
|
|
291
291
|
* @public
|
|
292
|
-
* @param {
|
|
292
|
+
* @param {Vec2} v2 - End vector.
|
|
293
293
|
* @param {number} l - Interpolate value.
|
|
294
|
-
* @returns {
|
|
294
|
+
* @returns {Vec2}
|
|
295
295
|
*/
|
|
296
|
-
public lerp(v1: any, v2:
|
|
296
|
+
public lerp(v1: any, v2: Vec2, l: number): Vec2;
|
|
297
297
|
/**
|
|
298
298
|
* Spherically interpolates between two vectors.
|
|
299
299
|
* Interpolates between current and v2 vector by amount t. The difference between this and linear interpolation (aka, "lerp") is that
|
|
300
300
|
* the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
|
|
301
301
|
* by the angle and its magnitude is interpolated between the magnitudes of from and to.
|
|
302
302
|
* @public
|
|
303
|
-
* @param {
|
|
303
|
+
* @param {Vec2} v2 -
|
|
304
304
|
* @param {number} t - The parameter t is clamped to the range [0, 1].
|
|
305
|
-
* @returns {
|
|
305
|
+
* @returns {Vec2}
|
|
306
306
|
*/
|
|
307
|
-
public slerp(v2:
|
|
307
|
+
public slerp(v2: Vec2, t: number): Vec2;
|
|
308
308
|
}
|
|
309
309
|
import { Vec3 } from "./Vec3.js";
|
|
@@ -69,32 +69,30 @@ export class Renderer {
|
|
|
69
69
|
* @type {Framebuffer}
|
|
70
70
|
*/
|
|
71
71
|
public pickingFramebuffer: Framebuffer;
|
|
72
|
+
_tempPickingPix_: Uint8Array;
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
* @type {Framebuffer}
|
|
76
|
+
*/
|
|
77
|
+
public distanceFramebuffer: Framebuffer;
|
|
78
|
+
/**
|
|
79
|
+
* @type {Array.<Renderer~distanceCallback>}
|
|
80
|
+
*/
|
|
81
|
+
_distanceCallbacks: Array<Renderer>;
|
|
82
|
+
_tempDistancePix_: Uint8Array;
|
|
72
83
|
/**
|
|
73
84
|
* Depth objects rendering queue.
|
|
74
85
|
* @type {Array.<Renderer~depthCallback>}
|
|
75
86
|
*/
|
|
76
87
|
_depthCallbacks: Array<Renderer>;
|
|
77
88
|
depthFramebuffer: Framebuffer;
|
|
78
|
-
_msaa:
|
|
89
|
+
_msaa: number;
|
|
79
90
|
_internalFormat: string;
|
|
80
91
|
_format: string;
|
|
81
92
|
_type: string;
|
|
82
93
|
sceneFramebuffer: Framebuffer | Multisample;
|
|
83
94
|
blitFramebuffer: Framebuffer;
|
|
84
95
|
toneMappingFramebuffer: Framebuffer;
|
|
85
|
-
/**
|
|
86
|
-
* Stores current picking rgb color.
|
|
87
|
-
* @private
|
|
88
|
-
* @type {Array.<number>} - (exactly 3 entries)
|
|
89
|
-
*/
|
|
90
|
-
private _currPickingColor;
|
|
91
|
-
/**
|
|
92
|
-
* Stores previous picked rgb color.
|
|
93
|
-
* @private
|
|
94
|
-
* @type {Array.<number>} - (exactly 3 entries)
|
|
95
|
-
*/
|
|
96
|
-
private _prevPickingColor;
|
|
97
|
-
_tempPickingColor_: Uint8Array;
|
|
98
96
|
_initialized: boolean;
|
|
99
97
|
/**
|
|
100
98
|
* Texture atlas for the billboards images. One atlas per node.
|
|
@@ -118,6 +116,7 @@ export class Renderer {
|
|
|
118
116
|
_currentOutput: string;
|
|
119
117
|
_fnScreenFrame: (() => void) | (() => void);
|
|
120
118
|
labelWorker: LabelWorker;
|
|
119
|
+
__useDistanceFramebuffer__: boolean;
|
|
121
120
|
/**
|
|
122
121
|
* Sets renderer events activity.
|
|
123
122
|
* @param {Boolean} activity - Events activity.
|
|
@@ -125,6 +124,8 @@ export class Renderer {
|
|
|
125
124
|
setEventsActivity(activity: boolean): void;
|
|
126
125
|
addDepthCallback(sender: any, callback: any): number;
|
|
127
126
|
removeDepthCallback(id: any): void;
|
|
127
|
+
addDistanceCallback(sender: any, callback: any): number;
|
|
128
|
+
removeDistanceCallback(id: any): void;
|
|
128
129
|
/**
|
|
129
130
|
* Adds picking rendering callback function.
|
|
130
131
|
* @param {object} sender - Callback context.
|
|
@@ -192,16 +193,19 @@ export class Renderer {
|
|
|
192
193
|
screenTexture: {
|
|
193
194
|
screen: any;
|
|
194
195
|
picking: any;
|
|
196
|
+
distance: any;
|
|
195
197
|
depth: any;
|
|
196
198
|
frustum?: undefined;
|
|
197
199
|
} | {
|
|
198
200
|
screen: any;
|
|
199
201
|
picking: any;
|
|
202
|
+
distance: any;
|
|
200
203
|
depth: any;
|
|
201
204
|
frustum: any;
|
|
202
205
|
};
|
|
203
206
|
screenFramePositionBuffer: any;
|
|
204
207
|
outputTexture: any;
|
|
208
|
+
_pickingMaskCoordinatesBuffer: any;
|
|
205
209
|
resize(): void;
|
|
206
210
|
setCurrentScreen(screenName: any): void;
|
|
207
211
|
_resizeStart(): void;
|
|
@@ -226,7 +230,7 @@ export class Renderer {
|
|
|
226
230
|
*/
|
|
227
231
|
public addNodes(nodesArr: Array<scene.RenderNode>): void;
|
|
228
232
|
getMaxMSAA(internalFormat: any): any;
|
|
229
|
-
getMSAA():
|
|
233
|
+
getMSAA(): number;
|
|
230
234
|
/**
|
|
231
235
|
* TODO: replace with cahce frendly linked list by bilboardHandler, label handler etc.
|
|
232
236
|
*/
|
|
@@ -249,8 +253,16 @@ export class Renderer {
|
|
|
249
253
|
* @private
|
|
250
254
|
*/
|
|
251
255
|
private _drawPickingBuffer;
|
|
256
|
+
/**
|
|
257
|
+
* Draw picking objects framebuffer.
|
|
258
|
+
* @private
|
|
259
|
+
*/
|
|
260
|
+
private _drawDistanceBuffer;
|
|
252
261
|
_drawDepthBuffer(): void;
|
|
253
|
-
|
|
262
|
+
_readPickingBuffer(): void;
|
|
263
|
+
_readDistanceBuffer(): void;
|
|
264
|
+
readPickingColor(x: any, y: any, outColor: any): void;
|
|
265
|
+
readDistanceColor(x: any, y: any, outColor: any): void;
|
|
254
266
|
/**
|
|
255
267
|
* Function starts rendering.
|
|
256
268
|
* @public
|
package/types/scene/Planet.d.ts
CHANGED
|
@@ -178,12 +178,6 @@ export class Planet extends RenderNode {
|
|
|
178
178
|
* @type {Array.<Array.<number>>}
|
|
179
179
|
*/
|
|
180
180
|
protected _textureCoordsBufferCache: Array<Array<number>>;
|
|
181
|
-
/**
|
|
182
|
-
* Framebuffer for relief. Is null when WEBGL_draw_buffers extension initialized.
|
|
183
|
-
* @protected
|
|
184
|
-
* @type {Object}
|
|
185
|
-
*/
|
|
186
|
-
protected _heightPickingFramebuffer: any;
|
|
187
181
|
quadTreeStrategy: any;
|
|
188
182
|
/**
|
|
189
183
|
* Night glowing gl texture.
|
|
@@ -374,6 +368,7 @@ export class Planet extends RenderNode {
|
|
|
374
368
|
* @param{Object} param1 -
|
|
375
369
|
*/
|
|
376
370
|
public createDefaultTextures(param0: any, param1: any): void;
|
|
371
|
+
_getLayerAttributionHTML(layer: any): string;
|
|
377
372
|
/**
|
|
378
373
|
* Updates attribution lists
|
|
379
374
|
* @public
|
|
@@ -420,7 +415,7 @@ export class Planet extends RenderNode {
|
|
|
420
415
|
/**
|
|
421
416
|
* @protected
|
|
422
417
|
*/
|
|
423
|
-
protected
|
|
418
|
+
protected _renderDistanceFramebufferPASS(): void;
|
|
424
419
|
/**
|
|
425
420
|
* @protected
|
|
426
421
|
*/
|
package/types/ui/Slider.d.ts
CHANGED
|
@@ -17,7 +17,10 @@ export class Slider extends View {
|
|
|
17
17
|
_onMouseDown_: any;
|
|
18
18
|
_onInput_: any;
|
|
19
19
|
_onMouseWheel_: any;
|
|
20
|
+
_onMouseWheelFF_: any;
|
|
21
|
+
_clearEvents(): void;
|
|
20
22
|
_onMouseWheel(e: any): void;
|
|
23
|
+
_onMouseWheelFF(e: any): void;
|
|
21
24
|
_onInput(e: any): void;
|
|
22
25
|
_onMouseDown(e: any): void;
|
|
23
26
|
_startPosX: any;
|
package/types/ui/View.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CLOSE_ICON: "<svg className=\"svg-icon\" style=\"width: 1em; height: 1em;vertical-align: middle;fill: currentColor; overflow: hidden;\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M777.856 280.192l-33.92-33.952-231.872 231.872-231.84-231.872-33.984 33.888 231.872 231.904-231.84 231.84 33.888 33.984 231.904-231.904 231.84 231.872 33.952-33.888-231.872-231.904z\"/>\n</svg>";
|
package/types/webgl/Handler.d.ts
CHANGED
|
@@ -107,7 +107,6 @@ export class Handler {
|
|
|
107
107
|
};
|
|
108
108
|
createTextureDefault: any;
|
|
109
109
|
ONCANVASRESIZE: any;
|
|
110
|
-
createTexture_n: (image: any, internalFormat: any, texture: any) => any;
|
|
111
110
|
/**
|
|
112
111
|
* Sets animation frame function.
|
|
113
112
|
* @public
|
|
@@ -256,10 +255,12 @@ export class Handler {
|
|
|
256
255
|
* @public
|
|
257
256
|
*/
|
|
258
257
|
public initialize(): void;
|
|
258
|
+
createTexture_n: any;
|
|
259
259
|
createTexture_l: any;
|
|
260
260
|
createTexture_mm: any;
|
|
261
261
|
createTexture_a: any;
|
|
262
|
-
|
|
262
|
+
intersectionObserver: IntersectionObserver;
|
|
263
|
+
resizeObserver: ResizeObserver;
|
|
263
264
|
_toggleVisibilityChange(visibility: any): void;
|
|
264
265
|
/**
|
|
265
266
|
* Sets default gl render parameters. Used in init function.
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/ShapeHandler
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
import * as shaders from '../shaders/shape.js';
|
|
8
|
-
|
|
9
|
-
class ShapeHandler {
|
|
10
|
-
constructor(entityCollection) {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Picking rendering option.
|
|
14
|
-
* @public
|
|
15
|
-
* @type {boolean}
|
|
16
|
-
*/
|
|
17
|
-
this.pickingEnabled = true;
|
|
18
|
-
|
|
19
|
-
this._entityCollection = entityCollection;
|
|
20
|
-
|
|
21
|
-
this._renderer = null;
|
|
22
|
-
|
|
23
|
-
this._shapes = [];
|
|
24
|
-
|
|
25
|
-
this.__staticId = ShapeHandler._staticCounter++;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get _staticCounter() {
|
|
29
|
-
if (!this._counter && this._counter !== 0) {
|
|
30
|
-
this._counter = 0;
|
|
31
|
-
}
|
|
32
|
-
return this._counter;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static set _staticCounter(n) {
|
|
36
|
-
this._counter = n;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
_initProgram() {
|
|
40
|
-
if (this._renderer.handler) {
|
|
41
|
-
if (!this._renderer.handler.programs.shape_nl) {
|
|
42
|
-
this._renderer.handler.addProgram(shaders.shape_nl());
|
|
43
|
-
}
|
|
44
|
-
if (!this._renderer.handler.programs.shape_wl) {
|
|
45
|
-
this._renderer.handler.addProgram(shaders.shape_wl());
|
|
46
|
-
}
|
|
47
|
-
if (!this._renderer.handler.programs.shape_picking) {
|
|
48
|
-
this._renderer.handler.addProgram(shaders.shape_picking());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
setRenderNode(renderNode) {
|
|
54
|
-
this._renderer = renderNode.renderer;
|
|
55
|
-
this._initProgram();
|
|
56
|
-
for (var i = 0; i < this._shapes.length; i++) {
|
|
57
|
-
this._shapes[i].setRenderNode(renderNode);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
add(shape) {
|
|
62
|
-
if (shape._handlerIndex == -1) {
|
|
63
|
-
shape._handler = this;
|
|
64
|
-
shape._handlerIndex = this._shapes.length;
|
|
65
|
-
this._shapes.push(shape);
|
|
66
|
-
this._entityCollection && this._entityCollection.renderNode && shape.setRenderNode(this._entityCollection.renderNode);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
remove(shape) {
|
|
71
|
-
// TODO
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
draw() {
|
|
75
|
-
var i = this._shapes.length;
|
|
76
|
-
while (i--) {
|
|
77
|
-
this._shapes[i].draw();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
drawPicking() {
|
|
82
|
-
var i = this._shapes.length;
|
|
83
|
-
while (i--) {
|
|
84
|
-
this._shapes[i].drawPicking();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
clear() {
|
|
89
|
-
for (let i = 0, len = this._shapes.length; i < len; i++) {
|
|
90
|
-
var ri = this._shapes[i];
|
|
91
|
-
ri._handlerIndex = -1;
|
|
92
|
-
ri._handler = null;
|
|
93
|
-
}
|
|
94
|
-
this._shapes.length = 0;
|
|
95
|
-
this._shapes = [];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { ShapeHandler };
|