Attempt at implementing Euler angles #595
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This uses code from THREEjs for converting to and from Euler, It implements all possible rotation orders, and should handle edge cases around poles.
I have tried to make it as readable as possible in line with other SK math helpers, but feedback is appreciated! Currently the "api" is in Radians, but converting to "Degrees" should be straightforward if wanted.
Actual (unit)tests are needed. Locally I have added a Unit-test lib for this, but not sure how it should be done to best fit the SK way.
Feel free to close this PR if adding Eulers is out of scope for SK, or you are unsure about the implementations fit. I did this without consulting with an issue or similar, but if its not useful i'll keep it in my own toolkit. If its usefull I would like to write more tests, and try to ship this thing :)
Remark: The math is not something I actually understand, but the output seems to be reliable in my testing. Math is ported from THREEjs, and should be compatible license wise.