Clean up coding style

This commit is contained in:
Christophe Riccio 2014-10-19 17:09:47 +02:00
parent bcd07b50f3
commit f2383340cf
28 changed files with 963 additions and 2678 deletions

View File

@ -70,10 +70,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x2(
ctor Null);
GLM_FUNC_DECL explicit tmat2x2(
T const & x);
GLM_FUNC_DECL explicit tmat2x2(ctor);
GLM_FUNC_DECL explicit tmat2x2(T const & x);
GLM_FUNC_DECL tmat2x2(
T const & x1, T const & y1,
T const & x2, T const & y2);
@ -144,99 +142,62 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+ (
tmat2x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+ (
T const & s,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+ (
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator- (
tmat2x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator- (
T const & s,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator- (
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator* (
tmat2x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator* (
T const & s,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator* (
tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator* (
typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator* (
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator* (
tmat2x2<T, P> const & m1,
tmat3x2<T, P> const & m2);
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator* (
tmat2x2<T, P> const & m1,
tmat4x2<T, P> const & m2);
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/ (
tmat2x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/ (
T const & s,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/ (
tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/ (
typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m);
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/ (
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2);
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> const operator-(
tmat2x2<T, P> const & m);
GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m);
} //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -90,10 +90,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -101,29 +98,21 @@ namespace detail
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(
tmat2x2<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
ctor
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
T const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero);
this->value[1] = col_type(Zero, s);
this->value[0] = col_type(s, 0);
this->value[1] = col_type(0, s);
}
template <typename T, precision P>
@ -138,11 +127,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
col_type const & v0,
col_type const & v1
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -164,11 +149,7 @@ namespace detail
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -179,90 +160,63 @@ namespace detail
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat2x2<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -273,7 +227,7 @@ namespace detail
// This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator= (tmat2x2<T, P> const & m)
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];
@ -282,7 +236,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator= (tmat2x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -291,7 +245,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -300,7 +254,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+= (tmat2x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(tmat2x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -309,7 +263,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -318,7 +272,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-= (tmat2x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(tmat2x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -327,7 +281,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -336,14 +290,14 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*= (tmat2x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(tmat2x2<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -352,7 +306,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/= (tmat2x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(tmat2x2<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
@ -393,11 +347,7 @@ namespace detail
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
(
tmat2x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] + s,
@ -405,11 +355,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
(
T const & s,
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
m[0] + s,
@ -417,11 +363,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0] + m2[0],
@ -429,11 +371,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
(
tmat2x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] - s,
@ -441,11 +379,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
(
T const & s,
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
s - m[0],
@ -453,11 +387,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0] - m2[0],
@ -465,11 +395,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
(
tmat2x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] * s,
@ -477,11 +403,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
(
T const & s,
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
m[0] * s,
@ -513,11 +435,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -527,11 +445,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*
(
tmat2x2<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -543,11 +457,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*
(
tmat2x2<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -561,11 +471,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/
(
tmat2x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] / s,
@ -573,11 +479,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/
(
T const & s,
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
s / m[0],
@ -585,31 +487,19 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/
(
tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type & v
)
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/
(
typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
tmat2x2<T, P> m1_copy(m1);
return m1_copy /= m2;
@ -617,10 +507,7 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
-m[0],
@ -631,21 +518,13 @@ namespace detail
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -54,8 +54,9 @@ namespace glm
# endif//GLM_FORCE_SIZE_FUNC
private:
// Data
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
// Constructors
@ -64,10 +65,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x3(
ctor);
GLM_FUNC_DECL explicit tmat2x3(
T const & s);
GLM_FUNC_DECL explicit tmat2x3(ctor);
GLM_FUNC_DECL explicit tmat2x3(T const & s);
GLM_FUNC_DECL tmat2x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1);

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type &
tmat2x3<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const &
tmat2x3<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -80,10 +72,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -91,28 +80,21 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(
tmat2x3<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
ctor
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
T const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T const & s)
{
this->value[0] = col_type(s, T(0), T(0));
this->value[1] = col_type(T(0), s, T(0));
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
}
template <typename T, precision P>
@ -127,11 +109,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
col_type const & v0,
col_type const & v1
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -155,11 +133,7 @@ namespace glm
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -170,90 +144,63 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat2x3<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -263,7 +210,7 @@ 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)
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];
@ -272,7 +219,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator= (tmat2x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -281,7 +228,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -290,7 +237,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+= (tmat2x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+=(tmat2x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -299,7 +246,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -308,7 +255,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-= (tmat2x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(tmat2x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -317,7 +264,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -326,7 +273,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -369,11 +316,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+
(
tmat2x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] + s,
@ -381,11 +324,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+
(
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0] + m2[0],
@ -393,11 +332,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-
(
tmat2x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] - s,
@ -405,11 +340,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-
(
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0] - m2[0],
@ -417,11 +348,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
(
tmat2x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] * s,
@ -429,11 +356,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
(
T const & s,
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
m[0] * s,
@ -464,11 +387,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
(
tmat2x3<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -480,11 +399,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
(
tmat2x3<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@ -514,11 +429,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*
(
tmat2x3<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -536,11 +447,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/
(
tmat2x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] / s,
@ -548,11 +455,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/
(
T const & s,
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
s / m[0],
@ -561,10 +464,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
-m[0],
@ -575,21 +475,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -54,8 +54,9 @@ namespace glm
# endif//GLM_FORCE_SIZE_FUNC
private:
// Data
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
// Constructors
@ -64,10 +65,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x4(
ctor);
GLM_FUNC_DECL explicit tmat2x4(
T const & s);
GLM_FUNC_DECL explicit tmat2x4(ctor);
GLM_FUNC_DECL explicit tmat2x4(T const & s);
GLM_FUNC_DECL tmat2x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1);

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type &
tmat2x4<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const &
tmat2x4<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -80,10 +72,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -91,25 +80,18 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(
tmat2x4<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
ctor
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
T const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
@ -128,11 +110,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
col_type const & v0,
col_type const & v1
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -156,11 +134,7 @@ namespace glm
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tvec4<V1, P> const & v1, tvec4<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -171,100 +145,73 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat2x4<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(T(0)));
this->value[1] = col_type(m[1], tvec2<T, P>(T(0)));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator= (tmat2x4<T, P> const & m)
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];
@ -273,7 +220,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator= (tmat2x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -282,7 +229,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -291,7 +238,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+= (tmat2x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(tmat2x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -300,7 +247,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -309,7 +256,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-= (tmat2x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(tmat2x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -318,7 +265,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -327,7 +274,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P> & tmat2x4<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat2x4<T, P> & tmat2x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -370,11 +317,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+
(
tmat2x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] + s,
@ -382,11 +325,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+
(
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0] + m2[0],
@ -394,11 +333,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-
(
tmat2x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] - s,
@ -406,11 +341,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-
(
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0] - m2[0],
@ -418,11 +349,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*
(
tmat2x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] * s,
@ -430,11 +357,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*
(
T const & s,
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
m[0] * s,
@ -442,11 +365,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type operator*
(
tmat2x4<T, P> const & m,
typename tmat2x4<T, P>::row_type const & v
)
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v)
{
return typename tmat2x4<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
@ -456,11 +375,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::row_type operator*
(
typename tmat2x4<T, P>::col_type const & v,
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m)
{
return typename tmat2x4<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
@ -468,11 +383,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*
(
tmat2x4<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@ -513,11 +424,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*
(
tmat2x4<T, P> const & m1,
tmat2x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -531,11 +438,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*
(
tmat2x4<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
@ -553,11 +456,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/
(
tmat2x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] / s,
@ -565,11 +464,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/
(
T const & s,
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T const & s, tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
s / m[0],
@ -578,10 +473,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
-m[0],
@ -592,21 +484,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat2x4<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -54,8 +54,9 @@ namespace glm
# endif//GLM_FORCE_SIZE_FUNC
private:
// Data
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
@ -64,10 +65,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x2(
ctor);
GLM_FUNC_DECL explicit tmat3x2(
T const & s);
GLM_FUNC_DECL explicit tmat3x2(ctor);
GLM_FUNC_DECL explicit tmat3x2(T const & s);
GLM_FUNC_DECL tmat3x2(
T const & x0, T const & y0,
T const & x1, T const & y1,

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type &
tmat3x2<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const &
tmat3x2<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -81,10 +73,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -93,8 +82,7 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(
tmat3x2<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -102,17 +90,11 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
ctor
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
T const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T const & s)
{
this->value[0] = col_type(s, 0);
this->value[1] = col_type(0, s);
@ -183,10 +165,7 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat3x2<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -194,21 +173,15 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(T(0));
this->value[2] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -216,10 +189,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -227,10 +197,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -238,10 +205,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -249,10 +213,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -260,10 +221,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -271,10 +229,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -285,7 +240,7 @@ 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)
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];
@ -295,7 +250,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator= (tmat3x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -305,7 +260,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -315,7 +270,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+= (tmat3x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(tmat3x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -325,7 +280,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -335,7 +290,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-= (tmat3x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(tmat3x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -345,7 +300,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -355,7 +310,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P> & tmat3x2<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat3x2<T, P> & tmat3x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -364,7 +319,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -373,7 +328,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -401,11 +356,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+
(
tmat3x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] + s,
@ -414,11 +365,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+
(
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0] + m2[0],
@ -427,11 +374,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-
(
tmat3x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] - s,
@ -440,11 +383,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-
(
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0] - m2[0],
@ -453,11 +392,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*
(
tmat3x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] * s,
@ -466,11 +401,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*
(
T const & s,
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
m[0] * s,
@ -479,10 +410,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type operator*
(
tmat3x2<T, P> const & m,
typename tmat3x2<T, P>::row_type const & v)
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v)
{
return typename tmat3x2<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
@ -490,10 +418,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::row_type operator*
(
typename tmat3x2<T, P>::col_type const & v,
tmat3x2<T, P> const & m)
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m)
{
return typename tmat3x2<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
@ -502,11 +427,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
(
tmat3x2<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@ -531,11 +452,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*
(
tmat3x2<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -547,11 +464,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*
(
tmat3x2<T, P> const & m1,
tmat4x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -565,11 +478,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/
(
tmat3x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] / s,
@ -578,11 +487,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/
(
T const & s,
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
s / m[0],
@ -592,10 +497,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
-m[0],
@ -607,21 +509,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat3x2<T, P> const & m1,
tmat3x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -69,10 +69,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x3(
ctor Null);
GLM_FUNC_DECL explicit tmat3x3(
T const & s);
GLM_FUNC_DECL explicit tmat3x3(ctor);
GLM_FUNC_DECL explicit tmat3x3(T const & s);
GLM_FUNC_DECL tmat3x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,

View File

@ -70,22 +70,14 @@ namespace detail
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type &
tmat3x3<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const &
tmat3x3<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -105,10 +97,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -116,16 +105,12 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
ctor
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(
tmat3x3<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -133,15 +118,11 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
T const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero);
this->value[2] = col_type(Zero, Zero, s);
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
this->value[2] = col_type(0, 0, s);
}
template <typename T, precision P>
@ -208,10 +189,7 @@ namespace detail
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat3x3<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -219,21 +197,15 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(tvec2<T, P>(0), value_type(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -241,54 +213,39 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(tvec2<T, P>(0), value_type(1));
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(tvec2<T, P>(0), value_type(1));
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -296,10 +253,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -310,7 +264,7 @@ namespace detail
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator= (tmat3x3<T, P> const & m)
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];
@ -320,7 +274,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator= (tmat3x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -330,7 +284,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -340,7 +294,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+= (tmat3x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(tmat3x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -350,7 +304,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -360,7 +314,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-= (tmat3x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(tmat3x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -370,7 +324,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -380,14 +334,14 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*= (tmat3x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(tmat3x3<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -397,13 +351,13 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/= (tmat3x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(tmat3x3<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -440,11 +394,7 @@ namespace detail
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+
(
tmat3x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] + s,
@ -453,11 +403,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+
(
T const & s,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
m[0] + s,
@ -466,11 +412,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x3<T, P>(
m1[0] + m2[0],
@ -479,11 +421,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-
(
tmat3x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] - s,
@ -492,11 +430,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-
(
T const & s,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
s - m[0],
@ -505,11 +439,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x3<T, P>(
m1[0] - m2[0],
@ -518,11 +448,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
(
tmat3x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] * s,
@ -531,11 +457,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
(
T const & s,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
m[0] * s,
@ -544,11 +466,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator*
(
tmat3x3<T, P> const & m,
typename tmat3x3<T, P>::row_type const & v
)
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
{
return typename tmat3x3<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
@ -557,11 +475,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator*
(
typename tmat3x3<T, P>::col_type const & v,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
{
return typename tmat3x3<T, P>::row_type(
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,
@ -570,11 +484,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -610,11 +520,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
(
tmat3x3<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -626,11 +532,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*
(
tmat3x3<T, P> const & m1,
tmat4x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -648,11 +550,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/
(
tmat3x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] / s,
@ -661,11 +559,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/
(
T const & s,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
s / m[0],
@ -674,31 +568,19 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/
(
tmat3x3<T, P> const & m,
typename tmat3x3<T, P>::row_type const & v
)
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/
(
typename tmat3x3<T, P>::col_type const & v,
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
tmat3x3<T, P> m1_copy(m1);
return m1_copy /= m2;
@ -706,10 +588,7 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
-m[0],
@ -721,21 +600,13 @@ namespace detail
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat3x3<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -54,8 +54,9 @@ namespace glm
# endif//GLM_FORCE_SIZE_FUNC
private:
// Data
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
@ -64,10 +65,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x4(
ctor Null);
GLM_FUNC_DECL explicit tmat3x4(
T const & s);
GLM_FUNC_DECL explicit tmat3x4(ctor);
GLM_FUNC_DECL explicit tmat3x4(T const & s);
GLM_FUNC_DECL tmat3x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
@ -111,101 +110,74 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat3x4<T, P> & operator= (tmat3x4<T, P> const & m);
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);
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+= (U s);
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+= (tmat3x4<U, P> const & m);
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-= (U s);
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-= (tmat3x4<U, P> const & m);
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator*= (U s);
GLM_FUNC_DECL tmat3x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator/= (U s);
GLM_FUNC_DECL tmat3x4<T, P> & operator/=(U 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++();
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
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+ (
tmat3x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+ (
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2);
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator- (
tmat3x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator- (
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2);
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator* (
tmat3x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator* (
T const & s,
tmat3x4<T, P> const & m);
GLM_FUNC_DECL tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator* (
tmat3x4<T, P> const & m,
typename tmat3x4<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator*(tmat3x4<T, P> const & m, typename tmat3x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator* (
typename tmat3x4<T, P>::col_type const & v,
tmat3x4<T, P> const & m);
GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator*(typename tmat3x4<T, P>::col_type const & v, tmat3x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator* (
tmat3x4<T, P> const & m1,
tmat4x3<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator* (
tmat3x4<T, P> const & m1,
tmat2x3<T, P> const & m2);
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator* (
tmat3x4<T, P> const & m1,
tmat3x3<T, P> const & m2);
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/ (
tmat3x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/ (
T const & s,
tmat3x4<T, P> const & m);
GLM_FUNC_DECL tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> const operator-(
tmat3x4<T, P> const & m);
GLM_FUNC_DECL tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type &
tmat3x4<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const &
tmat3x4<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -81,10 +73,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -93,8 +82,7 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(
tmat3x4<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -102,17 +90,11 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
ctor
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
T const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
@ -182,10 +164,7 @@ namespace glm
// Conversion
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat3x4<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -193,32 +172,23 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[2] = col_type(T(0), T(0), T(1), T(0));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[2] = col_type(m[2], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -226,65 +196,50 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[2] = col_type(T(0), T(0), T(1), T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[2] = col_type(m[2], T(0), T(1));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0), T(0), T(1), T(0));
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(T(0)));
this->value[1] = col_type(m[1], tvec2<T, P>(T(0)));
this->value[2] = col_type(m[2], tvec2<T, P>(T(1), T(0)));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[2] = col_type(m[2], T(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator= (tmat3x4<T, P> const & m)
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];
@ -294,7 +249,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator= (tmat3x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -304,7 +259,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -314,7 +269,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+= (tmat3x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(tmat3x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -324,7 +279,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -334,7 +289,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-= (tmat3x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(tmat3x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -344,7 +299,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -354,7 +309,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P> & tmat3x4<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat3x4<T, P> & tmat3x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -363,7 +318,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -372,7 +327,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -400,11 +355,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+
(
tmat3x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] + s,
@ -413,11 +364,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+
(
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0] + m2[0],
@ -426,11 +373,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-
(
tmat3x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] - s,
@ -439,11 +382,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-
(
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0] - m2[0],
@ -452,11 +391,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*
(
tmat3x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] * s,
@ -465,11 +400,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*
(
T const & s,
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
m[0] * s,
@ -505,11 +436,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*
(
tmat3x4<T, P> const & m1,
tmat4x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@ -558,11 +485,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*
(
tmat3x4<T, P> const & m1,
tmat2x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -576,11 +499,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*
(
tmat3x4<T, P> const & m1,
tmat3x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
@ -598,11 +517,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/
(
tmat3x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] / s,
@ -611,11 +526,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/
(
T const & s,
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
s / m[0],
@ -625,10 +536,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
-m[0],
@ -640,21 +548,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat3x4<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -54,8 +54,9 @@ namespace glm
# endif//GLM_FORCE_SIZE_FUNC
private:
// Data
/// @cond DETAIL
col_type value[4];
/// @endcond
public:
// Constructors
@ -64,10 +65,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x2(
ctor Null);
GLM_FUNC_DECL explicit tmat4x2(
T const & x);
GLM_FUNC_DECL explicit tmat4x2(ctor);
GLM_FUNC_DECL explicit tmat4x2(T const & x);
GLM_FUNC_DECL tmat4x2(
T const & x0, T const & y0,
T const & x1, T const & y1,
@ -82,7 +81,7 @@ namespace glm
//////////////////////////////////////
// Conversions
template<
template <
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
@ -117,21 +116,21 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat4x2<T, P>& operator= (tmat4x2<T, P> const & m);
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
@ -144,74 +143,47 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+ (
tmat4x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+ (
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2);
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator- (
tmat4x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator- (
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2);
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator* (
tmat4x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator* (
T const & s,
tmat4x2<T, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator* (
tmat4x2<T, P> const & m,
typename tmat4x2<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator* (
typename tmat4x2<T, P>::col_type const & v,
tmat4x2<T, P> const & m);
GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator* (
tmat4x2<T, P> const & m1,
tmat3x4<T, P> const & m2);
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator* (
tmat4x2<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
tmat4x3<T, P> const & m1,
tmat2x4<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/ (
tmat4x2<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/ (
T const & s,
tmat4x2<T, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> const operator-(
tmat4x2<T, P> const & m);
GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type &
tmat4x2<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const &
tmat4x2<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -82,8 +74,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(
tmat4x2<T, P> const & m)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -93,8 +84,7 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(
tmat4x2<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -107,10 +97,7 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
T const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero);
@ -192,10 +179,7 @@ namespace glm
// Conversion
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat4x2<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -204,34 +188,25 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(static_cast<T>(0));
this->value[3] = col_type(static_cast<T>(0));
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(static_cast<T>(0));
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -240,46 +215,34 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(static_cast<T>(0));
this->value[3] = col_type(static_cast<T>(0));
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(static_cast<T>(0));
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(static_cast<T>(0));
this->value[3] = col_type(static_cast<T>(0));
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -288,25 +251,19 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(static_cast<T>(0));
this->value[3] = col_type(0);
}
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=
(
tmat4x2<T, P> const & m
)
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];
@ -317,10 +274,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=
(
tmat4x2<U, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -331,7 +285,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -342,7 +296,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+= (tmat4x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(tmat4x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -353,7 +307,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -364,7 +318,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-= (tmat4x2<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(tmat4x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -375,7 +329,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -386,7 +340,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -396,7 +350,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -406,7 +360,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -435,11 +389,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+
(
tmat4x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] + s,
@ -449,11 +399,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+
(
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0] + m2[0],
@ -463,11 +409,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-
(
tmat4x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] - s,
@ -477,11 +419,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-
(
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0] - m2[0],
@ -491,11 +429,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*
(
tmat4x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] * s,
@ -505,11 +439,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*
(
T const & s,
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
m[0] * s,
@ -519,11 +449,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type operator*
(
tmat4x2<T, P> const & m,
typename tmat4x2<T, P>::row_type const & v
)
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v)
{
return typename tmat4x2<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
@ -531,11 +457,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::row_type operator*
(
typename tmat4x2<T, P>::col_type const & v,
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m)
{
return typename tmat4x2<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
@ -545,11 +467,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
(
tmat4x2<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -578,11 +496,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*
(
tmat4x2<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -594,11 +508,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*
(
tmat4x2<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -612,11 +522,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/
(
tmat4x2<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] / s,
@ -626,11 +532,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/
(
T const & s,
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
s / m[0],
@ -641,10 +543,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
-m[0],
@ -657,21 +556,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat4x2<T, P> const & m1,
tmat4x2<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -64,10 +64,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x3(
ctor Null);
GLM_FUNC_DECL explicit tmat4x3(
T const & x);
GLM_FUNC_DECL explicit tmat4x3(ctor);
GLM_FUNC_DECL explicit tmat4x3(T const & x);
GLM_FUNC_DECL tmat4x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
@ -117,101 +115,74 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
GLM_FUNC_DECL tmat4x3<T, P> & operator= (tmat4x3<T, P> const & m);
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);
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+= (U s);
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+= (tmat4x3<U, P> const & m);
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-= (U s);
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-= (tmat4x3<U, P> const & m);
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator*= (U s);
GLM_FUNC_DECL tmat4x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator/= (U s);
GLM_FUNC_DECL tmat4x3<T, P> & operator/=(U 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++();
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
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+ (
tmat4x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+ (
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2);
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator- (
tmat4x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator- (
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2);
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator* (
tmat4x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator* (
T const & s,
tmat4x3<T, P> const & m);
GLM_FUNC_DECL tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::col_type operator* (
tmat4x3<T, P> const & m,
typename tmat4x3<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat4x3<T, P>::col_type operator*(tmat4x3<T, P> const & m, typename tmat4x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::row_type operator* (
typename tmat4x3<T, P>::col_type const & v,
tmat4x3<T, P> const & m);
GLM_FUNC_DECL typename tmat4x3<T, P>::row_type operator*(typename tmat4x3<T, P>::col_type const & v, tmat4x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator* (
tmat4x3<T, P> const & m1,
tmat2x4<T, P> const & m2);
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator* (
tmat4x3<T, P> const & m1,
tmat3x4<T, P> const & m2);
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator* (
tmat4x3<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/ (
tmat4x3<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/ (
T const & s,
tmat4x3<T, P> const & m);
GLM_FUNC_DECL tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> const operator- (
tmat4x3<T, P> const & m);
GLM_FUNC_DECL tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -46,22 +46,14 @@ namespace glm
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type &
tmat4x3<T, P>::operator[]
(
size_type i
)
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](size_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const &
tmat4x3<T, P>::operator[]
(
size_type i
) const
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](size_type i) const
{
assert(i < this->length());
return this->value[i];
@ -82,8 +74,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
tmat4x3<T, P> const & m)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -93,8 +84,7 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
tmat4x3<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -107,14 +97,12 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
T const & s)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero);
this->value[2] = col_type(Zero, Zero, s);
this->value[3] = col_type(Zero, Zero, Zero);
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
this->value[2] = col_type(0, 0, s);
this->value[3] = col_type(0, 0, 0);
}
template <typename T, precision P>
@ -191,10 +179,7 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat4x3<U, Q> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -203,34 +188,25 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(1));
this->value[3] = col_type(static_cast<T>(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(static_cast<T>(0));
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -239,73 +215,55 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(static_cast<T>(0), value_type(0), value_type(1));
this->value[3] = col_type(static_cast<T>(0));
this->value[2] = col_type(0, 0, 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(1));
this->value[3] = col_type(static_cast<T>(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(static_cast<T>(0), value_type(0), value_type(1));
this->value[3] = col_type(static_cast<T>(0));
this->value[2] = col_type(0, 0, 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(1));
this->value[3] = col_type(m[3], value_type(0));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(m[3], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(static_cast<T>(0));
this->value[3] = col_type(0);
}
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=
(
tmat4x3<T, P> const & m
)
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];
@ -316,10 +274,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=
(
tmat4x3<U, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -330,7 +285,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -341,7 +296,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+= (tmat4x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(tmat4x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -352,7 +307,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -363,7 +318,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-= (tmat4x3<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(tmat4x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -374,7 +329,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -385,7 +340,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -395,7 +350,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -405,7 +360,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -418,9 +373,7 @@ namespace glm
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+ (
tmat4x3<T, P> const & m,
T const & s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] + s,
@ -430,9 +383,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+ (
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0] + m2[0],
@ -442,9 +393,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator- (
tmat4x3<T, P> const & m,
T const & s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] - s,
@ -454,9 +403,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator- (
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0] - m2[0],
@ -466,9 +413,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator* (
tmat4x3<T, P> const & m,
T const & s)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] * s,
@ -478,9 +423,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator* (
T const & s,
tmat4x3<T, P> const & m)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
m[0] * s,
@ -515,11 +458,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
(
tmat4x3<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -531,11 +470,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
(
tmat4x3<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -577,11 +512,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*
(
tmat4x3<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -599,11 +530,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/
(
tmat4x3<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] / s,
@ -613,11 +540,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/
(
T const & s,
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
s / m[0],
@ -628,10 +551,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
-m[0],
@ -641,11 +561,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++
(
tmat4x3<T, P> const & m,
int
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++(tmat4x3<T, P> const & m, int)
{
return tmat4x3<T, P>(
m[0] + T(1),
@ -655,11 +571,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--
(
tmat4x3<T, P> const & m,
int
)
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--(tmat4x3<T, P> const & m, int)
{
return tmat4x3<T, P>(
m[0] - T(1),
@ -688,21 +600,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat4x3<T, P> const & m1,
tmat4x3<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -69,10 +69,8 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x4(
ctor Null);
GLM_FUNC_DECL explicit tmat4x4(
T const & x);
GLM_FUNC_DECL explicit tmat4x4(ctor);
GLM_FUNC_DECL explicit tmat4x4(T const & x);
GLM_FUNC_DECL tmat4x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
@ -122,130 +120,93 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_t i);
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
GLM_FUNC_DECL tmat4x4<T, P> & operator= (tmat4x4<T, P> const & m);
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);
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+= (U s);
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+= (tmat4x4<U, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-= (U s);
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-= (tmat4x4<U, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*= (U s);
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*= (tmat4x4<U, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (U s);
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/= (tmat4x4<U, P> const & m);
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++();
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
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+ (
tmat4x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+ (
T const & s,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+ (
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator- (
tmat4x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator- (
T const & s,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator- (
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator* (
tmat4x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator* (
T const & s,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator* (
tmat4x4<T, P> const & m,
typename tmat4x4<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator*(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator* (
typename tmat4x4<T, P>::col_type const & v,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator*(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator* (
tmat4x4<T, P> const & m1,
tmat2x4<T, P> const & m2);
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator* (
tmat4x4<T, P> const & m1,
tmat3x4<T, P> const & m2);
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator* (
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/ (
tmat4x4<T, P> const & m,
T const & s);
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/ (
T const & s,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/ (
tmat4x4<T, P> const & m,
typename tmat4x4<T, P>::row_type const & v);
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/ (
typename tmat4x4<T, P>::col_type & v,
tmat4x4<T, P> const & m);
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type & v, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/ (
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2);
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> const operator- (
tmat4x4<T, P> const & m);
GLM_FUNC_DECL tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -106,22 +106,14 @@ namespace detail
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type &
tmat4x4<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const &
tmat4x4<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];
@ -142,10 +134,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -155,10 +144,7 @@ namespace detail
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat4x4<T, Q> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, Q> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -167,23 +153,16 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
ctor
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
T const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero, Zero);
this->value[2] = col_type(Zero, Zero, s, Zero);
this->value[3] = col_type(Zero, Zero, Zero, s);
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
this->value[2] = col_type(0, 0, s, 0);
this->value[3] = col_type(0, 0, 0, s);
}
template <typename T, precision P>
@ -295,109 +274,82 @@ namespace detail
//////////////////////////////////////
// Matrix convertion constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat2x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[2] = col_type(static_cast<T>(0));
this->value[3] = col_type(static_cast<T>(0), value_type(0), value_type(0), value_type(1));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(m[2], value_type(0));
this->value[3] = col_type(static_cast<T>(0), value_type(0), value_type(0), value_type(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat2x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], value_type(0));
this->value[1] = col_type(m[1], value_type(0));
this->value[2] = col_type(static_cast<T>(0));
this->value[3] = col_type(static_cast<T>(0), value_type(0), value_type(0), value_type(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat3x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[2] = col_type(m[2], tvec2<T, P>(0));
this->value[3] = col_type(static_cast<T>(0), value_type(0), value_type(0), value_type(1));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 0, 0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat2x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(T(0));
this->value[3] = col_type(T(0), T(0), T(0), T(1));
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat4x2<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], tvec2<T, P>(0));
this->value[1] = col_type(m[1], tvec2<T, P>(0));
this->value[2] = col_type(T(0));
this->value[3] = col_type(T(0), T(0), T(0), T(1));
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat3x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = col_type(T(0), T(0), T(0), T(1));
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat4x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], T(0));
this->value[1] = col_type(m[1], T(0));
this->value[2] = col_type(m[2], T(0));
this->value[3] = col_type(m[3], T(1));
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[3] = col_type(m[3], 1);
}
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=
(
tmat4x4<T, P> const & m
)
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));
@ -410,10 +362,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=
(
tmat4x4<U, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
@ -426,7 +375,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+= (U s)
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -437,7 +386,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+= (tmat4x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(tmat4x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -448,7 +397,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -459,7 +408,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-= (tmat4x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(tmat4x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -470,7 +419,7 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -481,14 +430,14 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*= (tmat4x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(tmat4x4<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -499,13 +448,13 @@ namespace detail
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/= (tmat4x4<U, P> const & m)
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(tmat4x4<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++ ()
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
@ -515,7 +464,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-- ()
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
@ -542,11 +491,7 @@ namespace detail
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+
(
tmat4x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] + s,
@ -556,11 +501,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+
(
T const & s,
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
m[0] + s,
@ -570,11 +511,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x4<T, P>(
m1[0] + m2[0],
@ -584,11 +521,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-
(
tmat4x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] - s,
@ -598,11 +531,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-
(
T const & s,
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
s - m[0],
@ -612,11 +541,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x4<T, P>(
m1[0] - m2[0],
@ -626,11 +551,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*
(
tmat4x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] * s,
@ -640,11 +561,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*
(
T const & s,
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
m[0] * s,
@ -716,11 +633,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*
(
tmat4x4<T, P> const & m1,
tmat2x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -734,11 +647,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*
(
tmat4x4<T, P> const & m1,
tmat3x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
@ -756,11 +665,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
typename tmat4x4<T, P>::col_type const SrcA0 = m1[0];
typename tmat4x4<T, P>::col_type const SrcA1 = m1[1];
@ -781,11 +686,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/
(
tmat4x4<T, P> const & m,
T const & s
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] / s,
@ -795,11 +696,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/
(
T const & s,
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
s / m[0],
@ -809,31 +706,19 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/
(
tmat4x4<T, P> const & m,
typename tmat4x4<T, P>::row_type const & v
)
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/
(
typename tmat4x4<T, P>::col_type const & v,
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
tmat4x4<T, P> m1_copy(m1);
return m1_copy /= m2;
@ -841,10 +726,7 @@ namespace detail
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
-m[0],
@ -854,11 +736,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator++
(
tmat4x4<T, P> const & m,
int
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator++(tmat4x4<T, P> const & m, int)
{
return tmat4x4<T, P>(
m[0] + static_cast<T>(1),
@ -868,11 +746,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator--
(
tmat4x4<T, P> const & m,
int
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator--(tmat4x4<T, P> const & m, int)
{
return tmat4x4<T, P>(
m[0] - static_cast<T>(1),
@ -885,21 +759,13 @@ namespace detail
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tmat4x4<T, P> const & m1,
tmat4x4<T, P> const & m2
)
GLM_FUNC_QUALIFIER bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -142,10 +142,10 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<T, P> const & v);
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s);
template <typename U>

View File

@ -70,14 +70,14 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v) :
x(v.x)
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, Q> const & v) :
x(v.x)
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, Q> const & v)
: x(v.x)
{}
//////////////////////////////////////
@ -88,8 +88,8 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(T const & s) :
x(s)
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(T const & s)
: x(s)
{}
//////////////////////////////////////
@ -97,48 +97,33 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
(
tvec1<U, Q> const & v
) :
x(static_cast<T>(v.x))
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
(
tvec2<U, Q> const & v
) :
x(static_cast<T>(v.x))
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec2<U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
(
tvec3<U, Q> const & v
) :
x(static_cast<T>(v.x))
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec3<U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
(
tvec4<U, Q> const & v
) :
x(static_cast<T>(v.x))
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec4<U, Q> const & v)
: x(static_cast<T>(v.x))
{}
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=
(
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
{
this->x = v.x;
return *this;
@ -146,10 +131,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<U, P> const & v)
{
this->x = static_cast<T>(v.x);
return *this;
@ -157,10 +139,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(U const & s)
{
this->x += static_cast<T>(s);
return *this;
@ -168,10 +147,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(tvec1<U, P> const & v)
{
this->x += static_cast<T>(v.x);
return *this;
@ -179,10 +155,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(U const & s)
{
this->x -= static_cast<T>(s);
return *this;
@ -190,10 +163,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(tvec1<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
return *this;
@ -201,10 +171,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(U const & s)
{
this->x *= static_cast<T>(s);
return *this;
@ -212,10 +179,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(tvec1<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
return *this;
@ -223,10 +187,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(U const & s)
{
this->x /= static_cast<T>(s);
return *this;
@ -234,10 +195,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(tvec1<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
return *this;
@ -280,21 +238,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return (v1.x == v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return (v1.x != v2.x);
}
@ -304,10 +254,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(U const & s)
{
this->x %= static_cast<T>(s);
return *this;
@ -315,10 +262,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(tvec1<U, P> const & v)
{
this->x %= static_cast<T>(v.x);
return *this;
@ -326,10 +270,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(U const & s)
{
this->x &= static_cast<T>(s);
return *this;
@ -337,10 +278,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(tvec1<U, P> const & v)
{
this->x &= static_cast<T>(v.x);
return *this;
@ -348,10 +286,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(U const & s)
{
this->x |= static_cast<T>(s);
return *this;
@ -359,10 +294,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(tvec1<U, P> const & v)
{
this->x |= U(v.x);
return *this;
@ -370,10 +302,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(U const & s)
{
this->x ^= static_cast<T>(s);
return *this;
@ -381,10 +310,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(tvec1<U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
return *this;
@ -392,10 +318,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(U const & s)
{
this->x <<= static_cast<T>(s);
return *this;
@ -403,10 +326,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(tvec1<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
return *this;
@ -414,10 +334,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=
(
U const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(U const & s)
{
this->x >>= static_cast<T>(s);
return *this;
@ -425,10 +342,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=
(
tvec1<U, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(tvec1<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
return *this;
@ -438,33 +352,21 @@ namespace glm
// Binary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s + v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x + v2.x);
@ -472,33 +374,21 @@ namespace glm
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s - v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x - v2.x);
@ -506,33 +396,21 @@ namespace glm
//operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s * v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x * v2.x);
@ -540,33 +418,21 @@ namespace glm
//operator/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s / v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x / v2.x);
@ -574,32 +440,21 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-
(
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v)
{
return tvec1<T, P>(
-v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator++
(
tvec1<T, P> const & v,
int
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator++(tvec1<T, P> const & v, int)
{
return tvec1<T, P>(
v.x + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator--
(
tvec1<T, P> const & v,
int
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator--(tvec1<T, P> const & v, int)
{
return tvec1<T, P>(
v.x - T(1));
@ -609,208 +464,133 @@ namespace glm
// Binary bit operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x % s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s % v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x % v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x & s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s & v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x & v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x | s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s | v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x | v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x ^ s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s ^ v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x ^ v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x << s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s << v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x << v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>
(
tvec1<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s)
{
return tvec1<T, P>(
v.x >> s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>
(
T const & s,
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v)
{
return tvec1<T, P>(
s >> v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>
(
tvec1<T, P> const & v1,
tvec1<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
{
return tvec1<T, P>(
v1.x >> v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator~
(
tvec1<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec1<T, P> operator~(tvec1<T, P> const & v)
{
return tvec1<T, P>(
~v.x);

View File

@ -151,10 +151,10 @@ 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);
template <typename U>

View File

@ -88,13 +88,13 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s) :
x(s), y(s)
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s)
: x(s), y(s)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s1, T const & s2) :
x(s1), y(s2)
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s1, T const & s2)
: x(s1), y(s2)
{}
//////////////////////////////////////
@ -102,16 +102,16 @@ namespace glm
template <typename T, precision P>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(A const & a, B const & b) :
x(static_cast<T>(a)),
y(static_cast<T>(b))
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(A const & a, B const & b)
: x(static_cast<T>(a))
, y(static_cast<T>(b))
{}
template <typename T, precision P>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b) :
x(a.x),
y(b.x)
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b)
: x(static_cast<T>(a.x))
, y(static_cast<T>(b.x))
{}
//////////////////////////////////////
@ -119,23 +119,23 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y))
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec3<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y))
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec3<U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec4<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y))
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec4<U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
//////////////////////////////////////
@ -305,21 +305,13 @@ namespace glm
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tvec2<T, P> const & v1,
tvec2<T, P> const & v2
)
GLM_FUNC_QUALIFIER bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
{
return (v1.x == v2.x) && (v1.y == v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tvec2<T, P> const & v1,
tvec2<T, P> const & v2
)
GLM_FUNC_QUALIFIER bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
{
return (v1.x != v2.x) || (v1.y != v2.y);
}
@ -329,7 +321,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(U s)
{
this->x %= static_cast<T>(s);
this->y %= static_cast<T>(s);
@ -338,7 +330,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(tvec1<U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.x);
@ -347,7 +339,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(tvec2<U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.y);
@ -356,7 +348,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(U s)
{
this->x &= static_cast<T>(s);
this->y &= static_cast<T>(s);
@ -365,7 +357,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(tvec1<U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.x);
@ -374,7 +366,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(tvec2<U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.y);
@ -383,7 +375,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(U s)
{
this->x |= static_cast<T>(s);
this->y |= static_cast<T>(s);
@ -392,7 +384,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(tvec1<U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.x);
@ -401,7 +393,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(tvec2<U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.y);
@ -410,7 +402,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(U s)
{
this->x ^= static_cast<T>(s);
this->y ^= static_cast<T>(s);
@ -419,7 +411,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(tvec1<U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.x);
@ -428,7 +420,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(tvec2<U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.y);
@ -437,7 +429,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(U s)
{
this->x <<= static_cast<T>(s);
this->y <<= static_cast<T>(s);
@ -446,7 +438,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(tvec1<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
@ -455,7 +447,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(tvec2<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.y);
@ -464,7 +456,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>= (U s)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(U s)
{
this->x >>= static_cast<T>(s);
this->y >>= static_cast<T>(s);
@ -473,7 +465,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(tvec1<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.x);
@ -482,7 +474,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>= (tvec2<U, P> const & v)
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(tvec2<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);

View File

@ -173,10 +173,10 @@ namespace glm
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<T, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
template <typename U>
@ -214,29 +214,29 @@ namespace glm
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%= (U s);
GLM_FUNC_DECL tvec3<T, P> & operator%=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%= (tvec3<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&= (U s);
GLM_FUNC_DECL tvec3<T, P> & operator&=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&= (tvec3<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|= (U s);
GLM_FUNC_DECL tvec3<T, P> & operator|=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|= (tvec3<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^= (U s);
GLM_FUNC_DECL tvec3<T, P> & operator^=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^= (tvec3<U, P> const & v);
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s);
template <typename U>

View File

@ -201,7 +201,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec1<U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.x);
@ -211,7 +211,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec3<U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.y);
@ -221,7 +221,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(U s)
{
this->x -= static_cast<T>(s);
this->y -= static_cast<T>(s);
@ -231,7 +231,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec1<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.x);
@ -241,7 +241,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec3<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.y);
@ -251,7 +251,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(U s)
{
this->x *= static_cast<T>(s);
this->y *= static_cast<T>(s);
@ -261,7 +261,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec1<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.x);
@ -271,7 +271,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec3<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.y);
@ -281,7 +281,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(U s)
{
this->x /= static_cast<T>(s);
this->y /= static_cast<T>(s);
@ -291,7 +291,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec1<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.x);
@ -301,7 +301,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec3<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.y);
@ -351,7 +351,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(U s)
{
this->x %= s;
this->y %= s;
@ -361,7 +361,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec1<U, P> const & v)
{
this->x %= v.x;
this->y %= v.x;
@ -371,7 +371,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec3<U, P> const & v)
{
this->x %= v.x;
this->y %= v.y;
@ -381,7 +381,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(U s)
{
this->x &= s;
this->y &= s;
@ -391,7 +391,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec1<U, P> const & v)
{
this->x &= v.x;
this->y &= v.x;
@ -401,7 +401,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec3<U, P> const & v)
{
this->x &= v.x;
this->y &= v.y;
@ -411,7 +411,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(U s)
{
this->x |= s;
this->y |= s;
@ -421,7 +421,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec1<U, P> const & v)
{
this->x |= v.x;
this->y |= v.x;
@ -431,7 +431,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec3<U, P> const & v)
{
this->x |= v.x;
this->y |= v.y;
@ -441,7 +441,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(U s)
{
this->x ^= s;
this->y ^= s;
@ -451,7 +451,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec1<U, P> const & v)
{
this->x ^= v.x;
this->y ^= v.x;
@ -461,7 +461,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec3<U, P> const & v)
{
this->x ^= v.x;
this->y ^= v.y;
@ -471,7 +471,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(U s)
{
this->x <<= s;
this->y <<= s;
@ -481,7 +481,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec1<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
@ -491,7 +491,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec3<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.y);
@ -501,7 +501,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>= (U s)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(U s)
{
this->x >>= static_cast<T>(s);
this->y >>= static_cast<T>(s);
@ -511,7 +511,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>= (tvec1<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec1<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.x);
@ -521,7 +521,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>= (tvec3<U, P> const & v)
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec3<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);

View File

@ -254,10 +254,10 @@ namespace glm
//////////////////////////////////////
// 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);
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(U s);
template <typename U>
@ -295,29 +295,29 @@ namespace glm
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%= (U s);
GLM_FUNC_DECL tvec4<T, P> & operator%=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%= (tvec4<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&= (U s);
GLM_FUNC_DECL tvec4<T, P> & operator&=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&= (tvec4<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|= (U s);
GLM_FUNC_DECL tvec4<T, P> & operator|=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|= (tvec4<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^= (U s);
GLM_FUNC_DECL tvec4<T, P> & operator^=(U s);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^= (tvec1<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^= (tvec4<U, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(U s);
template <typename U>

View File

@ -104,11 +104,8 @@ namespace glm
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v) :
x(v.x),
y(v.y),
z(v.z),
w(v.w)
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}
//////////////////////////////////////
@ -119,11 +116,8 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T const & s) :
x(s),
y(s),
z(s),
w(s)
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T const & s)
: x(s), y(s), z(s), w(s)
{}
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
@ -139,11 +133,8 @@ namespace glm
#endif
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T const & a, T const & b, T const & c, T const & d) :
x(a),
y(b),
z(c),
w(d)
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T const & a, T const & b, T const & c, T const & d)
: x(a), y(b), z(c), w(d)
{}
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
@ -773,11 +764,7 @@ namespace glm
// Binary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+
(
tvec4<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v, T const & s)
{
return tvec4<T, P>(
v.x + s,
@ -787,11 +774,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+
(
T const & s,
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(T const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s + v.x,
@ -801,11 +784,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+
(
tvec4<T, P> const & v1,
tvec4<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x + v2.x,
@ -816,11 +795,7 @@ namespace glm
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-
(
tvec4<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v, T const & s)
{
return tvec4<T, P>(
v.x - s,
@ -830,11 +805,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-
(
T const & s,
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(T const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s - v.x,
@ -844,11 +815,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-
(
tvec4<T, P> const & v1,
tvec4<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x - v2.x,
@ -859,11 +826,7 @@ namespace glm
//operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*
(
tvec4<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, T const & s)
{
return tvec4<T, P>(
v.x * s,
@ -873,11 +836,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*
(
T const & s,
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(T const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s * v.x,
@ -887,11 +846,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*
(
tvec4<T, P> const & v1,
tvec4<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x * v2.x,
@ -902,11 +857,7 @@ namespace glm
//operator/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/
(
tvec4<T, P> const & v,
T const & s
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v, T const & s)
{
return tvec4<T, P>(
v.x / s,
@ -916,11 +867,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/
(
T const & s,
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(T const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s / v.x,
@ -930,11 +877,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/
(
tvec4<T, P> const & v1,
tvec4<T, P> const & v2
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x / v2.x,
@ -945,10 +888,7 @@ namespace glm
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-
(
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v)
{
return tvec4<T, P>(
-v.x,

View File

@ -72,6 +72,12 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
#endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Accesses
GLM_FUNC_DECL T & operator[](length_t i);
GLM_FUNC_DECL T const & operator[](length_t i) const;
//////////////////////////////////////
// Implicit basic constructors
@ -87,6 +93,7 @@ namespace glm
GLM_FUNC_DECL explicit tquat(T const & s, tvec3<T, P> const & v);
GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z);
//////////////////////////////////////
// Convertions
/// Create a quaternion from two normalized axis
@ -95,21 +102,13 @@ namespace glm
/// @param v A second normalized axis
/// @see gtc_quaternion
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
GLM_FUNC_DECL explicit tquat(
tvec3<T, P> const & u,
tvec3<T, P> const & v);
GLM_FUNC_DECL explicit tquat(tvec3<T, P> const & u, tvec3<T, P> const & v);
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL explicit tquat(
tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL explicit tquat(
tmat3x3<T, P> const & m);
GLM_FUNC_DECL explicit tquat(
tmat4x4<T, P> const & m);
// Accesses
GLM_FUNC_DECL T & operator[](length_t i);
GLM_FUNC_DECL T const & operator[](length_t i) const;
GLM_FUNC_DECL explicit tquat(tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL explicit tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL explicit tquat(tmat4x4<T, P> const & m);
//////////////////////////////////////
// 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);
@ -118,75 +117,52 @@ namespace glm
};
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator- (
tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator+ (
tquat<T, P> const & q,
tquat<T, P> const & p);
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator* (
tquat<T, P> const & q,
tquat<T, P> const & p);
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator* (
tquat<T, P> const & q,
tvec3<T, P> const & v);
GLM_FUNC_DECL tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator* (
tvec3<T, P> const & v,
tquat<T, P> const & q);
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator* (
tquat<T, P> const & q,
tvec4<T, P> const & v);
GLM_FUNC_DECL tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator* (
tvec4<T, P> const & v,
tquat<T, P> const & q);
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator* (
tquat<T, P> const & q,
T const & s);
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator* (
T const & s,
tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator/ (
tquat<T, P> const & q,
T const & s);
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s);
/// Returns the length of the quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL T length(
tquat<T, P> const & q);
GLM_FUNC_DECL T length(tquat<T, P> const & q);
/// Returns the normalized quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> normalize(
tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
///
/// @see gtc_quaternion
template <typename T, precision P, template <typename, precision> class quatType>
GLM_FUNC_DECL T dot(
quatType<T, P> const & x,
quatType<T, P> const & y);
GLM_FUNC_DECL T dot(quatType<T, P> const & x, quatType<T, P> const & y);
/// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed.
@ -199,10 +175,7 @@ namespace glm
/// @see gtc_quaternion
/// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> mix(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a);
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a);
/// Linear interpolation of two quaternions.
/// The interpolation is oriented.
@ -213,10 +186,7 @@ namespace glm
/// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> lerp(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a);
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a);
/// Spherical linear interpolation of two quaternions.
/// The interpolation always take the short path and the rotation is performed at constant speed.
@ -227,24 +197,19 @@ namespace glm
/// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> slerp(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a);
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a);
/// Returns the q conjugate.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> conjugate(
tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q);
/// Returns the q inverse.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> inverse(
tquat<T, P> const & q);
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q);
/// Rotates a quaternion from a vector of 3 components axis and an angle.
///
@ -254,18 +219,14 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> rotate(
tquat<T, P> const & q,
T const & angle,
tvec3<T, P> const & axis);
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & axis);
/// Returns euler angles, yitch as x, yaw as y, roll as z.
/// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> eulerAngles(
tquat<T, P> const & x);
GLM_FUNC_DECL tvec3<T, P> eulerAngles(tquat<T, P> const & x);
/// Returns roll value of euler angles expressed in radians.
///
@ -289,29 +250,25 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> mat3_cast(
tquat<T, P> const & x);
GLM_FUNC_DECL tmat3x3<T, P> mat3_cast(tquat<T, P> const & x);
/// Converts a quaternion to a 4 * 4 matrix.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> mat4_cast(
tquat<T, P> const & x);
GLM_FUNC_DECL tmat4x4<T, P> mat4_cast(tquat<T, P> const & x);
/// Converts a 3 * 3 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(
tmat3x3<T, P> const & x);
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat3x3<T, P> const & x);
/// Converts a 4 * 4 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(
tmat4x4<T, P> const & x);
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat4x4<T, P> const & x);
/// Returns the quaternion rotation angle.
///
@ -323,8 +280,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> axis(
tquat<T, P> const & x);
GLM_FUNC_DECL tvec3<T, P> axis(tquat<T, P> const & x);
/// Build a quaternion from an angle and a normalized axis.
///
@ -333,9 +289,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> angleAxis(
T const & angle,
tvec3<T, P> const & axis);
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & axis);
/// Returns the component-wise comparison result of x < y.
///
@ -343,9 +297,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThan(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x <= y.
///
@ -353,9 +305,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThanEqual(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x > y.
///
@ -363,9 +313,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThan(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x >= y.
///
@ -373,9 +321,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThanEqual(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x == y.
///
@ -383,9 +329,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> equal(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x != y.
///
@ -393,10 +337,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> notEqual(
tquat<T, P> const & x,
tquat<T, P> const & y);
GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// @}
} //namespace glm

View File

@ -59,6 +59,26 @@ namespace detail
}
#endif
//////////////////////////////////////
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[] (length_t i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[] (length_t i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
//////////////////////////////////////
// Implicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
# ifndef GLM_FORCE_NO_CTOR_INIT
@ -67,48 +87,35 @@ namespace detail
{}
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)
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) :
x(q.x), y(q.y), z(q.z), w(q.w)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, Q> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w)
{}
//////////////////////////////////////
// Explicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
T const & s,
tvec3<T, P> const & v
) :
x(v.x),
y(v.y),
z(v.z),
w(s)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(T const & s, tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(s)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
T const & w,
T const & x,
T const & y,
T const & z
) :
x(x),
y(y),
z(z),
w(w)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(T const & w, T const & x, T const & y, T const & z)
: x(x), y(y), z(z), w(w)
{}
//////////////////////////////////////////////////////////////
// tquat conversions
// Conversions
//template <typename valType>
//GLM_FUNC_QUALIFIER tquat<valType>::tquat
@ -129,11 +136,7 @@ namespace detail
//}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tvec3<T, P> const & u,
tvec3<T, P> const & v
)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v)
{
tvec3<T, P> const LocalW(cross(u, v));
T Dot = detail::compute_dot<tvec3, T, P>::call(u, v);
@ -143,10 +146,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tvec3<T, P> const & eulerAngle
)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & eulerAngle)
{
tvec3<T, P> c = glm::cos(eulerAngle * T(0.5));
tvec3<T, P> s = glm::sin(eulerAngle * T(0.5));
@ -158,54 +158,25 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat3x3<T, P> const & m)
{
*this = quat_cast(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tmat4x4<T, P> const & m
)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat4x4<T, P> const & m)
{
*this = quat_cast(m);
}
//////////////////////////////////////////////////////////////
// tquat<T, P> accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[] (length_t i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[] (length_t i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> conjugate
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q)
{
return tquat<T, P>(q.w, -q.x, -q.y, -q.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> inverse
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q)
{
return conjugate(q) / dot(q, q);
}
@ -214,10 +185,7 @@ 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;
@ -227,10 +195,7 @@ namespace detail
}
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)
{
tquat<T, P> const p(*this);
@ -242,10 +207,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
(
T const & s
)
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(T const & s)
{
this->w *= s;
this->x *= s;
@ -255,10 +217,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator /=
(
T const & s
)
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(T const & s)
{
this->w /= s;
this->x /= s;
@ -271,41 +230,26 @@ namespace detail
// tquat<T, P> external operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator-
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q)
{
return tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator+
(
tquat<T, P> const & q,
tquat<T, P> const & p
)
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p)
{
return tquat<T, P>(q) += p;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*
(
tquat<T, P> const & q,
tquat<T, P> const & p
)
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p)
{
return tquat<T, P>(q) *= p;
}
// Transformation
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*
(
tquat<T, P> const & q,
tvec3<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v)
{
tvec3<T, P> const QuatVector(q.x, q.y, q.z);
tvec3<T, P> const uv(glm::cross(QuatVector, v));
@ -315,62 +259,38 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*
(
tvec3<T, P> const & v,
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q)
{
return glm::inverse(q) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*
(
tquat<T, P> const & q,
tvec4<T, P> const & v
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v)
{
return tvec4<T, P>(q * tvec3<T, P>(v), v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*
(
tvec4<T, P> const & v,
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q)
{
return glm::inverse(q) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*
(
tquat<T, P> const & q,
T const & s
)
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s)
{
return tquat<T, P>(
q.w * s, q.x * s, q.y * s, q.z * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*
(
T const & s,
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q)
{
return q * s;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator/
(
tquat<T, P> const & q,
T const & s
)
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s)
{
return tquat<T, P>(
q.w / s, q.x / s, q.y / s, q.z / s);
@ -380,40 +300,26 @@ namespace detail
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
tquat<T, P> const & q1,
tquat<T, P> const & q2
)
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2)
{
return (q1.x == q2.x) && (q1.y == q2.y) && (q1.z == q2.z) && (q1.w == q2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
tquat<T, P> const & q1,
tquat<T, P> const & q2
)
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2)
{
return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w);
}
////////////////////////////////////////////////////////
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q)
{
return glm::sqrt(dot(q, q));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> normalize
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q)
{
T len = length(q);
if(len <= T(0)) // Problem
@ -423,11 +329,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> cross
(
tquat<T, P> const & q1,
tquat<T, P> const & q2
)
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2)
{
return tquat<T, P>(
q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,
@ -438,12 +340,7 @@ namespace detail
/*
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> mix
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a
)
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
{
if(a <= T(0)) return x;
if(a >= T(1)) return y;
@ -518,12 +415,7 @@ namespace detail
*/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> mix
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a
)
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
{
T cosTheta = dot(x, y);
@ -546,12 +438,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> lerp
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a
)
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
{
// Lerp is only defined in [0, 1]
assert(a >= static_cast<T>(0));
@ -561,12 +448,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> slerp
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & a
)
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
{
tquat<T, P> z = y;
@ -599,12 +481,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> rotate
(
tquat<T, P> const & q,
T const & angle,
tvec3<T, P> const & v
)
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & v)
{
tvec3<T, P> Tmp = v;
@ -626,46 +503,31 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> eulerAngles
(
tquat<T, P> const & x
)
GLM_FUNC_QUALIFIER tvec3<T, P> eulerAngles(tquat<T, P> const & x)
{
return tvec3<T, P>(pitch(x), yaw(x), roll(x));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T roll
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q)
{
return T(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T pitch
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q)
{
return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T yaw
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q)
{
return asin(T(-2) * (q.x * q.z - q.w * q.y));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> mat3_cast
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tmat3x3<T, P> mat3_cast(tquat<T, P> const & q)
{
tmat3x3<T, P> Result(T(1));
T qxx(q.x * q.x);
@ -693,19 +555,13 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> mat4_cast
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER tmat4x4<T, P> mat4_cast(tquat<T, P> const & q)
{
return tmat4x4<T, P>(mat3_cast(q));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast
(
tmat3x3<T, P> const & m
)
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat3x3<T, P> const & m)
{
T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
@ -769,28 +625,19 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast
(
tmat4x4<T, P> const & m4
)
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat4x4<T, P> const & m4)
{
return quat_cast(tmat3x3<T, P>(m4));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T angle
(
tquat<T, P> const & x
)
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x)
{
return acos(x.w) * T(2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> axis
(
tquat<T, P> const & x
)
GLM_FUNC_QUALIFIER tvec3<T, P> axis(tquat<T, P> const & x)
{
T tmp1 = static_cast<T>(1) - x.w * x.w;
if(tmp1 <= static_cast<T>(0))
@ -800,11 +647,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis
(
T const & angle,
tvec3<T, P> const & v
)
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & v)
{
tquat<T, P> Result(uninitialize);
@ -819,11 +662,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThan
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -832,11 +671,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThanEqual
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -845,11 +680,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThan
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -858,11 +689,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThanEqual
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -871,11 +698,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> equal
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -884,11 +707,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> notEqual
(
tquat<T, P> const & x,
tquat<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)