star-sim

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

README.md (1056B)


      1 ![Gif of lazily wandering stars](https://cloud.githubusercontent.com/assets/5744114/24231758/af94bcbe-0f43-11e7-83ef-9e937b498c78.gif)
      2 
      3 This is a simulation of gravitational attraction between lots of 'stars'.
      4 
      5 The [Barnes-Hut Algorithm](http://arborjs.org/docs/barnes-hut) is used to
      6 efficiently calculate the forces acting on each star.
      7 
      8 ![Gif of recursive partition grid](https://cloud.githubusercontent.com/assets/5744114/25370870/6c51d2e8-2942-11e7-8a0b-929a185b768c.gif)
      9 
     10 
     11 ### Keyboard Shortcuts
     12 
     13 - `WASD` or `HJKL`: Pan.
     14 - `Arrow Keys`: Slow pan.
     15 - `=`: Zoom in.
     16 - `-`: Zoom out.
     17 - `0`: Zoom standard.
     18 - `Home`: Return to original view.
     19 - `b`: Toggle bounding box rendering.
     20 - `f`: Toggle brute-force mode. Stars turn blue when this mode is active, and
     21   gravitational attraction is calculated for every single pair of stars. The
     22   Barnes-Hut grid is not updated.
     23 - `g`: Toggle Barnes-Hut grid rendering.
     24 - `p`: Pause/unpause simulation.
     25 - `t`: Toggle star trail rendering.
     26 
     27 
     28 ### Dependencies
     29 
     30 - [SDL 2.0.5](https://www.libsdl.org/download-2.0.php)