Computation of flow-induced motion of floating bodies