I found this addon, it should do what you want.
https://blenderartists.org/t/ray-cast-selection/1141012