Found it, now to fix it

I think I located the big nasty bug that was causing overlap.  I was handling the degenerate cases of a zero length edge in my collision detection algorithm by assuming the shape didn’t exist and always forcing false when attempting to collide with it.   Basically when i found a degenerate edge assume all edges are degenerate.  I did this intentionally when I first wrote the algorithm and it solves the initial case of nothing has grown yet very nicely on the first frame.  The problem occurs when the quad-splitting algorithm results in shapes composed of 5 points but that are actually triangles.  They usually have a degenerate 0 length edge or two.  Now I just need a quick work around and hopefully everything will start working.  I need to remember to handle cases like that better in the future.

Comments are closed.