Real-time gravity simulation using Barnes-Hut tree decomposition. Written in C++ with OpenGL rendering.
Simulates N-body gravitational interactions in real time. Barnes-Hut reduces the naive O(n²) complexity to O(n log n) by approximating distant particle clusters as single bodies. The algorithm currently runs across two passes for gravity computation, accelerated on GPU via CUDA.
This is my first simulation project and an active work-in-progress. Expect rough edges — naming inconsistencies, performance headroom left on the table, and occasional bugs. Source code will be published as the codebase gets cleaned up.
- Windows 10 / 11
- NVIDIA GPU with CUDA support
Download the latest release and run the executable. No install needed.
- OpenGL
- GLFW
- GLAD
- Dear ImGui
- CUDA
PolyForm Noncommercial License. Free to read, modify, and contribute. Commercial use is not permitted — a commercial license will be offered separately in the future.