Page 1 of 1
Is it safe/possible to remove Triangles from a StaticMesh?
Posted: Tue Sep 06, 2011 10:42 pm
by Spankenstein
I create a static mesh for the level from a set of triangle vertices (and indices). Some of the triangles are marked as destructible and I would like them to either become passable or completely removed from the physics space when shot.
Is it safe/possible to remove triangles from a StaticMesh object?
I could create a separate object that slots into the mesh for destructible objects but I would like to know your take on the matter first.

Re: Is it safe/possible to remove Triangles from a StaticMes
Posted: Tue Sep 06, 2011 11:13 pm
by Norbo
Removing a triangle changes the topology of the mesh, so a hierarchy reconstruction would be necessary. This can be performed externally:
Code: Select all
staticMesh.Mesh.Tree.Reconstruct();
However, the reconstruction process is basically the entire cost of creating a new mesh object. You don't gain much other than keeping the same StaticMesh reference.
If the mesh isn't too big, then you could probably get away with doing this reconstruction each time. For reference, in some fracture prototypes, reconstruction was't much of a problem even with a few thousand elements and multiple reconstructions happening in quick succession (sometimes multiple in one frame). If the reconstruction is too expensive, then the 'destructible pieces' approach would be necessary.