diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index b829bf3d..cbcf7c0e 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -152,7 +152,7 @@ namespace detail ( X1 const & x1, Y1 const & y1, X2 const & x2, Y2 const & y2 - ) + ) { this->value[0] = col_type(value_type(x1), value_type(y1)); this->value[1] = col_type(value_type(x2), value_type(y2)); @@ -164,7 +164,7 @@ namespace detail ( tvec2 const & v1, tvec2 const & v2 - ) + ) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -415,7 +415,7 @@ namespace detail ////////////////////////////////////////////////////////////// // Binary operators - template + template GLM_FUNC_QUALIFIER tmat2x2 operator+ ( tmat2x2 const & m, @@ -427,7 +427,7 @@ namespace detail m[1] + s); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator+ ( typename tmat2x2::value_type const & s, @@ -439,7 +439,7 @@ namespace detail m[1] + s); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator+ ( tmat2x2 const & m1, @@ -451,7 +451,7 @@ namespace detail m1[1] + m2[1]); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator- ( tmat2x2 const & m, @@ -463,7 +463,7 @@ namespace detail m[1] - s); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator- ( typename tmat2x2::value_type const & s, @@ -475,7 +475,7 @@ namespace detail s - m[1]); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator- ( tmat2x2 const & m1, @@ -487,7 +487,7 @@ namespace detail m1[1] - m2[1]); } - template + template GLM_FUNC_QUALIFIER tmat2x2 operator* ( tmat2x2 const & m, @@ -499,11 +499,7 @@ namespace detail m[1] * s); } - // X - // X - // X X - // X X - template + template GLM_FUNC_QUALIFIER tmat2x2 operator* ( typename tmat2x2::value_type const & s, @@ -515,8 +511,8 @@ namespace detail m[1] * s); } - template - GLM_FUNC_QUALIFIER typename tmat2x2::col_type operator* + template + GLM_FUNC_QUALIFIER typename tmat2x2::col_type operator* ( tmat2x2 const & m, typename tmat2x2::row_type const & v @@ -527,11 +523,8 @@ namespace detail m[0][1] * v.x + m[1][1] * v.y); } - // X X - // X X - // X X - template - GLM_FUNC_QUALIFIER typename tmat2x2::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat2x2::row_type operator* ( typename tmat2x2::col_type const & v, tmat2x2 const & m @@ -543,9 +536,9 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat2x2 operator* + GLM_FUNC_QUALIFIER tmat2x2 operator* ( - tmat2x2 const & m1, + tmat2x2 const & m1, tmat2x2 const & m2 ) { @@ -557,7 +550,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat3x2 operator* + GLM_FUNC_QUALIFIER tmat3x2 operator* ( tmat2x2 const & m1, tmat3x2 const & m2 @@ -573,7 +566,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tmat4x2 operator* + GLM_FUNC_QUALIFIER tmat4x2 operator* ( tmat2x2 const & m1, tmat4x2 const & m2 diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 96a82f17..345670de 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::size_type tmat2x3::length() const - { - return 2; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::size_type tmat2x3::length() const + { + return 2; + } template GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::col_size() @@ -72,64 +72,64 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3() - { - this->value[0] = col_type(T(1), T(0), T(0)); - this->value[1] = col_type(T(0), T(1), T(0)); - } + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3() + { + this->value[0] = col_type(T(1), T(0), T(0)); + this->value[1] = col_type(T(0), T(1), T(0)); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat2x3 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( value_type 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, T(0), T(0)); + this->value[1] = col_type(T(0), s, T(0)); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 - ( - value_type const & x0, value_type const & y0, value_type const & z0, - value_type const & x1, value_type const & y1, value_type const & z1 - ) - { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - } + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + ( + value_type const & x0, value_type const & y0, value_type const & z0, + value_type const & x1, value_type const & y1, value_type const & z1 + ) + { + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 - ( - col_type const & v0, - col_type const & v1 - ) - { - this->value[0] = v0; - this->value[1] = v1; - } + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + ( + col_type const & v0, + col_type const & v1 + ) + { + this->value[0] = v0; + this->value[1] = v1; + } ////////////////////////////////////// // Convertion constructors @@ -141,8 +141,8 @@ namespace detail ) { value_type const Zero(0); - this->value[0] = tvec3(value_type(s), Zero, Zero); - this->value[1] = tvec3(Zero, value_type(s), Zero); + this->value[0] = tvec3(value_type(s), Zero, Zero); + this->value[1] = tvec3(Zero, value_type(s), Zero); } template @@ -155,8 +155,8 @@ namespace detail X2 const & x2, Y2 const & y2, Z2 const & z2 ) { - this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2)); + this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1)); + this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2)); } template @@ -167,325 +167,325 @@ namespace detail tvec3 const & v2 ) { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); } ////////////////////////////////////// - // Matrix conversions + // Matrix conversions - template - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat2x3 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat2x2 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat3x3 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat4x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat2x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat3x2 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat3x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat4x2 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3 ( tmat4x3 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + } - ////////////////////////////////////////////////////////////// - // Unary updatable operators + ////////////////////////////////////////////////////////////// + // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator= + template + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator= ( tmat2x3 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator= + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator= ( tmat2x3 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator+= + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator+= + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator+= ( tmat2x3 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-= + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-= + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-= ( tmat2x3 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator*= + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator*= + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator*= ( tmat2x3 const & m ) - { - return (*this = tmat2x3(*this * m)); - } + { + return (*this = tmat2x3(*this * m)); + } - template + template template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator/= + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++ () - { - ++this->value[0]; - ++this->value[1]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++ () + { + ++this->value[0]; + ++this->value[1]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator-- () - { - --this->value[0]; - --this->value[1]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Binary operators + template + GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator-- () + { + --this->value[0]; + --this->value[1]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator+ + ////////////////////////////////////////////////////////////// + // Binary operators + + template + GLM_FUNC_QUALIFIER tmat2x3 operator+ ( tmat2x3 const & m, typename tmat2x3::value_type const & s ) - { - return tmat2x3( - m[0] + s, - m[1] + s); - } + { + return tmat2x3( + m[0] + s, + m[1] + s); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator+ + template + GLM_FUNC_QUALIFIER tmat2x3 operator+ ( tmat2x3 const & m1, tmat2x3 const & m2 ) - { - return tmat2x3( - m1[0] + m2[0], - m1[1] + m2[1]); - } + { + return tmat2x3( + m1[0] + m2[0], + m1[1] + m2[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator- + template + GLM_FUNC_QUALIFIER tmat2x3 operator- ( tmat2x3 const & m, typename tmat2x3::value_type const & s ) - { - return tmat2x3( - m[0] - s, - m[1] - s); - } + { + return tmat2x3( + m[0] - s, + m[1] - s); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator- + template + GLM_FUNC_QUALIFIER tmat2x3 operator- ( tmat2x3 const & m1, tmat2x3 const & m2 ) - { - return tmat2x3( - m1[0] - m2[0], - m1[1] - m2[1]); - } + { + return tmat2x3( + m1[0] - m2[0], + m1[1] - m2[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator* + template + GLM_FUNC_QUALIFIER tmat2x3 operator* ( tmat2x3 const & m, typename tmat2x3::value_type const & s ) - { - return tmat2x3( - m[0] * s, - m[1] * s); - } + { + return tmat2x3( + m[0] * s, + m[1] * s); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator* + template + GLM_FUNC_QUALIFIER tmat2x3 operator* ( typename tmat2x3::value_type const & s, tmat2x3 const & m ) - { - return tmat2x3( - m[0] * s, - m[1] * s); - } + { + return tmat2x3( + m[0] * s, + m[1] * s); + } - template - GLM_FUNC_QUALIFIER typename tmat2x3::col_type operator* + template + GLM_FUNC_QUALIFIER typename tmat2x3::col_type operator* ( tmat2x3 const & m, typename tmat2x3::row_type const & v) - { - return typename tmat2x3::col_type( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y); - } + { + return typename tmat2x3::col_type( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y); + } - template - GLM_FUNC_QUALIFIER typename tmat2x3::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat2x3::row_type operator* ( typename tmat2x3::col_type const & v, tmat2x3 const & m) - { - return typename tmat2x3::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); - } + { + return typename tmat2x3::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); + } template GLM_FUNC_QUALIFIER tmat2x3 operator* @@ -503,13 +503,13 @@ namespace detail m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); } - template - GLM_FUNC_QUALIFIER tmat3x3 operator* + template + GLM_FUNC_QUALIFIER tmat3x3 operator* ( tmat2x3 const & m1, tmat3x2 const & m2 ) - { + { typename tmat2x3::value_type SrcA00 = m1[0][0]; typename tmat2x3::value_type SrcA01 = m1[0][1]; typename tmat2x3::value_type SrcA02 = m1[0][2]; @@ -535,7 +535,7 @@ namespace detail Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; return Result; - } + } template GLM_FUNC_QUALIFIER tmat4x3 operator* @@ -559,65 +559,65 @@ namespace detail m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); } - template - GLM_FUNC_QUALIFIER tmat2x3 operator/ + template + GLM_FUNC_QUALIFIER tmat2x3 operator/ ( tmat2x3 const & m, typename tmat2x3::value_type const & s ) - { - return tmat2x3( - m[0] / s, - m[1] / s); - } + { + return tmat2x3( + m[0] / s, + m[1] / s); + } - template - GLM_FUNC_QUALIFIER tmat2x3 operator/ + template + GLM_FUNC_QUALIFIER tmat2x3 operator/ ( typename tmat2x3::value_type const & s, tmat2x3 const & m ) - { - return tmat2x3( - s / m[0], - s / m[1]); - } + { + return tmat2x3( + s / m[0], + s / m[1]); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat2x3 const operator- + template + GLM_FUNC_QUALIFIER tmat2x3 const operator- ( tmat2x3 const & m ) - { - return tmat2x3( - -m[0], - -m[1]); - } + { + return tmat2x3( + -m[0], + -m[1]); + } - template - GLM_FUNC_QUALIFIER tmat2x3 const operator++ + template + GLM_FUNC_QUALIFIER tmat2x3 const operator++ ( tmat2x3 const & m, int ) - { - return tmat2x3( - m[0] + typename tmat2x3::value_type(1), - m[1] + typename tmat2x3::value_type(1)); - } + { + return tmat2x3( + m[0] + typename tmat2x3::value_type(1), + m[1] + typename tmat2x3::value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat2x3 const operator-- + template + GLM_FUNC_QUALIFIER tmat2x3 const operator-- ( tmat2x3 const & m, int ) - { - return tmat2x3( - m[0] - typename tmat2x3::value_type(1), - m[1] - typename tmat2x3::value_type(1)); - } + { + return tmat2x3( + m[0] - typename tmat2x3::value_type(1), + m[1] - typename tmat2x3::value_type(1)); + } ////////////////////////////////////// // Boolean operators @@ -641,6 +641,5 @@ namespace detail { return (m1[0] != m2[0]) || (m1[1] != m2[1]); } - } //namespace detail } //namespace glm diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index 3755d3df..f4096323 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -176,7 +176,7 @@ namespace detail ////////////////////////////////////// // Matrix conversions - + template template GLM_FUNC_QUALIFIER tmat2x4::tmat2x4 @@ -660,6 +660,5 @@ namespace detail { return (m1[0] != m2[0]) || (m1[1] != m2[1]); } - } //namespace detail } //namespace glm diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 117a82f2..2184c1f2 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -48,8 +48,8 @@ namespace detail template struct tmat4x3; template struct tmat4x4; - // \brief Template for 3 columns and 2 rows matrix of floating-point numbers. - // \ingroup core_template + /// @brief Template for 3 columns and 2 rows matrix of floating-point numbers. + /// @ingroup core_template template struct tmat3x2 { @@ -92,25 +92,25 @@ namespace detail // Conversions template GLM_FUNC_DECL explicit tmat3x2( - U const & x); + U const & x); template - < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3 - > + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3 + > GLM_FUNC_DECL explicit tmat3x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3); + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3); template GLM_FUNC_DECL explicit tmat3x2( - tvec2 const & v1, - tvec2 const & v2, - tvec2 const & v3); - + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3); + // Matrix conversions template GLM_FUNC_DECL explicit tmat3x2(tmat3x2 const & m); @@ -231,7 +231,6 @@ namespace detail tmat3x2 const operator++ ( tmat3x2 const & m, int); - } //namespace detail /// @addtogroup core_precision @@ -243,14 +242,14 @@ namespace detail /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tmat3x2 lowp_mat3x2; - + /// 3 columns of 2 components matrix of medium precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tmat3x2 mediump_mat3x2; - + /// 3 columns of 2 components matrix of high precision floating-point numbers. /// There is no guarantee on the actual precision. /// diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index 33a90e81..36136217 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::size_type tmat3x2::length() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::size_type tmat3x2::length() const + { + return 3; + } template GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::col_size() @@ -72,71 +72,71 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2() - { - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); - } + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2() + { + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat3x2 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; this->value[2] = m.value[2]; - } + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( value_type const & s ) - { - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); - } + { + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 - ( - value_type const & x0, value_type const & y0, - value_type const & x1, value_type const & y1, - value_type const & x2, value_type const & y2 - ) - { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - } + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + ( + value_type const & x0, value_type const & y0, + value_type const & x1, value_type const & y1, + value_type const & x2, value_type const & y2 + ) + { + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + ( + col_type const & v0, + col_type const & v1, + col_type const & v2 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + } ////////////////////////////////////// // Convertion constructors @@ -148,9 +148,9 @@ namespace detail ) { value_type const Zero(0); - this->value[0] = tvec2(value_type(s), Zero); - this->value[1] = tvec2(Zero, value_type(s)); - this->value[2] = tvec2(Zero); + this->value[0] = tvec2(value_type(s), Zero); + this->value[1] = tvec2(Zero, value_type(s)); + this->value[2] = tvec2(Zero); } template @@ -165,9 +165,9 @@ namespace detail X3 const & x3, Y3 const & y3 ) { - this->value[0] = col_type(value_type(x1), value_type(y1)); - this->value[1] = col_type(value_type(x2), value_type(y2)); - this->value[2] = col_type(value_type(x3), value_type(y3)); + this->value[0] = col_type(value_type(x1), value_type(y1)); + this->value[1] = col_type(value_type(x2), value_type(y2)); + this->value[2] = col_type(value_type(x3), value_type(y3)); } template @@ -179,380 +179,380 @@ namespace detail tvec2 const & v3 ) { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); } - ////////////////////////////////////////////////////////////// - // mat3x2 matrix conversions + ////////////////////////////////////////////////////////////// + // mat3x2 matrix conversions - template - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat3x2 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat2x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(T(0)); - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat3x3 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat4x4 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat2x3 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat2x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat3x4 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat4x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2 ( tmat4x3 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + } - ////////////////////////////////////////////////////////////// - // Unary updatable operators + ////////////////////////////////////////////////////////////// + // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator= + template + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator= ( tmat3x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator= ( tmat3x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator+= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator+= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator+= ( tmat3x2 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-= ( tmat3x2 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator*= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator*= + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator*= ( tmat3x2 const & m ) - { - return (*this = tmat3x2(*this * m)); - } + { + return (*this = tmat3x2(*this * m)); + } - template + template template - GLM_FUNC_QUALIFIER tmat3x2 & tmat3x2::operator/= + GLM_FUNC_QUALIFIER tmat3x2 & tmat3x2::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } - ////////////////////////////////////////////////////////////// - // Binary operators + ////////////////////////////////////////////////////////////// + // Binary operators - template - GLM_FUNC_QUALIFIER tmat3x2 operator+ + template + GLM_FUNC_QUALIFIER tmat3x2 operator+ ( tmat3x2 const & m, typename tmat3x2::value_type const & s ) - { - return tmat3x2( - m[0] + s, - m[1] + s, - m[2] + s); - } + { + return tmat3x2( + m[0] + s, + m[1] + s, + m[2] + s); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator+ + template + GLM_FUNC_QUALIFIER tmat3x2 operator+ ( tmat3x2 const & m1, tmat3x2 const & m2 ) - { - return tmat3x2( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } + { + return tmat3x2( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator- + template + GLM_FUNC_QUALIFIER tmat3x2 operator- ( tmat3x2 const & m, typename tmat3x2::value_type const & s ) - { - return tmat3x2( - m[0] - s, - m[1] - s, - m[2] - s); - } + { + return tmat3x2( + m[0] - s, + m[1] - s, + m[2] - s); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator- + template + GLM_FUNC_QUALIFIER tmat3x2 operator- ( tmat3x2 const & m1, tmat3x2 const & m2 ) - { - return tmat3x2( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } + { + return tmat3x2( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator* + template + GLM_FUNC_QUALIFIER tmat3x2 operator* ( tmat3x2 const & m, typename tmat3x2::value_type const & s ) - { - return tmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); - } + { + return tmat3x2( + m[0] * s, + m[1] * s, + m[2] * s); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator* + template + GLM_FUNC_QUALIFIER tmat3x2 operator* ( typename tmat3x2::value_type const & s, tmat3x2 const & m ) - { - return tmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); - } + { + return tmat3x2( + m[0] * s, + m[1] * s, + m[2] * s); + } - template - GLM_FUNC_QUALIFIER typename tmat3x2::col_type operator* + template + GLM_FUNC_QUALIFIER typename tmat3x2::col_type operator* ( tmat3x2 const & m, typename tmat3x2::row_type const & v) - { - return typename tmat3x2::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); - } + { + return typename tmat3x2::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); + } - template - GLM_FUNC_QUALIFIER typename tmat3x2::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat3x2::row_type operator* ( typename tmat3x2::col_type const & v, tmat3x2 const & m) - { - return typename tmat3x2::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1]); - } + { + return typename tmat3x2::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1]); + } - template - GLM_FUNC_QUALIFIER tmat2x2 operator* + template + GLM_FUNC_QUALIFIER tmat2x2 operator* ( tmat3x2 const & m1, tmat2x3 const & m2 ) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; - tmat2x2 Result(tmat2x2::null); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - return Result; - } + tmat2x2 Result(tmat2x2::null); + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + return Result; + } template GLM_FUNC_QUALIFIER tmat3x2 operator* @@ -588,72 +588,72 @@ namespace detail m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); } - template - GLM_FUNC_QUALIFIER tmat3x2 operator/ + template + GLM_FUNC_QUALIFIER tmat3x2 operator/ ( tmat3x2 const & m, typename tmat3x2::value_type const & s ) - { - return tmat3x2( - m[0] / s, - m[1] / s, - m[2] / s); - } + { + return tmat3x2( + m[0] / s, + m[1] / s, + m[2] / s); + } - template - GLM_FUNC_QUALIFIER tmat3x2 operator/ + template + GLM_FUNC_QUALIFIER tmat3x2 operator/ ( typename tmat3x2::value_type const & s, tmat3x2 const & m ) - { - return tmat3x2( - s / m[0], - s / m[1], - s / m[2]); - } + { + return tmat3x2( + s / m[0], + s / m[1], + s / m[2]); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat3x2 const operator- + template + GLM_FUNC_QUALIFIER tmat3x2 const operator- ( tmat3x2 const & m ) - { - return tmat3x2( - -m[0], - -m[1], - -m[2]); - } + { + return tmat3x2( + -m[0], + -m[1], + -m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x2 const operator++ + template + GLM_FUNC_QUALIFIER tmat3x2 const operator++ ( tmat3x2 const & m, int ) - { + { typename tmat3x2::value_type One(1); - return tmat3x2( - m[0] + One, - m[1] + One, - m[2] + One); - } + return tmat3x2( + m[0] + One, + m[1] + One, + m[2] + One); + } - template - GLM_FUNC_QUALIFIER tmat3x2 const operator-- + template + GLM_FUNC_QUALIFIER tmat3x2 const operator-- ( tmat3x2 const & m, int ) - { + { typename tmat3x2::value_type One(1); - return tmat3x2( - m[0] - One, - m[1] - One, - m[2] - One); - } + return tmat3x2( + m[0] - One, + m[1] - One, + m[2] - One); + } ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index 2ae56b3a..92437df6 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -48,8 +48,8 @@ namespace detail template struct tmat4x3; template struct tmat4x4; - // @brief Template for 3 * 3 matrix of floating-point numbers. - // @ingroup core_template + /// @brief Template for 3 * 3 matrix of floating-point numbers. + /// @ingroup core_template template struct tmat3x3 { @@ -68,9 +68,9 @@ namespace detail public: /// Implementation detail - /// @cond DETAIL + /// @cond DETAIL GLM_FUNC_DECL tmat3x3 _inverse() const; - /// @endcond + /// @endcond private: // Data @@ -98,24 +98,24 @@ namespace detail // Conversions template GLM_FUNC_DECL explicit tmat3x3( - U const & x); + U const & x); template - < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3 - > + < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3 + > GLM_FUNC_DECL explicit tmat3x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3); + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3); template GLM_FUNC_DECL explicit tmat3x3( - tvec3 const & v1, - tvec3 const & v2, - tvec3 const & v3); + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3); // Matrix conversions template @@ -263,7 +263,6 @@ namespace detail tmat3x3 const operator++ ( tmat3x3 const & m, int); - } //namespace detail /// @addtogroup core_precision diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index 84fc9452..f1db54b8 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -166,7 +166,7 @@ namespace detail X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2, X3 const & x3, Y3 const & y3, Z3 const & z3 - ) + ) { this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1)); this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2)); @@ -180,7 +180,7 @@ namespace detail tvec3 const & v1, tvec3 const & v2, tvec3 const & v3 - ) + ) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index 29e446cc..82721d5a 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::size_type tmat3x4::length() const - { - return 3; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::size_type tmat3x4::length() const + { + return 3; + } template GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::col_size() @@ -72,72 +72,72 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4() - { - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - } + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4() + { + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat3x4 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( value_type 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[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); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 - ( + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + ( value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, - value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, - value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2 - ) - { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - } + value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, + value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2 + ) + { + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + ( + col_type const & v0, + col_type const & v1, + col_type const & v2 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + } ////////////////////////////////////// // Convertion constructors @@ -149,9 +149,9 @@ namespace detail ) { value_type const Zero(0); - this->value[0] = tvec4(value_type(s), Zero, Zero, Zero); - this->value[1] = tvec4(Zero, value_type(s), Zero, Zero); - this->value[2] = tvec4(Zero, Zero, value_type(s), Zero); + this->value[0] = tvec4(value_type(s), Zero, Zero, Zero); + this->value[1] = tvec4(Zero, value_type(s), Zero, Zero); + this->value[2] = tvec4(Zero, Zero, value_type(s), Zero); } template @@ -164,11 +164,11 @@ namespace detail X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3 - ) + ) { - this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3), value_type(w3)); + this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1), value_type(w1)); + this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2), value_type(w2)); + this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3), value_type(w3)); } template @@ -178,413 +178,408 @@ namespace detail tvec4 const & v1, tvec4 const & v2, tvec4 const & v3 - ) + ) { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); } - // Conversion - template - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + // Conversion + template + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat3x4 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat2x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(0)); - this->value[1] = col_type(m[1], detail::tvec2(0)); - this->value[2] = col_type(T(0), T(0), T(1), T(0)); - } + { + this->value[0] = col_type(m[0], detail::tvec2(0)); + this->value[1] = col_type(m[1], detail::tvec2(0)); + this->value[2] = col_type(T(0), T(0), T(1), T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat3x3 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + this->value[2] = col_type(m[2], T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat4x4 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[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat2x3 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + this->value[2] = col_type(T(0), T(0), T(1), T(0)); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat3x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(0)); - this->value[1] = col_type(m[1], detail::tvec2(0)); - this->value[2] = col_type(m[2], T(0), T(1)); - } + { + this->value[0] = col_type(m[0], detail::tvec2(0)); + this->value[1] = col_type(m[1], detail::tvec2(0)); + this->value[2] = col_type(m[2], T(0), T(1)); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat2x4 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[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)); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat4x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(T(0))); - this->value[1] = col_type(m[1], detail::tvec2(T(0))); - this->value[2] = col_type(m[2], detail::tvec2(T(1), T(0))); - } + { + this->value[0] = col_type(m[0], detail::tvec2(T(0))); + this->value[1] = col_type(m[1], detail::tvec2(T(0))); + this->value[2] = col_type(m[2], detail::tvec2(T(1), T(0))); + } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4 ( tmat4x3 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], T(0)); + this->value[1] = col_type(m[1], T(0)); + this->value[2] = col_type(m[2], T(0)); + } - ////////////////////////////////////////////////////////////// - // Unary updatable operators + ////////////////////////////////////////////////////////////// + // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator= + template + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator= ( tmat3x4 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator= ( tmat3x4 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator+= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator+= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator+= ( tmat3x4 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-= ( tmat3x4 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator*= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator*= + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator*= ( tmat3x4 const & m ) - { - return (*this = tmat3x4(*this * m)); - } + { + return (*this = tmat3x4(*this * m)); + } - template + template template - GLM_FUNC_QUALIFIER tmat3x4 & tmat3x4::operator/= + GLM_FUNC_QUALIFIER tmat3x4 & tmat3x4::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } - ////////////////////////////////////////////////////////////// - // Binary operators + ////////////////////////////////////////////////////////////// + // Binary operators - template - GLM_FUNC_QUALIFIER tmat3x4 operator+ + template + GLM_FUNC_QUALIFIER tmat3x4 operator+ ( tmat3x4 const & m, typename tmat3x4::value_type const & s ) - { - return tmat3x4( - m[0] + s, - m[1] + s, - m[2] + s); - } + { + return tmat3x4( + m[0] + s, + m[1] + s, + m[2] + s); + } - template - GLM_FUNC_QUALIFIER tmat3x4 operator+ + template + GLM_FUNC_QUALIFIER tmat3x4 operator+ ( tmat3x4 const & m1, tmat3x4 const & m2 ) - { - return tmat3x4( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } + { + return tmat3x4( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } - template + template GLM_FUNC_QUALIFIER tmat3x4 operator- ( tmat3x4 const & m, typename tmat3x4::value_type const & s ) - { - return tmat3x4( - m[0] - s, - m[1] - s, - m[2] - s); - } + { + return tmat3x4( + m[0] - s, + m[1] - s, + m[2] - s); + } - template - GLM_FUNC_QUALIFIER tmat3x4 operator- + template + GLM_FUNC_QUALIFIER tmat3x4 operator- ( tmat3x4 const & m1, tmat3x4 const & m2 ) - { - return tmat3x4( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } + { + return tmat3x4( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x4 operator* + template + GLM_FUNC_QUALIFIER tmat3x4 operator* ( tmat3x4 const & m, typename tmat3x4::value_type const & s ) - { - return tmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); - } + { + return tmat3x4( + m[0] * s, + m[1] * s, + m[2] * s); + } - template - GLM_FUNC_QUALIFIER tmat3x4 operator* + template + GLM_FUNC_QUALIFIER tmat3x4 operator* ( typename tmat3x4::value_type const & s, tmat3x4 const & m ) - { - return tmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - GLM_FUNC_QUALIFIER typename tmat3x4::col_type operator* + { + return tmat3x4( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + GLM_FUNC_QUALIFIER typename tmat3x4::col_type operator* ( tmat3x4 const & m, typename tmat3x4::row_type const & v ) - { - return typename tmat3x4::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); - } + { + return typename tmat3x4::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); + } - // X X X - // X X X - // X X X - // X X X - // X X X X - template - GLM_FUNC_QUALIFIER typename tmat3x4::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat3x4::row_type operator* ( typename tmat3x4::col_type const & v, tmat3x4 const & m ) - { + { return typename tmat3x4::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); - } + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator* + template + GLM_FUNC_QUALIFIER tmat4x4 operator* ( tmat3x4 const & m1, tmat4x3 const & m2 ) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA03 = m1[0][3]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA13 = m1[1][3]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + const T SrcA23 = m1[2][3]; - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + const T SrcB32 = m2[3][2]; - tmat4x4 Result(tmat4x4::null); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; - return Result; - } + tmat4x4 Result(tmat4x4::null); + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; + return Result; + } template GLM_FUNC_QUALIFIER tmat2x4 operator* @@ -626,69 +621,69 @@ namespace detail m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); } - template - GLM_FUNC_QUALIFIER tmat3x4 operator/ + template + GLM_FUNC_QUALIFIER tmat3x4 operator/ ( tmat3x4 const & m, typename tmat3x4::value_type const & s ) - { - return tmat3x4( - m[0] / s, - m[1] / s, - m[2] / s); - } + { + return tmat3x4( + m[0] / s, + m[1] / s, + m[2] / s); + } - template - GLM_FUNC_QUALIFIER tmat3x4 operator/ + template + GLM_FUNC_QUALIFIER tmat3x4 operator/ ( typename tmat3x4::value_type const & s, tmat3x4 const & m ) - { - return tmat3x4( - s / m[0], - s / m[1], - s / m[2]); - } + { + return tmat3x4( + s / m[0], + s / m[1], + s / m[2]); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat3x4 const operator- + template + GLM_FUNC_QUALIFIER tmat3x4 const operator- ( tmat3x4 const & m ) - { - return tmat3x4( - -m[0], - -m[1], - -m[2]); - } + { + return tmat3x4( + -m[0], + -m[1], + -m[2]); + } - template - GLM_FUNC_QUALIFIER tmat3x4 const operator++ + template + GLM_FUNC_QUALIFIER tmat3x4 const operator++ ( tmat3x4 const & m, int ) - { - return tmat3x4( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1)); - } + { + return tmat3x4( + m[0] + T(1), + m[1] + T(1), + m[2] + T(1)); + } - template - GLM_FUNC_QUALIFIER tmat3x4 const operator-- + template + GLM_FUNC_QUALIFIER tmat3x4 const operator-- ( tmat3x4 const & m, int ) - { - return tmat3x4( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1)); + { + return tmat3x4( + m[0] - T(1), + m[1] - T(1), + m[2] - T(1)); } ////////////////////////////////////// @@ -713,6 +708,5 @@ namespace detail { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); } - } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index 1f131254..3326c9ab 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -89,32 +89,32 @@ namespace detail col_type const & v1, col_type const & v2, col_type const & v3); - + ////////////////////////////////////// // Conversions template GLM_FUNC_DECL explicit tmat4x2( - U const & x); + U const & x); template - < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4 - > + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3, + typename X4, typename Y4 + > GLM_FUNC_DECL explicit tmat4x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4); + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3, + X4 const & x4, Y4 const & y4); template GLM_FUNC_DECL explicit tmat4x2( - tvec2 const & v1, - tvec2 const & v2, - tvec2 const & v3, - tvec2 const & v4); + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3, + tvec2 const & v4); // Matrix conversions template @@ -161,12 +161,12 @@ namespace detail tmat4x2 operator+ ( tmat4x2 const & m, typename tmat4x2::value_type const & s); - + template tmat4x2 operator+ ( tmat4x2 const & m1, tmat4x2 const & m2); - + template tmat4x2 operator- ( tmat4x2 const & m, @@ -236,7 +236,6 @@ namespace detail tmat4x2 const operator++ ( tmat4x2 const & m, int); - } //namespace detail /// @addtogroup core_precision diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index f522ae8c..5ee0272d 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::size_type tmat4x2::length() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::size_type tmat4x2::length() const + { + return 4; + } template GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::col_size() @@ -72,81 +72,81 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2() - { + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2() + { value_type const Zero(0); value_type const One(1); - this->value[0] = col_type(One, Zero); - this->value[1] = col_type(Zero, One); - this->value[2] = col_type(Zero, Zero); - this->value[3] = col_type(Zero, Zero); - } + this->value[0] = col_type(One, Zero); + this->value[1] = col_type(Zero, One); + this->value[2] = col_type(Zero, Zero); + this->value[3] = col_type(Zero, Zero); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat4x2 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + this->value[3] = m.value[3]; + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( value_type const & s ) - { + { value_type const Zero(0); - this->value[0] = col_type(s, Zero); - this->value[1] = col_type(Zero, s); - this->value[2] = col_type(Zero, Zero); - this->value[3] = col_type(Zero, Zero); - } + this->value[0] = col_type(s, Zero); + this->value[1] = col_type(Zero, s); + this->value[2] = col_type(Zero, Zero); + this->value[3] = col_type(Zero, Zero); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 - ( - value_type const & x0, value_type const & y0, - value_type const & x1, value_type const & y1, - value_type const & x2, value_type const & y2, - value_type const & x3, value_type const & y3 - ) - { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); - } + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + ( + value_type const & x0, value_type const & y0, + value_type const & x1, value_type const & y1, + value_type const & x2, value_type const & y2, + value_type const & x3, value_type const & y3 + ) + { + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + ( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } ////////////////////////////////////// // Convertion constructors @@ -158,10 +158,10 @@ namespace detail ) { value_type const Zero(0); - this->value[0] = tvec2(value_type(s), Zero); - this->value[1] = tvec2(Zero, value_type(s)); - this->value[2] = tvec2(Zero, Zero); - this->value[3] = tvec2(Zero, Zero); + this->value[0] = tvec2(value_type(s), Zero); + this->value[1] = tvec2(Zero, value_type(s)); + this->value[2] = tvec2(Zero, Zero); + this->value[3] = tvec2(Zero, Zero); } template @@ -178,9 +178,9 @@ namespace detail X4 const & x4, Y4 const & y4 ) { - this->value[0] = col_type(value_type(x1), value_type(y1)); - this->value[1] = col_type(value_type(x2), value_type(y2)); - this->value[2] = col_type(value_type(x3), value_type(y3)); + this->value[0] = col_type(value_type(x1), value_type(y1)); + this->value[1] = col_type(value_type(x2), value_type(y2)); + this->value[2] = col_type(value_type(x3), value_type(y3)); this->value[3] = col_type(value_type(x4), value_type(y4)); } @@ -194,409 +194,409 @@ namespace detail tvec2 const & v4 ) { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); this->value[3] = col_type(v4); } - // Conversion - template - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + // Conversion + template + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat4x2 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(m[3]); + { + 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(m[3]); } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat2x2 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(value_type(0)); - this->value[3] = col_type(value_type(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(value_type(0)); + this->value[3] = col_type(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat3x3 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(value_type(0)); - } + { + 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(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat4x4 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(m[3]); - } + { + 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(m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat2x3 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(value_type(0)); - this->value[3] = col_type(value_type(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(value_type(0)); + this->value[3] = col_type(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat3x2 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(value_type(0)); - } + { + 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(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat2x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(value_type(0)); - this->value[3] = col_type(value_type(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(value_type(0)); + this->value[3] = col_type(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat4x3 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(m[3]); - } + { + 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(m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2 ( tmat3x4 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(value_type(0)); - } + { + 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(value_type(0)); + } - ////////////////////////////////////////////////////////////// - // Unary updatable operators + ////////////////////////////////////////////////////////////// + // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator= + template + GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator= ( tmat4x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator= + GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator= ( tmat4x2 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator+= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator+= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator+= ( tmat4x2 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-= ( tmat4x2 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator*= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator*= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator*= ( tmat4x2 const & m ) - { - return (*this = tmat4x2(*this * m)); - } + { + return (*this = tmat4x2(*this * m)); + } - template + template template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator/= + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } - ////////////////////////////////////////////////////////////// - // Binary operators + ////////////////////////////////////////////////////////////// + // Binary operators - template - GLM_FUNC_QUALIFIER tmat4x2 operator+ + template + GLM_FUNC_QUALIFIER tmat4x2 operator+ ( tmat4x2 const & m, typename tmat4x2::value_type const & s ) - { - return tmat4x2( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } + { + return tmat4x2( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator+ + template + GLM_FUNC_QUALIFIER tmat4x2 operator+ ( tmat4x2 const & m1, tmat4x2 const & m2 ) - { - return tmat4x2( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } + { + return tmat4x2( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator- + template + GLM_FUNC_QUALIFIER tmat4x2 operator- ( tmat4x2 const & m, typename tmat4x2::value_type const & s ) - { - return tmat4x2( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } + { + return tmat4x2( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator- + template + GLM_FUNC_QUALIFIER tmat4x2 operator- ( tmat4x2 const & m1, tmat4x2 const & m2 ) - { - return tmat4x2( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } + { + return tmat4x2( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator* + template + GLM_FUNC_QUALIFIER tmat4x2 operator* ( tmat4x2 const & m, typename tmat4x2::value_type const & s ) - { - return tmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } + { + return tmat4x2( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator* + template + GLM_FUNC_QUALIFIER tmat4x2 operator* ( typename tmat4x2::value_type const & s, tmat4x2 const & m ) - { - return tmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } + { + return tmat4x2( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } - template - GLM_FUNC_QUALIFIER typename tmat4x2::col_type operator* + template + GLM_FUNC_QUALIFIER typename tmat4x2::col_type operator* ( tmat4x2 const & m, typename tmat4x2::row_type const & v) - { - return typename tmat4x2::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } + { + return typename tmat4x2::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } - template - GLM_FUNC_QUALIFIER typename tmat4x2::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat4x2::row_type operator* ( typename tmat4x2::col_type const & v, tmat4x2 const & m) - { - return typename tmat4x2::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1], - v.x * m[3][0] + v.y * m[3][1]); - } + { + return typename tmat4x2::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1], + v.x * m[3][0] + v.y * m[3][1]); + } - template - GLM_FUNC_QUALIFIER tmat2x2 operator* + template + GLM_FUNC_QUALIFIER tmat2x2 operator* ( tmat4x2 const & m1, tmat2x4 const & m2 ) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; - tmat2x2 Result(tmat2x2::null); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - return Result; - } + tmat2x2 Result(tmat2x2::null); + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + return Result; + } template GLM_FUNC_QUALIFIER tmat3x2 operator* @@ -632,75 +632,75 @@ namespace detail m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); } - template - GLM_FUNC_QUALIFIER tmat4x2 operator/ + template + GLM_FUNC_QUALIFIER tmat4x2 operator/ ( tmat4x2 const & m, typename tmat4x2::value_type const & s ) - { - return tmat4x2( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } + { + return tmat4x2( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } - template - GLM_FUNC_QUALIFIER tmat4x2 operator/ + template + GLM_FUNC_QUALIFIER tmat4x2 operator/ ( typename tmat4x2::value_type const & s, tmat4x2 const & m ) - { - return tmat4x2( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } + { + return tmat4x2( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x2 const operator- + template + GLM_FUNC_QUALIFIER tmat4x2 const operator- ( tmat4x2 const & m ) - { - return tmat4x2( - -m[0], - -m[1], - -m[2], - -m[3]); - } + { + return tmat4x2( + -m[0], + -m[1], + -m[2], + -m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x2 const operator++ + template + GLM_FUNC_QUALIFIER tmat4x2 const operator++ ( tmat4x2 const & m, int ) - { - return tmat4x2( + { + return tmat4x2( m[0] + typename tmat4x2::value_type(1), - m[1] + typename tmat4x2::value_type(1), - m[2] + typename tmat4x2::value_type(1), - m[3] + typename tmat4x2::value_type(1)); - } + m[1] + typename tmat4x2::value_type(1), + m[2] + typename tmat4x2::value_type(1), + m[3] + typename tmat4x2::value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x2 const operator-- + template + GLM_FUNC_QUALIFIER tmat4x2 const operator-- ( tmat4x2 const & m, int ) - { - return tmat4x2( - m[0] - typename tmat4x2::value_type(1), - m[1] - typename tmat4x2::value_type(1), - m[2] - typename tmat4x2::value_type(1), - m[3] - typename tmat4x2::value_type(1)); - } + { + return tmat4x2( + m[0] - typename tmat4x2::value_type(1), + m[1] - typename tmat4x2::value_type(1), + m[2] - typename tmat4x2::value_type(1), + m[3] - typename tmat4x2::value_type(1)); + } ////////////////////////////////////// // Boolean operators @@ -724,6 +724,5 @@ namespace detail { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); } - } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index ead8cfb2..f94fe8d0 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -48,8 +48,8 @@ namespace detail template struct tmat4x3; template struct tmat4x4; - // \brief Template for 4 columns and 3 rows matrix of floating-point numbers. - // \ingroup core_template + /// @brief Template for 4 columns and 3 rows matrix of floating-point numbers. + /// @ingroup core_template template struct tmat4x3 { @@ -88,32 +88,32 @@ namespace detail col_type const & v0, col_type const & v1, col_type const & v2, - col_type const & v3); - + col_type const & v3); + ////////////////////////////////////// // Conversions template GLM_FUNC_DECL explicit tmat4x3( - U const & x); - + U const & x); + template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> GLM_FUNC_DECL explicit tmat4x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3, - X4 const & x4, Y4 const & y4, Z4 const & z4); + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3, + X4 const & x4, Y4 const & y4, Z4 const & z4); template GLM_FUNC_DECL explicit tmat4x3( - tvec3 const & v1, - tvec3 const & v2, - tvec3 const & v3, - tvec3 const & v4); - + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3, + tvec3 const & v4); + // Matrix conversions template GLM_FUNC_DECL explicit tmat4x3(tmat4x3 const & m); @@ -159,12 +159,12 @@ namespace detail tmat4x3 operator+ ( tmat4x3 const & m, typename tmat4x3::value_type const & s); - + template tmat4x3 operator+ ( tmat4x3 const & m1, tmat4x3 const & m2); - + template tmat4x3 operator- ( tmat4x3 const & m, @@ -234,7 +234,6 @@ namespace detail tmat4x3 const operator++ ( tmat4x3 const & m, int); - }//namespace detail /// @addtogroup core_precision diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index 5846bde1..f3ec6de5 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::size_type tmat4x3::length() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::size_type tmat4x3::length() const + { + return 4; + } template GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::col_size() @@ -72,81 +72,81 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3() - { + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3() + { value_type const Zero(0); value_type const One(1); - this->value[0] = col_type(One, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero); - this->value[2] = col_type(Zero, Zero, One); - this->value[3] = col_type(Zero, Zero, Zero); - } + this->value[0] = col_type(One, Zero, Zero); + this->value[1] = col_type(Zero, One, Zero); + this->value[2] = col_type(Zero, Zero, One); + this->value[3] = col_type(Zero, Zero, Zero); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat4x3 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + this->value[3] = m.value[3]; + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( value_type 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, 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); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 - ( - value_type const & x0, value_type const & y0, value_type const & z0, - value_type const & x1, value_type const & y1, value_type const & z1, - value_type const & x2, value_type const & y2, value_type const & z2, - value_type const & x3, value_type const & y3, value_type const & z3 - ) - { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); - } + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + ( + value_type const & x0, value_type const & y0, value_type const & z0, + value_type const & x1, value_type const & y1, value_type const & z1, + value_type const & x2, value_type const & y2, value_type const & z2, + value_type const & x3, value_type const & y3, value_type const & z3 + ) + { + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + ( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } ////////////////////////////////////// // Convertion constructors @@ -158,10 +158,10 @@ namespace detail ) { value_type const Zero(0); - this->value[0] = tvec3(value_type(s), Zero, Zero); - this->value[1] = tvec3(Zero, value_type(s), Zero); - this->value[2] = tvec3(Zero, Zero, value_type(s)); - this->value[3] = tvec3(Zero, Zero, Zero); + this->value[0] = tvec3(value_type(s), Zero, Zero); + this->value[1] = tvec3(Zero, value_type(s), Zero); + this->value[2] = tvec3(Zero, Zero, value_type(s)); + this->value[3] = tvec3(Zero, Zero, Zero); } template @@ -178,9 +178,9 @@ namespace detail X4 const & x4, Y4 const & y4, Z4 const & z4 ) { - this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2)); - this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3)); + this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1)); + this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2)); + this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3)); this->value[3] = col_type(value_type(x4), value_type(y4), value_type(z4)); } @@ -192,369 +192,369 @@ namespace detail tvec3 const & v2, tvec3 const & v3, tvec3 const & v4 - ) + ) { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); this->value[3] = col_type(v4); } - ////////////////////////////////////////////////////////////// - // Matrix conversions + ////////////////////////////////////////////////////////////// + // Matrix conversions - template - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat4x3 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(m[3]); + { + 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(m[3]); } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat2x2 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(value_type(0)); - } + { + 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(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat3x3 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(value_type(0)); - } + { + 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(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat4x4 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(m[3]); - } + { + 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(m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat2x3 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(value_type(0), value_type(0), value_type(1)); - this->value[3] = col_type(value_type(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(value_type(0), value_type(0), value_type(1)); + this->value[3] = col_type(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat3x2 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(value_type(0)); - } + { + 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(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat2x4 const & m ) - { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(value_type(0), value_type(0), value_type(1)); - this->value[3] = col_type(value_type(0)); - } + { + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(value_type(0), value_type(0), value_type(1)); + this->value[3] = col_type(value_type(0)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat4x2 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], 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)); + } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3 ( tmat3x4 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(value_type(0)); - } + { + 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(value_type(0)); + } - ////////////////////////////////////////////////////////////// - // Unary updatable operators + ////////////////////////////////////////////////////////////// + // Unary updatable operators template - GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator= + GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator= ( tmat4x3 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator= + GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator= ( tmat4x3 const & m ) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator+= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator+= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator+= ( tmat4x3 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-= ( tmat4x3 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator*= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator*= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator*= ( tmat4x3 const & m ) - { - return (*this = tmat4x3(*this * m)); - } + { + return (*this = tmat4x3(*this * m)); + } - template + template template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator/= + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } - ////////////////////////////////////////////////////////////// - // Binary operators + ////////////////////////////////////////////////////////////// + // Binary operators - template - GLM_FUNC_QUALIFIER tmat4x3 operator+ ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator+ ( tmat4x3 const & m, typename tmat4x3::value_type const & s) - { - return tmat4x3( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } + { + return tmat4x3( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator+ ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator+ ( tmat4x3 const & m1, tmat4x3 const & m2) - { - return tmat4x3( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } + { + return tmat4x3( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator- ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator- ( tmat4x3 const & m, typename tmat4x3::value_type const & s) - { - return tmat4x3( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } + { + return tmat4x3( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator- ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator- ( tmat4x3 const & m1, tmat4x3 const & m2) - { - return tmat4x3( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } + { + return tmat4x3( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator* ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator* ( tmat4x3 const & m, typename tmat4x3::value_type const & s) - { - return tmat4x3( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } + { + return tmat4x3( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator* ( + template + GLM_FUNC_QUALIFIER tmat4x3 operator* ( typename tmat4x3::value_type const & s, tmat4x3 const & m) - { - return tmat4x3( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - GLM_FUNC_QUALIFIER typename tmat4x3::col_type operator* + { + return tmat4x3( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER typename tmat4x3::col_type operator* ( tmat4x3 const & m, typename tmat4x3::row_type const & v) - { - return typename tmat4x3::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } + { + return typename tmat4x3::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } - template - GLM_FUNC_QUALIFIER typename tmat4x3::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat4x3::row_type operator* ( typename tmat4x3::col_type const & v, tmat4x3 const & m) - { - return typename tmat4x3::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], - v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); - } + { + return typename tmat4x3::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], + v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); + } template GLM_FUNC_QUALIFIER tmat2x3 operator* @@ -572,51 +572,51 @@ namespace detail m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); } - template - GLM_FUNC_QUALIFIER tmat3x3 operator* + template + GLM_FUNC_QUALIFIER tmat3x3 operator* ( tmat4x3 const & m1, tmat3x4 const & m2 ) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - T const SrcA32 = m1[3][2]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; + T const SrcA32 = m1[3][2]; - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - T const SrcB23 = m2[2][3]; + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; + T const SrcB23 = m2[2][3]; - tmat3x3 Result(tmat3x3::null); - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - return Result; - } + tmat3x3 Result(tmat3x3::null); + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; + return Result; + } template GLM_FUNC_QUALIFIER tmat4x3 operator* @@ -640,75 +640,75 @@ namespace detail m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); } - template - GLM_FUNC_QUALIFIER tmat4x3 operator/ + template + GLM_FUNC_QUALIFIER tmat4x3 operator/ ( tmat4x3 const & m, typename tmat4x3::value_type const & s ) - { - return tmat4x3( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } + { + return tmat4x3( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } - template - GLM_FUNC_QUALIFIER tmat4x3 operator/ + template + GLM_FUNC_QUALIFIER tmat4x3 operator/ ( typename tmat4x3::value_type const & s, tmat4x3 const & m ) - { - return tmat4x3( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } + { + return tmat4x3( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x3 const operator- + template + GLM_FUNC_QUALIFIER tmat4x3 const operator- ( tmat4x3 const & m ) - { - return tmat4x3( - -m[0], - -m[1], - -m[2], - -m[3]); - } + { + return tmat4x3( + -m[0], + -m[1], + -m[2], + -m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x3 const operator++ + template + GLM_FUNC_QUALIFIER tmat4x3 const operator++ ( tmat4x3 const & m, int ) - { - return tmat4x3( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1), - m[3] + T(1)); - } + { + return tmat4x3( + m[0] + T(1), + m[1] + T(1), + m[2] + T(1), + m[3] + T(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x3 const operator-- + template + GLM_FUNC_QUALIFIER tmat4x3 const operator-- ( tmat4x3 const & m, int ) - { - return tmat4x3( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1), - m[3] - T(1)); - } + { + return tmat4x3( + m[0] - T(1), + m[1] - T(1), + m[2] - T(1), + m[3] - T(1)); + } ////////////////////////////////////// // Boolean operators @@ -732,7 +732,6 @@ namespace detail { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); } - } //namespace detail } //namespace glm diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index 607d3d3c..03615692 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -68,9 +68,9 @@ namespace detail public: /// Implementation detail - /// @cond DETAIL + /// @cond DETAIL GLM_FUNC_DECL tmat4x4 _inverse() const; - /// @endcond + /// @endcond private: // Data @@ -100,25 +100,25 @@ namespace detail // Conversions template GLM_FUNC_DECL explicit tmat4x4( - U const & x); + U const & x); template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> GLM_FUNC_DECL explicit tmat4x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, - X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, + X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, + X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); template GLM_FUNC_DECL explicit tmat4x4( - tvec4 const & v1, - tvec4 const & v2, - tvec4 const & v3, - tvec4 const & v4); + tvec4 const & v1, + tvec4 const & v2, + tvec4 const & v3, + tvec4 const & v4); // Matrix conversions template diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index 838fb993..e796506f 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -29,11 +29,11 @@ namespace glm{ namespace detail { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::size_type tmat4x4::length() const - { - return 4; - } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::size_type tmat4x4::length() const + { + return 4; + } template GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::col_size() @@ -72,93 +72,93 @@ namespace detail return this->value[i]; } - ////////////////////////////////////////////////////////////// - // Constructors + ////////////////////////////////////////////////////////////// + // Constructors - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4() - { + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4() + { value_type Zero(0); value_type One(1); - this->value[0] = col_type(One, Zero, Zero, Zero); - this->value[1] = col_type(Zero, One, Zero, Zero); - this->value[2] = col_type(Zero, Zero, One, Zero); - this->value[3] = col_type(Zero, Zero, Zero, One); - } + this->value[0] = col_type(One, Zero, Zero, Zero); + this->value[1] = col_type(Zero, One, Zero, Zero); + this->value[2] = col_type(Zero, Zero, One, Zero); + this->value[3] = col_type(Zero, Zero, Zero, One); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat4x4 const & m ) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + this->value[3] = m.value[3]; + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( ctor ) - {} + {} - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( value_type 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, 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); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 - ( - value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, - value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, - value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2, - value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3 - ) - { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - this->value[3] = col_type(x3, y3, z3, w3); - } + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + ( + value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, + value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, + value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2, + value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3 + ) + { + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); + this->value[3] = col_type(x3, y3, z3, w3); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 - ( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + ( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } - template - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat4x4 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(m[3]); + { + 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(m[3]); } ////////////////////////////////////// @@ -173,10 +173,10 @@ namespace detail GLM_STATIC_ASSERT(detail::type::is_float || std::numeric_limits::is_integer, "*mat4x4 constructor only takes float and integer types"); value_type const Zero(0); - this->value[0] = tvec4(value_type(s), Zero, Zero, Zero); - this->value[1] = tvec4(Zero, value_type(s), Zero, Zero); - this->value[2] = tvec4(Zero, Zero, value_type(s), Zero); - this->value[3] = tvec4(Zero, Zero, Zero, value_type(s)); + this->value[0] = tvec4(value_type(s), Zero, Zero, Zero); + this->value[1] = tvec4(Zero, value_type(s), Zero, Zero); + this->value[2] = tvec4(Zero, Zero, value_type(s), Zero); + this->value[3] = tvec4(Zero, Zero, Zero, value_type(s)); } template @@ -213,9 +213,9 @@ namespace detail GLM_STATIC_ASSERT(detail::type::is_float || std::numeric_limits::is_integer, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); GLM_STATIC_ASSERT(detail::type::is_float || std::numeric_limits::is_integer, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); - this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3), value_type(w3)); + this->value[0] = col_type(value_type(x1), value_type(y1), value_type(z1), value_type(w1)); + this->value[1] = col_type(value_type(x2), value_type(y2), value_type(z2), value_type(w2)); + this->value[2] = col_type(value_type(x3), value_type(y3), value_type(z3), value_type(w3)); this->value[3] = col_type(value_type(x4), value_type(y4), value_type(z4), value_type(w4)); } @@ -234,484 +234,484 @@ namespace detail GLM_STATIC_ASSERT(detail::type::is_float || std::numeric_limits::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); GLM_STATIC_ASSERT(detail::type::is_float || std::numeric_limits::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); this->value[3] = col_type(v4); } ////////////////////////////////////// // Matrix convertion constructors - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat2x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(0)); - this->value[1] = col_type(m[1], detail::tvec2(0)); - this->value[2] = col_type(value_type(0)); - this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); - } + { + this->value[0] = col_type(m[0], detail::tvec2(0)); + this->value[1] = col_type(m[1], detail::tvec2(0)); + this->value[2] = col_type(value_type(0)); + this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat3x3 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(value_type(0), value_type(0), value_type(0), value_type(1)); - } + { + 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(value_type(0), value_type(0), value_type(0), value_type(1)); + } template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat2x3 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(value_type(0)); - this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); - } + { + 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(value_type(0)); + this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat3x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(0)); - this->value[1] = col_type(m[1], detail::tvec2(0)); - this->value[2] = col_type(m[2], detail::tvec2(0)); - this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); - } + { + this->value[0] = col_type(m[0], detail::tvec2(0)); + this->value[1] = col_type(m[1], detail::tvec2(0)); + this->value[2] = col_type(m[2], detail::tvec2(0)); + this->value[3] = col_type(value_type(0), value_type(0), value_type(0), value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat2x4 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[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)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat4x2 const & m ) - { - this->value[0] = col_type(m[0], detail::tvec2(0)); - this->value[1] = col_type(m[1], detail::tvec2(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], detail::tvec2(0)); + this->value[1] = col_type(m[1], detail::tvec2(0)); + this->value[2] = col_type(T(0)); + this->value[3] = col_type(T(0), T(0), T(0), T(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat3x4 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[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)); + } - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4 ( tmat4x3 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], 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)); + } - ////////////////////////////////////////////////////////////// - // Operators + ////////////////////////////////////////////////////////////// + // Operators - template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator= + template + GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator= ( tmat4x4 const & m ) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator= + GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator= ( tmat4x4 const & m ) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator+= + GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator+= ( U const & s ) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator+= + GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator+= ( tmat4x4 const & m ) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-= ( U const & s ) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-= ( tmat4x4 const & m ) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator*= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator*= ( U const & s ) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator*= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator*= ( tmat4x4 const & m ) - { - return (*this = *this * m); - } + { + return (*this = *this * m); + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator/= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator/= ( U const & s ) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } - template + template template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator/= + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator/= ( tmat4x4 const & m ) - { - return (*this = *this / m); - } + { + return (*this = *this / m); + } - template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } + template + GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } - template - GLM_FUNC_QUALIFIER tmat4x4 tmat4x4::_inverse() const - { - // Calculate all mat2 determinants - value_type SubFactor00 = this->value[2][2] * this->value[3][3] - this->value[3][2] * this->value[2][3]; - value_type SubFactor01 = this->value[2][1] * this->value[3][3] - this->value[3][1] * this->value[2][3]; - value_type SubFactor02 = this->value[2][1] * this->value[3][2] - this->value[3][1] * this->value[2][2]; - value_type SubFactor03 = this->value[2][0] * this->value[3][3] - this->value[3][0] * this->value[2][3]; - value_type SubFactor04 = this->value[2][0] * this->value[3][2] - this->value[3][0] * this->value[2][2]; - value_type SubFactor05 = this->value[2][0] * this->value[3][1] - this->value[3][0] * this->value[2][1]; - value_type SubFactor06 = this->value[1][2] * this->value[3][3] - this->value[3][2] * this->value[1][3]; - value_type SubFactor07 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; - value_type SubFactor08 = this->value[1][1] * this->value[3][2] - this->value[3][1] * this->value[1][2]; - value_type SubFactor09 = this->value[1][0] * this->value[3][3] - this->value[3][0] * this->value[1][3]; - value_type SubFactor10 = this->value[1][0] * this->value[3][2] - this->value[3][0] * this->value[1][2]; - value_type SubFactor11 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; - value_type SubFactor12 = this->value[1][0] * this->value[3][1] - this->value[3][0] * this->value[1][1]; - value_type SubFactor13 = this->value[1][2] * this->value[2][3] - this->value[2][2] * this->value[1][3]; - value_type SubFactor14 = this->value[1][1] * this->value[2][3] - this->value[2][1] * this->value[1][3]; - value_type SubFactor15 = this->value[1][1] * this->value[2][2] - this->value[2][1] * this->value[1][2]; - value_type SubFactor16 = this->value[1][0] * this->value[2][3] - this->value[2][0] * this->value[1][3]; - value_type SubFactor17 = this->value[1][0] * this->value[2][2] - this->value[2][0] * this->value[1][2]; - value_type SubFactor18 = this->value[1][0] * this->value[2][1] - this->value[2][0] * this->value[1][1]; + template + GLM_FUNC_QUALIFIER tmat4x4 tmat4x4::_inverse() const + { + // Calculate all mat2 determinants + value_type SubFactor00 = this->value[2][2] * this->value[3][3] - this->value[3][2] * this->value[2][3]; + value_type SubFactor01 = this->value[2][1] * this->value[3][3] - this->value[3][1] * this->value[2][3]; + value_type SubFactor02 = this->value[2][1] * this->value[3][2] - this->value[3][1] * this->value[2][2]; + value_type SubFactor03 = this->value[2][0] * this->value[3][3] - this->value[3][0] * this->value[2][3]; + value_type SubFactor04 = this->value[2][0] * this->value[3][2] - this->value[3][0] * this->value[2][2]; + value_type SubFactor05 = this->value[2][0] * this->value[3][1] - this->value[3][0] * this->value[2][1]; + value_type SubFactor06 = this->value[1][2] * this->value[3][3] - this->value[3][2] * this->value[1][3]; + value_type SubFactor07 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; + value_type SubFactor08 = this->value[1][1] * this->value[3][2] - this->value[3][1] * this->value[1][2]; + value_type SubFactor09 = this->value[1][0] * this->value[3][3] - this->value[3][0] * this->value[1][3]; + value_type SubFactor10 = this->value[1][0] * this->value[3][2] - this->value[3][0] * this->value[1][2]; + value_type SubFactor11 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; + value_type SubFactor12 = this->value[1][0] * this->value[3][1] - this->value[3][0] * this->value[1][1]; + value_type SubFactor13 = this->value[1][2] * this->value[2][3] - this->value[2][2] * this->value[1][3]; + value_type SubFactor14 = this->value[1][1] * this->value[2][3] - this->value[2][1] * this->value[1][3]; + value_type SubFactor15 = this->value[1][1] * this->value[2][2] - this->value[2][1] * this->value[1][2]; + value_type SubFactor16 = this->value[1][0] * this->value[2][3] - this->value[2][0] * this->value[1][3]; + value_type SubFactor17 = this->value[1][0] * this->value[2][2] - this->value[2][0] * this->value[1][2]; + value_type SubFactor18 = this->value[1][0] * this->value[2][1] - this->value[2][0] * this->value[1][1]; /* - tmat4x4 Inverse( - + (this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02), - - (this->value[1][0] * SubFactor00 - this->value[1][2] * SubFactor03 + this->value[1][3] * SubFactor04), - + (this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05), - - (this->value[1][0] * SubFactor02 - this->value[1][1] * SubFactor04 + this->value[1][2] * SubFactor05), + tmat4x4 Inverse( + + (this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02), + - (this->value[1][0] * SubFactor00 - this->value[1][2] * SubFactor03 + this->value[1][3] * SubFactor04), + + (this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05), + - (this->value[1][0] * SubFactor02 - this->value[1][1] * SubFactor04 + this->value[1][2] * SubFactor05), - - (this->value[0][1] * SubFactor00 - this->value[0][2] * SubFactor01 + this->value[0][3] * SubFactor02), - + (this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04), - - (this->value[0][0] * SubFactor01 - this->value[0][1] * SubFactor03 + this->value[0][3] * SubFactor05), - + (this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05), + - (this->value[0][1] * SubFactor00 - this->value[0][2] * SubFactor01 + this->value[0][3] * SubFactor02), + + (this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04), + - (this->value[0][0] * SubFactor01 - this->value[0][1] * SubFactor03 + this->value[0][3] * SubFactor05), + + (this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05), - + (this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08), - - (this->value[0][0] * SubFactor06 - this->value[0][2] * SubFactor09 + this->value[0][3] * SubFactor10), - + (this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12), - - (this->value[0][0] * SubFactor08 - this->value[0][1] * SubFactor10 + this->value[0][2] * SubFactor12), + + (this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08), + - (this->value[0][0] * SubFactor06 - this->value[0][2] * SubFactor09 + this->value[0][3] * SubFactor10), + + (this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12), + - (this->value[0][0] * SubFactor08 - this->value[0][1] * SubFactor10 + this->value[0][2] * SubFactor12), - - (this->value[0][1] * SubFactor13 - this->value[0][2] * SubFactor14 + this->value[0][3] * SubFactor15), - + (this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17), - - (this->value[0][0] * SubFactor14 - this->value[0][1] * SubFactor16 + this->value[0][3] * SubFactor18), - + (this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18)); + - (this->value[0][1] * SubFactor13 - this->value[0][2] * SubFactor14 + this->value[0][3] * SubFactor15), + + (this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17), + - (this->value[0][0] * SubFactor14 - this->value[0][1] * SubFactor16 + this->value[0][3] * SubFactor18), + + (this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18)); */ - tmat4x4 Inverse( - + this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02, - - this->value[1][0] * SubFactor00 + this->value[1][2] * SubFactor03 - this->value[1][3] * SubFactor04, - + this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05, - - this->value[1][0] * SubFactor02 + this->value[1][1] * SubFactor04 - this->value[1][2] * SubFactor05, + tmat4x4 Inverse( + + this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02, + - this->value[1][0] * SubFactor00 + this->value[1][2] * SubFactor03 - this->value[1][3] * SubFactor04, + + this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05, + - this->value[1][0] * SubFactor02 + this->value[1][1] * SubFactor04 - this->value[1][2] * SubFactor05, - - this->value[0][1] * SubFactor00 + this->value[0][2] * SubFactor01 - this->value[0][3] * SubFactor02, - + this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04, - - this->value[0][0] * SubFactor01 + this->value[0][1] * SubFactor03 - this->value[0][3] * SubFactor05, - + this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05, + - this->value[0][1] * SubFactor00 + this->value[0][2] * SubFactor01 - this->value[0][3] * SubFactor02, + + this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04, + - this->value[0][0] * SubFactor01 + this->value[0][1] * SubFactor03 - this->value[0][3] * SubFactor05, + + this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05, - + this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08, - - this->value[0][0] * SubFactor06 + this->value[0][2] * SubFactor09 - this->value[0][3] * SubFactor10, - + this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12, - - this->value[0][0] * SubFactor08 + this->value[0][1] * SubFactor10 - this->value[0][2] * SubFactor12, + + this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08, + - this->value[0][0] * SubFactor06 + this->value[0][2] * SubFactor09 - this->value[0][3] * SubFactor10, + + this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12, + - this->value[0][0] * SubFactor08 + this->value[0][1] * SubFactor10 - this->value[0][2] * SubFactor12, - - this->value[0][1] * SubFactor13 + this->value[0][2] * SubFactor14 - this->value[0][3] * SubFactor15, - + this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17, - - this->value[0][0] * SubFactor14 + this->value[0][1] * SubFactor16 - this->value[0][3] * SubFactor18, - + this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18); + - this->value[0][1] * SubFactor13 + this->value[0][2] * SubFactor14 - this->value[0][3] * SubFactor15, + + this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17, + - this->value[0][0] * SubFactor14 + this->value[0][1] * SubFactor16 - this->value[0][3] * SubFactor18, + + this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18); - value_type Determinant = + value_type Determinant = + this->value[0][0] * Inverse[0][0] + this->value[0][1] * Inverse[1][0] + this->value[0][2] * Inverse[2][0] + this->value[0][3] * Inverse[3][0]; - Inverse /= Determinant; - return Inverse; - } + Inverse /= Determinant; + return Inverse; + } // Binary operators - template - GLM_FUNC_QUALIFIER tmat4x4 operator+ + template + GLM_FUNC_QUALIFIER tmat4x4 operator+ ( tmat4x4 const & m, typename tmat4x4::value_type const & s ) - { - return tmat4x4( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } + { + return tmat4x4( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator+ + template + GLM_FUNC_QUALIFIER tmat4x4 operator+ ( typename tmat4x4::value_type const & s, tmat4x4 const & m ) - { - return tmat4x4( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } + { + return tmat4x4( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator+ + template + GLM_FUNC_QUALIFIER tmat4x4 operator+ ( tmat4x4 const & m1, tmat4x4 const & m2 ) - { - return tmat4x4( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } + { + return tmat4x4( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator- + template + GLM_FUNC_QUALIFIER tmat4x4 operator- ( tmat4x4 const & m, typename tmat4x4::value_type const & s ) - { - return tmat4x4( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } + { + return tmat4x4( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator- + template + GLM_FUNC_QUALIFIER tmat4x4 operator- ( typename tmat4x4::value_type const & s, tmat4x4 const & m ) - { - return tmat4x4( - s - m[0], - s - m[1], - s - m[2], - s - m[3]); - } + { + return tmat4x4( + s - m[0], + s - m[1], + s - m[2], + s - m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator- + template + GLM_FUNC_QUALIFIER tmat4x4 operator- ( tmat4x4 const & m1, tmat4x4 const & m2 ) - { - return tmat4x4( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } + { + return tmat4x4( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator* + template + GLM_FUNC_QUALIFIER tmat4x4 operator* ( tmat4x4 const & m, typename tmat4x4::value_type const & s ) - { - return tmat4x4( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } + { + return tmat4x4( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator* + template + GLM_FUNC_QUALIFIER tmat4x4 operator* ( typename tmat4x4::value_type const & s, tmat4x4 const & m ) - { - return tmat4x4( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } + { + return tmat4x4( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type operator* + template + GLM_FUNC_QUALIFIER typename tmat4x4::col_type operator* ( tmat4x4 const & m, typename tmat4x4::row_type const & v ) - { - return typename tmat4x4::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w); - } + { + return typename tmat4x4::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w); + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::row_type operator* + template + GLM_FUNC_QUALIFIER typename tmat4x4::row_type operator* ( typename tmat4x4::col_type const & v, tmat4x4 const & m ) - { - return typename tmat4x4::row_type( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w, - m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w); - } + { + return typename tmat4x4::row_type( + m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, + m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w, + m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w, + m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w); + } template GLM_FUNC_QUALIFIER tmat2x4 operator* @@ -753,13 +753,13 @@ namespace detail m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); } - template - GLM_FUNC_QUALIFIER tmat4x4 operator* + template + GLM_FUNC_QUALIFIER tmat4x4 operator* ( tmat4x4 const & m1, tmat4x4 const & m2 ) - { + { typename tmat4x4::col_type const SrcA0 = m1[0]; typename tmat4x4::col_type const SrcA1 = m1[1]; typename tmat4x4::col_type const SrcA2 = m1[2]; @@ -770,113 +770,113 @@ namespace detail typename tmat4x4::col_type const SrcB2 = m2[2]; typename tmat4x4::col_type const SrcB3 = m2[3]; - tmat4x4 Result(tmat4x4::null); + tmat4x4 Result(tmat4x4::null); Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; - return Result; - } + return Result; + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator/ + template + GLM_FUNC_QUALIFIER tmat4x4 operator/ ( tmat4x4 const & m, typename tmat4x4::value_type const & s ) - { - return tmat4x4( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } + { + return tmat4x4( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator/ + template + GLM_FUNC_QUALIFIER tmat4x4 operator/ ( typename tmat4x4::value_type const & s, tmat4x4 const & m ) - { - return tmat4x4( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } + { + return tmat4x4( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::col_type operator/ + template + GLM_FUNC_QUALIFIER typename tmat4x4::col_type operator/ ( tmat4x4 const & m, typename tmat4x4::row_type const & v ) - { - return m._inverse() * v; - } + { + return m._inverse() * v; + } - template - GLM_FUNC_QUALIFIER typename tmat4x4::row_type operator/ + template + GLM_FUNC_QUALIFIER typename tmat4x4::row_type operator/ ( typename tmat4x4::col_type const & v, tmat4x4 const & m ) - { - return v * m._inverse(); - } + { + return v * m._inverse(); + } - template - GLM_FUNC_QUALIFIER tmat4x4 operator/ + template + GLM_FUNC_QUALIFIER tmat4x4 operator/ ( tmat4x4 const & m1, tmat4x4 const & m2 ) - { - return m1 * m2._inverse(); - } + { + return m1 * m2._inverse(); + } // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x4 const operator- + template + GLM_FUNC_QUALIFIER tmat4x4 const operator- ( tmat4x4 const & m ) - { - return tmat4x4( - -m[0], - -m[1], - -m[2], - -m[3]); - } + { + return tmat4x4( + -m[0], + -m[1], + -m[2], + -m[3]); + } - template - GLM_FUNC_QUALIFIER tmat4x4 const operator++ + template + GLM_FUNC_QUALIFIER tmat4x4 const operator++ ( tmat4x4 const & m, int ) - { - return tmat4x4( - m[0] + typename tmat4x4::value_type(1), - m[1] + typename tmat4x4::value_type(1), - m[2] + typename tmat4x4::value_type(1), - m[3] + typename tmat4x4::value_type(1)); - } + { + return tmat4x4( + m[0] + typename tmat4x4::value_type(1), + m[1] + typename tmat4x4::value_type(1), + m[2] + typename tmat4x4::value_type(1), + m[3] + typename tmat4x4::value_type(1)); + } - template - GLM_FUNC_QUALIFIER tmat4x4 const operator-- + template + GLM_FUNC_QUALIFIER tmat4x4 const operator-- ( tmat4x4 const & m, int ) - { - return tmat4x4( - m[0] - typename tmat4x4::value_type(1), - m[1] - typename tmat4x4::value_type(1), - m[2] - typename tmat4x4::value_type(1), - m[3] - typename tmat4x4::value_type(1)); - } + { + return tmat4x4( + m[0] - typename tmat4x4::value_type(1), + m[1] - typename tmat4x4::value_type(1), + m[2] - typename tmat4x4::value_type(1), + m[3] - typename tmat4x4::value_type(1)); + } ////////////////////////////////////// // Boolean operators diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 597cba12..61a63544 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -44,8 +44,8 @@ namespace detail template struct tvec3; template struct tvec4; - // The basic 2D vector type. - // \ingroup core_template + /// The basic 2D vector type. + /// @ingroup core_template template struct tvec2 { @@ -127,11 +127,11 @@ namespace detail tvec2(tref2 const & r); - template - GLM_FUNC_DECL tvec2(const glm::detail::swizzle<2,T,tvec2,E0,E1,-1,-2>& that) - { - *this = that(); - } + template + GLM_FUNC_DECL tvec2(const glm::detail::swizzle<2,T,tvec2,E0,E1,-1,-2>& that) + { + *this = that(); + } ////////////////////////////////////// // Convertion constructors diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 1a3ef2ca..ccf0f1fd 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -1024,6 +1024,5 @@ namespace detail { return tvec2(this->x, this->y); } - }//namespace detail }//namespace glm diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 59dc49fc..94f53838 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -44,8 +44,8 @@ namespace detail template struct tvec2; template struct tvec4; - // Basic 3D vector type. - // \ingroup core_template + /// Basic 3D vector type. + /// @ingroup core_template template struct tvec3 { @@ -165,23 +165,23 @@ namespace detail template GLM_FUNC_DECL explicit tvec3(A const & s, tref2 const & v); - template - GLM_FUNC_DECL tvec3(glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & that) - { - *this = that(); - } + template + GLM_FUNC_DECL tvec3(glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & that) + { + *this = that(); + } - template - GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & s) - { - *this = tvec3(v(), s); - } + template + GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & s) + { + *this = tvec3(v(), s); + } - template - GLM_FUNC_DECL tvec3(T const & s, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v) - { - *this = tvec3(s, v()); - } + template + GLM_FUNC_DECL tvec3(T const & s, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v) + { + *this = tvec3(s, v()); + } ////////////////////////////////////// // Unary arithmetic operators diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 8aad76f9..9d850da2 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -166,47 +166,47 @@ namespace detail template GLM_FUNC_DECL explicit tvec4(tvec4 const & v); - template - GLM_FUNC_DECL tvec4(glm::detail::swizzle<4, T, tvec4, E0, E1, E2, E3> const & that) - { - *this = that(); - } + template + GLM_FUNC_DECL tvec4(glm::detail::swizzle<4, T, tvec4, E0, E1, E2, E3> const & that) + { + *this = that(); + } - template - GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, glm::detail::swizzle<2, T, tvec2, F0, F1, -1, -2> const & u) - { - *this = tvec4(v(), u()); - } + template + GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, glm::detail::swizzle<2, T, tvec2, F0, F1, -1, -2> const & u) + { + *this = tvec4(v(), u()); + } - template - GLM_FUNC_DECL tvec4(T const & x, T const & y, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v) - { - *this = tvec4(x, y, v()); - } + template + GLM_FUNC_DECL tvec4(T const & x, T const & y, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v) + { + *this = tvec4(x, y, v()); + } - template - GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & w) - { - *this = tvec4(x, v(), w); - } + template + GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & w) + { + *this = tvec4(x, v(), w); + } - template - GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & z, T const & w) - { - *this = tvec4(v(), z, w); - } + template + GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2, E0, E1, -1, -2> const & v, T const & z, T const & w) + { + *this = tvec4(v(), z, w); + } - template - GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & v, T const & w) - { - *this = tvec4(v(), w); - } + template + GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & v, T const & w) + { + *this = tvec4(v(), w); + } - template - GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & v) - { - *this = tvec4(x, v()); - } + template + GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<3, T, tvec3, E0, E1, E2, -1> const & v) + { + *this = tvec4(x, v()); + } ////////////////////////////////////// // Swizzle constructors diff --git a/glm/gtc/epsilon.hpp b/glm/gtc/epsilon.hpp index 29544235..9db9e60f 100644 --- a/glm/gtc/epsilon.hpp +++ b/glm/gtc/epsilon.hpp @@ -56,16 +56,16 @@ namespace glm /// Returns the component-wise compare of |x - y| < epsilon. /// @see gtc_epsilon - template - bool epsilonEqual( + template + boolType epsilonEqual( genTypeT const & x, genTypeT const & y, genTypeU const & epsilon); - + /// Returns the component-wise compare of |x - y| >= epsilon. /// @see gtc_epsilon - template - bool epsilonNotEqual( + template + boolType epsilonNotEqual( genTypeT const & x, genTypeT const & y, genTypeU const & epsilon); diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index b4d15905..7c3162ca 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -28,23 +28,67 @@ namespace glm { - template + template <> GLM_FUNC_QUALIFIER bool epsilonEqual ( - genType const & x, - genType const & y, - genType const & epsilon + glm::half const & x, + glm::half const & y, + glm::half const & epsilon ) { return abs(x - y) < epsilon; } - template + template <> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + float const & x, + float const & y, + float const & epsilon + ) + { + return abs(x - y) < epsilon; + } + + template <> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + double const & x, + double const & y, + double const & epsilon + ) + { + return abs(x - y) < epsilon; + } + + template <> GLM_FUNC_QUALIFIER bool epsilonNotEqual ( - genType const & x, - genType const & y, - genType const & epsilon + glm::half const & x, + glm::half const & y, + glm::half const & epsilon + ) + { + return abs(x - y) >= epsilon; + } + + template <> + GLM_FUNC_QUALIFIER bool epsilonNotEqual + ( + float const & x, + float const & y, + float const & epsilon + ) + { + return abs(x - y) >= epsilon; + } + + template <> + GLM_FUNC_QUALIFIER bool epsilonNotEqual + ( + double const & x, + double const & y, + double const & epsilon ) { return abs(x - y) >= epsilon; @@ -62,76 +106,6 @@ namespace glm abs(x.y - y.y) < epsilon); } - template - GLM_FUNC_QUALIFIER detail::tvec3 epsilonEqual - ( - detail::tvec3 const & x, - detail::tvec3 const & y, - valType const & epsilon) - { - return detail::tvec3( - abs(x.x - y.x) < epsilon, - abs(x.y - y.y) < epsilon, - abs(x.z - y.z) < epsilon); - } - - template - GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual - ( - detail::tvec4 const & x, - detail::tvec4 const & y, - valType const & epsilon - ) - { - return detail::tvec4( - abs(x.x - y.x) < epsilon, - abs(x.y - y.y) < epsilon, - abs(x.z - y.z) < epsilon, - abs(x.w - y.w) < epsilon); - } - - template - GLM_FUNC_QUALIFIER detail::tvec2 epsilonNotEqual - ( - detail::tvec2 const & x, - detail::tvec2 const & y, - valType const & epsilon - ) - { - return detail::tvec2( - abs(x.x - y.x) >= epsilon, - abs(x.y - y.y) >= epsilon); - } - - template - GLM_FUNC_QUALIFIER detail::tvec3 epsilonNotEqual - ( - detail::tvec3 const & x, - detail::tvec3 const & y, - valType const & epsilon - ) - { - return detail::tvec3( - abs(x.x - y.x) >= epsilon, - abs(x.y - y.y) >= epsilon, - abs(x.z - y.z) >= epsilon); - } - - template - GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual - ( - detail::tvec4 const & x, - detail::tvec4 const & y, - valType const & epsilon - ) - { - return detail::tvec4( - abs(x.x - y.x) >= epsilon, - abs(x.y - y.y) >= epsilon, - abs(x.z - y.z) >= epsilon, - abs(x.w - y.w) >= epsilon); - } - template GLM_FUNC_QUALIFIER detail::tvec2 epsilonEqual ( @@ -145,6 +119,19 @@ namespace glm abs(x.y - y.y) < epsilon.y); } + template + GLM_FUNC_QUALIFIER detail::tvec3 epsilonEqual + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + valType const & epsilon) + { + return detail::tvec3( + abs(x.x - y.x) < epsilon, + abs(x.y - y.y) < epsilon, + abs(x.z - y.z) < epsilon); + } + template GLM_FUNC_QUALIFIER detail::tvec3 epsilonEqual ( @@ -164,22 +151,22 @@ namespace glm ( detail::tvec4 const & x, detail::tvec4 const & y, - detail::tvec4 const & epsilon + valType const & epsilon ) { return detail::tvec4( - abs(x.x - y.x) < epsilon.x, - abs(x.y - y.y) < epsilon.y, - abs(x.z - y.z) < epsilon.z, - abs(x.w - y.w) < epsilon.w); + abs(x.x - y.x) < epsilon, + abs(x.y - y.y) < epsilon, + abs(x.z - y.z) < epsilon, + abs(x.w - y.w) < epsilon); } template GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual ( - detail::tquat const & x, - detail::tquat const & y, - detail::tquat const & epsilon + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & epsilon ) { return detail::tvec4( @@ -189,6 +176,19 @@ namespace glm abs(x.w - y.w) < epsilon.w); } + template + GLM_FUNC_QUALIFIER detail::tvec2 epsilonNotEqual + ( + detail::tvec2 const & x, + detail::tvec2 const & y, + valType const & epsilon + ) + { + return detail::tvec2( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon); + } + template GLM_FUNC_QUALIFIER detail::tvec2 epsilonNotEqual ( @@ -202,6 +202,20 @@ namespace glm abs(x.y - y.y) >= epsilon.y); } + template + GLM_FUNC_QUALIFIER detail::tvec3 epsilonNotEqual + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + valType const & epsilon + ) + { + return detail::tvec3( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon, + abs(x.z - y.z) >= epsilon); + } + template GLM_FUNC_QUALIFIER detail::tvec3 epsilonNotEqual ( @@ -216,6 +230,21 @@ namespace glm abs(x.z - y.z) >= epsilon.z); } + template + GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual + ( + detail::tvec4 const & x, + detail::tvec4 const & y, + valType const & epsilon + ) + { + return detail::tvec4( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon, + abs(x.z - y.z) >= epsilon, + abs(x.w - y.w) >= epsilon); + } + template GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual ( @@ -231,6 +260,22 @@ namespace glm abs(x.w - y.w) >= epsilon.w); } +/* + template + GLM_FUNC_QUALIFIER detail::tvec4 epsilonEqual + ( + detail::tquat const & x, + detail::tquat const & y, + detail::tquat const & epsilon + ) + { + return detail::tvec4( + abs(x.x - y.x) < epsilon.x, + abs(x.y - y.y) < epsilon.y, + abs(x.z - y.z) < epsilon.z, + abs(x.w - y.w) < epsilon.w); + } + template GLM_FUNC_QUALIFIER detail::tvec4 epsilonNotEqual ( @@ -245,4 +290,6 @@ namespace glm abs(x.z - y.z) >= epsilon.z, abs(x.w - y.w) >= epsilon.w); } +*/ + }//namespace glm diff --git a/test/core/core_type_mat2x2.cpp b/test/core/core_type_mat2x2.cpp index 5ea12670..9df5da3f 100644 --- a/test/core/core_type_mat2x2.cpp +++ b/test/core/core_type_mat2x2.cpp @@ -34,24 +34,20 @@ int test_inverse() int Error(0); { - glm::mat2 Matrix(1, 2, 3, 4); - glm::mat2 Inverse = glm::inverse(Matrix); - glm::mat2 Identity = Matrix * Inverse; + glm::mat2 const Matrix(1, 2, 3, 4); + glm::mat2 const Inverse = glm::inverse(Matrix); + glm::mat2 const Identity = Matrix * Inverse; - Error += glm::epsilonEqual(Identity[0][0], 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[0][1], 0.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[1][0], 0.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[1][1], 1.0f, 0.01f) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; } { - glm::mat2 Matrix(1, 2, 3, 4); - glm::mat2 Identity = Matrix / Matrix; + glm::mat2 const Matrix(1, 2, 3, 4); + glm::mat2 const Identity = Matrix / Matrix; - Error += glm::epsilonEqual(Identity[0][0], 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[0][1], 0.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[1][0], 0.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(Identity[1][1], 1.0f, 0.01f) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; } return Error; diff --git a/test/core/core_type_mat3x3.cpp b/test/core/core_type_mat3x3.cpp index 46fbdafc..9cf85a5e 100644 --- a/test/core/core_type_mat3x3.cpp +++ b/test/core/core_type_mat3x3.cpp @@ -8,6 +8,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include +#include #include void print(glm::dmat3 const & Mat0) @@ -53,12 +54,45 @@ static int test_operators() return (S && !R) ? 0 : 1; } +int test_inverse() +{ + int Error(0); + + { + glm::mat3 const Matrix( + glm::vec3(0.6f, 0.2f, 0.3f), + glm::vec3(0.2f, 0.7f, 0.5f), + glm::vec3(0.3f, 0.5f, 0.7f)); + glm::mat3 const Inverse = glm::inverse(Matrix); + glm::mat3 const Identity = Matrix * Inverse; + + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + } + + { + glm::mat3 const Matrix( + glm::vec3(0.6f, 0.2f, 0.3f), + glm::vec3(0.2f, 0.7f, 0.5f), + glm::vec3(0.3f, 0.5f, 0.7f)); + glm::mat3 const Identity = Matrix / Matrix; + + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + } + + return Error; +} + int main() { int Error = 0; Error += test_mat3x3(); Error += test_operators(); + Error += test_inverse(); return Error; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index f771224c..dc4083a4 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -7,8 +7,9 @@ // File : test/core/type_mat4x4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_PRECISION_HIGHP_FLOAT +//#define GLM_PRECISION_HIGHP_FLOAT #include +#include #include void print(glm::dmat4 const & Mat0) @@ -20,7 +21,33 @@ void print(glm::dmat4 const & Mat0) printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); } -int test_mat4x4() +void print(glm::mat4 const & Mat0) +{ + printf("mat4(\n"); + printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[0][0], Mat0[0][1], Mat0[0][2], Mat0[0][3]); + printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[1][0], Mat0[1][1], Mat0[1][2], Mat0[1][3]); + printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[2][0], Mat0[2][1], Mat0[2][2], Mat0[2][3]); + printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); +} + +int test_inverse_mat4x4() +{ + glm::mat4 Mat0( + glm::vec4(0.6f, 0.2f, 0.3f, 0.4f), + glm::vec4(0.2f, 0.7f, 0.5f, 0.3f), + glm::vec4(0.3f, 0.5f, 0.7f, 0.2f), + glm::vec4(0.4f, 0.3f, 0.2f, 0.6f)); + glm::mat4 Inv0 = glm::inverse(Mat0); + glm::mat4 Res0 = Mat0 * Inv0; + + print(Mat0); + print(Inv0); + print(Res0); + + return 0; +} + +int test_inverse_dmat4x4() { glm::dmat4 Mat0( glm::dvec4(0.6f, 0.2f, 0.3f, 0.4f), @@ -56,12 +83,54 @@ static bool test_operators() return (S && !R) ? 0 : 1; } +int test_inverse() +{ + int Error(0); + + { + glm::mat4 const Matrix( + glm::vec4(0.6f, 0.2f, 0.3f, 0.4f), + glm::vec4(0.2f, 0.7f, 0.5f, 0.3f), + glm::vec4(0.3f, 0.5f, 0.7f, 0.2f), + glm::vec4(0.4f, 0.3f, 0.2f, 0.6f)); + glm::mat4 const Inverse = glm::inverse(Matrix); + glm::mat4 const Identity = Matrix * Inverse; + + print(Matrix); + print(Inverse); + print(Identity); + + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec4(1.0f, 0.0f, 0.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec4(0.0f, 1.0f, 0.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[3], glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), glm::vec4(0.01f))) ? 0 : 1; + } + + { + glm::mat4 const Matrix( + glm::vec4(0.6f, 0.2f, 0.3f, 0.4f), + glm::vec4(0.2f, 0.7f, 0.5f, 0.3f), + glm::vec4(0.3f, 0.5f, 0.7f, 0.2f), + glm::vec4(0.4f, 0.3f, 0.2f, 0.6f)); + glm::mat4 const Identity = Matrix / Matrix; + + Error += glm::all(glm::epsilonEqual(Identity[0], glm::vec4(1.0f, 0.0f, 0.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[1], glm::vec4(0.0f, 1.0f, 0.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[2], glm::vec4(0.0f, 0.0f, 1.0f, 0.0f), glm::vec4(0.01f))) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Identity[3], glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), glm::vec4(0.01f))) ? 0 : 1; + } + + return Error; +} + int main() { int Error = 0; - Error += test_mat4x4(); + Error += test_inverse_dmat4x4(); + Error += test_inverse_mat4x4(); Error += test_operators(); + Error += test_inverse(); return Error; }