Create breakable form, build out of slices with different physical behaviour

Topics: Developer Forum, User Forum
Oct 12, 2013 at 6:16 PM
Hi there,

in my game i have forms which are made out of different slices. Slices can be triangles and/or quads. Each slice in a form can be heavy or light. The connection of a heavy slice to another slice is stronger than the connection of a light slice to another slice. The physical behaviour of a slice or form should be like metal or a brick. Is it possible to achive this? I tried two different approaches, but i was not satisfied by any of them.

1) I created a class "Form" which contains a slice-matrix. Each slice has a body attached which is either heavy or light. Then i created weld-joints between the respecting slices, so each slice has two to four weld joints (to its neighbours in the matrix). Based on if its a heavy or a light slice the joint has a different breakpoint value.

This method offers all features i wanted, but does not work very well in practise. The forms are very 'bouncy' and sometimes bodies get into each other. It just feels not 'real', but buggy.

2) My second approach was with the "Breakable Body" class. I still have my slice-matrix, but instead of giving each slice its own body, i create a single breakable body out of the vertices of my slices. This is somehow more performant since i only have one body, but the drawback to this solution is, that i cant have different weights in different parts of my form. Ok, i could live with that. But there is another very big disadvantage. The breakable body class is designed to break the whole body and not just parts of it. I can not live with that, because this is pretty important for my game mechanics. At least the body is not that bouncy as in approch 1.

So here is my question - is there a way to achieve what i am looking for or at least just break parts out of a breakable body? In other words i then would have to find out, where inside the body the forces are applied.

Thank you for your help!