🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Collision response and change in force

Started by
1 comment, last by _WeirdCat_ 6 years, 5 months ago

Hi, i am implementing a billiard simulation game and i have a question about collision response. 

As integrator, i am using Semi-Implicit Euler, 

 


      ball.setVelocity(ball.getVelocity().add(ball.getAcceleration().multiply(dt)));
      ball.setPosition(ball.getPosition().add(ball.getVelocity().multiply(dt)));

 

Before integrating, i am calculating acceleration :


this.setAcceleration(this.getForce().multiply(1 / this.getMass()));

dt is time frame here, and acceleration, velocity, force and position are Vector class. (operations as add, multiply... are standard vector operations).

My question is - when i initially hit ball with cue, i am giving force -k*x (Hooke's law) to ball. But when it collides with other ball, i can only find formulas that calculate new position and new velocity, but my force will stay same. But how to change force here in both balls (it will change velocity and position later in SE Euler).

I appreciate any answer!

Advertisement

You need to define yourself how much force the hit will consume.

This topic is closed to new replies.

Advertisement