Seperating objects after collision?

Started by
13 comments, last by Antimode Siker 18 years, 1 month ago
suggestion...
Do you Really need to know exactly When the ships collide?
I personally find that exact timing of the collision, is less important than the outgoing velocities afterwards. The collision only happens for an instant, its the after effects that the human eye will see as obviously right or wrong.

even as the objects are interpenetrating over a few timesteps, the normal of the contact plane isn't going to be changing all that much, so you can get away with approximating it...

so rather than find exact time of collision, i just calculate what the new velocities should be, then apply those to the previous position of each object.
cheap, stable, looks good...
Advertisement
Well, there is a surprising fact about the time issue. The reason for calculating the time of the collision isn't really that you need to know exactly /when/ it happens, even that that's a nice side effect. The reason is that you need to know exactly /what/ happens instead.

By what I mean what did the object collide against? What will happen is that you do your ray-triangle intersection tests, and the ray will intersect a number of triangles. How do you know which one is the one you will collide with? Well, from the math you easily get the time of the collision. So to find the triangle you will collide with, you just pick the one which would take the least time to get to giving your current velocity vector.

Now if this time actually is longer than your whole timestep, the triangle is so far away that you won't collide with it at all within the timestep. It might be on the other side of the map for all you know. So then there's no collision.
Alexander "Siker" LjungbergNorwinter Studios
Quote:Original post by Anonymous Poster
Quote:Original post by discman1028
Just as a side-note, this book is an all-encompassing masterpiece on collision-detection techniques, IMO. I recommend laying down the $$, especially if you're jumping into 3D collision detection + response.


I've been considering getting that book.... but I wonder if it's going to have anything I dont already know.
Whenever I go to a bookstore and pick a random game physics book off the shelf I find every single thing is familiar, is this any different? Or is it popular only because its well written?


This is not a general physics book, but a book completely on collision detection. Reviews say it is "all-encompassing" with all approaches, and he speaks from experience. The author is an expert, and posts on this forum actually. See his site (http://realtimecollisiondetection.net) here. He also posts corrections to his book on the site, which is very cool.

I'm not an expert on collision detection, but I want to be someday, and this book came highly recommended.
--== discman1028 ==--
Thanks for all the suggestions, I might look into trying to calculate the time of the collision. So is the basic idea that I send out rays from one model (from its verticies?) and check to see if they collide with any triangles on the other model. I can then use the model that sent out its rays velocity to calculate the time taken to get to the intersection point, and find the triangle with the lowest time taken, and if that is lower than my timestep I can move the model to pos += vel * time_taken - epislon and do my collision response?

Cheers,
Mark.
Yeah, that's the basic idea. What you would normally do though is to just send out one ray from the center of your object in the direction of your velocity vector. Then you would aproximate your object in some way. Say you aproximate it with a bounding sphere. Then you wouldn't actually test ray-triangle but sphere-triangle for a sphere with a certain radius. You can use other aproximating shapes, but try not to use the whole model. That's very slow - for each model triangle, you would have to test against all potential trianges possible to collide with. Say that you have 1000 potential triangles to collide with and your model has 1000 triangles too. Then you have to perform 1000*1000 triangle-triangle intersection tests. As you add more triangles this grows very quickly.
Alexander "Siker" LjungbergNorwinter Studios

This topic is closed to new replies.

Advertisement