## Recommended Posts

Posted (edited)

Hello,

I have recently implemented continuous collision detection using Conservative Advancement and I am currently trying to switch to Bilateral Advancement as described by Erin Catto in his GDC 2013 talk "Continuous Collision". However I am having trouble finding the right separation functions to use in 3D. I think I have the Vertex-Vertex, Vertex-Face, Edge-Face and Face-Face separation functions working correctly but I am unsure of the Vertex-Edge and Edge-Edge case.

I have found (from the bullet forums) how to get the separation axis for the Edge-Edge case using:

Vector3 EdgeA = closestFeatures.verticesA[1] - closestFeatures.verticesA[0];
EdgeA.Normalize();

Vector3 EdgeB = closestFeatures.verticesB[1] - closestFeatures.verticesB[0];
EdgeB.Normalize();

Vector3 Axis = Vector3::CrossProduct(EdgeA, EdgeB);

if (Vector3::DotProduct(closestFeatures.verticesB[0] - closestFeatures.verticesA[0], Axis) < 0.0f)
{
Axis = -Axis;
EdgeB = -EdgeB;
}


But I am unsure of where to go from here, I'm sure it is something simple that I am missing.

If anyone who has implemented technique before could help me, it would be greatly appreciated.

Thanks

Edited by Ronan085

##### Share on other sites

What are you stuck on?

##### Share on other sites

So on the Edge-Edge case I have the axis of separation but I can't figure out how to use that to get a separation value.

##### Share on other sites

In the edge-edge case you would simply compute the closest points between the two edges. E.g. like so:

Edge vs Edge is tricky. First the separation function is not convex. Say the edges are nearly parallel. When you build the cross product while the edges move the resulting axis (e1 x e2) can flip. It can also be arbitrary if the edges are essentially parallel (e.g. zero vector). This is actually an open problem with this method and the solution for this is pretty involved. A simple work around is to fall back on a global axis like vertex vs vertex. It is not as optimal but will work well. That is what suggest first to get things working...

## Create an account

Register a new account

• 9
• 24
• 9
• 13