Impact dynamics theory for the analysis and simulation of collisions