Should the calculation for second be swapped? If hit1.t < hit2.t, then first and second will both be child1.
Yes, good catch.
Should the calculation for second be swapped? If hit1.t < hit2.t, then first and second will both be child1.
Yes, good catch.