| Native | Web |
|---|---|
![]() |
![]() |
Screenshots from older version
![]() |
![]() |
![]() |
git clone https://github.com/pkarnakov/ptoy.git
- Linux or Mac OS X
- C++14 compiler
- CMake
- emscripten (optional to build WebAssembly)
- SDL2
- glew
Build with CMake
make
Build with debug info and assertions
make debug
./build/ptoy
or ./build_debug/ptoy for the debug build.
r: switch mouse to Repulsion modea: switch mouse to Attraction modep: switch mouse to Pick modef: switch mouse to Freeze modeo: switch mouse to Portal modeb: switch mouse to Bonds moden: switch mouse to No action modes,m,l: restart with a small (10x10), medium (25x25) or large (45x45) grid of particles1,2: restart with the default scene or with a box filled half-wayd: drop a block of 10x10 particles from abovedown,up: point gravity further down or further up, also turning it ont: switch the position update between second and first orderg: toggle gravityi: remove last pair of portalsspace: toggle pauseq: quit after pressing 3 times
Click actions depend on the mode selected by keyboard, all mouse buttons are equivalent.
| Mode | Key | Click action |
|---|---|---|
| Repulsion (default) | r |
repulsive force |
| Attraction | a |
attractive force |
| Portal | o |
draw portals (blue, then orange) |
| Pick | p |
pick the closest particle |
| Freeze | f |
freeze/unfreeze particle |
| Bonds | b |
draw bonds between particles |
| No action | n |
nothing |
- docs/MODEL.md: the forces, the constants, the contact dashpot and the time integrator




