Programming Collisions of Objects (Multiple Collision Case)

I found out about a collision in physics programming, and I have one big doubt.

Reflecting in spheres, when one spherical collision with 2 at the same time, I thought that the magnitude of the forces that moves both spheres should be divided by 2. But when I program this, I always see that one sphere has more speed than the second, forcing them to program it, it first encounters what is different. Show the image to clearly illustrate the problem:

enter image description here

First he discovers a red sphere. Then a collision is detected, and the magnitude of the force is similar to that of only one sphere. Then he discovers the orange sphere, and the magnitude of the force is less than the first.

, , - ?

, , , 50.

+5
4

, , . , , , , 1) , ; 2) , , - , , , . , , , , , - .

, , , . - , : , , .., , , .

, , , . , , ( ). , , , , , , , ( = /). , , , , , ( )/( ) - .

+1

, , - , , .. , , .

+1

DarenW ( n00b, ) , :

//test for collisions
blueHitRed = didCollide(blue, red)
blueHitOrange = didCollide(blue, orange)
...
//calculate resultant velocities
red.velocity = ...
orange.velocity = ...
blue.velocity

, -

//red
blueHitRed = ...
red.velocity = ...
blue.velocity = ...
//orange
blueHitOrange = ...
orange.velocity = ...
blue.velocity = ...
+1

N-body. , , . .

[] : , n-. n-, .

-2

All Articles