I ported my game to irrlicht 1.7.2 and it broke. I was wondering what changes would cause this code to fail:
Code: Select all
// this returns the incorrect result
irr::core::matrix4 m;
m.setRotationDegrees(core::vector3df (270.000000, 0.000000, 0.000000));
irr::core::matrix4 n;
n.setRotationDegrees(core::vector3df (-90.000000 0.000000 0.00000));
m *= n;
return m.getRotationDegrees();
// returns 360.000000 -0.000000 0.000000
// (should return 180, 0, 0)
// returns almost the correct result.
irr::core::matrix4 m;
m.setRotationDegrees(core::vector3df (270.000000, 0.000000, 0.000000));
irr::core::matrix4 n;
n.setRotationDegrees(core::vector3df (-89.910004 0.000000 0.000000));
m *= n;
return m.getRotationDegrees();
// returns 180.089996 -0.000000 0.000000
I don't really know an alternative to using matrices to rotate directions so I'm kinda stuck on this problem at the moment.