An N-body multithreaded orbit simulator, optimised with the Barnes-Hut treecode algorithm.
A spiral galaxy rendered with 100k particles at 10fps on a laptop. notice the bar in the middle, similar to the milky way.
The GUI
ezgif.com-video-cutter.1.online-video-cutter.com.1.mp4
3 smaller (10k) galaxies colliding
an elliptical galaxy generated from the result of the previous galaxy merge
ezgif.com-crop.mp4
100k particles spread across 10^8 metres zoom-out
those 100k particles eventually cluster and form something similar to the cosmic web
QuadTree visualisation with 10k asteroid ring (no central planet)
- capable of loading up to and over 100k particles without a GPU
- fairly accurate (can create stable orbits)
- capable of creating spirals (almost) and barred galaxies
- particles are rendered as pixel values instead of polygons for efficiency
- multithreading support for updating forces
- A very efficient implementation of the barnes-hut treecode algorithm
- the tree is generated with iteratively (recursion is slower and more memory intensive)
- the tree is stored linearly in an array (faster access, less pointer access)
- the tree nodes only save one pointer and 2-3 doubles for better performance
- please have an ImGUI-SFML shared library installed! e.g.
pacman -S imgui-sfml
- cmake is required to build the project (using ninja is also possible)