Quaternion or axis-angle rotation maths
(1.21.4) I am working on a chain-based weapon (see video) which can rotate and wrap around blocks. My issue currently is that it can only rotate horizontally, since I only have a single scalar as the angular momentum which changes it yaw. I'd like to make it rotate in 3D, and for that I think I'd need some way to convert pitch + yaw into a different format, such as a quaternion or an angle-axis rotation, do some maths in that representation, and then convert it back into pitch + yaw. Are there any simple ways to do this? Or is there a library for this I can use?