Realtime fracture of convex polygons from a OBB in 2D?

Started by
2 comments, last by Randy Gaul 5 years, 8 months ago

I am in search for a realtime algorythm to build fracture parts from a oriented box in 2D with respect of the impact point and the impact velocity, for building-up a exploding rock started as a box-shape.

What techniques are there which are or can be easy translated to 2D?

Advertisement

https://www.gdcvault.com/play/1023003/The-Art-of-Destruction-in

http://matthias-mueller-fischer.ch/publications/fractureSG2013.pdf

Old image from my implementation of the second approach. Should be fairly simple in 2D.

wallfracture.png

You can do this with a simple algorithm in 2D using a brute-force method. It's super fast when you cap N to something reasonable. For a 2D OBB I imagine maybe N as 5-15 could look good for a lot of games.


generate N points inside of obb
let S be an empty set of polygons
for each point A in N points
    let shape be initialized with obb
    for each other point B in N points
        create plane P between A and B
        assign A and B to P as references (in case this book-keeping is needed later)
        slice shape with P
    S.insert(shape)
S is now the voronoi diagram

How you generate your initial point set determines the style of the shatter. After this algorithm runs you can look at each shape relative to how close it is to the impact point, and assign initial velocities.

This topic is closed to new replies.

Advertisement