A C++ gravity simulator.
- Click on the screen to add a new object.
- `To toggle debug info.
- RTo reset the simulation.
- Scroll to change the gravity strength.
- ↑/↓ To change the object spawn size.
- ←/→ To change the variance in spawn size.
- W/D To change the maximum speed an object will spawn with.
- Objects merge when they overlap.
- Internally stores objects with SOA rather AOS for better cache performance.
- Built with SFML.
- Uses the brute force algorithm (O(N^2)) to calculate everything, so might not be the most efficient. I do plan on eventually using SIMD instructions to make this faster which is another reason why a SOA data structure is being used for the objects.
git clone "https://github.com/Alex-Petrucci/GravitySim"This project uses CMake so build use the compiler/build system of your choice.
Before building, you might want to configure
some things in Config.hpp. The defaults
are just what I think looks good on my PC.
The one most people will probably want to change
is the FPS_CAP which has been set to 144hz
as that is what my monitor can display.
Just run the executable produced by the build.
