I have created game objects where i represent the geometry with signed distance functions (SDF) (the SDFs are voxelized/discretized, unimportant for this question). But I would also like to use these SDF for the physics part.
I use these SDFs to find intersections between other SDFs and also regular colliders, resulting in intersection points and normals.
Mass and inertia tensors are also calculated from the SDFs. (I convert the inertia tensor to inertia vector and rotation for the Rigidbody component)
Together with rigidbody velocity, these are all the variables needed to calculate an impulse force (equation 5 from Collision response - Wikipedia)
The problem is however that the equation uses inertia tensor matrices (3x3).
I have that for my SDFs game objects, but for regular colliders I only have the inertia vector and rotation which as far as I can find, no one knows how to convert back to a tensor.
The only solution I can think of is to manually calculate inertia tensor matrices for all game objects with regular colliders which I hope to avoid.
Have I misunderstood something? Is calculating an impulse force the way to go? How can I then achieve that?
Sorry for the vague questions…
Some more details
All Game objects have rigidbodies (with proper mass and inertia).
Some game objects have a set of regular colliders (as usual)
Some game objects instead have a set of SDF, each SDF is bounded by a box collider (trigger). In the trigger callbacks I query the SDF for the actual intersection data. Intersection data for each game object collision pair is accumulated and saved, then in FixedUpdate an impulse force is applied on both rigid bodies involved in the collision.
Found a paper which is kind of related
In chapter 5.2 the response force is calculated as just the “amount” of overlap, scaling the force with larger overlap. I cant see how this will work since it would break conservation of energy and momentum.