Browse Source

Point*D overload for Matrix subclasses.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
c820cbeee6
  1. 8
      src/Math/Matrix3.h
  2. 6
      src/Math/Matrix4.h

8
src/Math/Matrix3.h

@ -20,7 +20,7 @@
*/
#include "Matrix.h"
#include "Vector3.h"
#include "Point2D.h"
namespace Magnum { namespace Math {
@ -138,6 +138,12 @@ template<class T> class Matrix3: public Matrix<3, T> {
return (*this)[2].xy();
}
#ifndef DOXYGEN_GENERATING_OUTPUT
inline Point2D<T> operator*(const Point2D<T>& other) const {
return Matrix<3, T>::operator*(other);
}
#endif
MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(Matrix3, Vector3, 3)
MAGNUM_RECTANGULARMATRIX_SUBCLASS_OPERATOR_IMPLEMENTATION(3, 3, Matrix3<T>)
};

6
src/Math/Matrix4.h

@ -20,7 +20,7 @@
*/
#include "Matrix3.h"
#include "Vector4.h"
#include "Point3D.h"
namespace Magnum { namespace Math {
@ -176,6 +176,10 @@ template<class T> class Matrix4: public Matrix<4, T> {
#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 {
return Matrix<4, T>::operator*(other);
}
#endif
MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(Matrix4, Vector4, 4)

Loading…
Cancel
Save