@openglobus/og 0.22.2 → 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/css/og.css +137 -1
- package/lib/@openglobus/js/Globe.d.ts +0 -1
- package/lib/@openglobus/js/Object3d.d.ts +20 -10
- package/lib/@openglobus/js/camera/Camera.d.ts +57 -15
- package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/@openglobus/js/control/CameraLock.d.ts +38 -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/SimpleNavigation.d.ts +27 -10
- package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/@openglobus/js/control/index.d.ts +3 -2
- package/lib/@openglobus/js/entity/Entity.d.ts +282 -19
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
- package/lib/@openglobus/js/entity/GeoObject.d.ts +135 -39
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/@openglobus/js/index.d.ts +2 -1
- package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
- 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 +47 -33
- package/lib/@openglobus/js/math/Ray.d.ts +10 -14
- package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
- package/lib/@openglobus/js/math.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +15 -7
- package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
- package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
- package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
- package/lib/@openglobus/js/ui/Input.d.ts +32 -0
- package/lib/@openglobus/js/ui/View.d.ts +3 -1
- package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
- package/lib/@openglobus/js/utils/shared.d.ts +22 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/@openglobus/js/webgl/Handler.d.ts +22 -12
- 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 +0 -1
- package/lib/js/Globe.js +4 -2
- package/lib/js/Object3d.d.ts +20 -10
- package/lib/js/Object3d.js +124 -48
- package/lib/js/Popup.js +1 -1
- package/lib/js/camera/Camera.d.ts +57 -15
- package/lib/js/camera/Camera.js +109 -29
- package/lib/js/camera/Frustum.d.ts +3 -0
- package/lib/js/camera/Frustum.js +7 -0
- package/lib/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/js/camera/PlanetCamera.js +52 -5
- package/lib/js/control/Atmosphere.js +10 -6
- package/lib/js/control/CameraLock.d.ts +38 -0
- package/lib/js/control/CameraLock.js +216 -0
- package/lib/js/control/Control.js +1 -1
- package/lib/js/control/DebugInfo.js +38 -8
- package/lib/js/control/KeyboardNavigation.js +9 -9
- 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 +11 -5
- package/lib/js/control/SimpleNavigation.d.ts +27 -10
- package/lib/js/control/SimpleNavigation.js +149 -49
- package/lib/js/control/Sun.js +6 -6
- package/lib/js/control/TouchNavigation.js +11 -8
- package/lib/js/control/elevationProfile/ElevationProfileScene.js +6 -5
- package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +488 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +107 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +31 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
- package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/js/control/geoObjectEditor/colors.js +8 -0
- package/lib/js/control/index.d.ts +3 -2
- package/lib/js/control/index.js +3 -2
- package/lib/js/control/timeline/TimelineControl.js +2 -0
- package/lib/js/control/visibleExtent/Segment.js +4 -4
- package/lib/js/entity/Entity.d.ts +282 -19
- package/lib/js/entity/Entity.js +497 -62
- package/lib/js/entity/EntityCollection.d.ts +8 -9
- package/lib/js/entity/EntityCollection.js +48 -45
- package/lib/js/entity/GeoObject.d.ts +135 -39
- package/lib/js/entity/GeoObject.js +150 -90
- package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/js/entity/GeoObjectHandler.js +198 -295
- package/lib/js/entity/InstanceData.d.ts +76 -0
- package/lib/js/entity/InstanceData.js +347 -0
- package/lib/js/entity/Polyline.d.ts +19 -6
- package/lib/js/entity/Polyline.js +76 -36
- package/lib/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/js/entity/PolylineHandler.js +26 -1
- package/lib/js/index.d.ts +2 -1
- package/lib/js/index.js +2 -1
- package/lib/js/input/MouseHandler.d.ts +1 -0
- package/lib/js/input/MouseHandler.js +12 -1
- package/lib/js/layer/Bing.js +2 -2
- package/lib/js/layer/Vector.d.ts +4 -0
- package/lib/js/layer/Vector.js +16 -0
- package/lib/js/light/LightSource.d.ts +1 -139
- package/lib/js/light/LightSource.js +21 -227
- 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 +47 -33
- package/lib/js/math/Quat.js +92 -90
- package/lib/js/math/Ray.d.ts +10 -14
- package/lib/js/math/Ray.js +56 -33
- package/lib/js/math/Vec2.d.ts +22 -0
- package/lib/js/math/Vec2.js +32 -0
- package/lib/js/math/Vec3.d.ts +15 -0
- package/lib/js/math/Vec3.js +30 -1
- package/lib/js/math.d.ts +2 -2
- package/lib/js/math.js +3 -3
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +8 -8
- package/lib/js/quadTree/Node.d.ts +1 -1
- package/lib/js/quadTree/Node.js +2 -2
- package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/renderer/Renderer.d.ts +63 -44
- package/lib/js/renderer/Renderer.js +267 -266
- package/lib/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/js/renderer/RendererEvents.js +5 -2
- package/lib/js/scene/Planet.d.ts +15 -7
- package/lib/js/scene/Planet.js +133 -90
- package/lib/js/scene/RenderNode.d.ts +10 -25
- package/lib/js/scene/RenderNode.js +70 -58
- package/lib/js/segment/Segment.js +4 -4
- package/lib/js/shaders/depth.js +2 -5
- package/lib/js/shaders/drawnode.d.ts +1 -0
- package/lib/js/shaders/drawnode.js +51 -52
- package/lib/js/shaders/geoObject.d.ts +1 -0
- package/lib/js/shaders/geoObject.js +154 -91
- package/lib/js/shaders/polyline.js +68 -51
- package/lib/js/shaders/utils.d.ts +1 -1
- package/lib/js/shaders/utils.js +11 -0
- package/lib/js/terrain/GlobusTerrain.js +2 -2
- package/lib/js/ui/Checkbox.d.ts +31 -0
- package/lib/js/ui/Checkbox.js +110 -0
- package/lib/js/ui/Color.js +2 -1
- package/lib/js/ui/Dialog.d.ts +3 -0
- package/lib/js/ui/Dialog.js +20 -0
- package/lib/js/ui/Input.d.ts +32 -0
- package/lib/js/ui/Input.js +107 -0
- package/lib/js/ui/View.d.ts +3 -1
- package/lib/js/ui/View.js +6 -0
- package/lib/js/utils/objParser.d.ts +44 -12
- package/lib/js/utils/objParser.js +241 -149
- package/lib/js/utils/shared.d.ts +22 -0
- package/lib/js/utils/shared.js +34 -0
- package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/js/webgl/Framebuffer.js +136 -29
- package/lib/js/webgl/Handler.d.ts +22 -12
- package/lib/js/webgl/Handler.js +53 -34
- package/lib/js/webgl/Program.js +0 -8
- package/package.json +5 -3
- 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 {};
|