Changed distance direction to positive outside and negative inside the object.