Gravity simulation for circular objects using Newton's law of universal gravitation and some other physics formulas
This branch will focus on refactoring, and just generally improvements.
gravsim.mp4
Get latest release from releases. You can also install from itch.io https://notlivingstudios.itch.io/gravsim
[Space] - Pause
[W] - Move camera up
[A] - Move camera left
[S] - Move camera down
[D] - Move camera right
[Right Click + drag] Spawn object with velocity ( velocity depends on direction and distance of drag)
To build this project, you will need:
- clang or a compiler with C++23 support (eg. clang)
- cmake version 3.26 and above
- ninja (or any other cmake supported build system)
The following instructions will assume you are using ninja as your build system
-
First install ninja. See here for instructions
-
Secondly clone this repository and its submodules:
git clone https://github.com/ultraflame4/GravSim.git --recursive --depth=1- Use cmake to generate project build files.
cmake -S . -B build -G Ninja --preset=default- Build the project with.
cmake --build build- Run the executable
GravSim.exein the build folder
- The collision physics is very buggy.
2. Spawning too many bodies will make them disappear. I have no idea why. fixed
