Comment by et1337
4 days ago
Based on my experience writing many games that work great barring the occasional random physics engine explosion, I suspect that trigonometry is responsible for a significant proportion of glitches.
I think over the years I subconsciously learned to avoid trig because of the issues mentioned, but I do still fall back to angles, especially for things like camera rotation. I am curious how far the OP goes with this crusade in their production code.
Yes, for physics engines I think that's a very good use case when its worth the extra complexity for robustness. Generally I think if errors (or especially nan's) can meaningfully compound, ie if you have persistent state, that's when its a good idea to do a deeper investigation
Your response is well-grounded--trig is trouble. Angles are often fine, but many 3rd party library functions are not.
Have you ended up with a set of self-implemented tools that you reuse?
You can definitely handle camera rotation via vector operations on rotation matrices.