11.8 C
New York
Monday, April 28, 2025

JavaScript – Toxiclibs Softbody Physics Downside with a low weight grimace


Hopefully that is effectively to publish right here. I’m studying to code and work on one factor (actually making an attempt to breed this https://www.instagram.com/juhani.halkomaki/reel/dgfpqfcngze/ )

I’ve created a sketch on p5.js utilizing toxiclibs for physics in an try and get hold of one thing comparable.

I’m utilizing particle and is derived chains to create my snakes, there aren’t any collisions for what I can say in Toxiclibs, the particles have a sure radio with a unfavourable attraction utilized to them, to forestall them from going via the opposite snakes or themselves. This works effectively for essentially the most half and I just like the inflatable high quality.

However as extra snakes fall on the high, snakes on the backside are crushed an excessive amount of, and at last the energy of the repulsion causes them to sink. You possibly can see what I imply right here:

https://youtu.be/1pag5o84imo

Roughly half of the video, you may see the place I activate a visualization of the traces of power, and the particles which might be joined flip every portray. I perceive that one of these Jitter is a reasonably widespread downside, however I do not know the best way to clear up it, I’ve tried many hacks and finally ends up being messy and by no means solves the issue. I’m wondering if that is simply an inherent downside of utilizing springs and particles with repulsion between them and gravity. I suppose the detection of collisions would clear up this, however there may be none obtainable in toxiclibs.

Does anybody have any recommendation? Or recommendations on how to do that similar sort of physics within the matter.JS or one thing else?



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles