@fnndsc/orrery 0.1.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 (116) hide show
  1. package/README.md +12 -0
  2. package/dist/controls/cameraRig.d.ts +223 -0
  3. package/dist/controls/cameraRig.js +353 -0
  4. package/dist/controls/cameraRig.js.map +1 -0
  5. package/dist/controls/gestures.d.ts +133 -0
  6. package/dist/controls/gestures.js +282 -0
  7. package/dist/controls/gestures.js.map +1 -0
  8. package/dist/controls/index.d.ts +9 -0
  9. package/dist/controls/index.js +10 -0
  10. package/dist/controls/index.js.map +1 -0
  11. package/dist/controls/picker.d.ts +117 -0
  12. package/dist/controls/picker.js +167 -0
  13. package/dist/controls/picker.js.map +1 -0
  14. package/dist/controls/replay.d.ts +94 -0
  15. package/dist/controls/replay.js +147 -0
  16. package/dist/controls/replay.js.map +1 -0
  17. package/dist/draw/censusField.d.ts +113 -0
  18. package/dist/draw/censusField.js +241 -0
  19. package/dist/draw/censusField.js.map +1 -0
  20. package/dist/draw/constants.d.ts +13 -0
  21. package/dist/draw/constants.js +14 -0
  22. package/dist/draw/constants.js.map +1 -0
  23. package/dist/draw/geometry.d.ts +33 -0
  24. package/dist/draw/geometry.js +55 -0
  25. package/dist/draw/geometry.js.map +1 -0
  26. package/dist/draw/handoff.d.ts +11 -0
  27. package/dist/draw/handoff.js +12 -0
  28. package/dist/draw/handoff.js.map +1 -0
  29. package/dist/draw/handoffField.d.ts +74 -0
  30. package/dist/draw/handoffField.js +151 -0
  31. package/dist/draw/handoffField.js.map +1 -0
  32. package/dist/draw/index.d.ts +20 -0
  33. package/dist/draw/index.js +21 -0
  34. package/dist/draw/index.js.map +1 -0
  35. package/dist/draw/labelField.d.ts +63 -0
  36. package/dist/draw/labelField.js +149 -0
  37. package/dist/draw/labelField.js.map +1 -0
  38. package/dist/draw/lamps.d.ts +16 -0
  39. package/dist/draw/lamps.js +17 -0
  40. package/dist/draw/lamps.js.map +1 -0
  41. package/dist/draw/nebula.d.ts +8 -0
  42. package/dist/draw/nebula.js +28 -0
  43. package/dist/draw/nebula.js.map +1 -0
  44. package/dist/draw/palette.d.ts +41 -0
  45. package/dist/draw/palette.js +32 -0
  46. package/dist/draw/palette.js.map +1 -0
  47. package/dist/draw/sphereField.d.ts +98 -0
  48. package/dist/draw/sphereField.js +168 -0
  49. package/dist/draw/sphereField.js.map +1 -0
  50. package/dist/draw/starField.d.ts +127 -0
  51. package/dist/draw/starField.js +267 -0
  52. package/dist/draw/starField.js.map +1 -0
  53. package/dist/draw/stars.d.ts +65 -0
  54. package/dist/draw/stars.js +132 -0
  55. package/dist/draw/stars.js.map +1 -0
  56. package/dist/draw/timing.d.ts +11 -0
  57. package/dist/draw/timing.js +12 -0
  58. package/dist/draw/timing.js.map +1 -0
  59. package/dist/draw/tubeField.d.ts +131 -0
  60. package/dist/draw/tubeField.js +352 -0
  61. package/dist/draw/tubeField.js.map +1 -0
  62. package/dist/draw/tubes.d.ts +41 -0
  63. package/dist/draw/tubes.js +116 -0
  64. package/dist/draw/tubes.js.map +1 -0
  65. package/dist/index.d.ts +15 -0
  66. package/dist/index.js +15 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/layout/accretion.d.ts +31 -0
  69. package/dist/layout/accretion.js +384 -0
  70. package/dist/layout/accretion.js.map +1 -0
  71. package/dist/layout/constellations.d.ts +25 -0
  72. package/dist/layout/constellations.js +197 -0
  73. package/dist/layout/constellations.js.map +1 -0
  74. package/dist/layout/galaxy.d.ts +12 -0
  75. package/dist/layout/galaxy.js +99 -0
  76. package/dist/layout/galaxy.js.map +1 -0
  77. package/dist/layout/hierarchy.d.ts +45 -0
  78. package/dist/layout/hierarchy.js +464 -0
  79. package/dist/layout/hierarchy.js.map +1 -0
  80. package/dist/layout/index.d.ts +20 -0
  81. package/dist/layout/index.js +21 -0
  82. package/dist/layout/index.js.map +1 -0
  83. package/dist/layout/layoutInput.d.ts +29 -0
  84. package/dist/layout/layoutInput.js +45 -0
  85. package/dist/layout/layoutInput.js.map +1 -0
  86. package/dist/layout/molecule.d.ts +64 -0
  87. package/dist/layout/molecule.js +155 -0
  88. package/dist/layout/molecule.js.map +1 -0
  89. package/dist/layout/pull.d.ts +94 -0
  90. package/dist/layout/pull.js +137 -0
  91. package/dist/layout/pull.js.map +1 -0
  92. package/dist/layout/ranked.d.ts +75 -0
  93. package/dist/layout/ranked.js +148 -0
  94. package/dist/layout/ranked.js.map +1 -0
  95. package/dist/layout/registry.d.ts +23 -0
  96. package/dist/layout/registry.js +165 -0
  97. package/dist/layout/registry.js.map +1 -0
  98. package/dist/layout/seeded.d.ts +32 -0
  99. package/dist/layout/seeded.js +48 -0
  100. package/dist/layout/seeded.js.map +1 -0
  101. package/dist/layout/types.d.ts +81 -0
  102. package/dist/layout/types.js +14 -0
  103. package/dist/layout/types.js.map +1 -0
  104. package/dist/scene/index.d.ts +6 -0
  105. package/dist/scene/index.js +7 -0
  106. package/dist/scene/index.js.map +1 -0
  107. package/dist/scene/orrery.d.ts +592 -0
  108. package/dist/scene/orrery.js +1555 -0
  109. package/dist/scene/orrery.js.map +1 -0
  110. package/dist/types/encoding.d.ts +43 -0
  111. package/dist/types/encoding.js +7 -0
  112. package/dist/types/encoding.js.map +1 -0
  113. package/dist/types/space.d.ts +12 -0
  114. package/dist/types/space.js +10 -0
  115. package/dist/types/space.js.map +1 -0
  116. package/package.json +57 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @file Pointer gestures: a mouse, a pen and fingers, read as intents.
3
+ *
4
+ * The canvas hears raw pointer events; the rig and the scene want intents.
5
+ * This sits between and keeps every piece of pointer state in one place:
6
+ *
7
+ * - a press on empty space begins a VIEW DRAG — an orbit, or a pan with
8
+ * shift or the right or middle button (always a pan in a flat view);
9
+ * - a press the scene takes as a GRAB (a node under the pointer) is handed
10
+ * back to it, move by move, until the release;
11
+ * - two FINGERS steer the camera together — spreading closes in, pinching
12
+ * draws back, the pair moving together pans — and the finger left when
13
+ * one lifts neither orbits nor taps;
14
+ * - a click SELECTS, a double click ACTIVATES; a finger has no double click
15
+ * it can count on, so two taps close in time and place are one;
16
+ * - the click that ends a drag, a pull or a gesture is its release, never a
17
+ * select;
18
+ * - the wheel dollies.
19
+ *
20
+ * What lies under the pointer, what a grab moves, and what a tip says are
21
+ * the scene's; this knows only pointers.
22
+ *
23
+ * @module
24
+ */
25
+ import type { CameraRig } from './cameraRig.js';
26
+ /** Screen travel past which a press becomes a drag. */
27
+ export declare const DRAG_THRESHOLD_PX: number;
28
+ /** Two taps this close in time are a double tap. */
29
+ export declare const DOUBLE_TAP_MS: number;
30
+ /** Two taps this close in place are a double tap. */
31
+ export declare const DOUBLE_TAP_PX: number;
32
+ /**
33
+ * What the gestures hand back to the scene that owns the canvas.
34
+ *
35
+ * @property grab_begin - A press landed where no gesture holds the camera:
36
+ * return true when it took hold of something, and its moves come here.
37
+ * @property grab_move - The pointer moved while holding.
38
+ * @property grab_end - The hold let go: return whether it had moved, so its
39
+ * click is swallowed.
40
+ * @property hover - The pointer moved over the field with nothing held.
41
+ * @property leave - The pointer left the field.
42
+ * @property tap - A click or a tap: `select`, or `activate` on a double.
43
+ * @property tip_hide - A press or a gesture began; whatever names the thing
44
+ * under the pointer is out of date.
45
+ * @property gesture_end - The last finger of a two-finger gesture lifted:
46
+ * the camera stands where the fingers left it. Optional — a scene that
47
+ * reads nothing into a finished pinch leaves it out.
48
+ */
49
+ export interface GestureTarget {
50
+ grab_begin(event: PointerEvent): boolean;
51
+ grab_move(event: PointerEvent): void;
52
+ grab_end(): boolean;
53
+ hover(event: PointerEvent): void;
54
+ leave(event: PointerEvent): void;
55
+ tap(event: MouseEvent, kind: 'select' | 'activate'): void;
56
+ tip_hide(): void;
57
+ gesture_end?(): void;
58
+ }
59
+ /**
60
+ * How the view is steered, read at the moment it is.
61
+ *
62
+ * @property flat - The view is flat: a drag pans, never orbits.
63
+ * @property untethered - The camera is parked off the focus (a place, not
64
+ * a thing): the dolly runs down the eye ray, and a pinch does not pan.
65
+ */
66
+ export interface GestureMode {
67
+ flat(): boolean;
68
+ untethered(): boolean;
69
+ }
70
+ /**
71
+ * The pointer's intents on one canvas.
72
+ */
73
+ export declare class PointerGestures {
74
+ private readonly element;
75
+ private readonly rig;
76
+ private readonly target;
77
+ private readonly mode;
78
+ private readonly clock;
79
+ private readonly touches;
80
+ private pinch;
81
+ private gestureHeld;
82
+ private lastTap;
83
+ private kind;
84
+ private tapActivatedAt;
85
+ private suppressClick;
86
+ private viewDrag;
87
+ private grabbing;
88
+ private over;
89
+ private readonly detachers;
90
+ /**
91
+ * @param element - The canvas; its touch action is taken from the page.
92
+ * @param rig - The camera the view gestures steer.
93
+ * @param target - The scene's side of each gesture.
94
+ * @param mode - How the view is steered right now.
95
+ * @param clock - Wall-clock milliseconds; `Date.now` unless a test drives time.
96
+ */
97
+ constructor(element: HTMLElement, rig: CameraRig, target: GestureTarget, mode: GestureMode, clock?: () => number);
98
+ /** @returns Whether the pointer is over the field: the idle spin waits while it is. */
99
+ pointerOver(): boolean;
100
+ /** @returns What the last press was made with: `mouse`, `pen` or `touch`. */
101
+ pressKind(): string;
102
+ /** @returns How many fingers are down. */
103
+ fingersDown(): number;
104
+ /** Stops listening. */
105
+ detach(): void;
106
+ private listen;
107
+ private click_handle;
108
+ private down_handle;
109
+ private up_handle;
110
+ private move_handle;
111
+ private hover;
112
+ /**
113
+ * A press touches the space: the idle spin pauses exactly where it is —
114
+ * never a snap — and what follows depends on what was under the pointer.
115
+ */
116
+ private press;
117
+ /** Lets go of whatever a press began: a view drag, or the scene's grab. */
118
+ private release;
119
+ /** Steers the view from an empty-space drag: orbit, or pan. */
120
+ private view_move;
121
+ /** The two fingers down: their spread and their middle. */
122
+ private fingers_read;
123
+ /**
124
+ * A second finger lands: whatever the first began — a pull, an orbit —
125
+ * lets go, and the two steer the camera together until they lift.
126
+ */
127
+ private gesture_begin;
128
+ /**
129
+ * Two fingers move: spreading closes in and pinching draws back, as the
130
+ * wheel does, and the pair moving together pans.
131
+ */
132
+ private gesture_move;
133
+ }
@@ -0,0 +1,282 @@
1
+ /** Screen travel past which a press becomes a drag. */
2
+ export const DRAG_THRESHOLD_PX = 4;
3
+ /** Two taps this close in time are a double tap. */
4
+ export const DOUBLE_TAP_MS = 350;
5
+ /** Two taps this close in place are a double tap. */
6
+ export const DOUBLE_TAP_PX = 30;
7
+ /** A browser's own dblclick this soon after a double tap is the same act. */
8
+ const TAP_DBLCLICK_ECHO_MS = 600;
9
+ /** How long the lift that ends a gesture keeps swallowing its click. */
10
+ const GESTURE_LIFT_MS = 400;
11
+ /**
12
+ * The pointer's intents on one canvas.
13
+ */
14
+ export class PointerGestures {
15
+ element;
16
+ rig;
17
+ target;
18
+ mode;
19
+ clock;
20
+ touches = new Map();
21
+ pinch = null;
22
+ gestureHeld = false;
23
+ lastTap = null;
24
+ kind = 'mouse';
25
+ tapActivatedAt = 0;
26
+ suppressClick = false;
27
+ viewDrag = null;
28
+ grabbing = false;
29
+ over = false;
30
+ detachers = [];
31
+ /**
32
+ * @param element - The canvas; its touch action is taken from the page.
33
+ * @param rig - The camera the view gestures steer.
34
+ * @param target - The scene's side of each gesture.
35
+ * @param mode - How the view is steered right now.
36
+ * @param clock - Wall-clock milliseconds; `Date.now` unless a test drives time.
37
+ */
38
+ constructor(element, rig, target, mode, clock = Date.now) {
39
+ this.element = element;
40
+ this.rig = rig;
41
+ this.target = target;
42
+ this.mode = mode;
43
+ this.clock = clock;
44
+ // Fingers belong to the scene, not the page: without this the browser
45
+ // takes a pinch for a page zoom and a drag for a scroll.
46
+ element.style.touchAction = 'none';
47
+ this.listen('click', (event) => this.click_handle(event));
48
+ this.listen('dblclick', (event) => {
49
+ if (this.clock() - this.tapActivatedAt < TAP_DBLCLICK_ECHO_MS)
50
+ return;
51
+ this.target.tap(event, 'activate');
52
+ });
53
+ this.listen('pointerdown', (event) => this.down_handle(event));
54
+ this.listen('pointerup', (event) => this.up_handle(event));
55
+ this.listen('pointercancel', (event) => this.up_handle(event));
56
+ this.listen('pointermove', (event) => this.move_handle(event));
57
+ this.listen('pointerleave', (event) => {
58
+ this.over = false;
59
+ this.target.leave(event);
60
+ });
61
+ // The wheel dollies: closer to read a dense graph, back for the whole.
62
+ this.listen('wheel', (event) => {
63
+ event.preventDefault();
64
+ this.rig.dolly(event.deltaY, this.mode.untethered());
65
+ }, { passive: false });
66
+ // Right-drag pans; the browser's menu would eat the gesture.
67
+ this.listen('contextmenu', (event) => event.preventDefault());
68
+ }
69
+ /** @returns Whether the pointer is over the field: the idle spin waits while it is. */
70
+ pointerOver() {
71
+ return this.over;
72
+ }
73
+ /** @returns What the last press was made with: `mouse`, `pen` or `touch`. */
74
+ pressKind() {
75
+ return this.kind;
76
+ }
77
+ /** @returns How many fingers are down. */
78
+ fingersDown() {
79
+ return this.touches.size;
80
+ }
81
+ /** Stops listening. */
82
+ detach() {
83
+ for (const off of this.detachers.splice(0))
84
+ off();
85
+ }
86
+ listen(name, handler, options) {
87
+ this.element.addEventListener(name, handler, options);
88
+ this.detachers.push(() => this.element.removeEventListener(name, handler, options));
89
+ }
90
+ click_handle(event) {
91
+ // The click that ends a pull, a view drag or a gesture is its release.
92
+ if (this.suppressClick) {
93
+ this.suppressClick = false;
94
+ return;
95
+ }
96
+ if (this.kind === 'touch') {
97
+ const now = this.clock();
98
+ const last = this.lastTap;
99
+ if (last !== null && now - last.at <= DOUBLE_TAP_MS && Math.hypot(event.clientX - last.x, event.clientY - last.y) <= DOUBLE_TAP_PX) {
100
+ this.lastTap = null;
101
+ this.tapActivatedAt = now;
102
+ this.target.tap(event, 'activate');
103
+ return;
104
+ }
105
+ this.lastTap = { at: now, x: event.clientX, y: event.clientY };
106
+ }
107
+ this.target.tap(event, 'select');
108
+ }
109
+ down_handle(event) {
110
+ this.kind = event.pointerType;
111
+ if (event.pointerType === 'touch') {
112
+ // The first finger of a new touch starts clean: a lift the browser
113
+ // never reported (a cancelled gesture, a system swipe) must not leave
114
+ // a phantom finger that turns every later tap into a third.
115
+ if (event.isPrimary) {
116
+ this.touches.clear();
117
+ this.pinch = null;
118
+ this.gestureHeld = false;
119
+ }
120
+ this.touches.set(event.pointerId, { x: event.clientX, y: event.clientY });
121
+ if (this.touches.size === 2) {
122
+ this.gesture_begin();
123
+ return;
124
+ }
125
+ if (this.touches.size > 2 || this.gestureHeld)
126
+ return;
127
+ this.press(event);
128
+ // No hover under a finger: the press names what it landed on — after
129
+ // the press, which clears the tip a cursor leaves behind.
130
+ this.hover(event);
131
+ return;
132
+ }
133
+ this.press(event);
134
+ }
135
+ up_handle(event) {
136
+ if (event.pointerType === 'touch') {
137
+ this.touches.delete(event.pointerId);
138
+ if (this.touches.size < 2)
139
+ this.pinch = null;
140
+ if (this.touches.size === 0 && this.gestureHeld) {
141
+ this.gestureHeld = false;
142
+ // The lift that ends a gesture is not a tap.
143
+ this.suppressClick = true;
144
+ setTimeout(() => { this.suppressClick = false; }, GESTURE_LIFT_MS);
145
+ this.release();
146
+ this.target.gesture_end?.();
147
+ return;
148
+ }
149
+ }
150
+ this.release();
151
+ }
152
+ move_handle(event) {
153
+ if (event.pointerType === 'touch' && this.touches.has(event.pointerId)) {
154
+ this.touches.set(event.pointerId, { x: event.clientX, y: event.clientY });
155
+ if (this.pinch !== null) {
156
+ this.gesture_move();
157
+ return;
158
+ }
159
+ if (this.gestureHeld)
160
+ return;
161
+ }
162
+ if (this.grabbing) {
163
+ this.target.grab_move(event);
164
+ }
165
+ else if (this.viewDrag !== null) {
166
+ this.view_move(event);
167
+ }
168
+ else {
169
+ this.hover(event);
170
+ }
171
+ }
172
+ hover(event) {
173
+ // The space holds still while the pointer is over it: a target that
174
+ // turns under the cursor is a click on a neighbour.
175
+ this.over = true;
176
+ this.target.hover(event);
177
+ }
178
+ /**
179
+ * A press touches the space: the idle spin pauses exactly where it is —
180
+ * never a snap — and what follows depends on what was under the pointer.
181
+ */
182
+ press(event) {
183
+ if (this.rig.holding_get() || this.rig.flying())
184
+ return;
185
+ this.rig.spin_pause();
186
+ if (this.target.grab_begin(event)) {
187
+ this.grabbing = true;
188
+ }
189
+ else {
190
+ this.viewDrag = {
191
+ lastX: event.clientX,
192
+ lastY: event.clientY,
193
+ startX: event.clientX,
194
+ startY: event.clientY,
195
+ pan: event.shiftKey || event.button === 2 || event.button === 1,
196
+ moved: false,
197
+ };
198
+ }
199
+ try {
200
+ this.element.setPointerCapture(event.pointerId);
201
+ }
202
+ catch {
203
+ // A capture refusal (synthetic events, a vanished pointer) only costs
204
+ // drag continuity outside the canvas.
205
+ }
206
+ this.target.tip_hide();
207
+ }
208
+ /** Lets go of whatever a press began: a view drag, or the scene's grab. */
209
+ release() {
210
+ if (this.viewDrag !== null) {
211
+ if (this.viewDrag.moved)
212
+ this.suppressClick = true;
213
+ this.viewDrag = null;
214
+ this.rig.spin_pause();
215
+ }
216
+ if (!this.grabbing)
217
+ return;
218
+ this.grabbing = false;
219
+ this.rig.spin_pause();
220
+ if (this.target.grab_end())
221
+ this.suppressClick = true;
222
+ }
223
+ /** Steers the view from an empty-space drag: orbit, or pan. */
224
+ view_move(event) {
225
+ const drag = this.viewDrag;
226
+ if (drag === null)
227
+ return;
228
+ this.rig.spin_pause();
229
+ const dx = event.clientX - drag.lastX;
230
+ const dy = event.clientY - drag.lastY;
231
+ drag.lastX = event.clientX;
232
+ drag.lastY = event.clientY;
233
+ if (!drag.moved && Math.abs(event.clientX - drag.startX) + Math.abs(event.clientY - drag.startY) > DRAG_THRESHOLD_PX) {
234
+ drag.moved = true;
235
+ this.rig.touch_note();
236
+ }
237
+ if (!drag.moved)
238
+ return;
239
+ if (drag.pan || this.mode.flat()) {
240
+ this.rig.pan(dx, dy);
241
+ }
242
+ else {
243
+ this.rig.orbit(dx, dy);
244
+ }
245
+ }
246
+ /** The two fingers down: their spread and their middle. */
247
+ fingers_read() {
248
+ const [a, b] = [...this.touches.values()];
249
+ if (a === undefined || b === undefined)
250
+ return null;
251
+ return { spread: Math.hypot(a.x - b.x, a.y - b.y), midX: (a.x + b.x) / 2, midY: (a.y + b.y) / 2 };
252
+ }
253
+ /**
254
+ * A second finger lands: whatever the first began — a pull, an orbit —
255
+ * lets go, and the two steer the camera together until they lift.
256
+ */
257
+ gesture_begin() {
258
+ this.release();
259
+ this.gestureHeld = true;
260
+ this.pinch = this.fingers_read();
261
+ this.rig.spin_pause();
262
+ this.target.tip_hide();
263
+ }
264
+ /**
265
+ * Two fingers move: spreading closes in and pinching draws back, as the
266
+ * wheel does, and the pair moving together pans.
267
+ */
268
+ gesture_move() {
269
+ const now = this.fingers_read();
270
+ if (now === null || this.pinch === null)
271
+ return;
272
+ if (now.spread > 0 && this.pinch.spread > 0) {
273
+ // The spread's ratio is the zoom, in the wheel's own units, so a
274
+ // pinch and a wheel travel the same.
275
+ this.rig.dolly(Math.log(this.pinch.spread / now.spread) / 0.001, this.mode.untethered());
276
+ }
277
+ if (this.mode.flat() || !this.mode.untethered())
278
+ this.rig.pan(now.midX - this.pinch.midX, now.midY - this.pinch.midY);
279
+ this.pinch = now;
280
+ }
281
+ }
282
+ //# sourceMappingURL=gestures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../src/controls/gestures.ts"],"names":[],"mappings":"AA0BA,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AAC3C,oDAAoD;AACpD,MAAM,CAAC,MAAM,aAAa,GAAW,GAAG,CAAC;AACzC,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAW,EAAE,CAAC;AACxC,6EAA6E;AAC7E,MAAM,oBAAoB,GAAW,GAAG,CAAC;AACzC,wEAAwE;AACxE,MAAM,eAAe,GAAW,GAAG,CAAC;AAoDpC;;GAEG;AACH,MAAM,OAAO,eAAe;IAqBP;IACA;IACA;IACA;IACA;IAxBF,OAAO,GAA0C,IAAI,GAAG,EAAE,CAAC;IACpE,KAAK,GAA0D,IAAI,CAAC;IACpE,WAAW,GAAY,KAAK,CAAC;IAC7B,OAAO,G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IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,iEAAiE;YACjE,qCAAqC;YACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtH,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file The controls layer's public face: what steers the view.
3
+ *
4
+ * @module
5
+ */
6
+ export * from './cameraRig.js';
7
+ export * from './gestures.js';
8
+ export * from './picker.js';
9
+ export * from './replay.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file The controls layer's public face: what steers the view.
3
+ *
4
+ * @module
5
+ */
6
+ export * from './cameraRig.js';
7
+ export * from './gestures.js';
8
+ export * from './picker.js';
9
+ export * from './replay.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controls/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * @file Picking: what lies under a pointer, however it is drawn.
3
+ *
4
+ * The drawers keep what they draw; the picker asks the scene for it as
5
+ * plain sources — meshes, stars and nebulae as points with a reach, a
6
+ * census that picks by ray — and answers with an id. In order: a solid
7
+ * sphere wins (an entered feed stands as spheres among stars), then a
8
+ * census member, then the nearest star within its drawn size, then a
9
+ * nebula the pointer is inside. A dimmed thing is scenery and takes no
10
+ * pointer; a halo wrapping a cluster is taken only when nothing solid lies
11
+ * along the ray.
12
+ *
13
+ * @module
14
+ */
15
+ import * as THREE from 'three';
16
+ /** A fingertip is wider than a cursor: the least a star reaches for one. */
17
+ export declare const TOUCH_REACH_PX: number;
18
+ /** The least a star reaches for a cursor. */
19
+ export declare const CURSOR_REACH_PX: number;
20
+ /** A star as picking needs it: in the world group's own space. */
21
+ export interface PickStar {
22
+ id: string;
23
+ position: THREE.Vector3;
24
+ radius: number;
25
+ dim: boolean;
26
+ }
27
+ /** A nebula as picking needs it: in the world group's own space. */
28
+ export interface PickNebula {
29
+ id: string;
30
+ position: THREE.Vector3;
31
+ radius: number;
32
+ }
33
+ /**
34
+ * What can be picked, asked for at the moment of the pick.
35
+ *
36
+ * @property meshes - Solid spheres; each names its node in `userData.nodeId`
37
+ * and may be marked `dim` or `halo`.
38
+ * @property stars - Points of light.
39
+ * @property nebulae - Glows a pointer can be inside.
40
+ * @property census - A census that picks by ray, or null when none stands.
41
+ */
42
+ export interface PickSources {
43
+ meshes(): Iterable<THREE.Object3D>;
44
+ stars(): Iterable<PickStar>;
45
+ nebulae(): Iterable<PickNebula>;
46
+ census(): {
47
+ pick(raycaster: THREE.Raycaster): string | null;
48
+ } | null;
49
+ }
50
+ /** A pointer's place on the page. */
51
+ export interface PointerAt {
52
+ clientX: number;
53
+ clientY: number;
54
+ }
55
+ /**
56
+ * Finds what lies under a pointer.
57
+ */
58
+ export declare class Picker {
59
+ private readonly camera;
60
+ private readonly world;
61
+ private readonly element;
62
+ private readonly sources;
63
+ private readonly starGlow;
64
+ private readonly raycaster;
65
+ /**
66
+ * @param camera - The eye.
67
+ * @param world - The group every drawer hangs from.
68
+ * @param element - The canvas, for where a pointer falls on it.
69
+ * @param sources - What can be picked.
70
+ * @param starGlow - How far a star's glow reaches, in radii: its drawn size.
71
+ */
72
+ constructor(camera: THREE.PerspectiveCamera, world: THREE.Object3D, element: {
73
+ getBoundingClientRect(): DOMRect;
74
+ }, sources: PickSources, starGlow: number);
75
+ /**
76
+ * Aims the ray from the eye through the pointer, the world current.
77
+ *
78
+ * @param at - The pointer.
79
+ * @returns The aimed raycaster (shared: read it before the next aim).
80
+ */
81
+ ray_aim(at: PointerAt): THREE.Raycaster;
82
+ /**
83
+ * The solid sphere under the pointer. A halo wraps its cluster, so its
84
+ * surface is hit before the spheres inside it: a solid hit anywhere along
85
+ * the ray wins, the halo only when nothing solid is.
86
+ *
87
+ * @param at - The pointer.
88
+ * @returns The mesh, or null.
89
+ */
90
+ mesh_under(at: PointerAt): THREE.Mesh | null;
91
+ /**
92
+ * The node behind the solid sphere under the pointer.
93
+ *
94
+ * @param at - The pointer.
95
+ * @returns Its id, or null.
96
+ */
97
+ meshNode_under(at: PointerAt): string | null;
98
+ /**
99
+ * The node under the pointer, however it is drawn: a solid sphere, a
100
+ * census member, or a star (or nebula) when nothing solid is.
101
+ *
102
+ * @param at - The pointer.
103
+ * @param touch - Whether a finger is asking: a star reaches farther for one.
104
+ * @returns Its id, or null.
105
+ */
106
+ node_under(at: PointerAt, touch: boolean): string | null;
107
+ /**
108
+ * The star — or, over no star, the nebula — under the pointer, picked in
109
+ * screen space: a star is hit within its drawn size (never less than a
110
+ * few pixels, more for a finger), the nearest centre for its size wins.
111
+ *
112
+ * @param at - The pointer.
113
+ * @param touch - Whether a finger is asking.
114
+ * @returns Its id, or null.
115
+ */
116
+ star_under(at: PointerAt, touch: boolean): string | null;
117
+ }