what ray-cast algorithm can do?