check for ray when testing distances