@openglobus/og 0.23.0 → 0.24.0

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.
Files changed (84) hide show
  1. package/lib/@openglobus/js/Globe.d.ts +0 -1
  2. package/lib/@openglobus/js/camera/Camera.d.ts +48 -15
  3. package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
  4. package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
  5. package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
  6. package/lib/@openglobus/js/control/index.d.ts +1 -2
  7. package/lib/@openglobus/js/entity/Entity.d.ts +24 -20
  8. package/lib/@openglobus/js/entity/GeoObject.d.ts +0 -9
  9. package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
  10. package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
  11. package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
  12. package/lib/@openglobus/js/math/Plane.d.ts +3 -1
  13. package/lib/@openglobus/js/math/Quat.d.ts +1 -0
  14. package/lib/@openglobus/js/math/Ray.d.ts +6 -16
  15. package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
  16. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
  17. package/lib/@openglobus/js/scene/Planet.d.ts +4 -0
  18. package/lib/@openglobus/js/webgl/Handler.d.ts +21 -12
  19. package/lib/@openglobus/og.esm.js +1 -1
  20. package/lib/@openglobus/og.esm.js.map +1 -1
  21. package/lib/@openglobus/og.umd.js +1 -1
  22. package/lib/@openglobus/og.umd.js.map +1 -1
  23. package/lib/js/Globe.d.ts +0 -1
  24. package/lib/js/Globe.js +4 -2
  25. package/lib/js/Popup.js +1 -1
  26. package/lib/js/camera/Camera.d.ts +48 -15
  27. package/lib/js/camera/Camera.js +82 -28
  28. package/lib/js/camera/PlanetCamera.d.ts +13 -0
  29. package/lib/js/camera/PlanetCamera.js +52 -5
  30. package/lib/js/control/CameraLock.js +1 -1
  31. package/lib/js/control/DebugInfo.js +30 -10
  32. package/lib/js/control/KeyboardNavigation.js +8 -8
  33. package/lib/js/control/MouseNavigation.d.ts +62 -51
  34. package/lib/js/control/MouseNavigation.js +361 -305
  35. package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
  36. package/lib/js/control/MouseWheelZoomControl.js +270 -181
  37. package/lib/js/control/OldMouseNavigation.d.ts +64 -0
  38. package/lib/js/control/OldMouseNavigation.js +368 -0
  39. package/lib/js/control/ScaleControl.js +2 -2
  40. package/lib/js/control/SimpleNavigation.js +8 -7
  41. package/lib/js/control/Sun.js +5 -5
  42. package/lib/js/control/TouchNavigation.js +11 -8
  43. package/lib/js/control/elevationProfile/ElevationProfileScene.js +2 -1
  44. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +19 -33
  45. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +18 -18
  46. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +3 -2
  47. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +1 -4
  48. package/lib/js/control/geoObjectEditor/RotateEntity.js +1 -1
  49. package/lib/js/control/index.d.ts +1 -2
  50. package/lib/js/control/index.js +1 -2
  51. package/lib/js/control/visibleExtent/Segment.js +4 -4
  52. package/lib/js/entity/Entity.d.ts +24 -20
  53. package/lib/js/entity/Entity.js +62 -47
  54. package/lib/js/entity/GeoObject.d.ts +0 -9
  55. package/lib/js/entity/GeoObject.js +0 -3
  56. package/lib/js/entity/InstanceData.js +6 -3
  57. package/lib/js/input/MouseHandler.d.ts +1 -0
  58. package/lib/js/input/MouseHandler.js +12 -1
  59. package/lib/js/math/Mat3.d.ts +1 -1
  60. package/lib/js/math/Mat3.js +1 -1
  61. package/lib/js/math/Mat4.d.ts +10 -1
  62. package/lib/js/math/Mat4.js +17 -1
  63. package/lib/js/math/Plane.d.ts +3 -1
  64. package/lib/js/math/Plane.js +11 -1
  65. package/lib/js/math/Quat.d.ts +1 -0
  66. package/lib/js/math/Quat.js +1 -0
  67. package/lib/js/math/Ray.d.ts +6 -16
  68. package/lib/js/math/Ray.js +53 -46
  69. package/lib/js/math/Vec2.d.ts +22 -0
  70. package/lib/js/math/Vec2.js +32 -0
  71. package/lib/js/renderer/Renderer.js +10 -6
  72. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  73. package/lib/js/renderer/RendererEvents.js +3 -1
  74. package/lib/js/scene/Planet.d.ts +4 -0
  75. package/lib/js/scene/Planet.js +24 -3
  76. package/lib/js/segment/Segment.js +4 -4
  77. package/lib/js/terrain/GlobusTerrain.js +2 -2
  78. package/lib/js/webgl/Handler.d.ts +21 -12
  79. package/lib/js/webgl/Handler.js +42 -33
  80. package/package.json +2 -2
  81. package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
  82. package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
  83. package/lib/js/control/EarthNavigation.d.ts +0 -50
  84. package/lib/js/control/EarthNavigation.js +0 -202
