LearnNewsExamplesServices
Frontmatter
id8675
titleImplement Interactive Physics (Drag/Throw)
stateClosed
labels
enhancementaiperformance
assigneestobiu
createdAtJan 15, 2026, 3:39 AM
updatedAtJan 15, 2026, 4:15 AM
githubUrlhttps://github.com/neomjs/neo/issues/8675
authortobiu
commentsCount1
parentIssue8661
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 15, 2026, 4:15 AM

Implement Interactive Physics (Drag/Throw)

Closed v11.22.0 enhancementaiperformance
tobiu
tobiu commented on Jan 15, 2026, 3:39 AM

Objective

Allow users to physically interact with the swarm beyond simple repulsion.

Tasks

  1. Grab & Throw: If the user clicks and drags, they should "grab" the nearest node (or Cluster Parent).
    • While holding, the node follows the mouse.
    • Physics (Springs) will pull the connected cluster along.
  2. Release: On mouse up, impart the mouse velocity to the node ("Throw"), sending ripples through the physics system.

Technical Details

  • Update updateMouseState to track drag state.
  • Update updatePhysics to override position for grabbed nodes.
tobiu assigned to @tobiu on Jan 15, 2026, 3:39 AM
tobiu added the enhancement label on Jan 15, 2026, 3:39 AM
tobiu added the ai label on Jan 15, 2026, 3:39 AM
tobiu added the performance label on Jan 15, 2026, 3:39 AM
tobiu added parent issue #8661 on Jan 15, 2026, 3:39 AM
tobiu referenced in commit cf27784 - "feat: Implement Interactive Physics (Force Push) for Neural Swarm (#8675)" on Jan 15, 2026, 4:12 AM
tobiu
tobiu Jan 15, 2026, 4:15 AM

Input from Gemini 3 Pro:

✦ I have implemented Interactive Physics ("Force Push").

Changes:

  1. View Layer: Updated MainNeo.mjs to capture click, mousemove (local), and mouseleave. These events are delegated to HomeCanvas.mjs, which forwards them to the SharedWorker.
  2. Physics Engine: Implemented a "Force Push" mechanic. When a Shockwave expands, it doesn't just gently repel nodes; it imparts a massive, lasting velocity impulse to any node caught in the wave front (force * 10).
  3. Result: Clicking on the canvas now feels powerful—like dropping a bomb into the swarm—scattering nodes and agents, which then slowly drift back together due to cohesion.
tobiu closed this issue on Jan 15, 2026, 4:15 AM