@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.
- package/lib/@openglobus/js/Globe.d.ts +0 -1
- package/lib/@openglobus/js/camera/Camera.d.ts +48 -15
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
- package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/index.d.ts +1 -2
- package/lib/@openglobus/js/entity/Entity.d.ts +24 -20
- package/lib/@openglobus/js/entity/GeoObject.d.ts +0 -9
- package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
- package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
- package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
- package/lib/@openglobus/js/math/Plane.d.ts +3 -1
- package/lib/@openglobus/js/math/Quat.d.ts +1 -0
- package/lib/@openglobus/js/math/Ray.d.ts +6 -16
- package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +4 -0
- package/lib/@openglobus/js/webgl/Handler.d.ts +21 -12
- 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 +0 -1
- package/lib/js/Globe.js +4 -2
- package/lib/js/Popup.js +1 -1
- package/lib/js/camera/Camera.d.ts +48 -15
- package/lib/js/camera/Camera.js +82 -28
- package/lib/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/js/camera/PlanetCamera.js +52 -5
- package/lib/js/control/CameraLock.js +1 -1
- package/lib/js/control/DebugInfo.js +30 -10
- package/lib/js/control/KeyboardNavigation.js +8 -8
- package/lib/js/control/MouseNavigation.d.ts +62 -51
- package/lib/js/control/MouseNavigation.js +361 -305
- package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/MouseWheelZoomControl.js +270 -181
- package/lib/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/js/control/OldMouseNavigation.js +368 -0
- package/lib/js/control/ScaleControl.js +2 -2
- package/lib/js/control/SimpleNavigation.js +8 -7
- package/lib/js/control/Sun.js +5 -5
- package/lib/js/control/TouchNavigation.js +11 -8
- package/lib/js/control/elevationProfile/ElevationProfileScene.js +2 -1
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +19 -33
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +18 -18
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +3 -2
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +1 -4
- package/lib/js/control/geoObjectEditor/RotateEntity.js +1 -1
- package/lib/js/control/index.d.ts +1 -2
- package/lib/js/control/index.js +1 -2
- package/lib/js/control/visibleExtent/Segment.js +4 -4
- package/lib/js/entity/Entity.d.ts +24 -20
- package/lib/js/entity/Entity.js +62 -47
- package/lib/js/entity/GeoObject.d.ts +0 -9
- package/lib/js/entity/GeoObject.js +0 -3
- package/lib/js/entity/InstanceData.js +6 -3
- package/lib/js/input/MouseHandler.d.ts +1 -0
- package/lib/js/input/MouseHandler.js +12 -1
- package/lib/js/math/Mat3.d.ts +1 -1
- package/lib/js/math/Mat3.js +1 -1
- package/lib/js/math/Mat4.d.ts +10 -1
- package/lib/js/math/Mat4.js +17 -1
- package/lib/js/math/Plane.d.ts +3 -1
- package/lib/js/math/Plane.js +11 -1
- package/lib/js/math/Quat.d.ts +1 -0
- package/lib/js/math/Quat.js +1 -0
- package/lib/js/math/Ray.d.ts +6 -16
- package/lib/js/math/Ray.js +53 -46
- package/lib/js/math/Vec2.d.ts +22 -0
- package/lib/js/math/Vec2.js +32 -0
- package/lib/js/renderer/Renderer.js +10 -6
- package/lib/js/renderer/RendererEvents.d.ts +1 -0
- package/lib/js/renderer/RendererEvents.js +3 -1
- package/lib/js/scene/Planet.d.ts +4 -0
- package/lib/js/scene/Planet.js +24 -3
- package/lib/js/segment/Segment.js +4 -4
- package/lib/js/terrain/GlobusTerrain.js +2 -2
- package/lib/js/webgl/Handler.d.ts +21 -12
- package/lib/js/webgl/Handler.js +42 -33
- package/package.json +2 -2
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/EarthNavigation.d.ts +0 -50
- 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
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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 {};
|