@@ -1,44 +0,0 @@
1
- import { Sphere } from "../bv/Sphere";
2
- import { Key } from "../Lock";
3
- import { Quat } from "../math/Quat";
4
- import { Vec3 } from "../math/Vec3";
5
- import { Control, IControlParams } from "./Control";
6
- import { IStepForward } from "./MouseNavigation";
7
- interface IMouseWheelZoomControl extends IControlParams {
8
- minSlope?: number;
9
- }
10
- export declare class MouseWheelZoomControl extends Control {
11
- protected grabbedPoint: Vec3;
12
- protected _eye0: Vec3;
13
- protected pointOnEarth: Vec3;
14
- protected earthUp: Vec3;
15
- inertia: number;
16
- protected grabbedSpheroid: Sphere;
17
- protected qRot: Quat;
18
- protected scaleRot: number;
19
- protected distDiff: number;
20
- protected stepsCount: number;
21
- protected stepsForward: IStepForward[] | null;
22
- protected stepIndex: number;
23
- protected _lmbDoubleClickActive: boolean;
24
- protected minSlope: number;
25
- protected _keyLock: Key;
26
- protected _deactivate: boolean;
27
- protected _move: number;
28
- constructor(options?: IMouseWheelZoomControl);
29
- oninit(): void;
30
- /**
31
- * Planet zoom in.
32
- * @public
33
- */
34
- zoomIn(): void;
35
- /**
36
- * Planet zoom out.
37
- * @public
38
- */
39
- zoomOut(): void;
40
- stopRotation(): void;
41
- stopZoom(): void;
42
- protected _draw(): void;
43
- }
44
- export {};
@@ -1,181 +1,270 @@
1
- import { Sphere } from "../bv/Sphere";
2
- import { Key } from "../Lock";
3
- import { Quat } from "../math/Quat";
4
- import { Vec3 } from "../math/Vec3";
5
- import { Control } from "./Control";
6
- import { MouseNavigation } from "./MouseNavigation";
7
- export class MouseWheelZoomControl extends Control {
8
- constructor(options = {}) {
9
- super(options);
10
- this._name = "MouseWheelZoomControl";
11
- this.grabbedPoint = new Vec3();
12
- this._eye0 = new Vec3();
13
- this.pointOnEarth = new Vec3();
14
- this.earthUp = new Vec3();
15
- this.inertia = 0.007;
16
- this.grabbedSpheroid = new Sphere();
17
- this.planet = null;
18
- this.qRot = new Quat();
19
- this.scaleRot = 0.0;
20
- this.distDiff = 0.3;
21
- this.stepsCount = 8;
22
- this.stepsForward = null;
23
- this.stepIndex = 0;
24
- this._lmbDoubleClickActive = true;
25
- this.minSlope = options.minSlope || 0.1;
26
- this._keyLock = new Key();
27
- this._deactivate = false;
28
- this._move = 0;
29
- }
30
- oninit() {
31
- let zoomDiv = document.createElement("div"), btnZoomIn = document.createElement("button"), btnZoomOut = document.createElement("button");
32
- zoomDiv.className = "ogZoomControl";
33
- btnZoomIn.className = "ogZoomButton ogZoomIn";
34
- btnZoomOut.className = "ogZoomButton ogZoomOut";
35
- zoomDiv.appendChild(btnZoomIn);
36
- zoomDiv.appendChild(btnZoomOut);
37
- this.renderer.div.appendChild(zoomDiv);
38
- btnZoomIn.addEventListener("mousedown", () => this.zoomIn());
39
- btnZoomIn.addEventListener("mouseup", () => this.stopZoom());
40
- btnZoomOut.addEventListener("mousedown", () => this.zoomOut());
41
- btnZoomOut.addEventListener("mouseup", () => this.stopZoom());
42
- btnZoomIn.addEventListener("touchstart", (e) => {
43
- e.preventDefault();
44
- this.zoomIn();
45
- });
46
- btnZoomIn.addEventListener("touchend", (e) => {
47
- e.preventDefault();
48
- this.stopZoom();
49
- });
50
- btnZoomIn.addEventListener("touchcancel", (e) => {
51
- e.preventDefault();
52
- this.stopZoom();
53
- });
54
- btnZoomOut.addEventListener("touchstart", (e) => {
55
- e.preventDefault();
56
- this.zoomOut();
57
- });
58
- btnZoomOut.addEventListener("touchend", (e) => {
59
- e.preventDefault();
60
- this.stopZoom();
61
- });
62
- btnZoomOut.addEventListener("touchcancel", (e) => {
63
- e.preventDefault();
64
- this.stopZoom();
65
- });
66
- this.renderer.events.on("draw", this._draw, this);
67
- }
68
- /**
69
- * Planet zoom in.
70
- * @public
71
- */
72
- zoomIn() {
73
- if (this.stepIndex) {
74
- return;
75
- }
76
- this.planet.stopFlying();
77
- this.stopRotation();
78
- this._deactivate = true;
79
- this.planet.layerLock.lock(this._keyLock);
80
- this.planet.terrainLock.lock(this._keyLock);
81
- this.planet._normalMapCreator.lock(this._keyLock);
82
- this.stepsForward = MouseNavigation.getMovePointsFromPixelTerrain(this.planet.camera, this.planet, this.stepsCount, this.distDiff, this.renderer.handler.getCenter(), true, null) || null;
83
- if (this.stepsForward) {
84
- this.stepIndex = this.stepsCount;
85
- }
86
- }
87
- /**
88
- * Planet zoom out.
89
- * @public
90
- */
91
- zoomOut() {
92
- if (this.stepIndex) {
93
- return;
94
- }
95
- this.planet.stopFlying();
96
- this.stopRotation();
97
- this._deactivate = true;
98
- this.planet.layerLock.lock(this._keyLock);
99
- this.planet.terrainLock.lock(this._keyLock);
100
- this.planet._normalMapCreator.lock(this._keyLock);
101
- this.stepsForward = MouseNavigation.getMovePointsFromPixelTerrain(this.planet.camera, this.planet, this.stepsCount, this.distDiff, this.renderer.handler.getCenter(), false, null) || null;
102
- if (this.stepsForward) {
103
- this.stepIndex = this.stepsCount;
104
- }
105
- }
106
- stopRotation() {
107
- this.qRot.clear();
108
- this.planet.layerLock.free(this._keyLock);
109
- this.planet.terrainLock.free(this._keyLock);
110
- this.planet._normalMapCreator.free(this._keyLock);
111
- }
112
- stopZoom() {
113
- this._move = 0;
114
- this.planet.layerLock.free(this._keyLock);
115
- this.planet.terrainLock.free(this._keyLock);
116
- this.planet._normalMapCreator.free(this._keyLock);
117
- }
118
- _draw() {
119
- if (this._active) {
120
- let r = this.renderer;
121
- let cam = this.planet.camera;
122
- let prevEye = cam.eye.clone();
123
- if (this.stepIndex) {
124
- r.controlsBag.scaleRot = 1.0;
125
- let sf = this.stepsForward[this.stepsCount - this.stepIndex--];
126
- let maxAlt = cam.maxAltitude + this.planet.ellipsoid.equatorialSize;
127
- let minAlt = cam.minAltitude + this.planet.ellipsoid.equatorialSize;
128
- const camAlt = sf.eye.length();
129
- if (camAlt > maxAlt || camAlt < minAlt) {
130
- return;
131
- }
132
- cam.eye = sf.eye;
133
- cam._u = sf.v;
134
- cam._r = sf.u;
135
- cam._b = sf.n;
136
- cam.checkTerrainCollision();
137
- cam.update();
138
- }
139
- else {
140
- if (this._deactivate) {
141
- this._deactivate = false;
142
- this.planet.layerLock.free(this._keyLock);
143
- this.planet.terrainLock.free(this._keyLock);
144
- this.planet._normalMapCreator.free(this._keyLock);
145
- }
146
- }
147
- if (r.events.mouseState.leftButtonDown || !this.scaleRot) {
148
- return;
149
- }
150
- this.scaleRot -= this.inertia;
151
- if (this.scaleRot <= 0.0) {
152
- this.scaleRot = 0.0;
153
- }
154
- else {
155
- r.controlsBag.scaleRot = this.scaleRot;
156
- let rot = this.qRot
157
- .slerp(Quat.IDENTITY, 1.0 - this.scaleRot * this.scaleRot * this.scaleRot)
158
- .normalize();
159
- if (!(rot.x || rot.y || rot.z)) {
160
- this.scaleRot = 0.0;
161
- }
162
- cam.eye = rot.mulVec3(cam.eye);
163
- cam._u = rot.mulVec3(cam._u);
164
- cam._r = rot.mulVec3(cam._r);
165
- cam._b = rot.mulVec3(cam._b);
166
- cam.checkTerrainCollision();
167
- cam.update();
168
- }
169
- if (cam.eye.distance(prevEye) / cam.getAltitude() > 0.01) {
170
- this.planet.layerLock.lock(this._keyLock);
171
- this.planet.terrainLock.lock(this._keyLock);
172
- this.planet._normalMapCreator.lock(this._keyLock);
173
- }
174
- else {
175
- this.planet.layerLock.free(this._keyLock);
176
- this.planet.terrainLock.free(this._keyLock);
177
- this.planet._normalMapCreator.free(this._keyLock);
178
- }
179
- }
180
- }
181
- }
1
+ "use strict";
2
+ // import {Sphere} from "../bv/Sphere";
3
+ // import {Key} from "../Lock";
4
+ // import {Quat} from "../math/Quat";
5
+ // import {Vec3} from "../math/Vec3";
6
+ // import {Control, IControlParams} from "./Control";
7
+ // import {IStepForward, MouseNavigation} from "./MouseNavigation";
8
+ //
9
+ // interface IMouseWheelZoomControl extends IControlParams {
10
+ // minSlope?: number;
11
+ // }
12
+ //
13
+ // export class MouseWheelZoomControl extends Control {
14
+ // protected grabbedPoint: Vec3;
15
+ // protected _eye0: Vec3;
16
+ // protected pointOnEarth: Vec3;
17
+ // protected earthUp: Vec3;
18
+ // public inertia: number;
19
+ // protected grabbedSpheroid: Sphere;
20
+ // protected qRot: Quat;
21
+ // protected scaleRot: number;
22
+ // protected distDiff: number;
23
+ // protected stepsCount: number;
24
+ // protected stepsForward: IStepForward[] | null;
25
+ // protected stepIndex: number;
26
+ // protected _lmbDoubleClickActive: boolean;
27
+ // protected minSlope: number;
28
+ // protected _keyLock: Key;
29
+ // protected _deactivate: boolean;
30
+ // protected _move: number;
31
+ //
32
+ // constructor(options: IMouseWheelZoomControl = {}) {
33
+ // super(options);
34
+ //
35
+ // this._name = "MouseWheelZoomControl";
36
+ //
37
+ // this.grabbedPoint = new Vec3();
38
+ // this._eye0 = new Vec3();
39
+ // this.pointOnEarth = new Vec3();
40
+ // this.earthUp = new Vec3();
41
+ // this.inertia = 0.007;
42
+ // this.grabbedSpheroid = new Sphere();
43
+ // this.planet = null;
44
+ // this.qRot = new Quat();
45
+ // this.scaleRot = 0.0;
46
+ //
47
+ // this.distDiff = 0.3;
48
+ // this.stepsCount = 8;
49
+ // this.stepsForward = null;
50
+ // this.stepIndex = 0;
51
+ //
52
+ // this._lmbDoubleClickActive = true;
53
+ //
54
+ // this.minSlope = options.minSlope || 0.1;
55
+ //
56
+ // this._keyLock = new Key();
57
+ //
58
+ // this._deactivate = false;
59
+ //
60
+ // this._move = 0;
61
+ // }
62
+ //
63
+ // public override oninit() {
64
+ // let zoomDiv = document.createElement("div"),
65
+ // btnZoomIn = document.createElement("button"),
66
+ // btnZoomOut = document.createElement("button");
67
+ //
68
+ // zoomDiv.className = "ogZoomControl";
69
+ // btnZoomIn.className = "ogZoomButton ogZoomIn";
70
+ // btnZoomOut.className = "ogZoomButton ogZoomOut";
71
+ //
72
+ // zoomDiv.appendChild(btnZoomIn);
73
+ // zoomDiv.appendChild(btnZoomOut);
74
+ //
75
+ // this.renderer!.div!.appendChild(zoomDiv);
76
+ //
77
+ // btnZoomIn.addEventListener("mousedown", () => this.zoomIn());
78
+ // btnZoomIn.addEventListener("mouseup", () => this.stopZoom());
79
+ //
80
+ // btnZoomOut.addEventListener("mousedown", () => this.zoomOut());
81
+ // btnZoomOut.addEventListener("mouseup", () => this.stopZoom());
82
+ //
83
+ // btnZoomIn.addEventListener("touchstart", (e: TouchEvent) => {
84
+ // e.preventDefault();
85
+ // this.zoomIn();
86
+ // });
87
+ // btnZoomIn.addEventListener("touchend", (e: TouchEvent) => {
88
+ // e.preventDefault();
89
+ // this.stopZoom();
90
+ // });
91
+ // btnZoomIn.addEventListener("touchcancel", (e: TouchEvent) => {
92
+ // e.preventDefault();
93
+ // this.stopZoom();
94
+ // });
95
+ //
96
+ // btnZoomOut.addEventListener("touchstart", (e: TouchEvent) => {
97
+ // e.preventDefault();
98
+ // this.zoomOut();
99
+ // });
100
+ // btnZoomOut.addEventListener("touchend", (e: TouchEvent) => {
101
+ // e.preventDefault();
102
+ // this.stopZoom();
103
+ // });
104
+ // btnZoomOut.addEventListener("touchcancel", (e: TouchEvent) => {
105
+ // e.preventDefault();
106
+ // this.stopZoom();
107
+ // });
108
+ //
109
+ // this.renderer!.events.on("draw", this._draw, this);
110
+ // }
111
+ //
112
+ // /**
113
+ // * Planet zoom in.
114
+ // * @public
115
+ // */
116
+ // public zoomIn() {
117
+ // if (this.stepIndex) {
118
+ // return;
119
+ // }
120
+ //
121
+ // this.planet!.stopFlying();
122
+ //
123
+ // this.stopRotation();
124
+ //
125
+ // this._deactivate = true;
126
+ //
127
+ // this.planet!.layerLock.lock(this._keyLock);
128
+ // this.planet!.terrainLock.lock(this._keyLock);
129
+ // this.planet!._normalMapCreator.lock(this._keyLock);
130
+ //
131
+ // this.stepsForward = MouseNavigation.getMovePointsFromPixelTerrain(
132
+ // this.planet!.camera,
133
+ // this.planet!,
134
+ // this.stepsCount,
135
+ // this.distDiff,
136
+ // this.renderer!.handler.getCenter(),
137
+ // true,
138
+ // null
139
+ // ) || null;
140
+ //
141
+ // if (this.stepsForward) {
142
+ // this.stepIndex = this.stepsCount;
143
+ // }
144
+ // }
145
+ //
146
+ // /**
147
+ // * Planet zoom out.
148
+ // * @public
149
+ // */
150
+ // public zoomOut() {
151
+ // if (this.stepIndex) {
152
+ // return;
153
+ // }
154
+ //
155
+ // this.planet!.stopFlying();
156
+ //
157
+ // this.stopRotation();
158
+ //
159
+ // this._deactivate = true;
160
+ //
161
+ // this.planet!.layerLock.lock(this._keyLock);
162
+ // this.planet!.terrainLock.lock(this._keyLock);
163
+ // this.planet!._normalMapCreator.lock(this._keyLock);
164
+ //
165
+ // this.stepsForward = MouseNavigation.getMovePointsFromPixelTerrain(
166
+ // this.planet!.camera,
167
+ // this.planet!,
168
+ // this.stepsCount,
169
+ // this.distDiff,
170
+ // this.renderer!.handler.getCenter(),
171
+ // false,
172
+ // null
173
+ // ) || null;
174
+ //
175
+ // if (this.stepsForward) {
176
+ // this.stepIndex = this.stepsCount;
177
+ // }
178
+ // }
179
+ //
180
+ // public stopRotation() {
181
+ // this.qRot.clear();
182
+ // this.planet!.layerLock.free(this._keyLock);
183
+ // this.planet!.terrainLock.free(this._keyLock);
184
+ // this.planet!._normalMapCreator.free(this._keyLock);
185
+ // }
186
+ //
187
+ // public stopZoom() {
188
+ // this._move = 0;
189
+ //
190
+ // this.planet!.layerLock.free(this._keyLock);
191
+ // this.planet!.terrainLock.free(this._keyLock);
192
+ // this.planet!._normalMapCreator.free(this._keyLock);
193
+ // }
194
+ //
195
+ // protected _draw() {
196
+ // if (this._active) {
197
+ // let r = this.renderer!;
198
+ // let cam = this.planet!.camera;
199
+ // let prevEye = cam.eye.clone();
200
+ //
201
+ // if (this.stepIndex) {
202
+ // r.controlsBag.scaleRot = 1.0;
203
+ // let sf = this.stepsForward![this.stepsCount - this.stepIndex--];
204
+ //
205
+ // let maxAlt = cam.maxAltitude + this.planet!.ellipsoid.equatorialSize;
206
+ // let minAlt = cam.minAltitude + this.planet!.ellipsoid.equatorialSize;
207
+ // const camAlt = sf.eye.length();
208
+ // if (camAlt > maxAlt || camAlt < minAlt) {
209
+ // return;
210
+ // }
211
+ //
212
+ // cam.eye = sf.eye;
213
+ // cam._u = sf.v;
214
+ // cam._r = sf.u;
215
+ // cam._b = sf.n;
216
+ //
217
+ // cam.checkTerrainCollision();
218
+ //
219
+ // cam.update();
220
+ // } else {
221
+ // if (this._deactivate) {
222
+ // this._deactivate = false;
223
+ //
224
+ // this.planet!.layerLock.free(this._keyLock);
225
+ // this.planet!.terrainLock.free(this._keyLock);
226
+ // this.planet!._normalMapCreator.free(this._keyLock);
227
+ // }
228
+ // }
229
+ //
230
+ // if (r.events.mouseState.leftButtonDown || !this.scaleRot) {
231
+ // return;
232
+ // }
233
+ //
234
+ // this.scaleRot -= this.inertia;
235
+ // if (this.scaleRot <= 0.0) {
236
+ // this.scaleRot = 0.0;
237
+ // } else {
238
+ //
239
+ // r.controlsBag.scaleRot = this.scaleRot;
240
+ //
241
+ // let rot = this.qRot
242
+ // .slerp(Quat.IDENTITY, 1.0 - this.scaleRot * this.scaleRot * this.scaleRot)
243
+ // .normalize();
244
+ //
245
+ // if (!(rot.x || rot.y || rot.z)) {
246
+ // this.scaleRot = 0.0;
247
+ // }
248
+ //
249
+ // cam.eye = rot.mulVec3(cam.eye);
250
+ // cam._u = rot.mulVec3(cam._u);
251
+ // cam._r = rot.mulVec3(cam._r);
252
+ // cam._b = rot.mulVec3(cam._b);
253
+ //
254
+ // cam.checkTerrainCollision();
255
+ //
256
+ // cam.update();
257
+ // }
258
+ //
259
+ // if (cam.eye.distance(prevEye) / cam.getAltitude() > 0.01) {
260
+ // this.planet!.layerLock.lock(this._keyLock);
261
+ // this.planet!.terrainLock.lock(this._keyLock);
262
+ // this.planet!._normalMapCreator.lock(this._keyLock);
263
+ // } else {
264
+ // this.planet!.layerLock.free(this._keyLock);
265
+ // this.planet!.terrainLock.free(this._keyLock);
266
+ // this.planet!._normalMapCreator.free(this._keyLock);
267
+ // }
268
+ // }
269
+ // }
270
+ // }
@@ -0,0 +1,64 @@
1
+ import { Control, IControlParams } from "./Control";
2
+ import { Key } from "../Lock";
3
+ import { Quat } from "../math/Quat";
4
+ import { Sphere } from "../bv/Sphere";
5
+ import { Vec3 } from "../math/Vec3";
6
+ import { Vec2 } from "../math/Vec2";
7
+ import { Planet } from "../scene/Planet";
8
+ import { PlanetCamera } from "../camera/PlanetCamera";
9
+ import { IMouseState } from "../renderer/RendererEvents";
10
+ export interface IStepForward {
11
+ eye: Vec3;
12
+ v: Vec3;
13
+ u: Vec3;
14
+ n: Vec3;
15
+ }
16
+ interface IMouseNavigationParams extends IControlParams {
17
+ minSlope?: number;
18
+ }
19
+ /**
20
+ * Mouse planet camera dragging control.
21
+ */
22
+ export declare class OldMouseNavigation extends Control {
23
+ protected grabbedPoint: Vec3;
24
+ protected _eye0: Vec3;
25
+ protected pointOnEarth: Vec3;
26
+ protected earthUp: Vec3;
27
+ inertia: number;
28
+ protected grabbedSpheroid: Sphere;
29
+ protected qRot: Quat;
30
+ protected scaleRot: number;
31
+ protected distDiff: number;
32
+ protected stepsCount: number;
33
+ protected stepsForward: IStepForward[] | null;
34
+ protected stepIndex: number;
35
+ protected _lmbDoubleClickActive: boolean;
36
+ minSlope: number;
37
+ protected _wheelDirection: number;
38
+ protected _keyLock: Key;
39
+ protected _deactivate: boolean;
40
+ protected _shiftBusy: boolean;
41
+ constructor(options?: IMouseNavigationParams);
42
+ static getMovePointsFromPixelTerrain(cam: PlanetCamera, planet: Planet, stepsCount: number, delta: number, point: Vec2, forward: boolean, dir?: Vec3 | null): IStepForward[] | undefined;
43
+ onactivate(): void;
44
+ ondeactivate(): void;
45
+ activateDoubleClickZoom(): void;
46
+ deactivateDoubleClickZoom(): void;
47
+ protected onMouseEnter(e: IMouseState): void;
48
+ protected onMouseLeave(): void;
49
+ protected onMouseWheel(e: IMouseState): void;
50
+ oninit(): void;
51
+ protected onMouseLeftButtonDoubleClick(e: IMouseState): void;
52
+ protected onMouseLeftButtonClick(): void;
53
+ stopRotation(): void;
54
+ protected onMouseLeftButtonUp(e: IMouseState): void;
55
+ protected onMouseLeftButtonDown(e: IMouseState): void;
56
+ protected onMouseRightButtonClick(e: IMouseState): void;
57
+ protected onMouseRightButtonDown(e: IMouseState): void;
58
+ onShiftFree(): void;
59
+ protected onMouseMove(e: IMouseState): void;
60
+ protected onDraw(): void;
61
+ lockPlanet(skipTerrain?: boolean): void;
62
+ freePlanet(): void;
63
+ }
64
+ export {};