Improved character terrain collision