Basically, I have a setup that saves and loads Newton bodies in 3D space, and one of the parameters is the body's attitude, represented as a Quaternion, with 4 Quaternion parameters listed. I save the file in txt format (I want my users to be able to edit it) and then I read and re-load objects and position and orient them according to the parameters. So, on one occasion, I saved just such a file, and while re-loading it, I get a nasty crash deep inside Newton. After a few hours of debugging, I narrowed it down:
- Code: Select all
// This line works fine when loaded
attitude= -0.188616, 0.738900, 0.626815, -0.159867
// This line results in a fatal crash
attitude= -0.188616, 0.738901, 0.626815, -0.159867
Can you spot the difference? Yup... it is a 0.000001 difference in the 2nd parameter.
I have no idea how to debug this, nor would I even to begin to contemplate debugging the inner workings of Newton. Can anything be done to prevent this, put some recoverable checks? All I can do is supply a call stack upon crash.