I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them freely without resistance.
For collision detection, I have been using the Separating Axis Theorem (SAT) to calculate overlap between the player and environment. The problem is with the resolution phase. The SAT gives the axis of minimum overlap and the amount you need to move an object along the normal in order to resolve this overlap. This method leads to the player sliding downwards when gravity is applied on a slope, or encountering resistance when moving horizontally into a slope.
To solve this, I want to resolve the collision by applying the minimum y-offset:
And an answer to a similar question here seems to provide some of the ground work of how to do it, but I don't feel I have all the information I need. How would such a method work for arbitary polygons? From which point do I need to be calculating the overlap from? Do I have all the information I need already from calculating the separating axis or do I need to compute further values?