|
|
|
|
@ -120,18 +120,31 @@ template<class T> class Matrix4: public Matrix<4, T> {
|
|
|
|
|
|
|
|
|
|
/** @brief Rotation and scaling part of the matrix */ |
|
|
|
|
inline Matrix3<T> rotationScaling() const { |
|
|
|
|
#ifndef MAGNUM_GCC45_COMPATIBILITY /* GCC 4.5 badly optimizes this */ |
|
|
|
|
return Matrix3<T>::from( |
|
|
|
|
(*this)[0].xyz(), |
|
|
|
|
(*this)[1].xyz(), |
|
|
|
|
(*this)[2].xyz()); |
|
|
|
|
#else |
|
|
|
|
return Matrix3<T>( |
|
|
|
|
(*this)(0, 0), (*this)(0, 1), (*this)(0, 2), |
|
|
|
|
(*this)(1, 0), (*this)(1, 1), (*this)(1, 2), |
|
|
|
|
(*this)(2, 0), (*this)(2, 1), (*this)(2, 2)); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** @brief Rotation part of the matrix */ |
|
|
|
|
inline Matrix3<T> rotation() const { |
|
|
|
|
return Matrix3<T>::from( |
|
|
|
|
#ifndef MAGNUM_GCC45_COMPATIBILITY /* GCC 4.5 badly optimizes this */ |
|
|
|
|
(*this)[0].xyz().normalized(), |
|
|
|
|
(*this)[1].xyz().normalized(), |
|
|
|
|
(*this)[2].xyz().normalized()); |
|
|
|
|
#else |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(Matrix4, Vector4, 4) |
|
|
|
|
|