Skip to content

An N-body orbit simulator, optimised with the Barnes-Hut treecode algorithm.

License

Notifications You must be signed in to change notification settings

ron0studios/OrbitSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OrbitSim

An N-body multithreaded orbit simulator, optimised with the Barnes-Hut treecode algorithm.

in action


image

A spiral galaxy rendered with 100k particles at 10fps on a laptop. notice the bar in the middle, similar to the milky way.

image

The GUI

ezgif.com-video-cutter.1.online-video-cutter.com.1.mp4

3 smaller (10k) galaxies colliding

image

an elliptical galaxy generated from the result of the previous galaxy merge

ezgif.com-crop.mp4

100k particles spread across 10^8 metres zoom-out

image

those 100k particles eventually cluster and form something similar to the cosmic web

image

QuadTree visualisation with 10k asteroid ring (no central planet)

details


  • capable of loading up to and over 100k particles without a GPU
  • fairly accurate (can create stable orbits)
  • capable of creating spirals (almost) and barred galaxies
  • particles are rendered as pixel values instead of polygons for efficiency
  • multithreading support for updating forces
  • A very efficient implementation of the barnes-hut treecode algorithm
    • the tree is generated with iteratively (recursion is slower and more memory intensive)
    • the tree is stored linearly in an array (faster access, less pointer access)
    • the tree nodes only save one pointer and 2-3 doubles for better performance

requirements

  • please have an ImGUI-SFML shared library installed! e.g. pacman -S imgui-sfml
  • cmake is required to build the project (using ninja is also possible)

About

An N-body orbit simulator, optimised with the Barnes-Hut treecode algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published