Commit ad14340
feat: add zero-config pointer/raycaster system and pinch-to-zoom gestures
- Implemented complete pointer interaction system (hover, click, multitouch)
- Added pinch-to-zoom and two-finger pan gesture controls
- Removed manual raycasting boilerplate from all examples
- Fixed multi-selection to support contiguous range with Shift+Click
- Added Vite plugin for automatic playground rebuild on snippet changes
Pointer System:
- PointerController: Event-driven raycasting (no per-frame overhead)
- DOMPointerAdapter: DOM event → abstract pointer state
- Auto-highlight on hover, auto-select on click (configurable)
- Multi-pointer support with per-pointer highlight tracking
- Transport-agnostic (works with local and remote pointers)
- 13 tests passing
Gesture System:
- GestureController: Pinch-to-zoom and two-finger pan
- Touch point tracking with distance calculation
- Configurable zoom/pan speeds, auto-clamped zoom (0.1x-10x)
- Passive:false event listeners for preventDefault support
- 8 tests passing
New Examples:
- 18-custom-click-handling.md: preventDefault pattern, modifier keys
- 19-multitouch.md: Multi-pointer interaction, pressure sensitivity
- 20-remote-pointer.md: Transport-based pointer sync architecture
- 21-pinch-to-zoom.md: Touch gesture controls for camera
Updated Examples:
- 12-basic-selection.md: Zero-config click selection
- 13-multi-selection.md: Proper contiguous Shift+Click selection
- 15-presence-tracking.md: Simplified with auto-click
- 16-hover-highlighting.md: Removed ~50 lines of raycasting code
Developer Experience:
- Vite plugin watches snippets/ and auto-rebuilds playground
- Full HMR support for snippet changes
- Console logging with emoji indicators (📝 changed, ➕ added, ➖ removed)
Breaking Changes: None (backwards compatible via legacy pointer ID)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent ed4614c commit ad14340
File tree
17 files changed
+1415
-179
lines changed- WebSites/spacecraft-viewer
- examples
- snippets
- scripts
- src
- controllers
- core
17 files changed
+1415
-179
lines changedLarge diffs are not rendered by default.
Lines changed: 8 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
42 | 41 | | |
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 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
72 | 45 | | |
73 | 46 | | |
74 | 47 | | |
75 | | - | |
| 48 | + | |
76 | 49 | | |
77 | 50 | | |
78 | 51 | | |
| |||
Lines changed: 47 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
40 | 57 | | |
41 | | - | |
42 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
43 | 62 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
47 | 73 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
51 | 77 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
70 | 81 | | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 84 | + | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
Lines changed: 11 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 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 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
93 | 74 | | |
94 | 75 | | |
95 | 76 | | |
| |||
Lines changed: 15 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 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 | | - | |
| 65 | + | |
| 66 | + | |
98 | 67 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
103 | 72 | | |
104 | | - | |
105 | | - | |
| 73 | + | |
| 74 | + | |
106 | 75 | | |
107 | 76 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
128 | 80 | | |
129 | 81 | | |
130 | 82 | | |
131 | | - | |
| 83 | + | |
132 | 84 | | |
133 | 85 | | |
134 | 86 | | |
135 | 87 | | |
136 | 88 | | |
137 | 89 | | |
138 | 90 | | |
139 | | - | |
| 91 | + | |
140 | 92 | | |
141 | 93 | | |
142 | 94 | | |
| |||
0 commit comments