polygon collision detection and response