@ -25,7 +25,7 @@
namespace Magnum { namespace Math {
namespace Magnum { namespace Math {
/**
/**
@ brief 4 x4 matrix
@ brief 4 x4 matrix for affine transformations in 3 D
@ tparam T Data type
@ tparam T Data type
Provides functions for transformations in 3 D . See Matrix3 for 2 D
Provides functions for transformations in 3 D . See Matrix3 for 2 D
@ -138,8 +138,9 @@ template<class T> class Matrix4: public Matrix<4, T> {
* @ see rotation ( ) const , rotation ( T , const Vector3 & ) ,
* @ see rotation ( ) const , rotation ( T , const Vector3 & ) ,
* Matrix3 : : rotationScaling ( ) const
* Matrix3 : : rotationScaling ( ) const
*/
*/
inline Matrix3 < T > rotationScaling ( ) const {
inline Matrix < 3 , T > rotationScaling ( ) const {
return Matrix3 < T > : : from (
/* Not Matrix3, because it is for affine 2D transformations */
return Matrix < 3 , T > : : from (
( * this ) [ 0 ] . xyz ( ) ,
( * this ) [ 0 ] . xyz ( ) ,
( * this ) [ 1 ] . xyz ( ) ,
( * this ) [ 1 ] . xyz ( ) ,
( * this ) [ 2 ] . xyz ( ) ) ;
( * this ) [ 2 ] . xyz ( ) ) ;
@ -152,8 +153,9 @@ template<class T> class Matrix4: public Matrix<4, T> {
* @ see rotationScaling ( ) const , rotation ( T , const Vector3 & ) ,
* @ see rotationScaling ( ) const , rotation ( T , const Vector3 & ) ,
* Matrix3 : : rotation ( ) const
* Matrix3 : : rotation ( ) const
*/
*/
inline Matrix3 < T > rotation ( ) const {
inline Matrix < 3 , T > rotation ( ) const {
return Matrix3 < T > : : from (
/* Not Matrix3, because it is for affine 2D transformations */
return Matrix < 3 , T > : : from (
( * this ) [ 0 ] . xyz ( ) . normalized ( ) ,
( * this ) [ 0 ] . xyz ( ) . normalized ( ) ,
( * this ) [ 1 ] . xyz ( ) . normalized ( ) ,
( * this ) [ 1 ] . xyz ( ) . normalized ( ) ,
( * this ) [ 2 ] . xyz ( ) . normalized ( ) ) ;
( * this ) [ 2 ] . xyz ( ) . normalized ( ) ) ;
@ -175,8 +177,6 @@ template<class T> class Matrix4: public Matrix<4, T> {
}
}
# ifndef DOXYGEN_GENERATING_OUTPUT
# ifndef DOXYGEN_GENERATING_OUTPUT
inline Matrix3 < T > ij ( size_t skipRow , size_t skipCol ) const { return Matrix < 4 , T > : : ij ( skipRow , skipCol ) ; }
inline Point3D < T > operator * ( const Point3D < T > & other ) const {
inline Point3D < T > operator * ( const Point3D < T > & other ) const {
return Matrix < 4 , T > : : operator * ( other ) ;
return Matrix < 4 , T > : : operator * ( other ) ;
}
}