Basically I want to create my own tools for developing a 2D top-down game and when it comes to collision detection I’m trying to implement the SAT method, but somehow my calculations seem to be way off from expected in certain situation (see picture below).
Collision Detector returns true
And at other times they are super accurate (2nd picture)
returns false, which is correct
I mostly followed the implementation from this page and even tho only sub-optimally, but it seems to be working.
So ultimately my guess is that it’s some sort of rounding error in the calculations, but I’m not sure if it should/could be this big.
If you have any suggestions on how to modify my methods, or where else to look for issues it’d be much appreciated!
My project files are available in this repository, the main classes concerned with the checks and calculations are CollisionDetector and Vector.