Choosing The Right Result
This morning feels like a small victory. As I had a moment of realization. I think the old system didn’t take this into account.

Since I’m using the Seperating Axis Theorem(SAT). You would normally only check every axis until you find one that does not overlap. That’s your seperating axis, you exit out of the loop and everyone is happy.

Though what I am trying to do needs the information of all edges. Otherwise we don’t know if there is another edge that’s closer to the entity we are checking.

However, what I didn’t do is pick the right collision result. We still only want the result that is relevant to us. If one axis is overlapping, but the other is not. Then only the one that is not overlapping is relevant. That is our seperating axis which we base the rest of our system on. But what happened was that the other axis, which did register a collision, was used. Resulting in incorrect behaviour.

Those Visuals Again
It sounds pretty obvious, but it’s something I probably overlooked in the old system. And it took me quite some time to realise for this attempt as well. This is again where the visuals help me greatly to identify these problems. The result of a collision happening or not seems to be correct again after fixing this problem.

The things left are that the direction of the overlap is not registered correctly. As well as the acceleration having too much influence on it. Slowly but surely we will get there 🙂

Last modified: July 14, 2023