Adding ray intersection functions