How to estimate collision power?

Discuss new features and future development.

How to estimate collision power?

Postby garek » Sun May 22, 2016 6:13 am

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.
Posts: 1
Joined: Sun May 22, 2016 6:00 am

Re: How to estimate collision power?

Postby slembcke » Sun May 22, 2016 10:15 am

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. ;)
Can't sleep... Chipmunks will eat me...
Check out our latest projects! ->
User avatar
Site Admin
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest