A Little Physics Sandbox
Context
Over a couple of months of spare evenings I built a little physics sandbox almost entirely through llm code generation. This was when the penny dropped for me. I’ve certainly been thinking rationally about AGI and downstream implications for longer, but it was this work that made it all suddenly feel viscerally real.
Features
The full source code is available on GitHub.
- Barnes–Hut N-body gravity
- GPU SPH fluids (Metal) with rigid-fluid coupling
- 2-D rigid bodies (GJK/EPA, LCP solver, Baumgarte stab.)
- ECS architecture (EnTT) + scenario loader
- Real-time performance
- Solid / fluid / gas renderers
It’s all built in C++ and attempts to build everything from scratch without any third party libraries (a couple of concessions were made along the way; EnTT, SFML).
Demo Clips
Takeaway
Seeing an AI draft components that once felt like months of work changed my mental model of what’s possible and where my time is best spent.