- #1
Alekkk
- 3
- 2
I am trying to program a game in which I have a bouncy rubber ball which upon collision with the ground, will have a squeeze factor (like a spring) and will bounce back higher due to spring physics.
I have currently been able to make a rigid bouncing ball since that simply follows the rules of rigid body collisions with conservation of momentum. What I want now is to have a ball which upon collision with the ground, squeezes a certain amount according to the balls "spring constant", force of gravity, and speed upon collision and then bounces back up according to the spring force equation. Where I am lost however is in the connection between forces, momentum, and energy. When I detect that the ball has touched the ground at a certain speed in my game, what is the next step? How do I determine how much the ball squeezes (ie spring compression), and how do I calculate the progression of the squeezing, unsqueezing, and bounce-back of the ball.
If someone could give me a rundown of a single bounce of an elastic ball with details of every step of calculation, that would be amazing!
I have currently been able to make a rigid bouncing ball since that simply follows the rules of rigid body collisions with conservation of momentum. What I want now is to have a ball which upon collision with the ground, squeezes a certain amount according to the balls "spring constant", force of gravity, and speed upon collision and then bounces back up according to the spring force equation. Where I am lost however is in the connection between forces, momentum, and energy. When I detect that the ball has touched the ground at a certain speed in my game, what is the next step? How do I determine how much the ball squeezes (ie spring compression), and how do I calculate the progression of the squeezing, unsqueezing, and bounce-back of the ball.
If someone could give me a rundown of a single bounce of an elastic ball with details of every step of calculation, that would be amazing!