Implementation of constraint-based verlet solvers explained by Jakobsen's Advanced Character Physics and Muller's Position Based Dynamics.
You can play with the Jakobsen-style demo, the source code is under /jakobsen folder in this repository. These are the things you can do:
UP ARROW
Increases the gravity (adds positive values).DOWN ARROW
Decreases the gravity (subtracts positive values).Left Mouse Click & Drag
Create pin constraints that drag the points.Middle Mouse Click & Drag
Same as left mouse but the contraints cannot break.N
Sets the number of iterations to evaluate the constraints.B
Sets the breaking threshold (in pixels) to tell when the spring constraint should break.
Some documentation about how ParticleSystem, PinConstraint and SpringConstraint.