In my project using Three.js, I am building a simulation of a robot that needs to detect obstacles. More specifically, the robot should be able to determine the distance to the closest obstacle directly in front of it. How can I achieve this using Three.js? Essentially, I need to create a mechanism for the robot to "look" along a specific ray and identify the nearest object that intersects with it.