Fixed memory corruption (undefined behaviour) #303

This commit is contained in:
Christophe Riccio 2015-02-14 13:56:48 +01:00
parent f1d4c39622
commit 7844332816
25 changed files with 431 additions and 279 deletions

View File

@ -63,6 +63,7 @@ namespace glm
//////////////////////////////////////
// Constructors
GLM_FUNC_DECL tmat2x2();
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
@ -127,6 +128,8 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
template <typename U>

View File

@ -62,6 +62,13 @@ namespace detail
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
@ -236,6 +243,14 @@ namespace detail
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m)

View File

@ -58,6 +58,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat2x3();
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
@ -123,20 +124,22 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<U, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+= (U s);
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+= (tmat2x3<U, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-= (U s);
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-= (tmat2x3<U, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator*= (U s);
GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator/= (U s);
GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
@ -150,74 +153,47 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+ (
tmat2x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+ (
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator- (
tmat2x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator- (
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
tmat2x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
T const & s,
tmat2x3<T, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator* (
tmat2x3<T, P> const & m,
typename tmat2x3<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator* (
typename tmat2x3<T, P>::col_type const & v,
tmat2x3<T, P> const & m);
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
tmat2x3<T, P> const & m1,
tmat2x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator* (
tmat2x3<T, P> const & m1,
tmat3x2<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator* (
tmat2x3<T, P> const & m1,
tmat4x2<T, P> const & m2);
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/ (
tmat2x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/ (
T const & s,
tmat2x3<T, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> const operator- (
tmat2x3<T, P> const & m);
GLM_FUNC_DECL tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -44,6 +44,13 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
@ -220,6 +227,14 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m)

View File

@ -58,6 +58,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat2x4();
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
@ -124,20 +125,22 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<U, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator+= (U s);
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator+= (tmat2x4<U, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator-= (U s);
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator-= (tmat2x4<U, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator*= (U s);
GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator/= (U s);
GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
@ -151,74 +154,47 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+ (
tmat2x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+ (
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2);
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator- (
tmat2x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator- (
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2);
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator* (
tmat2x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator* (
T const & s,
tmat2x4<T, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator* (
tmat2x4<T, P> const & m,
typename tmat2x4<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator* (
typename tmat2x4<T, P>::col_type const & v,
tmat2x4<T, P> const & m);
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator* (
tmat2x4<T, P> const & m1,
tmat4x2<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator* (
tmat2x4<T, P> const & m1,
tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator* (
tmat2x4<T, P> const & m1,
tmat3x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/ (
tmat2x4<T, P> const & m,
T s);
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/ (
T s,
tmat2x4<T, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> const operator- (
tmat2x4<T, P> const & m);
GLM_FUNC_DECL tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -44,6 +44,13 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m)
@ -221,6 +228,14 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m)

View File

@ -58,6 +58,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x2();
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
@ -130,20 +131,22 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<U, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+= (U s);
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+= (tmat3x2<U, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-= (U s);
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-= (tmat3x2<U, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator*= (U s);
GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator/= (U s);
GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
@ -156,74 +159,47 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+ (
tmat3x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+ (
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2);
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator- (
tmat3x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator- (
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2);
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator* (
tmat3x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator* (
T const & s,
tmat3x2<T, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator* (
tmat3x2<T, P> const & m,
typename tmat3x2<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator* (
typename tmat3x2<T, P>::col_type const & v,
tmat3x2<T, P> const & m);
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator* (
tmat3x2<T, P> const & m1,
tmat2x3<T, P> const & m2);
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator* (
tmat3x2<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator* (
tmat3x2<T, P> const & m1,
tmat4x3<T, P> const & m2);
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/ (
tmat3x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/ (
T const & s,
tmat3x2<T, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> const operator-(
tmat3x2<T, P> const & m);
GLM_FUNC_DECL tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -45,6 +45,14 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m)
@ -249,6 +257,15 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m)

View File

@ -62,6 +62,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x3();
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
@ -134,129 +135,94 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<U, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator+= (U s);
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator+= (tmat3x3<U, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator-= (U s);
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator-= (tmat3x3<U, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator*= (U s);
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator*= (tmat3x3<U, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U s);
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
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++();
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
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
tmat3x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
T const & s,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator- (
tmat3x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator- (
T const & s,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator- (
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator* (
tmat3x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator* (
T const & s,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator* (
tmat3x3<T, P> const & m,
typename tmat3x3<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator* (
typename tmat3x3<T, P>::col_type const & v,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator* (
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
tmat3x3<T, P> const & m1,
tmat2x3<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator* (
tmat3x3<T, P> const & m1,
tmat4x3<T, P> const & m2);
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
tmat3x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
T const & s,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/ (
tmat3x3<T, P> const & m,
typename tmat3x3<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/ (
typename tmat3x3<T, P>::col_type const & v,
tmat3x3<T, P> const & m);
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> const operator-(
tmat3x3<T, P> const & m);
GLM_FUNC_DECL tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -73,6 +73,14 @@ namespace detail
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, Q> const & m)
@ -273,6 +281,15 @@ namespace detail
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m)

View File

@ -58,6 +58,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x4();
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
@ -129,6 +130,8 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
template <typename U>

View File

@ -45,6 +45,14 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m)
@ -248,6 +256,15 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m)

View File

@ -58,6 +58,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x2();
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
@ -135,20 +136,22 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator+=(U s);
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator+=(tmat4x2<U, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator-=(U s);
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator-=(tmat4x2<U, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator*=(U s);
GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator/=(U s);
GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators

View File

@ -46,6 +46,15 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m)
@ -271,6 +280,16 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m)

View File

@ -57,6 +57,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x3();
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
@ -134,6 +135,8 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
template <typename U>

View File

@ -46,6 +46,15 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m)
@ -271,6 +280,16 @@ namespace glm
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m)

View File

@ -62,6 +62,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x4();
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
@ -139,6 +140,8 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
template <typename U>

View File

@ -106,6 +106,15 @@ namespace detail
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, Q> const & m)
@ -357,6 +366,18 @@ namespace detail
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m)

View File

@ -163,34 +163,34 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec2<T, P> & operator=(tvec2<T, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator=(tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator+=(U s);
GLM_FUNC_DECL tvec2<T, P>& operator+=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator+=(tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator+=(tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator-=(U s);
GLM_FUNC_DECL tvec2<T, P>& operator-=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator-=(tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator-=(tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator*=(U s);
GLM_FUNC_DECL tvec2<T, P>& operator*=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator*=(tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator*=(tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator/=(U s);
GLM_FUNC_DECL tvec2<T, P>& operator/=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator/=(tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator/=(tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec2<U, P> const & v);
//////////////////////////////////////
// Increment and decrement operators
@ -204,29 +204,29 @@ namespace glm
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator%= (U s);
GLM_FUNC_DECL tvec2<T, P> & operator%=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator%= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator%= (tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&= (U s);
GLM_FUNC_DECL tvec2<T, P> & operator&=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&= (tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|= (U s);
GLM_FUNC_DECL tvec2<T, P> & operator|=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|= (tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^= (U s);
GLM_FUNC_DECL tvec2<T, P> & operator^=(U s);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^= (tvec2<U, P> const & v);
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator<<=(U s);
template <typename U>

View File

@ -167,7 +167,7 @@ namespace detail
// Implicit basic constructors
GLM_FUNC_DECL tvec4();
//GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
@ -285,7 +285,7 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
//GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);

View File

@ -42,6 +42,11 @@ namespace glm
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
@ -245,6 +250,16 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
this->w = v.w;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<U, P> const & v)

View File

@ -91,6 +91,7 @@ namespace glm
// Implicit basic constructors
GLM_FUNC_DECL tquat();
GLM_FUNC_DECL tquat(tquat<T, P> const & q);
template <precision Q>
GLM_FUNC_DECL tquat(tquat<T, Q> const & q);
@ -133,10 +134,19 @@ namespace glm
//////////////////////////////////////
// Operators
GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> & operator*=(T const & s);
GLM_FUNC_DECL tquat<T, P> & operator/=(T const & s);
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const & q);
template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const & q);
template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator/=(U s);
};
template <typename T, precision P>

View File

@ -104,6 +104,11 @@ namespace detail
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, P> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, Q> const & q)
@ -176,7 +181,7 @@ namespace detail
this->w = c.x * c.y * c.z + s.x * s.y * s.z;
this->x = s.x * c.y * c.z - c.x * s.y * s.z;
this->y = c.x * s.y * c.z + s.x * c.y * s.z;
this->z = c.x * c.y * s.z - s.x * s.y * c.z;
this->z = c.x * c.y * s.z - s.x * s.y * c.z;
}
template <typename T, precision P>
@ -221,19 +226,43 @@ namespace detail
// tquat<valType> operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<T, P> const & q)
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
{
this->w += q.w;
this->x += q.x;
this->y += q.y;
this->z += q.z;
this->w = q.w;
this->x = q.x;
this->y = q.y;
this->z = q.z;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<T, P> const & q)
template <typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q)
{
this->w = static_cast<T>(q.w);
this->x = static_cast<T>(q.x);
this->y = static_cast<T>(q.y);
this->z = static_cast<T>(q.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<U, P> const & q)
{
this->w += static_cast<T>(q.w);
this->x += static_cast<T>(q.x);
this->y += static_cast<T>(q.y);
this->z += static_cast<T>(q.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r)
{
tquat<T, P> const p(*this);
tquat<T, P> const q(r);
this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z;
this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y;
@ -242,23 +271,25 @@ namespace detail
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(T const & s)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(U s)
{
this->w *= s;
this->x *= s;
this->y *= s;
this->z *= s;
this->w *= static_cast<U>(s);
this->x *= static_cast<U>(s);
this->y *= static_cast<U>(s);
this->z *= static_cast<U>(s);
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(T const & s)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(U s)
{
this->w /= s;
this->x /= s;
this->y /= s;
this->z /= s;
this->w /= static_cast<U>(s);
this->x /= static_cast<U>(s);
this->y /= static_cast<U>(s);
this->z /= static_cast<U>(s);
return *this;
}

View File

@ -90,6 +90,7 @@ namespace glm
// Implicit basic constructors
GLM_FUNC_DECL tdualquat();
GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d);
template <precision Q>
GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d);
@ -116,8 +117,14 @@ namespace glm
GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
// Operators
GLM_FUNC_DECL tdualquat<T, P> & operator*=(T const & s);
GLM_FUNC_DECL tdualquat<T, P> & operator/=(T const & s);
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator/=(U s);
};
template <typename T, precision P>

View File

@ -91,6 +91,12 @@ namespace glm
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
: real(d.real)
, dual(d.dual)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, Q> const & d)
@ -150,18 +156,37 @@ namespace glm
// tdualquat operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator*=(T const & s)
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q)
{
this->real *= s;
this->dual *= s;
this->real = q.real;
this->dual = q.dual;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator/=(T const & s)
template <typename U>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<U, P> const & q)
{
this->real /= s;
this->dual /= s;
this->real = q.real;
this->dual = q.dual;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator*=(U s)
{
this->real *= static_cast<T>(s);
this->dual *= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator/=(U s)
{
this->real /= static_cast<T>(s);
this->dual /= static_cast<T>(s);
return *this;
}