When my sphere (or backside a part of a capsule) strikes with its backside close to the sting of a largely horizontal triangle (a face of a heightmap), I’m generally getting very unhealthy (largely horizontal) normals. How ought to a correct collision regular be calculated on this state of affairs?
This is my try to clarify the present state of affairs main to those unhealthy normals. Operating the standard separating axis assessments, it’s decided that the perfect axis is generally vertical. Based mostly on this axis, the colliding options of the shapes are decided. The function of the sphere is at all times a degree on the underside, and the function of the triangle might be the entire face, an edge or a degree. The unhealthy normals listed here are arising from point-edge collisions. Particularly, the perfect axis was decided to be largely vertical, however it will probably occur that the purpose is extraordinarily near the sting, and vertically nearer than horizontally (and so apparently a separating axis within the airplane of the triangle was not thought of or not the perfect), in order that the contact pair consisting of the purpose of the sphere and the closest level on the sting has a standard which is generally horizontal.
How ought to this downside be solved?
For reference: that is Godot problem #69683 which I wish to repair.