Page 1 of 1

"Crushing" of compound objects

Posted: Mon Mar 31, 2014 8:55 pm
by ChAdams
In my game I have multiple shapes grouped into the same body. These shapes have different hitpoints, currently when there's a collision involving compound objects, the shape which collides takes all the impact, and the group object bounces.

I've got it set up to distribute damage across adjacent shapes in a group with diminishing value, however I have a better idea that isn't so obvious to implement.

When there's a collision, i'd like to calculate the maximum inertia before a shape would be destroyed/removed based on same arbitrary equation of force->hp loss and current hp, if the collision produces an inertia greater or equal to that maximum, then destroy the shape and limit the inertia to be used to apply force to that maximum. If I've thought correctly, then as my objects collide they shouldn't bounce back until enough shapes have been destroyed to total enough inertia to cause a directional change.

And my question is if there's an easy way to implement this without modifying chipmunk, and if I need to make modifications what the best approach would be.

Cheers!

Re: "Crushing" of compound objects

Posted: Mon May 12, 2014 2:33 pm
by rrakkola
Here's one topic on detecting "crushing" if it helps any...

http://chipmunk-physics.net/forum/viewt ... 660#p13660