Simulation of rigid-body impact using the articulated-body algorithm