This repo uses verlet integration to simulate a world with:
- Points
- Sticks connecting points
- A cloth
- A (swinging) block
It was mostly inspired by this paper by Thomas Jakobsen.
I wrote a blog explaining this code.
Prerequisites:
git clone <this repo>
Tested on java8.
Running lein run
in the root of this project will start an applet where you
can interact with mouse and keyboard.
Keybindings:
-
b
(re)start block simulation -
c
(re)start cloth simulation -
p
(re)start point simulation -
s
(re)start stick simulation -
i
to show info screen -
q
to quit
Mouse interactions:
- Click and drag any point
- Unpin a pinned point
Use the code the way you want it at your own risk. It is not copyrighted.