|
|
|
@ -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]); |
|
|
|
|
} |
|
|
|
|