main ray intersection routines