implement SquareObstacle#getDistance()