trn.euler.z = Geometry::atan2<float>(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<float>(m(2, 0), m(0, 0));
+ trn.euler.y = Geometry::atan2<float>(-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<float>(m(2, 1), m(1, 1));
m = Matrix::rotation(-trn.euler.x, Vector3(1.0f, 0.0f, 0.0f))*m;