finding which side of a polygon a casted ray intersects

Hey there,

A ray cast can detect which body it intersects, This is great. but (in case the body is a polygon) what about the side of the body? Is there a way to figure out which side of the body the ray touches? I’d need to know the x and y positions of the two points that define the side.

I hope this is clear enough… :slight_smile:

Thanks!

@Rodolphe - Google has many solutions to this

Oops, I’ve looked closer, and I think I’ve found something… http://stackoverflow.com/questions/328107/how-can-you-determine-a-point-is-between-two-other-points-on-a-line-segment