general collision function