mattdesl / verlet-system

2D and 3D verlet integration
http://mattdesl.github.io/verlet-system/demo/line.html
MIT License
75 stars 5 forks source link

angle constraints #3

Open forresto opened 7 years ago

forresto commented 7 years ago

Would it be possible to make a new lib (like verlet-constraint) for angle constraints?

Subprotocol's version: https://github.com/subprotocol/verlet-js/blob/3293d409aafe3adfd56811849b9168cb84599c28/lib/constraint.js#L76-L99

forresto commented 7 years ago

In case anybody is looking at my work in that repo ☝️ , the angle constraints need some help: they don't respect mass and stiffness correctly yet. Anybody want to help me with that math?

forresto commented 7 years ago

Setting the angle constraints based on base shape in frame 0, you see distance constraints take effect in frame 1, then the angles work it out: tshirt-slider-solve