Skip to content

A simulation of gravitationally bound particles with an interactable graphical user interface.

License

Notifications You must be signed in to change notification settings

volkhu/n-body-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n-body-simulation

A simulation of gravitationally bound particles with an interactable graphical user interface.

Screenshot

User interface

Controls

  • LEFT MOUSE BUTTON - hold and drag the cursor around to move the camera
  • RIGHT MOUSE BUTTON - spawn a new particle at the location of the cursor
  • SCROLL WHEEL - zoom in/out on the position of the cursor
  • LEFT SHIFT - hold to increase camera movement and zoom speed
  • W A S D or - move the camera using the keyboard
  • C - toggle tracking of center of mass (any camera movement except zooming will also disengage this mode)
  • G - toggle anti-aliasing (can reduce performance)
  • ESC - exit the application

Repository structure

  • / - main components of the application like the viewport or input handling
  • /calculators/ - methods for calculating forces applying on simulation particles, currently just the O(n^2) strategy of comparing all particle pairs is implemented
  • /integrators/ - methods for translating calculated forces into particle movements over the timespan of the simulation, currently Euler with Leapfrog or its variants planned in the future
  • /models/ - objects for holding the state of various parts of the system like particles or camera

About

A simulation of gravitationally bound particles with an interactable graphical user interface.

Topics

Resources

License

Stars

Watchers

Forks

Languages