"Crushing" of compound objects

Discuss new features and future development.

"Crushing" of compound objects

Postby ChAdams » Mon Mar 31, 2014 8:55 pm

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.

Posts: 23
Joined: Thu Apr 26, 2012 2:34 pm

Re: "Crushing" of compound objects

Postby rrakkola » Mon May 12, 2014 2:33 pm

Here's one topic on detecting "crushing" if it helps any...

http://chipmunk-physics.net/forum/viewt ... 660#p13660
Posts: 9
Joined: Thu Jun 27, 2013 3:04 pm

Return to Features/Development

Who is online

Users browsing this forum: No registered users and 2 guests