@geoblocks/cesium-iso 0.2.0 → 0.3.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/dist/cesium-iso.d.ts +249 -0
- package/dist/cesium-iso.d.ts.map +1 -0
- package/dist/cesium-iso.js +559 -0
- package/dist/cesium-iso.js.map +1 -0
- package/package.json +19 -5
- /package/{cesium-iso.js → src/cesium-iso.js} +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Cartesian2, Cartesian3 } from '@cesium/core';
|
|
2
|
+
/**
|
|
3
|
+
* An isometric view, as in a game: an orthographic camera at a fixed pitch, looking from a corner. A drag turns the
|
|
4
|
+
* view, a right drag (or Ctrl or Shift with the left) and one finger slide it across the ground, the wheel and a pinch
|
|
5
|
+
* zoom where they point, two fingers twist it; Q and E turn it a quarter, WASD and the arrows slide it, a double click
|
|
6
|
+
* glides to the spot.
|
|
7
|
+
*/
|
|
8
|
+
export default class CesiumIso {
|
|
9
|
+
viewer: import("@cesium/engine").CesiumWidget;
|
|
10
|
+
pitch_: number;
|
|
11
|
+
corner_: number;
|
|
12
|
+
size_: number;
|
|
13
|
+
minSize_: number;
|
|
14
|
+
maxSize_: number;
|
|
15
|
+
limit_: ((target: Cartesian3) => Cartesian3) | undefined;
|
|
16
|
+
orbit_: number;
|
|
17
|
+
active_: boolean;
|
|
18
|
+
/** @type {Cartesian3} */
|
|
19
|
+
target_: Cartesian3;
|
|
20
|
+
heading_: number;
|
|
21
|
+
/** @type {Map<number, Cartesian2>} */
|
|
22
|
+
pointers_: Map<number, Cartesian2>;
|
|
23
|
+
/** @type {{grab?: Cartesian3 | undefined, turn?: boolean, last?: {x: number, y: number}, distance?: number, angle?: number, twist?: number} | undefined} */
|
|
24
|
+
drag_: {
|
|
25
|
+
grab?: Cartesian3 | undefined;
|
|
26
|
+
turn?: boolean;
|
|
27
|
+
last?: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
distance?: number;
|
|
32
|
+
angle?: number;
|
|
33
|
+
twist?: number;
|
|
34
|
+
} | undefined;
|
|
35
|
+
/** @type {Set<string>} */
|
|
36
|
+
held_: Set<string>;
|
|
37
|
+
/** @type {{from: number, to: number, start: number} | undefined} */
|
|
38
|
+
turning_: {
|
|
39
|
+
from: number;
|
|
40
|
+
to: number;
|
|
41
|
+
start: number;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** @type {{from: Cartesian3, to: Cartesian3, start: number} | undefined} */
|
|
44
|
+
gliding_: {
|
|
45
|
+
from: Cartesian3;
|
|
46
|
+
to: Cartesian3;
|
|
47
|
+
start: number;
|
|
48
|
+
} | undefined;
|
|
49
|
+
/** @type {number | undefined} */
|
|
50
|
+
frame_: number | undefined;
|
|
51
|
+
/** @type {number | undefined} */
|
|
52
|
+
slid_: number | undefined;
|
|
53
|
+
/** @type {(() => void) | undefined} */
|
|
54
|
+
settling_: (() => void) | undefined;
|
|
55
|
+
/** @type {{time: number, heading: number, target: Cartesian3, turn: number, slide: Cartesian3} | undefined} */
|
|
56
|
+
moved_: {
|
|
57
|
+
time: number;
|
|
58
|
+
heading: number;
|
|
59
|
+
target: Cartesian3;
|
|
60
|
+
turn: number;
|
|
61
|
+
slide: Cartesian3;
|
|
62
|
+
} | undefined;
|
|
63
|
+
/** @type {{turn: number, slide: Cartesian3} | undefined} */
|
|
64
|
+
drift_: {
|
|
65
|
+
turn: number;
|
|
66
|
+
slide: Cartesian3;
|
|
67
|
+
} | undefined;
|
|
68
|
+
/** @type {number | undefined} */
|
|
69
|
+
drifted_: number | undefined;
|
|
70
|
+
/** @type {any} */
|
|
71
|
+
frustum_: any;
|
|
72
|
+
listeners_: [EventTarget, string, (e: any) => void][];
|
|
73
|
+
/**
|
|
74
|
+
* @param {import('@cesium/engine').CesiumWidget} viewer
|
|
75
|
+
* @param {{pitch?: number, heading?: number, size?: number, minSize?: number, maxSize?: number,
|
|
76
|
+
* limit?: (target: Cartesian3) => Cartesian3, orbit?: number}} [options] The pitch, in degrees down from the horizon; a
|
|
77
|
+
* corner's heading, in degrees, the others a quarter turn apart; the size, in meters across the screen's shorter side,
|
|
78
|
+
* and its bounds; a limit, a target moved back where the view may stand: it stops sliding there; the orbit, in meters
|
|
79
|
+
* from the target to the camera, beyond the scene: closer, faces a fraction of a millimeter apart do not fight.
|
|
80
|
+
*/
|
|
81
|
+
constructor(viewer: import('@cesium/engine').CesiumWidget, options?: {
|
|
82
|
+
pitch?: number;
|
|
83
|
+
heading?: number;
|
|
84
|
+
size?: number;
|
|
85
|
+
minSize?: number;
|
|
86
|
+
maxSize?: number;
|
|
87
|
+
limit?: (target: Cartesian3) => Cartesian3;
|
|
88
|
+
orbit?: number;
|
|
89
|
+
});
|
|
90
|
+
get active(): boolean;
|
|
91
|
+
set active(active: boolean);
|
|
92
|
+
/**
|
|
93
|
+
* What the view turns about, in the middle of the screen, a copy; set once active, the view moves there at once.
|
|
94
|
+
*/
|
|
95
|
+
get target(): Cartesian3;
|
|
96
|
+
set target(position: Cartesian3);
|
|
97
|
+
/**
|
|
98
|
+
* No more waiting for the terrain under the first target.
|
|
99
|
+
*/
|
|
100
|
+
settle_(): void;
|
|
101
|
+
/**
|
|
102
|
+
* The view's heading, in degrees, clockwise from the north, where the camera looks.
|
|
103
|
+
*/
|
|
104
|
+
get heading(): number;
|
|
105
|
+
/**
|
|
106
|
+
* The heading set, in degrees: the view turned there at once, with no easing (turnTo eases); an animation under way,
|
|
107
|
+
* a drift or a turn, is dropped. While active.
|
|
108
|
+
* @param {number} heading
|
|
109
|
+
*/
|
|
110
|
+
set heading(heading: number);
|
|
111
|
+
/**
|
|
112
|
+
* The view's size, in meters across the screen's shorter side; set, within its bounds, the view zooms at once about
|
|
113
|
+
* its target (zoom zooms about a point of the screen).
|
|
114
|
+
*/
|
|
115
|
+
get size(): number;
|
|
116
|
+
set size(size: number);
|
|
117
|
+
/**
|
|
118
|
+
* A turn, eased, to a heading, in degrees, the shorter way round: the view toward a side a place is seen from.
|
|
119
|
+
* @param {number} heading
|
|
120
|
+
*/
|
|
121
|
+
turnTo(heading: number): void;
|
|
122
|
+
/**
|
|
123
|
+
* A quarter turn, eased, to the next corner: the camera clockwise about the middle, seen from above (-1, as Q), or
|
|
124
|
+
* the other way (1, as E); 0 to the nearest.
|
|
125
|
+
* @param {number} sign
|
|
126
|
+
*/
|
|
127
|
+
turn(sign: number): void;
|
|
128
|
+
/**
|
|
129
|
+
* Zooms in (a factor below 1) or out, toward a point on the screen, by default its middle.
|
|
130
|
+
* @param {number} factor
|
|
131
|
+
* @param {Cartesian2} [at]
|
|
132
|
+
*/
|
|
133
|
+
zoom(factor: number, at?: Cartesian2): void;
|
|
134
|
+
/**
|
|
135
|
+
* Glides the view's middle to a position, eased.
|
|
136
|
+
* @param {Cartesian3 | undefined} position
|
|
137
|
+
*/
|
|
138
|
+
glideTo(position: Cartesian3 | undefined): void;
|
|
139
|
+
/**
|
|
140
|
+
* The camera on its orbit about the target, the frustum as wide as the size on the shorter side. Set straight: in
|
|
141
|
+
* the target's east-north-up frame, looking along the heading, down by the pitch; Cesium's lookAt and setView would
|
|
142
|
+
* read the depth under the middle back from the GPU to size an orthographic frustum, a stall at each move.
|
|
143
|
+
*/
|
|
144
|
+
place_(): void;
|
|
145
|
+
/**
|
|
146
|
+
* The view's width, in meters: the size on the screen's shorter side.
|
|
147
|
+
*/
|
|
148
|
+
width_(): number;
|
|
149
|
+
/**
|
|
150
|
+
* The heading of the corner after the nearest, by a sign.
|
|
151
|
+
* @param {number} heading
|
|
152
|
+
* @param {number} sign
|
|
153
|
+
*/
|
|
154
|
+
cornerAfter_(heading: number, sign: number): number;
|
|
155
|
+
/**
|
|
156
|
+
* A point of the canvas, from a pointer event.
|
|
157
|
+
* @param {MouseEvent} e
|
|
158
|
+
*/
|
|
159
|
+
at_(e: MouseEvent): Cartesian2;
|
|
160
|
+
/**
|
|
161
|
+
* What is seen at a point of the canvas: the scene, else the globe, if shown.
|
|
162
|
+
* @param {Cartesian2} point
|
|
163
|
+
* @returns {Cartesian3 | undefined}
|
|
164
|
+
*/
|
|
165
|
+
pick_(point: Cartesian2): Cartesian3 | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Where a point of the canvas meets the ground's plane through a position.
|
|
168
|
+
* @param {Cartesian2} point
|
|
169
|
+
* @param {Cartesian3} through
|
|
170
|
+
* @returns {Cartesian3 | undefined}
|
|
171
|
+
*/
|
|
172
|
+
ground_(point: Cartesian2, through: Cartesian3): Cartesian3 | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Slides the view so that a position of the ground is under a point of the canvas.
|
|
175
|
+
* @param {Cartesian3} position
|
|
176
|
+
* @param {Cartesian2} point
|
|
177
|
+
*/
|
|
178
|
+
keep_(position: Cartesian3, point: Cartesian2): void;
|
|
179
|
+
/**
|
|
180
|
+
* The target moved onto what is seen in the middle of the screen: the view does not change, being orthographic, but
|
|
181
|
+
* it turns about the ground there.
|
|
182
|
+
*/
|
|
183
|
+
anchor_(): void;
|
|
184
|
+
/**
|
|
185
|
+
* @param {PointerEvent} e
|
|
186
|
+
*/
|
|
187
|
+
down_(e: PointerEvent): void;
|
|
188
|
+
/**
|
|
189
|
+
* What the pointers down do: one finger, the right button, or the left with Ctrl or Shift slide the view; the left
|
|
190
|
+
* turns it; two fingers pinch, slide and twist it.
|
|
191
|
+
* @param {PointerEvent} e
|
|
192
|
+
*/
|
|
193
|
+
start_(e: PointerEvent): {
|
|
194
|
+
grab: Cartesian3 | undefined;
|
|
195
|
+
distance: number;
|
|
196
|
+
angle: number;
|
|
197
|
+
twist: number;
|
|
198
|
+
turn?: never;
|
|
199
|
+
last?: never;
|
|
200
|
+
} | {
|
|
201
|
+
distance?: never;
|
|
202
|
+
angle?: never;
|
|
203
|
+
twist?: never;
|
|
204
|
+
grab: Cartesian3 | undefined;
|
|
205
|
+
turn?: never;
|
|
206
|
+
last?: never;
|
|
207
|
+
} | {
|
|
208
|
+
distance?: never;
|
|
209
|
+
angle?: never;
|
|
210
|
+
twist?: never;
|
|
211
|
+
grab?: never;
|
|
212
|
+
turn: boolean;
|
|
213
|
+
last: {
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* @param {PointerEvent} e
|
|
220
|
+
*/
|
|
221
|
+
move_(e: PointerEvent): void;
|
|
222
|
+
/**
|
|
223
|
+
* Where the view is, to measure its next move from.
|
|
224
|
+
* @param {number} time
|
|
225
|
+
*/
|
|
226
|
+
snapshot_(time: number): void;
|
|
227
|
+
/**
|
|
228
|
+
* How fast the view moves under the drag, smoothed over the last moves.
|
|
229
|
+
* @param {number} time
|
|
230
|
+
*/
|
|
231
|
+
track_(time: number): void;
|
|
232
|
+
/**
|
|
233
|
+
* @param {PointerEvent} e
|
|
234
|
+
*/
|
|
235
|
+
up_(e: PointerEvent): void;
|
|
236
|
+
/**
|
|
237
|
+
* @param {WheelEvent} e
|
|
238
|
+
*/
|
|
239
|
+
wheel_(e: WheelEvent): void;
|
|
240
|
+
/**
|
|
241
|
+
* @param {KeyboardEvent} e
|
|
242
|
+
*/
|
|
243
|
+
keydown_(e: KeyboardEvent): void;
|
|
244
|
+
/**
|
|
245
|
+
* The keys held, the drift, the turn and the glide, a frame at a time, until they are done.
|
|
246
|
+
*/
|
|
247
|
+
animate_(): void;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=cesium-iso.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cesium-iso.d.ts","sourceRoot":"","sources":["../src/cesium-iso.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAA4F,MAAM,cAAc,CAAC;AA8B/I;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAUrB,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,MAAM,YAZS,UAAU,KAAK,UAAU;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f;IAED;;;;OAIG;IACH,MAAM,SAsBL;IAED;;OAEG;IACH,MAAM,WAGL;IAED;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAHT,MAGS,EAAE,IAAI,EAFf,MAEe,UAGzB;IAED;;;OAGG;IACH,GAAG,CAAC,CAAC,EAFM,UAEN,cAGJ;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAHA,UAGA,GAFE,UAAU,GAAG,SAAS,CAOlC;IAED;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAJF,UAIE,EAAE,OAAO,EAHX,UAGW,GAFT,UAAU,GAAG,SAAS,CAQlC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAHH,UAGG,EAAE,KAAK,EAFV,UAEU,QAMpB;IAED;;;OAGG;IACH,OAAO,SAON;IAED;;OAEG;IACH,KAAK,CAAC,CAAC,EAFI,YAEJ,QAQN;IAED;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAFG,YAEH;;;;;;;;;;;;;;;;;;;;;eAQuB,MAAM;eAAK,MAAM;;MAE/C;IAED;;OAEG;IACH,KAAK,CAAC,CAAC,EAFI,YAEJ,QAqCN;IAED;;;OAGG;IACH,SAAS,CAAC,IAAI,EAFH,MAEG,QAEb;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,EAFA,MAEA,QAUV;IAED;;OAEG;IACH,GAAG,CAAC,CAAC,EAFM,YAEN,QAqBJ;IAED;;OAEG;IACH,MAAM,CAAC,CAAC,EAFG,UAEH,QAGP;IAED;;OAEG;IACH,QAAQ,CAAC,CAAC,EAFC,aAED,QAaT;IAED;;OAEG;IACH,QAAQ,SA4DP;CACF"}
|
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { Cartesian2, Cartesian3, Cartographic, FixedFrameTransforms, IntersectionTests, Math as CesiumMath, Matrix4, Plane } from '@cesium/core';
|
|
2
|
+
import { EasingFunction } from '@cesium/engine';
|
|
3
|
+
// in meters, how far the camera stays from its target by default, out of the scene's way: an orthographic view's
|
|
4
|
+
// size does not depend on it, its depth's precision does (32-bit floats: half a millimeter at 5 km)
|
|
5
|
+
const ORBIT = 5000;
|
|
6
|
+
// the keys, as in the Sims: Q and E turn, WASD or the arrows slide across the ground while held, [x, y] on the screen
|
|
7
|
+
/** @type {Record<string, [number, number]>} */
|
|
8
|
+
const PAN = { w: [0, 1], arrowup: [0, 1], s: [0, -1], arrowdown: [0, -1], a: [-1, 0], arrowleft: [-1, 0], d: [1, 0], arrowright: [1, 0] };
|
|
9
|
+
// how fast the keys slide the view, a share of the screen's width a second; how long a turn and a glide take, in ms;
|
|
10
|
+
// how far two fingers turn before the view turns with them, so that a pinch does not turn it
|
|
11
|
+
const PAN_SPEED = 0.4;
|
|
12
|
+
const TURN_TIME = 450;
|
|
13
|
+
const GLIDE_TIME = 400;
|
|
14
|
+
const TWIST = CesiumMath.toRadians(15);
|
|
15
|
+
// after a drag, the view drifts on, slowing down by this share of its speed a frame (as three.js's OrbitControls' damping
|
|
16
|
+
// of 0.05), if let go within LET_GO ms of the last move
|
|
17
|
+
const DAMPING = 0.95;
|
|
18
|
+
const LET_GO = 60;
|
|
19
|
+
const easeInOut = EasingFunction.QUADRATIC_IN_OUT;
|
|
20
|
+
const positionScratch = new Cartesian2();
|
|
21
|
+
const planeScratch = new Plane(Cartesian3.UNIT_Z, 0);
|
|
22
|
+
const normalScratch = new Cartesian3();
|
|
23
|
+
const deltaScratch = new Cartesian3();
|
|
24
|
+
const frameScratch = new Matrix4();
|
|
25
|
+
const directionScratch = new Cartesian3();
|
|
26
|
+
const upScratch = new Cartesian3();
|
|
27
|
+
const orbitScratch = new Cartesian3();
|
|
28
|
+
/**
|
|
29
|
+
* An isometric view, as in a game: an orthographic camera at a fixed pitch, looking from a corner. A drag turns the
|
|
30
|
+
* view, a right drag (or Ctrl or Shift with the left) and one finger slide it across the ground, the wheel and a pinch
|
|
31
|
+
* zoom where they point, two fingers twist it; Q and E turn it a quarter, WASD and the arrows slide it, a double click
|
|
32
|
+
* glides to the spot.
|
|
33
|
+
*/
|
|
34
|
+
export default class CesiumIso {
|
|
35
|
+
/**
|
|
36
|
+
* @param {import('@cesium/engine').CesiumWidget} viewer
|
|
37
|
+
* @param {{pitch?: number, heading?: number, size?: number, minSize?: number, maxSize?: number,
|
|
38
|
+
* limit?: (target: Cartesian3) => Cartesian3, orbit?: number}} [options] The pitch, in degrees down from the horizon; a
|
|
39
|
+
* corner's heading, in degrees, the others a quarter turn apart; the size, in meters across the screen's shorter side,
|
|
40
|
+
* and its bounds; a limit, a target moved back where the view may stand: it stops sliding there; the orbit, in meters
|
|
41
|
+
* from the target to the camera, beyond the scene: closer, faces a fraction of a millimeter apart do not fight.
|
|
42
|
+
*/
|
|
43
|
+
constructor(viewer, options = {}) {
|
|
44
|
+
this.viewer = viewer;
|
|
45
|
+
this.pitch_ = CesiumMath.toRadians(options.pitch ?? 30);
|
|
46
|
+
this.corner_ = CesiumMath.toRadians(options.heading ?? 45);
|
|
47
|
+
this.size_ = options.size ?? 400;
|
|
48
|
+
this.minSize_ = options.minSize ?? 20;
|
|
49
|
+
this.maxSize_ = options.maxSize ?? 8000;
|
|
50
|
+
this.limit_ = options.limit;
|
|
51
|
+
this.orbit_ = options.orbit ?? ORBIT;
|
|
52
|
+
this.active_ = false;
|
|
53
|
+
/** @type {Cartesian3} */
|
|
54
|
+
this.target_ = new Cartesian3();
|
|
55
|
+
this.heading_ = 0;
|
|
56
|
+
/** @type {Map<number, Cartesian2>} */
|
|
57
|
+
this.pointers_ = new Map();
|
|
58
|
+
/** @type {{grab?: Cartesian3 | undefined, turn?: boolean, last?: {x: number, y: number}, distance?: number, angle?: number, twist?: number} | undefined} */
|
|
59
|
+
this.drag_ = undefined;
|
|
60
|
+
/** @type {Set<string>} */
|
|
61
|
+
this.held_ = new Set();
|
|
62
|
+
/** @type {{from: number, to: number, start: number} | undefined} */
|
|
63
|
+
this.turning_ = undefined;
|
|
64
|
+
/** @type {{from: Cartesian3, to: Cartesian3, start: number} | undefined} */
|
|
65
|
+
this.gliding_ = undefined;
|
|
66
|
+
/** @type {number | undefined} */
|
|
67
|
+
this.frame_ = undefined;
|
|
68
|
+
/** @type {number | undefined} */
|
|
69
|
+
this.slid_ = undefined;
|
|
70
|
+
/** @type {(() => void) | undefined} */
|
|
71
|
+
this.settling_ = undefined;
|
|
72
|
+
// the view's last move during a drag, and how fast it moved then: turning in radians, sliding in meters, a ms
|
|
73
|
+
/** @type {{time: number, heading: number, target: Cartesian3, turn: number, slide: Cartesian3} | undefined} */
|
|
74
|
+
this.moved_ = undefined;
|
|
75
|
+
/** @type {{turn: number, slide: Cartesian3} | undefined} */
|
|
76
|
+
this.drift_ = undefined;
|
|
77
|
+
/** @type {number | undefined} */
|
|
78
|
+
this.drifted_ = undefined;
|
|
79
|
+
// the camera's frustum before, given back on deactivation
|
|
80
|
+
/** @type {any} */
|
|
81
|
+
this.frustum_ = undefined;
|
|
82
|
+
this.listeners_ = /** @type {[EventTarget, string, (e: any) => void][]} */ ([
|
|
83
|
+
[viewer.scene.canvas, 'pointerdown', e => this.down_(e)],
|
|
84
|
+
[viewer.scene.canvas, 'pointermove', e => this.move_(e)],
|
|
85
|
+
[viewer.scene.canvas, 'pointerup', e => this.up_(e)],
|
|
86
|
+
[viewer.scene.canvas, 'pointercancel', e => this.up_(e)],
|
|
87
|
+
[viewer.scene.canvas, 'wheel', e => this.wheel_(e)],
|
|
88
|
+
[viewer.scene.canvas, 'dblclick', e => this.glideTo(this.pick_(this.at_(e)))],
|
|
89
|
+
[viewer.scene.canvas, 'contextmenu', e => e.preventDefault()],
|
|
90
|
+
[window, 'keydown', e => this.keydown_(e)],
|
|
91
|
+
[window, 'keyup', e => this.held_.delete(e.key.toLowerCase())],
|
|
92
|
+
[window, 'blur', () => this.held_.clear()],
|
|
93
|
+
[window, 'resize', () => this.place_()],
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
get active() {
|
|
97
|
+
return this.active_;
|
|
98
|
+
}
|
|
99
|
+
set active(active) {
|
|
100
|
+
if (active === this.active_) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.active_ = active;
|
|
104
|
+
const { scene } = this.viewer;
|
|
105
|
+
scene.screenSpaceCameraController.enableInputs = !active;
|
|
106
|
+
for (const [target, type, listener] of this.listeners_) {
|
|
107
|
+
if (active) {
|
|
108
|
+
target.addEventListener(type, listener, type === 'wheel' ? { passive: false } : undefined);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
target.removeEventListener(type, listener);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (active) {
|
|
115
|
+
// about the ground in the middle of the screen, from the nearest corner; before the scene has loaded, the
|
|
116
|
+
// ellipsoid there, raised to the terrain once its tiles are in, if the globe is shown
|
|
117
|
+
const { canvas, camera, globe } = scene;
|
|
118
|
+
const middle = new Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
|
|
119
|
+
const picked = this.pick_(middle);
|
|
120
|
+
this.target_ = picked ?? camera.pickEllipsoid(middle, scene.ellipsoid) ?? Cartesian3.clone(camera.positionWC);
|
|
121
|
+
this.heading_ = this.cornerAfter_(camera.heading, 0);
|
|
122
|
+
this.frustum_ = camera.frustum.clone();
|
|
123
|
+
// off any transform the camera was fixed to (once: Cesium reads the depth back here)
|
|
124
|
+
camera.lookAtTransform(Matrix4.IDENTITY);
|
|
125
|
+
camera.switchToOrthographicFrustum();
|
|
126
|
+
this.place_();
|
|
127
|
+
if (!picked && globe?.show) {
|
|
128
|
+
this.settling_ = globe.tileLoadProgressEvent.addEventListener(queued => {
|
|
129
|
+
const spot = Cartographic.fromCartesian(this.target_, scene.ellipsoid);
|
|
130
|
+
const height = queued ? undefined : globe.getHeight(spot);
|
|
131
|
+
if (height !== undefined) {
|
|
132
|
+
this.settle_();
|
|
133
|
+
this.target_ = Cartesian3.fromRadians(spot.longitude, spot.latitude, height, scene.ellipsoid);
|
|
134
|
+
this.place_();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.settle_();
|
|
141
|
+
cancelAnimationFrame(this.frame_ ?? 0);
|
|
142
|
+
this.frame_ = this.turning_ = this.gliding_ = this.drag_ = this.moved_ = this.drift_ = this.drifted_ = undefined;
|
|
143
|
+
this.pointers_.clear();
|
|
144
|
+
this.held_.clear();
|
|
145
|
+
const { canvas } = scene;
|
|
146
|
+
if (this.frustum_.aspectRatio !== undefined) {
|
|
147
|
+
this.frustum_.aspectRatio = canvas.clientWidth / canvas.clientHeight;
|
|
148
|
+
}
|
|
149
|
+
scene.camera.frustum = this.frustum_;
|
|
150
|
+
scene.requestRender();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* What the view turns about, in the middle of the screen, a copy; set once active, the view moves there at once.
|
|
155
|
+
*/
|
|
156
|
+
get target() {
|
|
157
|
+
return Cartesian3.clone(this.target_);
|
|
158
|
+
}
|
|
159
|
+
set target(position) {
|
|
160
|
+
this.settle_();
|
|
161
|
+
this.target_ = Cartesian3.clone(position);
|
|
162
|
+
if (this.active_) {
|
|
163
|
+
this.place_();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* No more waiting for the terrain under the first target.
|
|
168
|
+
*/
|
|
169
|
+
settle_() {
|
|
170
|
+
this.settling_?.();
|
|
171
|
+
this.settling_ = undefined;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The view's heading, in degrees, clockwise from the north, where the camera looks.
|
|
175
|
+
*/
|
|
176
|
+
get heading() {
|
|
177
|
+
return CesiumMath.toDegrees(this.heading_);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The heading set, in degrees: the view turned there at once, with no easing (turnTo eases); an animation under way,
|
|
181
|
+
* a drift or a turn, is dropped. While active.
|
|
182
|
+
* @param {number} heading
|
|
183
|
+
*/
|
|
184
|
+
set heading(heading) {
|
|
185
|
+
this.turning_ = this.drift_ = this.drifted_ = undefined;
|
|
186
|
+
this.heading_ = CesiumMath.toRadians(heading);
|
|
187
|
+
this.place_();
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The view's size, in meters across the screen's shorter side; set, within its bounds, the view zooms at once about
|
|
191
|
+
* its target (zoom zooms about a point of the screen).
|
|
192
|
+
*/
|
|
193
|
+
get size() {
|
|
194
|
+
return this.size_;
|
|
195
|
+
}
|
|
196
|
+
set size(size) {
|
|
197
|
+
this.size_ = CesiumMath.clamp(size, this.minSize_, this.maxSize_);
|
|
198
|
+
this.place_();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* A turn, eased, to a heading, in degrees, the shorter way round: the view toward a side a place is seen from.
|
|
202
|
+
* @param {number} heading
|
|
203
|
+
*/
|
|
204
|
+
turnTo(heading) {
|
|
205
|
+
this.drift_ = this.drifted_ = undefined;
|
|
206
|
+
this.anchor_();
|
|
207
|
+
const to = CesiumMath.toRadians(heading);
|
|
208
|
+
const delta = CesiumMath.negativePiToPi(to - this.heading_);
|
|
209
|
+
this.turning_ = { from: this.heading_, to: this.heading_ + delta, start: performance.now() };
|
|
210
|
+
this.animate_();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* A quarter turn, eased, to the next corner: the camera clockwise about the middle, seen from above (-1, as Q), or
|
|
214
|
+
* the other way (1, as E); 0 to the nearest.
|
|
215
|
+
* @param {number} sign
|
|
216
|
+
*/
|
|
217
|
+
turn(sign) {
|
|
218
|
+
this.drift_ = this.drifted_ = undefined;
|
|
219
|
+
this.anchor_();
|
|
220
|
+
this.turning_ = { from: this.heading_, to: this.cornerAfter_(this.heading_, -sign), start: performance.now() };
|
|
221
|
+
this.animate_();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Zooms in (a factor below 1) or out, toward a point on the screen, by default its middle.
|
|
225
|
+
* @param {number} factor
|
|
226
|
+
* @param {Cartesian2} [at]
|
|
227
|
+
*/
|
|
228
|
+
zoom(factor, at) {
|
|
229
|
+
const { canvas } = this.viewer.scene;
|
|
230
|
+
const point = at ?? new Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
|
|
231
|
+
const before = this.ground_(point, this.target_);
|
|
232
|
+
this.size_ = CesiumMath.clamp(this.size_ * factor, this.minSize_, this.maxSize_);
|
|
233
|
+
this.place_();
|
|
234
|
+
if (before) {
|
|
235
|
+
this.keep_(before, point);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Glides the view's middle to a position, eased.
|
|
240
|
+
* @param {Cartesian3 | undefined} position
|
|
241
|
+
*/
|
|
242
|
+
glideTo(position) {
|
|
243
|
+
if (!position) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.drift_ = this.drifted_ = undefined;
|
|
247
|
+
this.gliding_ = { from: Cartesian3.clone(this.target_), to: Cartesian3.clone(position), start: performance.now() };
|
|
248
|
+
this.animate_();
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The camera on its orbit about the target, the frustum as wide as the size on the shorter side. Set straight: in
|
|
252
|
+
* the target's east-north-up frame, looking along the heading, down by the pitch; Cesium's lookAt and setView would
|
|
253
|
+
* read the depth under the middle back from the GPU to size an orthographic frustum, a stall at each move.
|
|
254
|
+
*/
|
|
255
|
+
place_() {
|
|
256
|
+
if (!this.active_) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (this.limit_) {
|
|
260
|
+
this.target_ = Cartesian3.clone(this.limit_(this.target_), this.target_);
|
|
261
|
+
}
|
|
262
|
+
const { camera, ellipsoid } = this.viewer.scene;
|
|
263
|
+
const [sh, ch, sp, cp] = [Math.sin(this.heading_), Math.cos(this.heading_), Math.sin(this.pitch_), Math.cos(this.pitch_)];
|
|
264
|
+
const frame = FixedFrameTransforms.eastNorthUpToFixedFrame(this.target_, ellipsoid, frameScratch);
|
|
265
|
+
const direction = Matrix4.multiplyByPointAsVector(frame, Cartesian3.fromElements(sh * cp, ch * cp, -sp, directionScratch), directionScratch);
|
|
266
|
+
const up = Matrix4.multiplyByPointAsVector(frame, Cartesian3.fromElements(sh * sp, ch * sp, cp, upScratch), upScratch);
|
|
267
|
+
Matrix4.multiplyByPoint(frame, Cartesian3.fromElements(-sh * cp * this.orbit_, -ch * cp * this.orbit_, sp * this.orbit_, orbitScratch), camera.position);
|
|
268
|
+
Cartesian3.clone(direction, camera.direction);
|
|
269
|
+
Cartesian3.clone(up, camera.up);
|
|
270
|
+
Cartesian3.cross(direction, up, camera.right);
|
|
271
|
+
// the orthographic frustum's width
|
|
272
|
+
// the orthographic frustum's width; a subclass placing the camera on a perspective frustum has none to set
|
|
273
|
+
if ('width' in camera.frustum) {
|
|
274
|
+
camera.frustum.width = this.width_();
|
|
275
|
+
}
|
|
276
|
+
this.viewer.scene.requestRender();
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The view's width, in meters: the size on the screen's shorter side.
|
|
280
|
+
*/
|
|
281
|
+
width_() {
|
|
282
|
+
const { canvas } = this.viewer.scene;
|
|
283
|
+
return this.size_ * Math.max(1, canvas.clientWidth / canvas.clientHeight);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The heading of the corner after the nearest, by a sign.
|
|
287
|
+
* @param {number} heading
|
|
288
|
+
* @param {number} sign
|
|
289
|
+
*/
|
|
290
|
+
cornerAfter_(heading, sign) {
|
|
291
|
+
const quarter = CesiumMath.PI_OVER_TWO;
|
|
292
|
+
return this.corner_ + (Math.round((heading - this.corner_) / quarter) + sign) * quarter;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* A point of the canvas, from a pointer event.
|
|
296
|
+
* @param {MouseEvent} e
|
|
297
|
+
*/
|
|
298
|
+
at_(e) {
|
|
299
|
+
const rect = this.viewer.scene.canvas.getBoundingClientRect();
|
|
300
|
+
return new Cartesian2(e.clientX - rect.left, e.clientY - rect.top);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* What is seen at a point of the canvas: the scene, else the globe, if shown.
|
|
304
|
+
* @param {Cartesian2} point
|
|
305
|
+
* @returns {Cartesian3 | undefined}
|
|
306
|
+
*/
|
|
307
|
+
pick_(point) {
|
|
308
|
+
const { scene } = this.viewer;
|
|
309
|
+
const position = scene.pickPositionSupported ? scene.pickPosition(point) : undefined;
|
|
310
|
+
const ray = position || !scene.globe?.show ? undefined : scene.camera.getPickRay(point);
|
|
311
|
+
return position ?? (ray && scene.globe.pick(ray, scene));
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Where a point of the canvas meets the ground's plane through a position.
|
|
315
|
+
* @param {Cartesian2} point
|
|
316
|
+
* @param {Cartesian3} through
|
|
317
|
+
* @returns {Cartesian3 | undefined}
|
|
318
|
+
*/
|
|
319
|
+
ground_(point, through) {
|
|
320
|
+
const { scene } = this.viewer;
|
|
321
|
+
const normal = scene.ellipsoid.geodeticSurfaceNormal(through, normalScratch);
|
|
322
|
+
const plane = Plane.fromPointNormal(through, normal, planeScratch);
|
|
323
|
+
const ray = scene.camera.getPickRay(Cartesian2.clone(point, positionScratch));
|
|
324
|
+
return ray && IntersectionTests.rayPlane(ray, plane, new Cartesian3());
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Slides the view so that a position of the ground is under a point of the canvas.
|
|
328
|
+
* @param {Cartesian3} position
|
|
329
|
+
* @param {Cartesian2} point
|
|
330
|
+
*/
|
|
331
|
+
keep_(position, point) {
|
|
332
|
+
const now = this.ground_(point, position);
|
|
333
|
+
if (now) {
|
|
334
|
+
Cartesian3.add(this.target_, Cartesian3.subtract(position, now, deltaScratch), this.target_);
|
|
335
|
+
this.place_();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The target moved onto what is seen in the middle of the screen: the view does not change, being orthographic, but
|
|
340
|
+
* it turns about the ground there.
|
|
341
|
+
*/
|
|
342
|
+
anchor_() {
|
|
343
|
+
const { canvas } = this.viewer.scene;
|
|
344
|
+
const ground = this.pick_(new Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2));
|
|
345
|
+
if (ground) {
|
|
346
|
+
this.target_ = ground;
|
|
347
|
+
this.place_();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @param {PointerEvent} e
|
|
352
|
+
*/
|
|
353
|
+
down_(e) {
|
|
354
|
+
const canvas = this.viewer.scene.canvas;
|
|
355
|
+
canvas.setPointerCapture(e.pointerId);
|
|
356
|
+
this.settle_();
|
|
357
|
+
this.pointers_.set(e.pointerId, this.at_(e));
|
|
358
|
+
this.gliding_ = this.drift_ = this.drifted_ = undefined;
|
|
359
|
+
this.snapshot_(e.timeStamp);
|
|
360
|
+
this.drag_ = this.start_(e);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* What the pointers down do: one finger, the right button, or the left with Ctrl or Shift slide the view; the left
|
|
364
|
+
* turns it; two fingers pinch, slide and twist it.
|
|
365
|
+
* @param {PointerEvent} e
|
|
366
|
+
*/
|
|
367
|
+
start_(e) {
|
|
368
|
+
const points = [...this.pointers_.values()];
|
|
369
|
+
if (points.length === 2) {
|
|
370
|
+
const [a, b] = points;
|
|
371
|
+
const middle = Cartesian2.lerp(a, b, 0.5, new Cartesian2());
|
|
372
|
+
return { grab: this.ground_(middle, this.target_), distance: Cartesian2.distance(a, b), angle: Math.atan2(b.y - a.y, b.x - a.x), twist: 0 };
|
|
373
|
+
}
|
|
374
|
+
const slide = e.pointerType === 'touch' || e.button === 2 || e.ctrlKey || e.shiftKey;
|
|
375
|
+
const point = /** @type {{x: number, y: number}} */ (points[0]);
|
|
376
|
+
return slide ? { grab: this.ground_(new Cartesian2(point.x, point.y), this.target_) } : { turn: true, last: point };
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @param {PointerEvent} e
|
|
380
|
+
*/
|
|
381
|
+
move_(e) {
|
|
382
|
+
if (!this.pointers_.has(e.pointerId) || !this.drag_) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
this.pointers_.set(e.pointerId, this.at_(e));
|
|
386
|
+
const drag = this.drag_;
|
|
387
|
+
const points = [...this.pointers_.values()];
|
|
388
|
+
if (points.length === 2 && drag.distance !== undefined) {
|
|
389
|
+
const [a, b] = /** @type {[Cartesian2, Cartesian2]} */ (points);
|
|
390
|
+
const middle = Cartesian2.lerp(a, b, 0.5, new Cartesian2());
|
|
391
|
+
const [distance, angle] = [Cartesian2.distance(a, b), Math.atan2(b.y - a.y, b.x - a.x)];
|
|
392
|
+
this.size_ = CesiumMath.clamp(this.size_ * drag.distance / distance, this.minSize_, this.maxSize_);
|
|
393
|
+
this.place_();
|
|
394
|
+
if (drag.grab) {
|
|
395
|
+
this.keep_(drag.grab, middle);
|
|
396
|
+
}
|
|
397
|
+
const turned = CesiumMath.negativePiToPi(angle - /** @type {number} */ (drag.angle));
|
|
398
|
+
drag.twist = /** @type {number} */ (drag.twist) + turned;
|
|
399
|
+
if (Math.abs(drag.twist) >= TWIST) {
|
|
400
|
+
// the screen's y down: the fingers turning clockwise on it turn the ground clockwise under them
|
|
401
|
+
this.heading_ -= turned;
|
|
402
|
+
this.place_();
|
|
403
|
+
}
|
|
404
|
+
Object.assign(drag, { distance, angle });
|
|
405
|
+
// no drift after a pinch
|
|
406
|
+
this.snapshot_(e.timeStamp);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
else if (drag.turn && drag.last) {
|
|
410
|
+
const point = /** @type {{x: number, y: number}} */ (points[0]);
|
|
411
|
+
this.heading_ -= CesiumMath.TWO_PI * (point.x - drag.last.x) / this.viewer.scene.canvas.clientHeight;
|
|
412
|
+
drag.last = point;
|
|
413
|
+
this.place_();
|
|
414
|
+
}
|
|
415
|
+
else if (drag.grab) {
|
|
416
|
+
const point = /** @type {{x: number, y: number}} */ (points[0]);
|
|
417
|
+
this.keep_(drag.grab, new Cartesian2(point.x, point.y));
|
|
418
|
+
}
|
|
419
|
+
this.track_(e.timeStamp);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Where the view is, to measure its next move from.
|
|
423
|
+
* @param {number} time
|
|
424
|
+
*/
|
|
425
|
+
snapshot_(time) {
|
|
426
|
+
this.moved_ = { time, heading: this.heading_, target: Cartesian3.clone(this.target_), turn: 0, slide: new Cartesian3() };
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* How fast the view moves under the drag, smoothed over the last moves.
|
|
430
|
+
* @param {number} time
|
|
431
|
+
*/
|
|
432
|
+
track_(time) {
|
|
433
|
+
const moved = this.moved_;
|
|
434
|
+
const dt = moved ? time - moved.time : 0;
|
|
435
|
+
if (!moved || dt <= 0) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const slide = Cartesian3.divideByScalar(Cartesian3.subtract(this.target_, moved.target, deltaScratch), dt, deltaScratch);
|
|
439
|
+
moved.turn = (moved.turn + (this.heading_ - moved.heading) / dt) / 2;
|
|
440
|
+
Cartesian3.divideByScalar(Cartesian3.add(moved.slide, slide, moved.slide), 2, moved.slide);
|
|
441
|
+
Object.assign(moved, { time, heading: this.heading_, target: Cartesian3.clone(this.target_, moved.target) });
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* @param {PointerEvent} e
|
|
445
|
+
*/
|
|
446
|
+
up_(e) {
|
|
447
|
+
// a pointer pressed elsewhere (on a control over the canvas) and let go here was never the view's
|
|
448
|
+
if (!this.pointers_.has(e.pointerId)) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
this.pointers_.delete(e.pointerId);
|
|
452
|
+
// a finger lifted: the other slides on, from here
|
|
453
|
+
this.drag_ = this.pointers_.size ? this.start_(e) : undefined;
|
|
454
|
+
if (this.drag_) {
|
|
455
|
+
this.snapshot_(e.timeStamp);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
// let go while moving: the view drifts on, slowing down; else it turns about the ground in the middle
|
|
459
|
+
const moved = this.moved_;
|
|
460
|
+
this.moved_ = undefined;
|
|
461
|
+
if (moved && e.timeStamp - moved.time < LET_GO && (moved.turn || Cartesian3.magnitude(moved.slide))) {
|
|
462
|
+
this.drift_ = { turn: moved.turn, slide: moved.slide };
|
|
463
|
+
this.animate_();
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
this.anchor_();
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* @param {WheelEvent} e
|
|
471
|
+
*/
|
|
472
|
+
wheel_(e) {
|
|
473
|
+
e.preventDefault();
|
|
474
|
+
this.zoom(Math.pow(1.0015, e.deltaY * (e.deltaMode === 1 ? 33 : 1)), this.at_(e));
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @param {KeyboardEvent} e
|
|
478
|
+
*/
|
|
479
|
+
keydown_(e) {
|
|
480
|
+
const target = /** @type {Element | null} */ (e.target);
|
|
481
|
+
if (target?.closest?.('input, select, textarea') || e.ctrlKey || e.metaKey || e.altKey) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const key = e.key.toLowerCase();
|
|
485
|
+
if (key === 'q' || key === 'e') {
|
|
486
|
+
this.turn(key === 'q' ? -1 : 1);
|
|
487
|
+
}
|
|
488
|
+
else if (key in PAN) {
|
|
489
|
+
this.held_.add(key);
|
|
490
|
+
e.preventDefault();
|
|
491
|
+
this.animate_();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* The keys held, the drift, the turn and the glide, a frame at a time, until they are done.
|
|
496
|
+
*/
|
|
497
|
+
animate_() {
|
|
498
|
+
if (this.frame_ !== undefined) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
const step = (/** @type {number} */ now) => {
|
|
502
|
+
this.frame_ = undefined;
|
|
503
|
+
if (!this.active_) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
if (this.held_.size) {
|
|
507
|
+
const [x, y] = [...this.held_].reduce(([x, y], key) => [x + (PAN[key]?.[0] ?? 0), y + (PAN[key]?.[1] ?? 0)], [0, 0]);
|
|
508
|
+
const width = this.width_();
|
|
509
|
+
const meters = PAN_SPEED * width * Math.min(0.05, (now - (this.slid_ ?? now)) / 1000);
|
|
510
|
+
const { canvas } = this.viewer.scene;
|
|
511
|
+
const middle = new Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
|
|
512
|
+
const length = Math.hypot(x, y);
|
|
513
|
+
if (length) {
|
|
514
|
+
// the ground in the middle kept under a point of the screen as far from it as the keys slide, the other way;
|
|
515
|
+
// up the screen, the ground foreshortened by the pitch
|
|
516
|
+
const pixels = meters / width * canvas.clientWidth;
|
|
517
|
+
this.keep_(this.target_, new Cartesian2(middle.x - x / length * pixels, middle.y + y / length * pixels * Math.sin(this.pitch_)));
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
this.slid_ = this.held_.size ? now : undefined;
|
|
521
|
+
if (this.drift_) {
|
|
522
|
+
const dt = Math.min(50, now - (this.drifted_ ?? now));
|
|
523
|
+
this.heading_ += this.drift_.turn * dt;
|
|
524
|
+
Cartesian3.add(this.target_, Cartesian3.multiplyByScalar(this.drift_.slide, dt, deltaScratch), this.target_);
|
|
525
|
+
this.place_();
|
|
526
|
+
const keep = DAMPING ** (dt * 60 / 1000);
|
|
527
|
+
this.drift_.turn *= keep;
|
|
528
|
+
Cartesian3.multiplyByScalar(this.drift_.slide, keep, this.drift_.slide);
|
|
529
|
+
this.drifted_ = now;
|
|
530
|
+
// stopped: under a pixel a second
|
|
531
|
+
if (Math.abs(this.drift_.turn) < 1e-5 && Cartesian3.magnitude(this.drift_.slide) < this.width_() * 1e-6) {
|
|
532
|
+
this.drift_ = this.drifted_ = undefined;
|
|
533
|
+
this.anchor_();
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (this.gliding_) {
|
|
537
|
+
const t = Math.min(1, (now - this.gliding_.start) / GLIDE_TIME);
|
|
538
|
+
Cartesian3.lerp(this.gliding_.from, this.gliding_.to, easeInOut(t), this.target_);
|
|
539
|
+
this.place_();
|
|
540
|
+
if (t === 1) {
|
|
541
|
+
this.gliding_ = undefined;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (this.turning_) {
|
|
545
|
+
const t = Math.min(1, (now - this.turning_.start) / TURN_TIME);
|
|
546
|
+
this.heading_ = CesiumMath.lerp(this.turning_.from, this.turning_.to, easeInOut(t));
|
|
547
|
+
this.place_();
|
|
548
|
+
if (t === 1) {
|
|
549
|
+
this.turning_ = undefined;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (this.held_.size || this.drift_ || this.gliding_ || this.turning_) {
|
|
553
|
+
this.frame_ = requestAnimationFrame(step);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
this.frame_ = requestAnimationFrame(step);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
//# sourceMappingURL=cesium-iso.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cesium-iso.js","sourceRoot":"","sources":["../src/cesium-iso.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,IAAI,IAAI,UAAU,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAC/I,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE9C,iHAAiH;AACjH,oGAAoG;AACpG,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,sHAAsH;AACtH,+CAA+C;AAC/C,MAAM,GAAG,GAAG,EAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC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,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACZ,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACrE,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoblocks/cesium-iso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -8,12 +8,26 @@
|
|
|
8
8
|
"url": "https://github.com/geoblocks/cesium-helpers/",
|
|
9
9
|
"directory": "packages/cesium-iso"
|
|
10
10
|
},
|
|
11
|
-
"main": "cesium-iso.js",
|
|
12
|
-
"module": "cesium-iso.js",
|
|
11
|
+
"main": "dist/cesium-iso.js",
|
|
12
|
+
"module": "dist/cesium-iso.js",
|
|
13
|
+
"types": "dist/cesium-iso.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"source": "./src/cesium-iso.js",
|
|
17
|
+
"types": "./dist/cesium-iso.d.ts",
|
|
18
|
+
"default": "./dist/cesium-iso.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
13
21
|
"sideEffects": false,
|
|
14
22
|
"files": [
|
|
15
|
-
"
|
|
23
|
+
"dist",
|
|
24
|
+
"src",
|
|
25
|
+
"!src/**/*.test.js"
|
|
16
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p .",
|
|
29
|
+
"prepack": "npm run build"
|
|
30
|
+
},
|
|
17
31
|
"publishConfig": {
|
|
18
32
|
"access": "public"
|
|
19
33
|
},
|
|
@@ -21,5 +35,5 @@
|
|
|
21
35
|
"@cesium/core": ">=0.1.0",
|
|
22
36
|
"@cesium/engine": ">=10"
|
|
23
37
|
},
|
|
24
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "a6d8fdfe6b9ad266fd8a4593c38efd24e9a5546b"
|
|
25
39
|
}
|
|
File without changes
|