2D N-Body Simulation in C++: 250k Spiral! @s0lly
2D N-Body Simulation in C++: 250k Spiral!  @s0lly
Uploaded May 2019 | Updated September 2026, 2 hours ago
This engine allows the user to input thousands of objects and watch an n-body physics display occur.

I've improved some of the code and the runtime has improved significantly from the prior iteration. It's amazing what taking an unnecessary multiply or divide out of a loop can do!

The codebase can be found here: github.com/s0lly/NBody-Physics - It relies on only a few functions and objects to do all the work, so hopefully it will be quite easy to understand and follow.

Please let me know how I could improve this!


Acknowledgements:

This was made using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!

Music by Eric Skiff, song "All of Us" for the intro and "Arpanauts" for the main sequence. (Available at EricSkiff.com/music)
2D N-Body Simulation in C++: 250k Spiral!Excel with s0lly: 2. Simple Data Analysis and TemplatesGardeners of the Galaxy: Draft 1 (All in C++)AI Steering Behaviour Visualisation v1: Swarm TestCreating a Sprite Editor in C++ (v1: First Look)Maze Visualizations: 2) Sidewinder2D Game Engine in C++: [2] Adding a Camera / Moving Camera and SpritesUntitled Spreadsheet Space Simulator - First PeekC++ Snake Game (My First Playable Game!)First Games in C++: Dungeons and Flagons (v0.87) - Throwing Torches!First Games in C++: Krazy Karts (v0.6) - My First Menu System!Excel with s0lly: 5. Simulating the Game of Life
s0lly |

2D N-Body Simulation in C++: 250k Spiral!

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER