Simulation of multiple connected bodies for real-time application