Archived

This topic is now archived and is closed to further replies.

Endemoniada

Closest Distance Between Line Segments ?

Recommended Posts

Hi guys, My collision detection system is almost perfect but some weird things happen sometimes, I think if I can figure this out I can fix it. Can I determine the closest distance two line segments come to each other ? I don''t need to know where the closest point is, just the closest distance. The line segments are in 2D and can be facing in any direction. I know how to find the closest distance that one point is to a line segment but not a line segment to another line segment. Thanks again. PS- when I get my game done I''m gonna give a "Special Thanks" to gamedev :o)

Share this post


Link to post
Share on other sites
off the top of my head, express the lines in vector form in terms of two parameters lamda and mu, find the distance between two general points and minimise this with respect to lamda and mu

Share this post


Link to post
Share on other sites