I was reading the documentation and found that the deletion of shapes from a body is locked during callbacks. This is potentially troublesome for me as I need the ability to delete and redefine shapes for a deformable terrain implementation utilizing the marching boxes algorithm and polygonal approximation with the input being a black and white aliased collision mask.
Here is my algorithm thus far.
1) The map stores an initial, precomputed approximation of the terrain. The approximation is made with strings of 2 vertex b2Polygons.
2) The game keeps track of when changes to the terrain mask occur, such as the explosion of a bomb and appropriate graphical steps are taken to remove a section from the collision mask. All of the polygons in the affected area are then erased.
3) The marching boxes algorithm is then used to trace the affected area and redefine the collision volumes. This is done recursively and the new volumes are created using the coordinates of the set of boxes every 20 or so cycles. Depends on how accurate you want the simulation to be.
4) Carry on then. Nothing else to see here.
So... any thoughts or suggestions? Should be a hell of alot faster than polygon tessellation if you ask me. Because I saw the method using quadtrees that some Linux fanatics (jk, love Linux) were using for a Worms remake with Tux, and the number of volumes that were used just blew my mind.
Here is my algorithm thus far.
1) The map stores an initial, precomputed approximation of the terrain. The approximation is made with strings of 2 vertex b2Polygons.
2) The game keeps track of when changes to the terrain mask occur, such as the explosion of a bomb and appropriate graphical steps are taken to remove a section from the collision mask. All of the polygons in the affected area are then erased.
3) The marching boxes algorithm is then used to trace the affected area and redefine the collision volumes. This is done recursively and the new volumes are created using the coordinates of the set of boxes every 20 or so cycles. Depends on how accurate you want the simulation to be.
4) Carry on then. Nothing else to see here.
So... any thoughts or suggestions? Should be a hell of alot faster than polygon tessellation if you ask me. Because I saw the method using quadtrees that some Linux fanatics (jk, love Linux) were using for a Worms remake with Tux, and the number of volumes that were used just blew my mind.