Browse Source

GCC 4.5 compatibility: this workaround is not needed anymore.

Due to Matrix/Vector rework and other changes this is fixed on lower
levels already. The tests pass on both 4.5 and 4.4, hopefully it won't
break anywhere else.
Vladimír Vondruš 13 years ago
parent
commit
cbcb73a9d5
  1. 12
      src/Math/Matrix4.h

12
src/Math/Matrix4.h

@ -303,15 +303,9 @@ template<class T> class Matrix4: public Matrix<4, T> {
*/
inline constexpr Matrix<3, T> rotationScaling() const {
/* Not Matrix3, because it is for affine 2D transformations */
#ifndef CORRADE_GCC45_COMPATIBILITY /* GCC 4.5 badly optimizes this */
return {(*this)[0].xyz(),
(*this)[1].xyz(),
(*this)[2].xyz()};
#else
return {Vector3<T>((*this)[0][0], (*this)[0][1], (*this)[0][2]),
Vector3<T>((*this)[1][0], (*this)[1][1], (*this)[1][2]),
Vector3<T>((*this)[2][0], (*this)[2][1], (*this)[2][2])};
#endif
}
/**
@ -324,15 +318,9 @@ template<class T> class Matrix4: public Matrix<4, T> {
*/
inline Matrix<3, T> rotation() const {
/* Not Matrix3, because it is for affine 2D transformations */
#ifndef CORRADE_GCC45_COMPATIBILITY /* GCC 4.5 badly optimizes this */
return {(*this)[0].xyz().normalized(),
(*this)[1].xyz().normalized(),
(*this)[2].xyz().normalized()};
#else
return {Vector3<T>((*this)[0][0], (*this)[0][1], (*this)[0][2]).normalized(),
Vector3<T>((*this)[1][0], (*this)[1][1], (*this)[1][2]).normalized(),
Vector3<T>((*this)[2][0], (*this)[2][1], (*this)[2][2]).normalized()};
#endif
}
/** @todo uniform scaling extraction */

Loading…
Cancel
Save