Implements bilinear interpolation for terrain collision