@openglobus/og 0.12.3 → 0.13.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 +0 -2
- 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 +7 -7
- package/src/og/Extent.js +3 -3
- package/src/og/Globe.js +277 -275
- package/src/og/ImageCanvas.js +3 -3
- package/src/og/LonLat.js +9 -9
- package/src/og/QueueArray.js +2 -2
- package/src/og/Rectangle.js +5 -5
- package/src/og/bv/Box.js +1 -1
- package/src/og/bv/Sphere.js +2 -2
- package/src/og/camera/Camera.js +1 -1
- package/src/og/camera/PlanetCamera.js +649 -646
- package/src/og/control/LayerSwitcher.js +1 -1
- package/src/og/control/MouseNavigation.js +22 -13
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/TouchNavigation.js +319 -319
- package/src/og/control/ZoomControl.js +132 -132
- package/src/og/control/visibleExtent/Segment.js +12 -12
- package/src/og/ellipsoid/Ellipsoid.js +577 -567
- package/src/og/entity/BillboardHandler.js +878 -1051
- package/src/og/entity/Entity.js +1 -1
- package/src/og/entity/EntityCollection.js +847 -857
- package/src/og/entity/GeoObjectHandler.js +2 -2
- package/src/og/entity/LabelHandler.js +888 -1040
- package/src/og/entity/LabelWorker.js +0 -6
- package/src/og/entity/PointCloud.js +495 -495
- package/src/og/entity/Polyline.js +2218 -2222
- package/src/og/entity/RayHandler.js +1 -1
- package/src/og/layer/CanvasTiles.js +6 -3
- package/src/og/layer/GeoImage.js +1 -1
- package/src/og/layer/KML.js +5 -5
- package/src/og/layer/Layer.js +804 -752
- package/src/og/layer/Vector.js +997 -1010
- package/src/og/layer/XYZ.js +359 -357
- package/src/og/math/Line2.js +4 -4
- package/src/og/math/Quat.js +2 -2
- package/src/og/math/Ray.js +2 -2
- package/src/og/math/Vec2.js +524 -524
- package/src/og/math/Vec3.js +900 -900
- package/src/og/math/Vec4.js +261 -261
- package/src/og/math.js +397 -398
- package/src/og/quadTree/EntityCollectionNode.js +389 -387
- package/src/og/renderer/Renderer.js +14 -20
- package/src/og/renderer/RendererEvents.js +1034 -1045
- package/src/og/scene/Planet.js +12 -9
- package/src/og/scene/RenderNode.js +347 -354
- package/src/og/segment/Segment.js +3 -1
- package/src/og/segment/SegmentLonLat.js +1 -4
- package/src/og/shaders/billboard.js +220 -204
- package/src/og/shaders/drawnode.js +603 -603
- package/src/og/shaders/label.js +595 -456
- package/src/og/shaders/polyline.js +365 -361
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/FontAtlas.js +209 -200
- package/src/og/utils/GeoImageCreator.js +4 -5
- package/src/og/utils/TextureAtlas.js +4 -4
- package/src/og/utils/VectorTileCreator.js +414 -414
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Handler.js +28 -60
- package/src/og/webgl/Multisample.js +260 -260
- package/src/og/webgl/Program.js +411 -396
- package/types/bv/Box.d.ts +1 -1
- package/types/bv/Sphere.d.ts +1 -1
- package/types/camera/PlanetCamera.d.ts +3 -3
- package/types/control/LayerSwitcher.d.ts +1 -1
- package/types/ellipsoid/Ellipsoid.d.ts +9 -2
- package/types/entity/BillboardHandler.d.ts +0 -4
- package/types/entity/EntityCollection.d.ts +0 -8
- package/types/entity/LabelHandler.d.ts +0 -2
- package/types/entity/Polyline.d.ts +1 -1
- package/types/layer/KML.d.ts +11 -11
- package/types/layer/Layer.d.ts +5 -0
- package/types/layer/Vector.d.ts +1 -8
- package/types/math/Line2.d.ts +4 -4
- package/types/math/Ray.d.ts +2 -2
- package/types/math/Vec2.d.ts +1 -1
- package/types/math/Vec3.d.ts +1 -1
- package/types/math/Vec4.d.ts +2 -2
- package/types/math.d.ts +1 -1
- package/types/renderer/Renderer.d.ts +1 -1
- package/types/renderer/RendererEvents.d.ts +1 -1
- package/types/shaders/label.d.ts +1 -1
- package/types/utils/FontAtlas.d.ts +3 -2
- package/types/utils/TextureAtlas.d.ts +3 -3
- package/types/utils/VectorTileCreator.d.ts +4 -4
- package/types/utils/shared.d.ts +1 -1
- package/types/webgl/Handler.d.ts +6 -31
- package/types/webgl/Program.d.ts +2 -0
|
@@ -46,8 +46,8 @@ class MouseNavigation extends Control {
|
|
|
46
46
|
|
|
47
47
|
this._lmbDoubleClickActive = true;
|
|
48
48
|
|
|
49
|
-
this.minSlope = options.minSlope || 0.1;
|
|
50
|
-
|
|
49
|
+
this.minSlope = options.minSlope || 0.1;
|
|
50
|
+
|
|
51
51
|
this._wheelDirection = +1;
|
|
52
52
|
|
|
53
53
|
this._keyLock = new Key();
|
|
@@ -75,7 +75,7 @@ class MouseNavigation extends Control {
|
|
|
75
75
|
var d = a ? (delta * cam.eye.distance(a)) / stepsCount : 1000;
|
|
76
76
|
|
|
77
77
|
if (forward) {
|
|
78
|
-
d = -1.25*d;
|
|
78
|
+
d = -1.25 * d;
|
|
79
79
|
} else {
|
|
80
80
|
d *= 2;
|
|
81
81
|
}
|
|
@@ -214,7 +214,7 @@ class MouseNavigation extends Control {
|
|
|
214
214
|
this._deactivate = true;
|
|
215
215
|
|
|
216
216
|
this.planet.layerLock.lock(this._keyLock);
|
|
217
|
-
this.planet.terrainLock.lock(this._keyLock);
|
|
217
|
+
//this.planet.terrainLock.lock(this._keyLock);
|
|
218
218
|
this.planet._normalMapCreator.lock(this._keyLock);
|
|
219
219
|
|
|
220
220
|
var ms = this.renderer.events.mouseState;
|
|
@@ -226,9 +226,9 @@ class MouseNavigation extends Control {
|
|
|
226
226
|
ms,
|
|
227
227
|
event.wheelDelta > 0,
|
|
228
228
|
ms.direction
|
|
229
|
-
);
|
|
230
|
-
|
|
231
|
-
this._wheelDirection = event.wheelDelta;
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
this._wheelDirection = event.wheelDelta;
|
|
232
232
|
|
|
233
233
|
if (this.stepsForward) {
|
|
234
234
|
this.stepIndex = this.stepsCount;
|
|
@@ -247,14 +247,23 @@ class MouseNavigation extends Control {
|
|
|
247
247
|
this.stopRotation();
|
|
248
248
|
var p = this.planet.getCartesianFromPixelTerrain(this.renderer.events.mouseState);
|
|
249
249
|
if (p) {
|
|
250
|
+
var cam = this.renderer.activeCamera;
|
|
251
|
+
let maxAlt = cam.maxAltitude + this.planet.ellipsoid._b;
|
|
252
|
+
let minAlt = cam.minAltitude + this.planet.ellipsoid._b;
|
|
253
|
+
const camAlt = cam.eye.length();
|
|
250
254
|
var g = this.planet.ellipsoid.cartesianToLonLat(p);
|
|
255
|
+
if (camAlt > maxAlt || camAlt < minAlt) {
|
|
256
|
+
this.planet.flyLonLat(new LonLat(g.lon, g.lat))
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
251
260
|
if (this.renderer.events.isKeyPressed(input.KEY_ALT)) {
|
|
252
261
|
this.planet.flyLonLat(
|
|
253
|
-
new LonLat(g.lon, g.lat,
|
|
262
|
+
new LonLat(g.lon, g.lat, cam.eye.distance(p) * 2.0)
|
|
254
263
|
);
|
|
255
264
|
} else {
|
|
256
265
|
this.planet.flyLonLat(
|
|
257
|
-
new LonLat(g.lon, g.lat,
|
|
266
|
+
new LonLat(g.lon, g.lat, cam.eye.distance(p) * 0.57)
|
|
258
267
|
);
|
|
259
268
|
}
|
|
260
269
|
}
|
|
@@ -264,7 +273,7 @@ class MouseNavigation extends Control {
|
|
|
264
273
|
if (this._active) {
|
|
265
274
|
this.renderer.handler.canvas.classList.add("ogGrabbingPoiner");
|
|
266
275
|
this.grabbedPoint = this.planet.getCartesianFromMouseTerrain();
|
|
267
|
-
if (this.grabbedPoint) {
|
|
276
|
+
if (this.grabbedPoint) {
|
|
268
277
|
this._eye0.copy(this.renderer.activeCamera.eye);
|
|
269
278
|
this.grabbedSpheroid.radius = this.grabbedPoint.length();
|
|
270
279
|
this.stopRotation();
|
|
@@ -279,7 +288,7 @@ class MouseNavigation extends Control {
|
|
|
279
288
|
this.planet._normalMapCreator.free(this._keyLock);
|
|
280
289
|
}
|
|
281
290
|
|
|
282
|
-
onMouseLeftButtonUp(e) {
|
|
291
|
+
onMouseLeftButtonUp(e) {
|
|
283
292
|
this.renderer.handler.canvas.classList.remove("ogGrabbingPoiner");
|
|
284
293
|
if (e.x === e.prev_x && e.y === e.prev_y) {
|
|
285
294
|
this.scaleRot = 0.0;
|
|
@@ -343,7 +352,7 @@ class MouseNavigation extends Control {
|
|
|
343
352
|
}
|
|
344
353
|
|
|
345
354
|
onMouseRightButtonDown(e) {
|
|
346
|
-
var cam = this.renderer.activeCamera;
|
|
355
|
+
var cam = this.renderer.activeCamera;
|
|
347
356
|
|
|
348
357
|
if (this.pointOnEarth && this.renderer.events.mouseState.moving) {
|
|
349
358
|
this.renderer.controlsBag.scaleRot = 1.0;
|
|
@@ -387,7 +396,7 @@ class MouseNavigation extends Control {
|
|
|
387
396
|
let maxAlt = cam.maxAltitude + this.planet.ellipsoid._b;
|
|
388
397
|
let minAlt = cam.minAltitude + this.planet.ellipsoid._b;
|
|
389
398
|
const camAlt = sf.eye.length();
|
|
390
|
-
if (camAlt > maxAlt || camAlt < minAlt && this._wheelDirection > 0) {
|
|
399
|
+
if (camAlt > maxAlt || camAlt < minAlt && this._wheelDirection > 0) {
|
|
391
400
|
this._wheelDirection = +1;
|
|
392
401
|
return;
|
|
393
402
|
}
|
|
@@ -120,7 +120,7 @@ class MouseWheelZoomControl extends Control {
|
|
|
120
120
|
this.planet,
|
|
121
121
|
this.stepsCount,
|
|
122
122
|
this.distDiff,
|
|
123
|
-
this.renderer.getCenter(),
|
|
123
|
+
this.renderer.handler.getCenter(),
|
|
124
124
|
true,
|
|
125
125
|
null
|
|
126
126
|
);
|
|
@@ -153,7 +153,7 @@ class MouseWheelZoomControl extends Control {
|
|
|
153
153
|
this.planet,
|
|
154
154
|
this.stepsCount,
|
|
155
155
|
this.distDiff,
|
|
156
|
-
this.renderer.getCenter(),
|
|
156
|
+
this.renderer.handler.getCenter(),
|
|
157
157
|
false,
|
|
158
158
|
null
|
|
159
159
|
);
|