move ray_dir_ computation inside set_rows()

This change enforces internal consistency when users call set_rows() and
avoids some code duplication in the constructors