I want to convert an OpenGL transform matrix into an FRotator.
I go about this by getting the base axis from the OpenGL matrix and using the UKismetMathLibrary::MakeRotationFromAxes, but I am not getting correct results:
FVector X(matrix, matrix, matrix); // OpenGL X
FVector Y(matrix, matrix, matrix); // OpenGL Y
FVector Z(matrix, matrix, matrix); // OpenGL Z
FRotator Rotation = UKismetMathLibrary::MakeRotationFromAxes(X, Y, Z); // Forward, Right, Up
This is clearly not working for anyting other than the identity matrix. When I sett the matrix to identity and getting X = 1,0,0 Y = 0,1,0 and Z = 0,0,1 for base axes this yields an FRotator with Pitch = 0, Yaw = 0 and Roll = 0, which is what I would expect.
What am i missing here?