fixed ray cast to report the correct contacted edge