Find Collision response of two objects

Started by
21 comments, last by oliii 14 years, 11 months ago
If you trace one convex volume against another, you will get two time when the two objects are in contact. That's what the 'enter' and 'leave' are. Think of them more in the context of a ray-trace hitting a polygon. the ray will enter the polygon, then leave the polygon. Then normals Nenter and Nleave are just the normals at the points of contact.

the 'leave' part isn't exactly useful, however it is used in the swept test algorithm itself.

Everything is better with Metal.

Advertisement
In case of fast moving objects, you stop them to overlap each other by "estimating time t"(not get this idea clearly yet), in your example, you defined 2 states of collision that are collided and overlapped. In some cases, when 2 objects still don't touch each other(might be in next several time,they will collided) but your "Collided" Flag turned on TRUE and it calculated something which relate to position and veloc of 2 objects (but they still don't touch each other yet), I don't understand what did that codes processing mean in this case(2 objects still don't touch each other yet,right ?)
Finally,could you explain step by step in the task of separatedByAxis_swept function( I understood "swept" word in that function mean that 2 object still don't touch each other but they are moving with really fast speed thus they might collide each other, am I right ???), I tried to review it many times but still don't get it by my heart ! please tell me!
Quote:
In case of fast moving objects, you stop them to overlap each other by "estimating time t"(not get this idea clearly yet)


Not really, they object do not overlap initially, I'm just calculating the time they will collide in the future. That's the general idea behind a swept collision test. You try to find when they will collide forward in time, before (ideally) any overlapping occurs.

If the objects collide in a time of collision within the frame time step, then the collision will happen during this frame, and should be handled.

Once a collision is detected, the objects are move to the time of collision (time will be 0.0f if they were initially overlapping), and the response is applied.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement