diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index 5a9cb11f..56d16d2b 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -72,19 +72,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat2x3 type; + typedef tmat3x2 type; }; template struct outerProduct_trait { - typedef tmat2x4 type; + typedef tmat4x2 type; }; template struct outerProduct_trait { - typedef tmat3x2 type; + typedef tmat2x3 type; }; template @@ -96,19 +96,19 @@ namespace detail template struct outerProduct_trait { - typedef tmat3x4 type; + typedef tmat4x3 type; }; template struct outerProduct_trait { - typedef tmat4x2 type; + typedef tmat2x4 type; }; template struct outerProduct_trait { - typedef tmat4x3 type; + typedef tmat3x4 type; }; template diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index c27243fd..e03e0948 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -197,7 +197,7 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); template GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 4399e0be..f92b4df5 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -500,7 +500,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) { return tmat2x4( m[0] / s, diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 5ff33e07..fe7235ac 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -379,7 +379,7 @@ namespace detail // -- Binary operators -- template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); @@ -394,7 +394,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); @@ -409,7 +409,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); @@ -424,7 +424,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const T& scalar); template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & scalar); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index a650e494..6712ce33 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -730,7 +730,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) { return tvec4( v.x + scalar, @@ -760,7 +760,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) { return tvec4( v.x - scalar, @@ -790,7 +790,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) { return tvec4( v.x * scalar, @@ -820,7 +820,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) { return tvec4( v.x / scalar, diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index add5dfd9..80562e0f 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -101,7 +101,18 @@ int test_matrixCompMult() int test_outerProduct() { - glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); + { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); } + { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); } + { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); } + + { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); } + { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); } + + { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); } + { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); } + + { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); } + { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); } return 0; }