Function to detect intersection between a ray and a sphere.
Sphere intersection is now static.