Fixed increment and decrement operators for matrix types

master
Christophe Riccio ago%!(EXTRA string=12 years)
parent 95e72aa545
commit 66e3e52592
  1. 15
      glm/core/type_mat2x2.hpp
  2. 40
      glm/core/type_mat2x2.inl
  3. 14
      glm/core/type_mat2x3.hpp
  4. 40
      glm/core/type_mat2x3.inl
  5. 15
      glm/core/type_mat2x4.hpp
  6. 40
      glm/core/type_mat2x4.inl
  7. 14
      glm/core/type_mat3x2.hpp
  8. 44
      glm/core/type_mat3x2.inl
  9. 15
      glm/core/type_mat3x3.hpp
  10. 42
      glm/core/type_mat3x3.inl
  11. 15
      glm/core/type_mat3x4.hpp
  12. 42
      glm/core/type_mat3x4.inl
  13. 14
      glm/core/type_mat4x2.hpp
  14. 44
      glm/core/type_mat4x2.inl
  15. 14
      glm/core/type_mat4x3.hpp
  16. 16
      glm/core/type_mat4x3.inl
  17. 14
      glm/core/type_mat4x4.hpp
  18. 16
      glm/core/type_mat4x4.inl

@ -135,8 +135,14 @@ namespace detail
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U const & s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
};
// Binary operators
@ -235,15 +241,6 @@ namespace detail
tmat2x2<T, P> const operator-(
tmat2x2<T, P> const & m);
template <typename T, precision P>
tmat2x2<T, P> const operator-- (
tmat2x2<T, P> const & m,
int);
template <typename T, precision P>
tmat2x2<T, P> const operator++ (
tmat2x2<T, P> const & m,
int);
} //namespace detail
} //namespace glm

