X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftransform.cpp;fp=source%2Ftransform.cpp;h=b703a5b12e345863c03c533f782adcfa4e5b33be;hp=6862221ba496fb5626736169c80789883c58cb7d;hb=dd1a7cf2d8ce7bef1744f5a8cae5475104ea5438;hpb=f4d8ff7cab183c6e2ec3bf29c7449f25ea370646 diff --git a/source/transform.cpp b/source/transform.cpp index 6862221b..b703a5b1 100644 --- a/source/transform.cpp +++ b/source/transform.cpp @@ -17,7 +17,7 @@ Transform Transform::from_matrix(const Matrix &matrix) trn.euler.z = Geometry::atan2(matrix(1, 0), matrix(0, 0)); Matrix m = Matrix::rotation(-trn.euler.z, Vector3(0.0f, 0.0f, 1.0f))*matrix; - trn.euler.y = Geometry::atan2(m(2, 0), m(0, 0)); + trn.euler.y = Geometry::atan2(-m(2, 0), m(0, 0)); m = Matrix::rotation(-trn.euler.y, Vector3(0.0f, 1.0f, 0.0f))*m; trn.euler.x = Geometry::atan2(m(2, 1), m(1, 1)); m = Matrix::rotation(-trn.euler.x, Vector3(1.0f, 0.0f, 0.0f))*m;