drleviathan wrote:You could compute the AABB of all penetration vectors and then chose the corner that is furthest from the origin. Dunno if it works but is what I would try if I were doing the same thing.
The AABB combined with the sum of all penetration vectors could provide an even fancier solution. I can imagine scenarios where the AABB extents could be nearly equal along one or two dimensions making it unclear what is really the best direction. The sum of all penetrations could be used to differentiate. For example, you could compute the point where the sum vector leaves the AABB and always use that. I made an image that tries to communicate this: red vectors for all the penetration inputs, blue for their sum, and green for its projection against the AABB of the inputs.

Thanks, using corners works.
Using intersection with the sum of penetration isn't a good idea, imagine in my original image having gravity and penetration into the ground - using the intersection with the side of the AABB will only fully recover on the axis of the side's normal.
Using the corner of the AABB on the other hand makes sure you have full recovery on all axes.
gameover wrote:Just act on the largest penetration and ignore the others?
Imagine having penetration from more than 1 direction, like the gravity & ground example I just gave. Only using the largest doesn't guarantee you'll recover from all penetrations.