In TimeOfImpact.CalculateTimeOfImpact, Debug.Assert that the T value passed to SeparationFunction.Evaluate is not NaN. Bad inputs here can cause infinite loops at a lower level which can be a little hard to diagnose. As an added precaution, Debug.Assert the return value of CalculateTimeOfImpact is not NaN as well. This will help identify if something strange happened at a lower level as opposed to being provided bad input.
In TimeOfImpact.CalculateTimeOfImpact, Debug.Assert that the T value passed to SeparationFunction.Evaluate is not NaN. Bad inputs here can cause infinite loops at a lower level which can be a little hard to diagnose.
As an added precaution, Debug.Assert the return value of CalculateTimeOfImpact is not NaN as well. This will help identify if something strange happened at a lower level as opposed to being provided bad input.
VelcroPhysics/VelcroPhysics