Skip to content

gecarval/GravitySim

Repository files navigation

REPOSITORY STATS

GitHub code size in bytes Code language count GitHub top language GitHub last commit

Gravity Simulator

This is a project written in C using the MiniLibX as the API wich simulates Gravity and Colissions using the Burns-Hut algorithm for gravity aproximation and quadtree for collision detection.

Burnes-Hut algorithm

Installation

The project uses the MiniLibX using the X11 Window system in the Linux Operating System, after the instalation of all dependencies you should do as required:

  • Clone the repository;
git clone https://github.com/gecarval/GravitySim.git
  • Move to the folder;
cd GravitySim
  • Compile the project;
make
  • execute the program;
./render [Put Window Width] [Put Window Height]
  • execution examples:
./render 800 600
./render 1600 900
./render 1900 1000

Controls

BUTTON ACTION
T Reset Positions
Y Show Quadtree
U Show HashTable
LMB activate/deactivate brush
Esc exit
[ increase speed
] decrease speed
1 on/off Gravity Sim
Space clear screen

About

Using the MiniLibX API on C to create a gravity collision simulator with the Burns Hut algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published