Erwin Coumans wrote:I included it in Bullet 2.80, under Demos/VoronoiFractureDemo. I added automatic constraint generation between the parts, with a breakable threshold and increased solver iterations.
Thanks Erwin, the breakable constraints are very impressive!
Note to others about the new
VoronoiFractureDemo included in the latest release/svn of Bullet Physics library:
- The
VoronoiFractureDemo demo adds a collision margin to all voronoi shards to provide more stable, less "sticky" collisions. Therefore the
VoronoiFractureDemo demo will indeed produce actual gaps/cracks between voronoi shards (do not use these for boolean operations). Also Keep in mind that adding a collision margin increases the amount (2X) of time to generate voronoi shards. So by changing (near the top of VoronoiFractureDemo):
#define CONVEX_MARGIN 0.04
to:
#define CONVEX_MARGIN 0.0
Voronoi shard generation will approximately
double in speed (and will not have actual gaps/cracks between shards).
- The
VoronoiFractureDemo features breakable constraints. Breakable constraints are a very cool feature for pre-fractured shards to stay together until actual collisions break them apart based on impact/collision location and strength. But there is some performance cost for this to the simulation. Alternatively, to avoid this overhead, and to make your voronoi fractures look more realistic, you may want to consider doing voronoi fractures in real-time, on demand, at collision time; this involves simply spraying some voronoi points from the collision/impact location and generating standard rigid body voronoi shards (no constraints) in real-time. This has the advantage that damage looks impact specific, with more, smaller shards near the impact point; and not much performance penalty on the simulation. In the videos at the top of this thread, you can see some examples of
collision targeted voronoi shatters (not the
random point distribution ones); constraints were not used in those videos, voronoi shattering was simply performed at collision time based on impact location.
But with this demo I'm also thinking it might be possible to combine breakable constraints with real-time targeted voronoi shatter; this could provide both impact specific voronoi fracturing and clumping of shards so that they may break off in seemingly non-convex clusters, and be all ready for some secondary shattering (when they fall to the ground or whatever).