Override trig functions for infinite precision in set cases#81
Override trig functions for infinite precision in set cases#81eric-wieser wants to merge 2 commits intoleozide:masterfrom
Conversation
|
I've looked at this for a little bit today, I think using doubles instead of floats is a more generic solution and will work for more cases. Changing:
and: Fixes the problem you described. I'll need to experiment some more to see where the loss of precision is causing problems (sinf/cosf or LC_DTOR). |
|
Thanks for taking a look. Moving to doubles would definitely help, but might just hide the problem. The problem is that in C, Of course, the approach in this patch is sketchy, as it uses equality comparisons of floats. Passing angles in degrees in these cases would work better. |
|
I've updated the angle/pi defines and it seems to have solved the problem in a lot of cases. |
This fixes #80
The underlying issue here is that
lcMatrix44FromEulerAngles(LC_PI/2)was not returning an exact 90 degree rotation matrix.Overriding sin/cos might be overkill, but it did solve the problem on my machine, and seems pretty harmless anyway