Instant Non-sequencial Calculation of colisions b/w objects

In summary: This way, all calculations are done with current values only, and all entities are updated simultaneously.In summary, the conversation discusses the scenario of multiple collisions happening at the same time in a physics model for a game. The participants discuss how to handle this situation, with one suggesting the use of threads and the other suggesting maintaining two sets of values for each entity. They also touch upon the topic of using for loops in constructing a physics engine and the potential unpredictability of threads.
  • #1
Luke_M
10
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.
 
Last edited:
Technology news on Phys.org
  • #2
Luke,

The physics part I cannot easily help you with. As for the programming part, when you want multiple things to happen in parallel you use threads. A thread is a lightweight process. Each thread gets a timeslot much like a process does in a multiprocessing operating system. This is the closest you will get to having them run non-sequentially. I hope this helps.

Ryan
 
  • #3
I would not use threads for this because their time slices are unpredictable: some threads will sleep longer than others, causing your model to also be unpredictable. Instead, I would maintain two sets of values for each entity in your model: current values and next values. At each iteration of the loop, use the current values as input in the calculation of the next values. At the end of the loop, set the current values to the 'next' values you just calculated for use in the next iteration.
 

1. What is "Instant Non-sequencial Calculation of colisions b/w objects"?

"Instant Non-sequencial Calculation of colisions b/w objects" is a scientific concept that refers to a method of calculating collisions between objects in a virtual or physical space. It involves using mathematical equations and computer algorithms to predict the outcome of collisions between objects in real-time.

2. Why is this concept important in the field of science?

This concept is important in the field of science because it allows scientists to accurately model and predict the behavior of objects in various scenarios. This is especially useful in fields such as physics, engineering, and computer science, where understanding collisions between objects is crucial.

3. How does "Instant Non-sequencial Calculation of colisions b/w objects" differ from traditional methods of calculating collisions?

Unlike traditional methods, which require sequential calculations and can be time-consuming, "Instant Non-sequencial Calculation of colisions b/w objects" utilizes advanced mathematical algorithms and computer processing power to quickly and accurately calculate collisions between multiple objects simultaneously.

4. What are some practical applications of this concept?

Some practical applications of "Instant Non-sequencial Calculation of colisions b/w objects" include collision detection and avoidance systems in transportation, simulations in video games and virtual reality, and predicting the behavior of particles in nuclear reactions.

5. Are there any limitations to this concept?

While "Instant Non-sequencial Calculation of colisions b/w objects" is a powerful tool, it is not without its limitations. It relies heavily on the accuracy of initial conditions and assumptions, and complex scenarios may still require additional calculations and adjustments to accurately predict collision outcomes.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
9
Views
2K
  • Introductory Physics Homework Help
Replies
14
Views
1K
  • Introductory Physics Homework Help
2
Replies
38
Views
1K
  • Classical Physics
Replies
12
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
690
  • Introductory Physics Homework Help
Replies
6
Views
896
  • Programming and Computer Science
Replies
2
Views
715
Back
Top