Skip to content

ultraflame4/GravSim

Repository files navigation

GravSim [WIP]

Gravity simulation for circular objects using Newton's law of universal gravitation and some other physics formulas

gravsim.mp4

img.png

Downloads

Get latest release from releases. You can also install from itch.io https://notlivingstudios.itch.io/gravsim

Available on itch.io

Controls

[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)

Building

Prerequisites

To build this project, you will need:

  1. clang or a compiler with C++23 support (eg. clang)
  2. cmake version 3.26 and above
  3. ninja (or any other cmake supported build system)

Instructions

The following instructions will assume you are using ninja as your build system

  1. First install ninja. See here for instructions

  2. Secondly clone this repository and its submodules:

git clone https://github.com/ultraflame4/GravSim.git --recursive --depth=1
  1. Use cmake to generate project build files.
cmake -S . -B build -G Ninja
  1. Build the project with.
cmake --build build
  1. Run the executable GravSim.exe in the build folder

Notes:

  1. The collision physics is very buggy.

2. Spawning too many bodies will make them disappear. I have no idea why. fixed