Added triangle checks for primary rays with triangles and parts of the creation of primary rays.