Page 1 of 1

How to estimate collision power?

PostPosted: Sun May 22, 2016 6:13 am
by garek
I need to estimate the power of a collision to decide the future of the colliding objects: should they explode, or just "bounce" and stay alive.

The exact case:
Box is falling on the ground (static body; segment shape). If it falls "hard" it should explode and disappear from the world, if it falls "soft" then it should stay as is.

I guess one should use totalKE in post solve callback to make the decision. But the problem is that i do not know how to "normalize" the total kinetic energy (because i do not know its possible min and max values).

I would appreciate if somebody could point in the right direction!

Thank you.

Re: How to estimate collision power?

PostPosted: Sun May 22, 2016 10:15 am
by slembcke
You can't normalize it since it's range is 0 to infinity. Honestly the best way to handle it is to guess and check. Log the KE or impulse, decide what is a good number and use that. Adjust from there to get the right feel.

The "correct" way to do it would be to do material and structural analysis on the object that would break so you know how much force it could take in different places and directions. If you want to go to that level of detail for a game, then kudos for the dedication, but it probably won't add anything to the game experience. ;)