Add terrain collision detection