Code: Select all
float mat1f[] = {1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,0 };
core::matrix4 mat1;
for (int i=0; i<16; i++)
mat1[i]=mat1f[i];
core::vector3df rot1 = mat1.getRotationDegrees( );
Code: Select all
float mat1f[] = {1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,0 };
core::matrix4 mat1;
for (int i=0; i<16; i++)
mat1[i]=mat1f[i];
core::vector3df rot1 = mat1.getRotationDegrees( );
Code: Select all
if (!core::iszero(C))
{
const f64 invC = core::reciprocal(C);
rotx = mat[10] * invC * invScale.Z;
roty = mat[6] * invC * invScale.Y;
X = atan2( roty, rotx ) * RADTODEG64;
Code: Select all
// we need to check for negative scale on to axes, which would bring up wrong results
if (scale.Y<0 && scale.Z<0)
{
scale.Y =-scale.Y;
scale.Z =-scale.Z;
}
else if (scale.X<0 && scale.Z<0)
{
scale.X =-scale.X;
scale.Z =-scale.Z;
}
else if (scale.X<0 && scale.Y<0)
{
scale.X =-scale.X;
scale.Y =-scale.Y;
}