Re:Show HN: Gravitle – 2D soft-body engine built with Rust f...
by slavik81 on Saturday June 22, 2019 @04:03PM
(#20251455)
How do you ensure stability? Based on the "learn more" section, I would presume the soft body is made up of vertices stitched together with damped springs. Is that accurate?
[ Parent
| on HN ]
Re:Show HN: Gravitle – 2D soft-body engine built with Rust f...
by bourgoisloic on Saturday June 22, 2019 @10:58PM
(#20253013)
The springs are not damped yet, but for the main example, drag is enabled[1]. This continuously slows down the particles.
Drag is computed[2] for all the particles using something similar to the Drag equation[3].
Also, like electricslpnsld said, having a small enough time step helps.
[1] https://github.com/loicbourgois/gravitle/blob/master/fronten...
[2] https://github.com/loicbourgois/gravitle/blob/master/src/par...
Re:Show HN: Gravitle – 2D soft-body engine built with Rust f...
by joelthelion on Sunday June 23, 2019 @03:41AM
(#20253803)
You might want to look into finite elements. That's a bit harder conceptually, but it's not that hard to implement and should be far more realistic and robust.
Re:Show HN: Gravitle – 2D soft-body engine built with Rust f...
by electricslpnsld on Saturday June 22, 2019 @08:36PM
(#20252542)
I presume by keeping the time step small enough? If you go into the integrator settings in the demo and crank the time step, it does go unstable.