feat(pool): the current — a drag stirs a slow, persistent flow that keeps carrying the light - #130
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
This PR introduces a flow/current simulation to the pool output:
One medium finding: the full 512-element Reviewed commit: b885847 |
There was a problem hiding this comment.
Adds a fluid-velocity 'current' field to the pool snapshot and renders its streaks in the UI canvas, synced over websockets.
Key findings
- 🟡 Resend full
currentgrid on every pool frame — pool-field.ts:466
Summary
Gestures now deposit motion, not just colour. Under the Pool's light sources sits a coarse velocity grid — the current. Dragging pushes on it; after release the blobs are carried by it. Pull a spot and it stretches, circle and the pool keeps turning slowly for minutes, then comes to rest. This is the "pulling clay that then animates itself" feel.
@wavegrid/pool— newCurrent(packages/pool/src/current.ts)The pressure projection (a few Gauss–Seidel sweeps) is what makes a push turn into a swirl instead of piling everything in a corner: the water is incompressible, so pulling one side brings the other round.
PoolFieldchangescurrent.push(...)with its velocity; max speed scales with Motion (lerp(0.3, 1, motion) * CURRENT_MAX_SPEED).s.x += (s.vx + current.vx) * dt(rings keep their own ripple path).release()/reset()forward to the current;snapshot()gainscurrent: number[].UI
socket-stateparsescurrent(defaults to[]).PoolCanvasdraws faint white streaks per cell where the water moves — hidden in Beams only, so that view still shows exactly what the lasers get.No new controls, no protocol changes: server still emits ordinary HSB
paint/cannoncells via the same smoother; Clear/Stop/animation precedence unchanged (server tests still 100/100).Tests (
packages/pool)release()stills it within seconds;reset()at once; still pool sendscurrent: [].Link to Devin session: https://app.devin.ai/sessions/c4872c2982734093bdee80d04a7d5ceb
Open in Devin Desktop: https://app.devin.ai/desktop/session/c4872c2982734093bdee80d04a7d5ceb?variant=devin
Requested by: @pyramation