I have a landscape(generated via Perlin noise) and a ball. I want the ball to move along the geodesic(implementation of basic physics: gravitation, friction). I thought to do raycast around the ball to the landscape, choose the lowest point and move the ball to this point, but it won't work in every case and it won't allow the ball to jump (with inertia). So, what is the best way/algorithm to implement such feature?
P.S. I don't want to use any libraries.
It'll take some time, but it's not THAT hard, you need to calculate the ball's new position, ignoring the height field at all (only gravity & inertia) and then, after this step, you check for collisions (basic collision detection between sphere and triangle mesh), and if a collision is detected, generate the collision data and resolve it by applying an impulse OR force in the appropriate direction, using the motion direction and the collision normal direction. Now, if you never worked with collision detection before, it'll probably take you some extra time to learn the algorithms involved, like how to detect collision, how to generate the collision data (normal, penetration, etc).