generalized raycast improvements, using in ray_cast_path