Object deformations ( dynamic background ) for Gamma Game Engine

It think it would be really cool to implement a trimesh deformation feature in Gamma.
I don’t know if there are already complex physic formulaes, but I had the following reflexion :

  • Basically the way an object can be deformed is defined by three parameters :
    • The “hardness”, 1 means it cannot be deformed, 0 means when there’s one contact the whole object is deformed
    • The “elasticity”, 1 means the object, after it has been deformed, “return” completely to its initial shape
  • Implementation should be simple :
    • When there’s a collision detection, we take the vertices that are near the collision point and move them in the direction of the contact normal, and we take all vertices in a larger radius and apply them a “softer” deformation
    • At each step of the simulation, depending on the elasticity, we interpolate each point to its initial position

Has anyone ideas/commentary/source code/experience about that ?
Thx for advance

I dont think you can generalise it like that…

The interia tensors will change along with changing the shape, also, most physics calculations you find on the internet are convex-object based and if the object (by way of deformation) stops becoming convex, your in dead water as they say…And you do realise ODE doesn’t have yet stable dynamic convex collisions? So thats out of the picture. If your planning this for heightmaps, then every time you change the vertices, your going to have to send them down to ODE to recalculate everything (time waster).

If you have ever played the game FlatOut, they do car-deformations, probably using a similar argument to yours. However, if you look closely enough, you will notice that the physics objects of the car dont change (at least in dont think they do from my perspective of the car).

What I think they do is obtain the generated contact points that Havok produces, do a simple search to see what are the nearest vertices to those contact points and do what you did with the mesh, move it backwards in the negative direction of the contact normal…Ofcourse, they only do that to a certain degree, and force calculations are taken into consideration for deformation.

Can you see ive done something like this before? ::slight_smile:

DP