problem with multiple collisions

Started by
8 comments, last by Motorherp 19 years, 9 months ago
Hi, I've just finished my collision detection system and have started thinking about collision response. My question is this: given the situation below, how the heck does one A) resolve the following collision (ok that's just me being lazy - I have a physics book from A-level which I need to re-read!) B) resolve this collision given that I have a buncj of collision PAIRS and here we're talking a situation involving 6 different objects including an energy transfer (i think!) between F,D and E. I was thinking of maintaining a list of touching objects or something but I really have no idea. Any help would be enormously appreciated! :) Many Thanks Tony [Edited by - TonyFish on July 25, 2004 3:15:27 PM]
<Fish>{
Advertisement
d'oh I forgot the diagram. [razz]



[Edited by - TonyFish on July 27, 2004 7:20:47 AM]
<Fish>{
*bump*
<Fish>{
One method could be a recursive procedure of Check-For-Collision and Resolve-Collision, where after each resolution you then check the involved objects for additional collisions during the same time-frame. Thus, you would detect the collision between F and E first, then resolve them by an energy transerence from F to E, and then check if either has any further collisions in this frame. In this case, E collides with A, so you resolve that, check for more collisions, find none, etc. The repeating collision detections can be optimized because you already know the objects that may or may not collide, from previous tests.
(http://www.ironfroggy.com/)(http://www.ironfroggy.com/pinch)
One thing you'll want to be carefull off when using a recursive method is the possibilty of entering an infinite cycle. Imagine 3 objects all colliding simultaneously such that each object is in contact with every other object (think of a triangle). I'm sure you can see the potential for just looping around this triangle infinitely using recursion. Of course this can be countered by simply marking each collision pair when you process them and quiting when all pairs in a group have been marked. Another method you may want to consider however is multiple simultaneous collision resolution. This can be done for any group by forming the impulse equation for each object in the group (taking into account all collisions with that object). You end up with a bunch of simultaneous equations which when put into a matrix form can be solved using one of many solvers (eg Gauss Seidel). This method will give more accurate results and is probably quicker for small collision groups depending on your implementation. I had a quick look on the net but unfortunalty couldn't find any good tutorials for this stuff. However if you already know how to form impulse equations for collisions then the rest is just simultaneous equation solving for which there are many good sites and also free source. Hope this helps
[size="1"] [size="4"]:: SHMUP-DEV ::
Quote:However if you already know how to form impulse equations for collisions then the rest is just simultaneous equation solving

I don't :) I ordered the Eberly physics book but it won't arrive for a while. Could you direct me yo any good online resources?

So effectively I would collect all the collision pairs within a group of simultaneous collisions and then process them as a whole? This is what I was origianlly thinking of but I think I'm too new to all this to do anything like that yet.

Thanks
<Fish>{
Unfortunatley my search didn't come up with any sites that deal with this problem specificaly and the equations are too in depth for me to go through them here (especially since I'm at work at the mo :)). 'Game Physics' by Eberly explains all the basics for this stuff very well but be carefull of his method for multiple simultaneous resolution. Its very complex and a bit of overkill really, it can be done much more simply. If you cant wait though and want to have a stab at coming up with your own solution then you'll need to study up on conservation of linear and angular momentum. You want to form equations that conserve these quantities for the system at the contact point of the collision (minus a percentage to account for loss of energy due to non perfectly elastic collisions). Once you have these equations you'll then need to express them as a system involving a matrix of the coefficients, a vector of the unkowns, and a vector of the constants. This can then be solved using one of many methods but chances are you'll end up with a sparse matrix so I recommend something like Gauss Seidel method. Here are some good starting points for you:

scienceworld.wolfram.com
mathworld.wolfram.com

Good luck
[size="1"] [size="4"]:: SHMUP-DEV ::
firstly:


I'm looking at this problem too (someone recommended I chat to you), if you want to bounce ideas back and too feel free to PM/email me.
Well my problem is that I haven't really dabbled must with collision resolution (apart from the simplistic collisions which we dealt with at high-school in physics class). I am most interested by this (and finding nice OO mechanisms from an engine perspective) but at the moment I am simply drawing up a vague engine design and have no time to spend with my nose in every text book I own! I've just bunged everything under a very vague PhysicsManagement class but I'd like to expand this a bit (without spending too much time on the details).
<Fish>{
Hi there TonyFish. In case you havn't been reading d000hg's thread:

Complementarity Based Multiple Point Collision Resolution

If you think of going with the LCP approach, that Eberly book has an in depth section on LCP and the source for it is included on the CD that comes with the book. Hope this helps
[size="1"] [size="4"]:: SHMUP-DEV ::

This topic is closed to new replies.

Advertisement