Thanks for the responses!
Erin Catto wrote:
The stacking looks quite stable. Are you using any sort of shock propagation and/or breadth-first graph? I didn't notice any artifacts.
The mouse dragging is a little wonky because it tends to allow some deep overlap. I dragged one square on top of another and they began to hug each other.
Overall, a great job!
Cheers,
Erin
The solver is completely Gauss-Seidel, no shock propagation or anything of the sort. The reason the stacks are so stable that I'm using a really slow convergence over several time steps. This also leads to the problem you described.
The boxes are just like any other polygons, and uses distance maps for collision detection. This is far from ideal and will be resolved in a future version.
raigan2 wrote:KenB wrote:Distance maps are used for free-form objects. They are quite efficient in 2D.
It seems like you're calculating them really quickly.. are there any particular tricks, or are computers just fast enough these days?
The distance maps are only 128x128 big which allows them to be calculated fairly quickly. I use a simple but fast breadth-first approach for calculating them.
The distance maps are also used for rendering, and in both cases I use linear interpolation. This means that the visualization of a polygon corresponds exactly to its implicit definition.
/Emil Ernerfeldt