hopefully that is alright to put up right here. I am studying to code and dealing on a factor (truly attempting to breed this https://www.instagram.com/juhani.halkomaki/reel/DGFpqfCNgZe/ )
I’ve created a sketch in p5.js utilizing toxiclibs for physics in an try to get one thing related.
I am utilizing chains of particles and is derived to create my snakes, There aren’t any collisions so far as I can inform in toxiclibs, the particles have a sure radius with a adverse attraction utilized to them, to maintain them from going by means of the opposite snakes or themselves. This works effectively for probably the most half and I just like the bouncy high quality of it.
However as extra snakes fall on prime the snakes on the underside get squished up an excessive amount of, and finally the pressure of the repulsion causes them to jitter. You’ll be able to see what I imply right here:
about half method by means of the video you may see the place I activate a visualisation for the pressure strains, and the jittering particles flip backwards and forwards each body. I perceive this kind of jitter is a reasonably widespread downside however I don’t know resolve it, I’ve tried numerous hacks and it finally ends up getting messy and by no means solves the issue. I am questioning if that is simply an inherent downside of utilizing springs and particles with repulsion between them and gravity. I am guessing collision detection would repair this, however there’s none obtainable in toxicLibs.
Anyone received any suggestions? Or strategies for the way to do that similar sort of physics in matter.js or one thing else?