Collision with more than two objects at once in code

  • Thread starter Thread starter Luke_M
  • Start date Start date
  • Tags Tags
    Code Collision
AI Thread Summary
In a scenario where multiple objects collide simultaneously, the question arises whether a stationary object (E) will receive any vertical velocity (Vy) from the collisions. The discussion emphasizes that E will not receive Vy due to the nature of the collisions and their timing. For programming a physics model, it's noted that handling simultaneous collisions can be challenging, as traditional methods often rely on sequential processing. Instead of using loops, it is suggested to utilize equations to model collisions, considering that real-world collisions occur over time, allowing for propagation of effects. A practical approach involves treating the objects as slightly separated to manage the collision sequence effectively.
Luke_M
Messages
10
Reaction score
0
Balls A,B,C,D are traveling at V=1 to the right next to each other like a train they hit ball E whom is stationary. At the exact instant ball F is traveling down and hits A, F is traveling at V=1 but down

Here is a diagram this is birds eye view:

*=collision
both collisions have happened at the same time
|
|
V
F
*
-------->ABCD*E



A: Vx=1 m=10
B: Vx=1 m=10
C: Vx=1 m=20
D: Vx=1 m=10
E: Vx=0 m=60
F: Vy=1 m=10

will object E receive any Vy ?
why not ?
what are the new V's ?
I need to know how to work this out as I am making a physics model in my game.

If you are a programmer maybe you can also answer this question:
In the real world collisions can happen all at once like in my above example. How can I do this in code ? I can only do them sequentially with for loops. is this normal practice in constructing a physics engine. Because if I do the collision between F and A after the other collisions A's new V will incorrectly not be included in the calculation.
Thanks in advance.
 
Physics news on Phys.org
For programming I think that you need to take a look at a concept called "threading" not all languages support it, but Java does and I believe C++ does as well.

Here is a great place to start:
http://java.sun.com/docs/books/tutorial/essential/concurrency/

Plus why are you using loops, can't you just use a couple of equations to model this and just put those into your code?
 
IN the real world collisions don't happen "all at once". They take a finite amount of time, and the effects propagate through the bodies at the speed of sound, so if one side of a ball collides with something the other side of the ball doesn't "know" anything about that till a finite amount of time later. The typical speed of sound in a solid is a few km/sec, or a few mm per microsecond.

The easy way to program this is to pretend the balls are all a small distance apart. So in your example first, F collides with A and D collides with E (and those two collisions don't interact with each other).

Next, because D has slowed down, C collides with D, and so on.
 
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Back
Top