optimized triangle ray intersection