Program uses multi-threading to showcase a side-by-side comparison of the SAT Collision Detection both with and without optimization. (The windows start in the same place so drag one to reveal the other.)
-
Sometimes (it seems to be mostly when BouncingThings hit nearly perfectly point on or edge on) the collision detection between BouncingThings calculates the MTV incorrectly, and put the object on opposite sides to each other.
-
When the Pair Redundancy optimization is enabled, some objects will completely pass through each other.
-
The collision detection is most stable when no optimization is carried out. However, Visual Studio Performance Analysis shows that the collision detection takes just over two times the processing power.
- TL;DR Triangle and Square are redundant. Base class OP.
- Although Triangle and Square objects have their own classes, the BouncingThing class (the base class) will happily take any number of points (and a radius) and give you a convex shape based on that, which will work with the collision detection.
I did not have time to implement a quadtree and try to fix the glitchy-ness of my SAT algorithms. (The files aren't implemented)
