Expanded the new elastic-collision function to allow for constraint parameters.