Open cactusdualcore opened 1 month ago
There's a proposal for this for Godot too! https://github.com/godotengine/godot-proposals/issues/8906
I too was looking for this but couldn't find it in glam. This use case is valuable and general enough to be included. +1
Edit (Context): I'm trying to do something in bevy, which uses Quat to store rotation, and I want to find out the current rotation along a particular axis.
I ran into a problem where I wanted to decompose a rotation into a part which rotates around a specified axis and perpendicular to it. This can be done using the swing-twist decomposition of quaternions.
I now implemented an alternative solution to my problem, but I think this library would still profit from this feature.
I implemented a crude function to do this for me based on this stackoverflow question.
There seem to be many resources on this topic online. I have neither thoroughly tested nor benchmarked the above snipped and I assume it requires more polish. If desired, I could try putting together a PR for a full implementation?