Concave Mesh Collider allows intersection with the side of shared triangles
I am attempting to create a platformer and the player is hitting the "inner" part of the collision polygons, meaning the edge that is shared with another collision polygon.
Setup: The player has a RigidBody + Box Collider and the level has a Mesh Collider that is 1 solid piece of geometry. The player is moved with AddForce() calls to the rigid body. Inside of OnCollisionStay the player outputs the intersection point with the normal. (NOTE: The player is to the left in the image and these are previous frames intersections).
The Problem: The player can collide with an "inner" edge of a polygon, in other words, an edge that is shared by another edge. If the player hits this, the physics system stops them where they are. This is most apparent, and very easy for me to repro when jumping and landing just below the top of a slope. Presumably the player's collision box sinks into the ground slightly and catches the edge. However, in theory the collision system should recognize it as a shared edge and push the player out using the ACTUAL normals of the faces, not an inner edge.
See the attached image. The normal pointing directly right is not possible because the polygons are connected and should prevent it. I've even written a merge algorithm to remove all redundant vertices so the collision system should know that these polygons are linked and prevent the collision against the perpendicular edge.
I'm getting cranky about this. The game is a voxel based game, I wrote two different algorithms to merge my voxel edges to remove faces on the inside of the voxels (where two voxels are against each other, I remove their opposing faces). I wrote another that follows the lines of the voxel edges and merges the parallel lines into a single polygon. Even after all of that, I am still seeing these kinds of issues.
Any help is greatly appreciated.