Idk if it breaks on other platforms, but Firefox on Android it's working to tap and hold the middle of the screen for the center thruster, left for left thruster, and right for right thruster
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?
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.
I landed my first job 20 years ago by writing a similar demo. It was in ASM on a 80286, I was rendering a torus in 3D and applying physics using a spring/mass model.
Verlet physics are so nifty. A basic implementation with points, springs, gravity, and a simple floor (a Math.max check) produces stunning motion. Going from trying to tune angular momentum calculations to getting believable rotation 'for free' felt like a revelation
Thank you. There is not, but on the readme you can find a few links to learn more[1].
I don't have solid metrics, but using only JS for a previous attempt, I couldn't have 8 points running smoothly [2]. Now it works with 500[3].
I'm not sure whether it's because I have a better understanding of the problems now or just because Rust/wasm is way faster, but what is sure is that Rust makes it easier to write performant code, even if it's harder to learn at first.
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...
[3] https://en.wikipedia.org/wiki/Drag_equation
E: And started to work, could just have been some fringe issue, the page was just a white screen and didn't respond.
how much better is the performance due to rust/wasm compared to implementing the physics in JS?
I don't have solid metrics, but using only JS for a previous attempt, I couldn't have 8 points running smoothly [2]. Now it works with 500[3].
I'm not sure whether it's because I have a better understanding of the problems now or just because Rust/wasm is way faster, but what is sure is that Rust makes it easier to write performant code, even if it's harder to learn at first.
[1] https://github.com/loicbourgois/gravitle#learn-more
[2] https://loicbourgois.github.io/treeminor/demo/heart
[3] https://loicbourgois.github.io/gravitle/playground.html?test...