Generalized collision detection