Advertisement

Collision response and change in force

Started by February 06, 2018 05:58 PM
1 comment, last by _WeirdCat_ 7 years 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!

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

This topic is closed to new replies.

Advertisement