It depends...you can use the methods for collision detection or calcMinDistance and adjust the height according to the result.
Edit: Depending on the complexity of the terrain, you might want to calculate an OcTree and enable use for collision detection (and disable use for rendering) on it.