I'm implementing my physics engine for my 3D game. So far I've been able to implement collision detection between OBB, spheres and planes. The engine generate contacts and resolve them with an iterative impulse-based approach.
The result is this (so far).
Now I need to detect and generate contacts between a height map terrain and those bounding volumes (sphere and OBB). The terrain looks like this:
I understand that the approach is to select the triangles under the colliding object (a subset of the terrain mesh, an heightmap) and perform a collision detection test between the triangles and the bounding volume of the colliding object (I use spheres and OBBs).
I looked into OBB/sphere - triangle collision detection and I found how to do it by applying the SAT test. What I can't get info about, or an example implementation is how to generate contact data/manifold from it. I know the contact normal and penetration can be gathered by the SAT (the normal is the axis of least penetration, and the relative overlap is the interpenetration), but I need some ad hoc code for the contact point.
In the excellent book by Millington Game Physics Engine Development I found some code that deals with the OBB-OBB case. I need something similar for OBB/sphere - triangle case.