I have a wall mesh that is divided into destructible pieces. As it gets destroyed, the wall can collapse into separate objects with physics that can be destroyed as well. (Cut the wall in half horizontally and the top wall becomes a separate object with its own physics).

I already have the adjacency info to know neighbors, but how should I store the pieces so that I can detect when to split them into separate objects? What kind of tree would suit this and know when the branch was severed and what pieces to make a new object out of?

A test would be to smash a circle out of the wall, and the middle of the circle would fall out and contain only those remaining connected pieces as a new object.

Any examples out there?


  • \$\begingroup\$ Are the peices already divided? Or are you cutting in real-time? \$\endgroup\$ – Stradigos Jun 14 '16 at 4:59

I have implemented https://sourceforge.net/projects/satsumagraph/?source=navbar and it worked great. Very simple to use.

Added undirected adjacency to a custom graph then used a sub-graph to call a strongly connected query that returns a list of strongly connected nodes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.