fix contact normal directions when dist == 0
refactor