Closed IsaacWoods closed 6 years ago
Matrix4
implements From<Quaternion
, so basically you need just
let matrix: Matrix4<f32> = quaternion.into();
The other option, which I think reads better is:
let matrix = Matrix4::from(quaternion);
Ah, should've realised that! Thank you very much
No problem! I do think it is a bit of a usability problem on the Rustdoc end - it can be hard to miss trait implementations like that.
I'm probably just reading the docs wrong here (although I don't think I'm alone in thinking the API can be a tad confusing) but I can't seem to find a way to create a rotation matrix (specifically a
Matrix4
) from aQuaternion
. This seems a pretty fundamental thing to want to do if the library is meant to be used for games, so I'm assuming I'm just missing something obvious?