[ODE] Distance between two objects
Jon Watte
hplus-ode at mindcontrol.org
Mon Apr 19 11:09:15 MST 2004
> I'm not quite sure what you mean with the shortest distance. The shortest
> distance between any two objects is always a straight line.
> dist = sqrt((c[0]*c[0]) + (c[1]*c[1]) + (c[2]*c[2]));
This is the distance between two *points*. The original question was to get the distance between two *objects*. This is also known as the "separation distance".
For example, if you have a capped cylinder and a rectilinear block, finding the shortest distance requires a bunch of tests, similar to the separating axis theorem, except you can't take early outs (because you need to find the SMALLEST axis, not just ONE axis).
When you involve tri-meshes, it gets even worse. (GJK is what most people use here, I think)
Cheers,
/ h+
More information about the ODE
mailing list