Another rigid-body simulation experiment.
Here i am playing around with dynamically fracturing scene objects into smaller parts, that can either cause other objects to shatter or break into smaller parts themself.
This is kind of a recursive approach where the hit body is replaced by its fracture parts.
First, the collision-location (world -> locally) with the maximum applied impulse is computed, and is further used as the fracture-center.
Around the fracture-center an evenly distributed pattern of sampling points is generated. I tried several sampling methods and used jittered Fibonacci samples in the end.
The generated samples and the convex polygon of the original body serve as input for a voronoi structure. The resulting voronoi cells are used to build rigid bodies and replace the original (parent) body.
- Processing 3, https://processing.org
- PeasyCam, by Jonathan Feinberg, http://mrfeinberg.com/peasycam
- bRigid (jBullet), by Daniel Koehler, http://www.lab-eds.org/bRigid
- HE_Mesh, by Frederik Vanhoutte, https://github.com/wblut/HE_Mesh
- PixelFlow, by myself, https://github.com/diwi/PixelFlow
Demo (Runnable Jar)
download (Runnable Jar, any OS): Skylight_BulletPhysics_Breakable.zip