Original Post
Hi,
I''m working on collision detection at the moment and I''ve had something nice and simple working although it''s not entirely fair. Let me express the problem.
2D environment with circles of various sizes moving simultaneously. All collisions must happen at the correct location and simulation time is an issue (this is already a time intensive simulation and we need a long running time to get good results).
1st version relied on small timestep so that any errors were small but this was unacceptable.
2nd version: For each object, all other objects are converted in to it''s frame of reference and if any of the objects collided with it then the time of the collision and the two objects are recorded in the list. This is performed for each object and all the collisions are sorted in a list with collisions hapening earlier in time first.
So now for a few objects you might have a list like this (A,B,C,D etc are objects)
Object1, Object2, Time
A, B, 0.2
A, C, 0.4
So we know that the objects can be moved 0.2 time units forward and that will be when the first collision happens. We work out the objects new velocity vectors. Then we need to test if that collision has affected any other collisions in the list e.g. the collision between A & B may have diverted A''s path sufficiently such that it does not collide with C. So is it sufficient to remove all the collisions regarding A & B, then find the collision lists for A & B again and recombine them with the list (correcting for collision time).
This is what I''m thinking but it''s quite a pain in the ass.
Any input would be appreciated.
Thanks,
Meto
p.s. completely fair is sufficiently satisfied by a floating point time, they do move fairly slow anyway.