Skip to content

DeadlockCode/barnes-hut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Barnes-Hut

This is the official repository for the code shown in How to make HUGE N-Body Simulations (N=1,000,000+)

This repository consists of three branches:

  1. The master branch.

    This is the code shown in the video and is my (mostly) faithful implementation of the original algorithm as described in the Barnes-Hut paper.

  2. The improved branch.

    This modifies the original algorithm by a) storing the nodes in a cache friendly order and b) allowing multiple bodies to inhabit the same leaf node.

  3. The parallel branch.

    This is a crude attempt at parallelizing the improved branch to show its potential.

Guide

  1. Install Rust
  2. Clone the repository
  3. If you're not on Windows, follow this
  4. Checkout the desired branch
  5. Open the folder in a terminal
  6. Run 'cargo run --release'
  7. Enjoy

Controls

  • Scroll to zoom
  • Middle mouse button to grab view
  • Right mouse button to spawn a body
  • To change the mass of the body, wind the mouse around it while holding right click
  • Space to pause/continue
  • E to open a menu where you can enable the quadtree visualization

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages