Ray–sphere intersection (sphere at the origin). Uses the closest-approach form, which stays accurate when the ray starts very far away.
[near, far] distances along the ray, or null on a miss.
[near, far]
null
Ray–sphere intersection (sphere at the origin). Uses the closest-approach form, which stays accurate when the ray starts very far away.