Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Gravity simulator using Newton's Law of Universal Gravitation

License

NotificationsYou must be signed in to change notification settings

mkhan45/gravity-sim-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N body gravity sim with rust andggez, made to learn rust

Initially written with OOP, made a new version withspecs 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/

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.


[8]ページ先頭

©2009-2025 Movatter.jp