From c820cbeee68b42be229c03de5e75629c109a03b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 26 Sep 2012 20:38:50 +0200 Subject: [PATCH] Point*D overload for Matrix subclasses. --- src/Math/Matrix3.h | 8 +++++++- src/Math/Matrix4.h | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Math/Matrix3.h b/src/Math/Matrix3.h index 364d120fd..f9a1f75de 100644 --- a/src/Math/Matrix3.h +++ b/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 Matrix3: public Matrix<3, T> { return (*this)[2].xy(); } + #ifndef DOXYGEN_GENERATING_OUTPUT + inline Point2D operator*(const Point2D& other) const { + return Matrix<3, T>::operator*(other); + } + #endif + MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(Matrix3, Vector3, 3) MAGNUM_RECTANGULARMATRIX_SUBCLASS_OPERATOR_IMPLEMENTATION(3, 3, Matrix3) }; diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index 72260b9f5..1d72ee70a 100644 --- a/src/Math/Matrix4.h +++ b/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 Matrix4: public Matrix<4, T> { #ifndef DOXYGEN_GENERATING_OUTPUT inline Matrix3 ij(size_t skipRow, size_t skipCol) const { return Matrix<4, T>::ij(skipRow, skipCol); } + + inline Point3D operator*(const Point3D& other) const { + return Matrix<4, T>::operator*(other); + } #endif MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(Matrix4, Vector4, 4)