Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkhan45/gravity-sim-rs
Gravity simulator using Newton's Law of Universal Gravitation
https://github.com/mkhan45/gravity-sim-rs
ecs ggez gravity gravity-sim rust rust-lang simulation simulator specs
Last synced: 3 months ago
JSON representation
Gravity simulator using Newton's Law of Universal Gravitation
- Host: GitHub
- URL: https://github.com/mkhan45/gravity-sim-rs
- Owner: mkhan45
- License: mit
- Created: 2019-03-11T02:10:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-08T22:35:51.000Z (over 2 years ago)
- Last Synced: 2024-01-29T20:53:59.252Z (11 months ago)
- Topics: ecs, ggez, gravity, gravity-sim, rust, rust-lang, simulation, simulator, specs
- Language: Rust
- Homepage: https://mkhan45.github.io/gravity-sim-rs/
- Size: 42 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gravity-sim
## Superseded by https://github.com/mkhan45/gravity-sim-v2N body gravity sim with rust and `ggez`, made to learn rust
Initially written with OOP, made a new version with `specs` that runs about 20% better on my desktop PC, but slightly worse on my laptop. Maybe because it parallelizes a lot more?
Web port made with quicksilver, lots of features missing:
https://mkhan45.github.io/gravity-sim-rs/
![](preview_new.gif)
## Controls
Arrow keys to move
Scroll to zoom in/out
Q/A to increase/decrease radius of next placed body
W/S to increase/decrease density (try making it negative)
E/D to increase/decrease trail length (removing trails increases performance by a lot)
X/Z to increase/decrease prediction speed, setting it to 0 turns of predictions.
Left click to place a body, dragging before releasing makes an initial velocity vector.
Right click over a body to delete it.
G creates a 10x10 grid of bodies with the specified radii and densities.
R to reset.