pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber
https://cannon.pmnd.rs
2.76k stars 154 forks source link

Utility to easily make "Cloth" out of an array of Particle bodies #6

Open nevernotsean opened 4 years ago

nevernotsean commented 4 years ago

From the Cloth demo from Cannon...

Setting up a piece of cloth involves setting up many Particle bodies and connecting each Particle to its adjacent neighbor. Would be cool to include a utility method that does this.

I have my old "useCloth.js" that I used for this demo I. I could use some insight on where the heck I would put this. Does this belong in use-cannon at all?

drcmda commented 4 years ago

if you find a way to make it work across the web worker and if its generic enough sure, why not. or, if you figure that it isn't, put all the generic bits in here and a second lib orchestrates it nicely. im super curious where this is going because i have little experience (next to zero) with cannon or physics libs but would be eager to learn

ThomasRutzer commented 4 years ago

Hi @nevernotsean, is there any progress on that matter? I try to get something similar working, but would much appreciate to have a look at your approach

nevernotsean commented 4 years ago

Hi @ThomasRutzer unfortunately no progress on this from me. A few months ago, attempts to create a mesh of particles within the webworker was not possible. I did have some success with composing instanced particle bodies with components (similar to the ragdoll example). I will try to post a sandbox if I can find the code.

ThomasRutzer commented 4 years ago

Hi, @nevernotsean thanks for your quick response – would be awesome if you could share a sandbox. Nevertheless, I'm not sure if this is out of the scope of this lib 🤔