A physics sandbox written in Rust.
A toy project created while learning the language, graphics drawn using the piston_window crate.
Figure 1: Particle emitters and a particle orbiting a blackhole.
piston_window requires Rust 1.47.0 To reset to a previous Rust version use rustup default 1.47.0
Simply cd into physbox-rs after cloning into the repo.
Then, build and run with cargo run --release (make sure to use the release flag to build with optimisation).
-
left-clickand drag, insert an entity depending on the current insert mode: -
pParticle insert mode, creates a particle with the drawn initial velocity vector. -
eEmmiter insert mode, creates a particle emitter emitting particles with velocities distributed about the drawn vector. -
bBlackHole insert mode, creates a black hole with mass proportional to the drawn radius. -
oObstacle insert mode, inserts static collision detecting objects (not yet implelemted). -
right-clickremove entities under the mouse pointer. -
rremvoes all entities from the simulation. -
Spaceiterates through: Global gravity {Off, Down, Up}. -
Returntoggles solid walls around the window (on by default).
Figure 2: Emitters with global gravity and containing walls enabled.
Figure 3 A two black hole system, one stripping particles from the other's orbit.
Video 1: Drawing two particle emitters and inserting a blackhole between them.
Video 2: A two black hole system, one stripping mass from the other.
Video 3: Removing black holes from a system, then introducing global gravity.


