Failed assert: kTangent > Settings.Epsilon

Topics: User Forum
Jan 31, 2011 at 10:19 AM
Edited Jan 31, 2011 at 10:40 AM

My program, which uses FP3.0, fails an assertion in ContactSolver,Reset:

Debug.Assert(kTangent > Settings.Epsilon);

 

When the assertion fails, kTangent's value is NaN, as is the method's local variable rnA, which I assume is an invalid value.

What sort of error should I keep an eye out for here? I really have no idea where to start looking.


Developer
Jan 31, 2011 at 10:48 AM

It might help to get some information on which part of your code produces this error. E.g. what are you doing prior to this.

Wild standard guess: You probably haven't scaled all your units to MKS system and therefore end up with ridiculously big forces and heavy objects (from Farseers perspective), which sometimes produces NaNs (which you guessed correctly is an invalid value aka.: Not a Number) in various locations.

Jan 31, 2011 at 11:24 AM

I found the problem -- I was setting a body's LinearVelocity X and Y unknowingly to NaN because of some misuse of Vector2.Normalize. Thanks for the help.