star-sim

Barnes-Hut gravity simulation.
git clone git://git.amin.space/star-sim.git
Log | Files | Refs | README | LICENSE

commit f9f43f41a6f40a590147854369aeb5faff9b338a
parent fd6dd1fb977a2f2936d2a80a71279a76728191e6
Author: amin <dev@aminmesbah.com>
Date:   Sun, 30 Jul 2017 08:27:58 +0000

Release version 0.1.0.

FossilOrigin-Name: bf264fcef1efa60591bf372761d16d8fa19539d7e53706f2bf74774146dc442c
Diffstat:
MREADME.md | 23+++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md @@ -1,16 +1,23 @@ ![Gif of lazily wandering stars](https://cloud.githubusercontent.com/assets/5744114/24231758/af94bcbe-0f43-11e7-83ef-9e937b498c78.gif) -### Barnes Hut Simulation +This is a simulation of gravitational attraction between lots of 'stars'. -I'm currently working on implementing the [Barnes-Hut Algorithm](https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation). - -I've made a quadtree that I use to recursively partition the simulation space. +The [Barnes-Hut Algorithm](http://arborjs.org/docs/barnes-hut) is used to +efficiently calculate the forces acting on each star. ![Gif of recursive partition grid](https://cloud.githubusercontent.com/assets/5744114/25370870/6c51d2e8-2942-11e7-8a0b-929a185b768c.gif) -Now I just have to use that tree to simplify the gravitational attraction -calculations between distant groups of stars. -Dependencies ------------- +### Keyboard Shortcuts + +- `b`: Toggle brute-force mode. Stars turn blue when this mode is active, and + gravitational attraction is calculated for every single pair of stars. The + Barnes-Hut grid is not updated. +- `g`: Toggle Barnes-Hut grid rendering. +- `p`: Pause/unpause simulation. +- `t`: Toggle star trail rendering. + + +### Dependencies + - [SDL 2.0.5](https://www.libsdl.org/download-2.0.php)