@ -412,6 +412,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator++(int)
{
tmat2x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator--(int)
{
tmat2x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -649,30 +665,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator++
(
tmat2x2<T, P> const & m,
int
)
{
return tmat2x2<T, P>(
m[0] + T(1),
m[1] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator--
(
tmat2x2<T, P> const & m,
int
)
{
return tmat2x2<T, P>(
m[0] - T(1),
m[1] - T(1));
}
//////////////////////////////////////
// Boolean operators

@ -124,8 +124,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x3<T, P> operator++(int);
GLM_FUNC_DECL tmat2x3<T, P> operator--(int);
};
// Binary operators
@ -199,15 +204,6 @@ namespace detail
tmat2x3<T, P> const operator- (
tmat2x3<T, P> const & m);
template <typename T, precision P>
tmat2x3<T, P> const operator-- (
tmat2x3<T, P> const & m,
int);
template <typename T, precision P>
tmat2x3<T, P> const operator++ (
tmat2x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -389,6 +389,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator++(int)
{
tmat2x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator--(int)
{
tmat2x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -595,30 +611,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator++
(
tmat2x3<T, P> const & m,
int
)
{
return tmat2x3<T, P>(
m[0] + typename tmat2x3<T, P>::value_type(1),
m[1] + typename tmat2x3<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator--
(
tmat2x3<T, P> const & m,
int
)
{
return tmat2x3<T, P>(
m[0] - typename tmat2x3<T, P>::value_type(1),
m[1] - typename tmat2x3<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

@ -126,8 +126,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x4<T, P> operator++(int);
GLM_FUNC_DECL tmat2x4<T, P> operator--(int);
};
// Binary operators
@ -201,16 +206,6 @@ namespace detail
tmat2x4<T, P> const operator- (
tmat2x4<T, P> const & m);
template <typename T, precision P>
tmat2x4<T, P> const operator-- (
tmat2x4<T, P> const & m,
int);
template <typename T, precision P>
tmat2x4<T, P> const operator++ (
tmat2x4<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -392,6 +392,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator++(int)
{
tmat2x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator--(int)
{
tmat2x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -614,30 +630,6 @@ namespace detail
-m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator++
(
tmat2x4<T, P> const & m,
int
)
{
return tmat2x4<T, P>(
m[0] + typename tmat2x4<T, P>::value_type(1),
m[1] + typename tmat2x4<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator--
(
tmat2x4<T, P> const & m,
int
)
{
return tmat2x4<T, P>(
m[0] - typename tmat2x4<T, P>::value_type(1),
m[1] - typename tmat2x4<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

@ -132,8 +132,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
};
// Binary operators
@ -207,15 +212,6 @@ namespace detail
tmat3x2<T, P> const operator-(
tmat3x2<T, P> const & m);
template <typename T, precision P>
tmat3x2<T, P> const operator-- (
tmat3x2<T, P> const & m,
int);
template <typename T, precision P>
tmat3x2<T, P> const operator++ (
tmat3x2<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -421,6 +421,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator++(int)
{
tmat3x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator--(int)
{
tmat3x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -627,34 +643,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator++
(
tmat3x2<T, P> const & m,
int
)
{
typename tmat3x2<T, P>::value_type One(1);
return tmat3x2<T, P>(
m[0] + One,
m[1] + One,
m[2] + One);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator--
(
tmat3x2<T, P> const & m,
int
)
{
typename tmat3x2<T, P>::value_type One(1);
return tmat3x2<T, P>(
m[0] - One,
m[1] - One,
m[2] - One);
}
//////////////////////////////////////
// Boolean operators

@ -139,8 +139,14 @@ namespace detail
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U const & s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
};
// Binary operators
@ -239,15 +245,6 @@ namespace detail
tmat3x3<T, P> const operator-(
tmat3x3<T, P> const & m);
template <typename T, precision P>
tmat3x3<T, P> const operator-- (
tmat3x3<T, P> const & m,
int);
template <typename T, precision P>
tmat3x3<T, P> const operator++ (
tmat3x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -434,6 +434,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator++(int)
{
tmat3x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator--(int)
{
tmat3x3<T, P> Result(*this);
--*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::_inverse() const
{
@ -759,32 +775,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator++
(
tmat3x3<T, P> const & m,
int
)
{
return tmat3x3<T, P>(
m[0] + T(1),
m[1] + T(1),
m[2] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator--
(
tmat3x3<T, P> const & m,
int
)
{
return tmat3x3<T, P>(
m[0] - T(1),
m[1] - T(1),
m[2] - T(1));
}
//////////////////////////////////////
// Boolean operators

@ -132,8 +132,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x4<T, P> operator++(int);
GLM_FUNC_DECL tmat3x4<T, P> operator--(int);
};
// Binary operators
@ -207,16 +212,6 @@ namespace detail
tmat3x4<T, P> const operator-(
tmat3x4<T, P> const & m);
template <typename T, precision P>
tmat3x4<T, P> const operator-- (
tmat3x4<T, P> const & m,
int);
template <typename T, precision P>
tmat3x4<T, P> const operator++ (
tmat3x4<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -420,6 +420,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator++(int)
{
tmat3x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator--(int)
{
tmat3x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -660,32 +676,6 @@ namespace detail
-m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator++
(
tmat3x4<T, P> const & m,
int
)
{
return tmat3x4<T, P>(
m[0] + T(1),
m[1] + T(1),
m[2] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator--
(
tmat3x4<T, P> const & m,
int
)
{
return tmat3x4<T, P>(
m[0] - T(1),
m[1] - T(1),
m[2] - T(1));
}
//////////////////////////////////////
// Boolean operators

@ -137,8 +137,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
};
// Binary operators
@ -212,15 +217,6 @@ namespace detail
tmat4x2<T, P> const operator-(
tmat4x2<T, P> const & m);
template <typename T, precision P>
tmat4x2<T, P> const operator-- (
tmat4x2<T, P> const & m,
int);
template <typename T, precision P>
tmat4x2<T, P> const operator++ (
tmat4x2<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -454,6 +454,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator++(int)
{
tmat4x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator--(int)
{
tmat4x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
@ -676,34 +692,6 @@ namespace detail
-m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator++
(
tmat4x2<T, P> const & m,
int
)
{
return tmat4x2<T, P>(
m[0] + typename tmat4x2<T, P>::value_type(1),
m[1] + typename tmat4x2<T, P>::value_type(1),
m[2] + typename tmat4x2<T, P>::value_type(1),
m[3] + typename tmat4x2<T, P>::value_type(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator--
(
tmat4x2<T, P> const & m,
int
)
{
return tmat4x2<T, P>(
m[0] - typename tmat4x2<T, P>::value_type(1),
m[1] - typename tmat4x2<T, P>::value_type(1),
m[2] - typename tmat4x2<T, P>::value_type(1),
m[3] - typename tmat4x2<T, P>::value_type(1));
}
//////////////////////////////////////
// Boolean operators

@ -135,8 +135,13 @@ namespace detail
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator/= (U const & s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x3<T, P> operator++(int);
GLM_FUNC_DECL tmat4x3<T, P> operator--(int);
};
// Binary operators
@ -210,15 +215,6 @@ namespace detail
tmat4x3<T, P> const operator- (
tmat4x3<T, P> const & m);
template <typename T, precision P>
tmat4x3<T, P> const operator-- (
tmat4x3<T, P> const & m,
int);
template <typename T, precision P>
tmat4x3<T, P> const operator++ (
tmat4x3<T, P> const & m,
int);
}//namespace detail
}//namespace glm

@ -710,6 +710,22 @@ namespace detail
m[3] - T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
{
tmat4x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
{
tmat4x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////
// Boolean operators

@ -142,8 +142,14 @@ namespace detail
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (U const & s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (tmat4x4<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x4<T, P> operator++(int);
GLM_FUNC_DECL tmat4x4<T, P> operator--(int);
};
// Binary operators
@ -242,14 +248,6 @@ namespace detail
tmat4x4<T, P> const operator- (
tmat4x4<T, P> const & m);
template <typename T, precision P>
tmat4x4<T, P> const operator-- (
tmat4x4<T, P> const & m, int);
template <typename T, precision P>
tmat4x4<T, P> const operator++ (
tmat4x4<T, P> const & m, int);
}//namespace detail
}//namespace glm

@ -496,6 +496,22 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator++(int)
{
tmat4x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator--(int)
{
tmat4x4<T, P> Result(*this);
--*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::_inverse() const
{

Loading…
Cancel
Save