Sign in to follow this  
utkua

collision confusion

Recommended Posts

I have started with the idea of detecting overlap between objects and calculate responses, but realized it is not a good idea to use examine moment to find collisions between intervals. Many resources are explaining triangle triangle collision without a speed/velocity vector around. I have found myself writing an edge edge collision function with speed, it seemed good way to find collision between triangles using this while a collision can be between vertex-triangle or edge-edge. Well, I havent mention the angular speed yet... Also my aabb, I have used just an AABB to define my player, but it was not easy to find triangle aabb collision and it was not well suited while translation was changing the size of the AABB... So I am confused, I want to find general solutions but get anxious if I am trying to do something overkill... Is there a way, or a good url to get general practices are being used in the scene to avoid "keep hitting a wall" :)

Share this post


Link to post
Share on other sites
Most collision detection algorithms I've seen don't use any information other than the current position (and maybe the previous position). Generally detecting a collision that happens now instead of between frames is good enough.

The velocity (momentum) is then taken into consideration during collision response.

You only really need to worry about collision between frames if:

1. A large number of objects are likely to move fast enough to penetrate one another completely every frame.

2. Missing even a single collision has severely bad implications for your program

If you're still interested in finding the time of collision (the moment of first contact), you can do a linear interpolation between the the two positions that each object occupied between frames, form a quadratic equation, and solve it using the quadratic root formula.

This is called "swept volumes". It's described in Real Time Collision Detection by Christer Ericson, which is a good book if you're interested in this sort of thing.

I did this for collisions in my ALife simulator, you can read the math here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this