From 38f63d394311f8cc49711f20e17e01cf8f32022a Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Fri, 3 Jul 2015 15:21:11 -0400 Subject: [PATCH] Add static rows, cols, prec, and components fields to all matrix types --- glm/detail/type_mat2x2.hpp | 44 ++++++++++++++++++++++++-------------- glm/detail/type_mat2x3.hpp | 40 ++++++++++++++++++++++------------ glm/detail/type_mat2x4.hpp | 40 ++++++++++++++++++++++------------ glm/detail/type_mat3x2.hpp | 40 ++++++++++++++++++++++------------ glm/detail/type_mat3x3.hpp | 24 +++++++++++++++------ glm/detail/type_mat3x4.hpp | 40 ++++++++++++++++++++++------------ glm/detail/type_mat4x2.hpp | 38 +++++++++++++++++++++----------- glm/detail/type_mat4x3.hpp | 24 +++++++++++++++------ glm/detail/type_mat4x4.hpp | 24 +++++++++++++++------ glm/gtx/simd_mat4.hpp | 24 +++++++++++++++------ 10 files changed, 229 insertions(+), 109 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 046ceac3..c2bc2b40 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -54,11 +54,23 @@ namespace glm template friend tvec2 operator/(tvec2 const & v, tmat2x2 const & m); +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 2; + static GLM_CONSTEXPR length_t cols = 2; + static GLM_CONSTEXPR length_t rows = 2; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 2; + static const length_t cols = 2; + static const length_t rows = 2; + static const precision prec = P; +# endif + private: /// @cond DETAIL col_type value[2]; /// @endcond - + public: ////////////////////////////////////// // Constructors @@ -130,23 +142,23 @@ namespace glm GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & v); - template + template GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator+=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator-=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator*=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator/=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator/=(tmat2x2 const & m); ////////////////////////////////////// @@ -191,10 +203,10 @@ namespace glm template GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m1, tmat2x2 const & m2); - + template GLM_FUNC_DECL tmat3x2 operator*(tmat2x2 const & m1, tmat3x2 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat2x2 const & m1, tmat4x2 const & m2); @@ -214,7 +226,7 @@ namespace glm GLM_FUNC_DECL tmat2x2 operator/(tmat2x2 const & m1, tmat2x2 const & m2); // Unary constant operators - template + template GLM_FUNC_DECL tmat2x2 const operator-(tmat2x2 const & m); } //namespace glm diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 9986e881..5057ae46 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,11 +50,23 @@ namespace glm typedef tmat3x2 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 2; + static GLM_CONSTEXPR length_t cols = 3; + static GLM_CONSTEXPR length_t rows = 2; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 2; + static const length_t cols = 3; + static const length_t rows = 2; + static const precision prec = P; +# endif + private: - /// @cond DETAIL + /// @cond DETAIL col_type value[2]; /// @endcond - + public: // Constructors GLM_FUNC_DECL tmat2x3(); @@ -78,7 +90,7 @@ namespace glm GLM_FUNC_DECL tmat2x3( X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2); - + template GLM_FUNC_DECL tmat2x3( tvec3 const & v1, @@ -126,19 +138,19 @@ namespace glm GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator+=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator-=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator/=(U s); ////////////////////////////////////// @@ -181,7 +193,7 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat2x3 const & m1, tmat3x2 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat2x3 const & m1, tmat4x2 const & m2); diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 9239e9c9..7f682112 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,11 +50,23 @@ namespace glm typedef tmat4x2 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 2; + static GLM_CONSTEXPR length_t cols = 4; + static GLM_CONSTEXPR length_t rows = 2; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 2; + static const length_t cols = 4; + static const length_t rows = 2; + static const precision prec = P; +# endif + private: /// @cond DETAIL col_type value[2]; /// @endcond - + public: // Constructors GLM_FUNC_DECL tmat2x4(); @@ -68,7 +80,7 @@ namespace glm T const & x0, T const & y0, T const & z0, T const & w0, T const & x1, T const & y1, T const & z1, T const & w1); GLM_FUNC_DECL tmat2x4( - col_type const & v0, + col_type const & v0, col_type const & v1); ////////////////////////////////////// @@ -127,19 +139,19 @@ namespace glm GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator+=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator-=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator/=(U s); ////////////////////////////////////// @@ -179,7 +191,7 @@ namespace glm template GLM_FUNC_DECL tmat4x4 operator*(tmat2x4 const & m1, tmat4x2 const & m2); - + template GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m1, tmat2x2 const & m2); @@ -189,7 +201,7 @@ namespace glm template GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); - template + template GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); // Unary constant operators diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 9fd573f2..ab27b01f 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,11 +50,23 @@ namespace glm typedef tmat2x3 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 3; + static GLM_CONSTEXPR length_t cols = 2; + static GLM_CONSTEXPR length_t rows = 3; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 3; + static const length_t cols = 2; + static const length_t rows = 3; + static const precision prec = P; +# endif + private: /// @cond DETAIL col_type value[3]; /// @endcond - + public: // Constructors GLM_FUNC_DECL tmat3x2(); @@ -84,7 +96,7 @@ namespace glm X1 const & x1, Y1 const & y1, X2 const & x2, Y2 const & y2, X3 const & x3, Y3 const & y3); - + template GLM_FUNC_DECL tmat3x2( tvec2 const & v1, @@ -133,19 +145,19 @@ namespace glm GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator+=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator-=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator/=(U s); ////////////////////////////////////// @@ -184,10 +196,10 @@ namespace glm template GLM_FUNC_DECL tmat2x2 operator*(tmat3x2 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m1, tmat3x3 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat3x2 const & m1, tmat4x3 const & m2); diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index dddfc535..73142e6b 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -49,6 +49,18 @@ namespace glm typedef tmat3x3 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 3; + static GLM_CONSTEXPR length_t cols = 3; + static GLM_CONSTEXPR length_t rows = 3; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 3; + static const length_t cols = 3; + static const length_t rows = 3; + static const precision prec = P; +# endif + template friend tvec3 operator/(tmat3x3 const & m, tvec3 const & v); template @@ -88,7 +100,7 @@ namespace glm 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 tmat3x3( tvec3 const & v1, @@ -198,10 +210,10 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m1, tmat3x3 const & m2); - + template GLM_FUNC_DECL tmat2x3 operator*(tmat3x3 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat3x3 const & m1, tmat4x3 const & m2); diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 7814e3fd..c372fb27 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,6 +50,18 @@ namespace glm typedef tmat4x3 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 3; + static GLM_CONSTEXPR length_t cols = 4; + static GLM_CONSTEXPR length_t rows = 3; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 3; + static const length_t cols = 4; + static const length_t rows = 3; + static const precision prec = P; +# endif + private: /// @cond DETAIL col_type value[3]; @@ -83,7 +95,7 @@ namespace glm 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); - + template GLM_FUNC_DECL tmat3x4( tvec4 const & v1, @@ -132,19 +144,19 @@ namespace glm GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator+=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator+=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator-=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator-=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator*=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator/=(U s); ////////////////////////////////////// @@ -178,15 +190,15 @@ namespace glm template GLM_FUNC_DECL typename tmat3x4::col_type operator*(tmat3x4 const & m, typename tmat3x4::row_type const & v); - template + template GLM_FUNC_DECL typename tmat3x4::row_type operator*(typename tmat3x4::col_type const & v, tmat3x4 const & m); template GLM_FUNC_DECL tmat4x4 operator*(tmat3x4 const & m1, tmat4x3 const & m2); - + template GLM_FUNC_DECL tmat2x4 operator*(tmat3x4 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat3x4 operator*(tmat3x4 const & m1, tmat3x3 const & m2); diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index d529ecbd..d78b9f4d 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,6 +50,18 @@ namespace glm typedef tmat2x4 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 4; + static GLM_CONSTEXPR length_t cols = 2; + static GLM_CONSTEXPR length_t rows = 4; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 4; + static const length_t cols = 2; + static const length_t rows = 4; + static const precision prec = P; +# endif + private: /// @cond DETAIL col_type value[4]; @@ -70,7 +82,7 @@ namespace glm T const & x2, T const & y2, T const & x3, T const & y3); GLM_FUNC_DECL tmat4x2( - col_type const & v0, + col_type const & v0, col_type const & v1, col_type const & v2, col_type const & v3); @@ -138,19 +150,19 @@ namespace glm GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator+=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator-=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator/=(U s); ////////////////////////////////////// @@ -189,10 +201,10 @@ namespace glm template GLM_FUNC_DECL tmat3x2 operator*(tmat4x2 const & m1, tmat3x4 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); - + template GLM_FUNC_DECL tmat2x3 operator*(tmat4x3 const & m1, tmat2x4 const & m2); diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 8bde1ac0..f93f5c87 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,8 +50,20 @@ namespace glm typedef tmat3x4 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 4; + static GLM_CONSTEXPR length_t cols = 3; + static GLM_CONSTEXPR length_t rows = 4; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 4; + static const length_t cols = 3; + static const length_t rows = 4; + static const precision prec = P; +# endif + private: - // Data + // Data col_type value[4]; public: @@ -87,7 +99,7 @@ namespace glm 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 tmat4x3( tvec3 const & v1, @@ -191,7 +203,7 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat4x3 const & m1, tmat3x4 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat4x3 const & m1, tmat4x4 const & m2); diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index dcb7269b..6e68f6f7 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -49,6 +49,18 @@ namespace glm typedef tmat4x4 transpose_type; typedef T value_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 4; + static GLM_CONSTEXPR length_t cols = 4; + static GLM_CONSTEXPR length_t rows = 4; + static GLM_CONSTEXPR precision prec = P; +# else + static const length_t components = 4; + static const length_t cols = 4; + static const length_t rows = 4; + static const precision prec = P; +# endif + template friend tvec4 operator/(tmat4x4 const & m, tvec4 const & v); template @@ -177,13 +189,13 @@ namespace glm template GLM_FUNC_DECL tmat4x4 operator+(T const & s, tmat4x4 const & m); - template + template GLM_FUNC_DECL tmat4x4 operator+(tmat4x4 const & m1, tmat4x4 const & m2); - template + template GLM_FUNC_DECL tmat4x4 operator-(tmat4x4 const & m, T const & s); - template + template GLM_FUNC_DECL tmat4x4 operator-(T const & s, tmat4x4 const & m); template diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index 89ee5e75..3334dc53 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,9 +33,9 @@ /// /// @defgroup gtx_simd_mat4 GLM_GTX_simd_mat4 /// @ingroup gtx -/// +/// /// @brief SIMD implementation of mat4 type. -/// +/// /// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// @@ -71,6 +71,18 @@ namespace detail typedef fmat4x4SIMD type; typedef fmat4x4SIMD transpose_type; +# if GLM_HAS_CONSTEXPR + static GLM_CONSTEXPR length_t components = 4; + static GLM_CONSTEXPR length_t cols = 4; + static GLM_CONSTEXPR length_t rows = 4; + static GLM_CONSTEXPR precision prec = defaultp; +# else + static const length_t components = 4; + static const length_t cols = 4; + static const length_t rows = 4; + static const precision prec = defaultp; +# endif + GLM_FUNC_DECL length_t length() const; fvec4SIMD Data[4]; @@ -96,7 +108,7 @@ namespace detail __m128 const in[4]); // Conversions - //template + //template //explicit tmat4x4(tmat4x4 const & m); //explicit tmat4x4(tmat2x2 const & x);