Fake softbody collision deformer in geometry nodes

I am currently trying to create a collision deformer/fake softbody collision with geometry nodes. I had looked at the really excellent deformers by Bradley Gerstmann and Xeofrios (and learnt a lot). Unfortunately, they don’t handle the actual collision the way I would like, so I tried to find my own way.
If you let an object collide with a simple surface, it works relatively well (although I would like to tweak the deformation a bit more).

Z_mine


Unfortunately, I often separate the XYZ axes in my approach, which makes it difficult to transfer it from a simple XY plane to more complex collision surfaces.
One idea was to find the nearest collision face for each vertex and use their normal as a base for rotation. Then I could continue to separate the XYZ axes, do everything as before and rotate the vertices back at the end.

XYZ_simple

As you can see this approach kinda works on even surfaces, but fails completely where two faces with different surface normals connect.

XYZ_free


Currently I’m at a point where I don’t know if this whole rotate and rotate back approach is just plain stupid.

I would be really happy if someone smarter than me could take a look at the file I attached.
Except from that I’m happy to explain my approach a bit more detailed, I just didn’t want to make this post even longer.

(oh an by the way I plan to add a bit more advanced deformation and self collisions in the end, I just feel like I should find a way to reliably handle the collisions first)

:blender_logo_64_png: CollisionDeformer3.blend (4.8 MB)



EDIT : here you can find a screenshot of the node tree


link to the full resolution screenshot

1 Like