For a small game project, I need a simple solution to calculate the next position of a ball rolling against a slope. The result doesn't need to be the exact replication of the reality, a rough system may be sufficient, as long as the ball reacts roughly as a real rolling ball. I tried to resolve that by myself, however my skills in physics are very limited. Even after searching on the web, I could not figure out the complete process to achieve a such calculation.
Here are the information I know for the calculation:
- I know the elapsed time since the last drawn frame
- I know the polygon below the ball, from which I can deduce the slope
- I know the gravitation and friction forces, which are constants
What I need is the next ball position based on the physics forces applied on it. I would be thankful if somebody can explain to me:
- Which physics formulas should be used to achieve a such calculation
- A simple example, if possible in C++, but may be in pseudo-code or in another language, showing how to calculate this position from the above values
- At least a direction about which physical laws should be used to resolve the system, which I can then search on the web
NOTE I know that several physical engine exist, like Bullet or Box2d. I don't want to use them for now, I want to understand first how physics may work in a scene. So, please, don't provide a such solution.
Regards