✨ Heavens
Run N-Body simulations with your GPU:
📦 Dependencies
🚀 Quickstart
Clone the repository and set your working directory to the root of the project:
git clone https://github.com/FreddyWordingham/heavens.git
cd heavens
Build the project in release mode:
cargo build --release
Run the program:
cargo run --release
🎮 Controls
| Letter | Description |
|---|---|
- |
Halve timestep |
= |
Double timestep |
Q |
Decrease Zoom |
E |
Increase zoom |
Z |
Halve the blur radius |
X |
Double the blur radius |
F |
Decrease strength of gravity |
G |
Increase strength of gravity |
A |
Spin camera anticlockwise |
D |
Spin camera clockwise |
W |
Turn simulation towards camera |
S |
Turn simulation away from camera |
O |
Halve ghost stack visibility limit |
P |
Double ghost stack visibility limit |
Space |
Pause / Unpause Time |
📝 Usage
I will create a runtime TOML configuration scheme in the future.
For now you can use heavensas a library to design your own N-Body simulations:
- You'll need these imports:
use ;
- Initialise your settings:
- Initialise your camera:
- Now the fun part, initialise the initial conditions of your simulation:
- Write the main function:
async
See the example main.rs for a more complete example.
📚 Documentation
Find the documentation at https://docs.rs/heavens/
🌌 TODO
- Initial conditions helper class
- Ghost particles
- Colored particles
- Camera controls
- Write docstrings
- Runtime parameterisation
- No-window (capture) mode