Simplified ray-slab intersection code.