Implement dynamics algorithm for deformable body (still need revises).