Updated distance joint implementation