Disappearing Polygon Bug Fixed. Demo Improvements: New Cutting Line System.
Disappearing Polygon Bug Fixed
Sometimes after cutting a polygon, 1 half disappeared while the other was spawned. Probably happened with fracture shards too. (but was not noticeable because so many fracture shards were spawned. As it turned out, triangulating a polygon sometimes produced very small triangles where my area calculation code produced invalid areas (-1.#IND) causing all code using that invalid area to produce invalid polygons. These small triangles had such a small area that probably through float imprecisions a negative value (instead of 0) was used in sqrt causing the -1.#IND values. The triangle area code now returns 1.0 if a negative value is detected.
Cut Line System Overhaul
The cut line system in the cut fracture test scene was improved. Looks more like Fruit Ninja now xD.