Regularized solution of LCP problems with application to rigid body dynamics