My problem is simulation of soft object deformation on user interaction, like when you touch ball with sand inside it deformes its edges in spots you press on ball. How can I achieve it in Unity3D?

1 Answers

Kalle Halvarsson On

Soft body dynamics is a very complex topic, which is why most physics engines constrain themselves to rigid body dynamics. I am pretty sure that no one on StackOverflow is going to code this for you. There are some commercial solutions for Unity though, Obi Softbody and Truss Physics to list a couple.

Here is a cheaper but probably less feature complete option:

There are many different ways for simulating soft body physics, one common way is to map the vertices to a lattice of points (with some weight), and then simulate spring contraints between the lattice points. These types of lattices are probably best simulated with verlet integration.

Here is a research paper on lattice shape matching. Here is another paper on pressure models.