I'm trying to accomplish a deforming physic behaviour for level surfaces, but don't have any idea how to start with the implemenation so far.
Regardless of the shape of the surface (planes, cubes, spheres…), I want to have small indentations at the positions from game-entities (players, enemies, objects…).
It's kind of complicated to explain, so I illustrated what I'm talking about, here is an example with a sphere:
So, the surfaces should be able to deform themselves a little bit (to appear like a really soft bed or sofa). My surfaces need probably a high vertices count to get a smooth deforming, but my big problem is the math for calculating this deformation.
I'm programming in C/C++ with OpenGL, but any advices in the right direction will be fine.