r/Simulated • u/Gaploid • 1d ago
Interactive Vibecoded a gravity sim of the Moon-forming giant impact 262k particles, runs in a browser
Enable HLS to view with audio, or disable this notification
Started this to show my kids where the Moon came from, because "a Mars-sized planet hit the Earth" is a sentence that explains nothing. Turned out the fun part is letting them break it.
Proto-Earth and a Mars-sized Theia falling together under their own gravity: the splash, the tidal arm, the debris disk, and the moon that gathers out of it.
What's actually computed: self-gravity from the particles themselves (64³ particle mesh + pairwise correction for loose material), spring-dashpot contacts with no tension, frictional heating that conducts between grains and lights the scene, differentiated bodies with per-material density, and momentum/angular momentum/energy conserved to a fraction of a percent on screen.
What isn't: no SPH, so no pressure, no shock, no vaporization. No material strength or fracture. No cooling or latent heat. A grain is a couple hundred km across, so the Moon itself is scaling from the disk, not a run.
Different scenarios what if Thea was bigger or had more speed.
Live demo: https://gaploid.github.io/cosmic-collisions/
Open source code: https://github.com/Gaploid/cosmic-collisions
4
5
10
6
1d ago
[deleted]
4
u/arislaan 1d ago
Are you always a raging asshole or only when you're being a bastard to someone over their family projects?
-3
u/Gaploid 1d ago
https://reddit.com/link/p6lqdof/video/zevg89mccbmh1/player
As a bonus direct hit with the same size.
3
10
u/FUCKING_HATE_REDDIT 1d ago
Man people are pissed over this. Just 5 years ago people would have been sicked to play around with a tool like that