diff --git a/src/Magnum.h b/src/Magnum.h index aa96d4a37..a0e6e96f3 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -21,9 +21,7 @@ #include -#include "Math/Matrix3.h" #include "Math/Matrix4.h" -#include "Math/Vector4.h" namespace Magnum { diff --git a/src/Math/Matrix3.h b/src/Math/Matrix3.h index 183f98a5a..86900830a 100644 --- a/src/Math/Matrix3.h +++ b/src/Math/Matrix3.h @@ -20,6 +20,7 @@ */ #include "Matrix.h" +#include "Vector3.h" namespace Magnum { namespace Math { @@ -34,6 +35,27 @@ template class Matrix3: public Matrix { /** @copydoc Matrix::Matrix(const Matrix&) */ inline Matrix3(const Matrix& other): Matrix(other) {} + + /** @copydoc Matrix::operator=() */ + inline Matrix3& operator=(const Matrix& other) { return Matrix::operator=(other); } + + /** @copydoc Matrix::at(size_t) */ + inline Vector3 at(size_t col) const { return Matrix::at(col); } + + /** @copydoc Matrix::at(size_t, size_t) */ + inline T at(size_t row, size_t col) const { return Matrix::at(row, col); } + + /** @copydoc Matrix::operator*(const Matrix&) */ + inline Matrix3 operator*(const Matrix& other) const { return Matrix::operator*(other); } + + /** @copydoc Matrix::operator*(const Vector&) */ + inline Vector3 operator*(const Vector& other) const { return Matrix::operator*(other); } + + /** @copydoc Matrix::transposed() */ + inline Matrix3 transposed() const { return Matrix::transposed(); } + + /** @copydoc Matrix::inverse() */ + inline Matrix3 inverse() const { return Matrix::inverse(); } }; }} diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index d39f21374..87c724811 100644 --- a/src/Math/Matrix4.h +++ b/src/Math/Matrix4.h @@ -19,9 +19,8 @@ * @brief Class Magnum::Math::Matrix4 */ -#include "Matrix.h" - -#include "Vector3.h" +#include "Matrix3.h" +#include "Vector4.h" namespace Magnum { namespace Math { @@ -136,6 +135,30 @@ template class Matrix4: public Matrix { /** @copydoc Matrix::Matrix(const Matrix&) */ inline Matrix4(const Matrix& other): Matrix(other) {} + + /** @copydoc Matrix::operator=() */ + inline Matrix4& operator=(const Matrix& other) { return Matrix::operator=(other); } + + /** @copydoc Matrix::at(size_t) */ + inline Vector4 at(size_t col) const { return Matrix::at(col); } + + /** @copydoc Matrix::at(size_t, size_t) */ + inline T at(size_t row, size_t col) const { return Matrix::at(row, col); } + + /** @copydoc Matrix::operator*(const Matrix&) */ + inline Matrix4 operator*(const Matrix& other) const { return Matrix::operator*(other); } + + /** @copydoc Matrix::operator*(const Vector&) */ + inline Vector4 operator*(const Vector& other) const { return Matrix::operator*(other); } + + /** @copydoc Matrix::transposed() */ + inline Matrix4 transposed() const { return Matrix::transposed(); } + + /** @copydoc Matrix::ij() */ + inline Matrix3 ij(size_t skipRow, size_t skipCol) const { return Matrix::ij(skipRow, skipCol); } + + /** @copydoc Matrix::inverse() */ + inline Matrix4 inverse() const { return Matrix::inverse(); } }; }} diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index 8189ca388..3484957b9 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -76,6 +76,27 @@ template class Vector3: public Vector { inline void setR(T value) { setX(value); } /**< @brief Set R component */ inline void setG(T value) { setY(value); } /**< @brief Set G component */ inline void setB(T value) { setZ(value); } /**< @brief Set B component */ + + /** @copydoc Vector::operator=() */ + inline Vector3& operator=(const Vector& other) { return Vector::operator=(other); } + + /** @copydoc Vector::operator*(T) */ + inline Vector3 operator*(T number) const { return Vector::operator*(number); } + + /** @copydoc Vector::operator/() */ + inline Vector3 operator/(T number) const { return Vector::operator/(number); } + + /** @copydoc Vector::operator+() */ + inline Vector3 operator+(const Vector& other) const { return Vector::operator+(other); } + + /** @copydoc Vector::operator-(const Vector&) */ + inline Vector3 operator-(const Vector& other) const { return Vector::operator-(other); } + + /** @copydoc Vector::operator-() */ + inline Vector3 operator-() const { return Vector::operator-(); } + + /** @copydoc Vector::normalized() */ + inline Vector3 normalized() const { return Vector::normalized(); } }; }} diff --git a/src/Math/Vector4.h b/src/Math/Vector4.h index 510fbe0bb..01c2e0bd3 100644 --- a/src/Math/Vector4.h +++ b/src/Math/Vector4.h @@ -83,6 +83,27 @@ template class Vector4: public Vector { * @return First three components of the vector */ inline Vector3 rgb() const { return xyz(); } + + /** @copydoc Vector::operator=() */ + inline Vector4& operator=(const Vector& other) { return Vector::operator=(other); } + + /** @copydoc Vector::operator*(T) */ + inline Vector4 operator*(T number) const { return Vector::operator*(number); } + + /** @copydoc Vector::operator/() */ + inline Vector4 operator/(T number) const { return Vector::operator/(number); } + + /** @copydoc Vector::operator+() */ + inline Vector4 operator+(const Vector& other) const { return Vector::operator+(other); } + + /** @copydoc Vector::operator-(const Vector&) */ + inline Vector4 operator-(const Vector& other) const { return Vector::operator-(other); } + + /** @copydoc Vector::operator-() */ + inline Vector4 operator-() const { return Vector::operator-(); } + + /** @copydoc Vector::normalized() */ + inline Vector4 normalized() const { return Vector::normalized(); } }; }}