diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 0388e759..130bc7e6 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat2x2 transpose_type; typedef T value_type; - template - friend tvec2 operator/(tmat2x2 const & m, tvec2 const & v); - template - friend tvec2 operator/(tvec2 const & v, tmat2x2 const & m); - private: col_type value[2]; diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 7e0cc87d..45dfe142 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -177,10 +177,10 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, const T& s); + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator/(T const & s, tmat2x4 const & m); // -- Boolean operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index cac649f6..8d6f824e 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -493,7 +493,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, const T& s) + GLM_FUNC_QUALIFIER tmat2x4 operator/(tmat2x4 const & m, T const & s) { return tmat2x4( m[0] / s, @@ -501,7 +501,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat2x4 operator/(T s, tmat2x4 const & m) + GLM_FUNC_QUALIFIER tmat2x4 operator/(T const & s, tmat2x4 const & m) { return tmat2x4( s / m[0], diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 806ae811..3b90536b 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat3x3 transpose_type; typedef T value_type; - template - friend tvec3 operator/(tmat3x3 const & m, tvec3 const & v); - template - friend tvec3 operator/(tvec3 const & v, tmat3x3 const & m); - private: col_type value[3]; diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 4766f1d6..c210f396 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -49,11 +49,6 @@ namespace glm typedef tmat4x4 transpose_type; typedef T value_type; - template - friend tvec4 operator/(tmat4x4 const & m, tvec4 const & v); - template - friend tvec4 operator/(tvec4 const & v, tmat4x4 const & m); - private: col_type value[4]; @@ -210,7 +205,7 @@ namespace glm GLM_FUNC_DECL typename tmat4x4::col_type operator/(tmat4x4 const & m, typename tmat4x4::row_type const & v); template - GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type & v, tmat4x4 const & m); + GLM_FUNC_DECL typename tmat4x4::row_type operator/(typename tmat4x4::col_type const & v, tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4 operator/(tmat4x4 const & m1, tmat4x4 const & m2); diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 4668ff81..624bcf8f 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -346,7 +346,7 @@ namespace detail // -- Binary operators -- template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec1 const & v2); @@ -361,7 +361,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec1 const & v2); @@ -376,7 +376,7 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec1 const & v2); @@ -391,16 +391,16 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, const T& scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & scalar); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec1 const & v2); template GLM_FUNC_DECL tvec4 operator/(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator/(tvec1 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 3a929a01..29b78bf5 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -642,7 +642,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) { return tvec4( v.x + scalar, @@ -692,7 +692,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) { return tvec4( v.x - scalar, @@ -742,7 +742,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) { return tvec4( v.x * scalar, @@ -792,7 +792,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, const T& scalar) + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) { return tvec4( v.x / scalar, @@ -801,6 +801,16 @@ namespace glm v.w / scalar); } + template + GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec1 const & v2) + { + return tvec4( + v1.x / v2.x, + v1.y / v2.x, + v1.z / v2.x, + v1.w / v2.x); + } + template GLM_FUNC_QUALIFIER tvec4 operator/(T scalar, tvec4 const & v) { @@ -811,6 +821,16 @@ namespace glm scalar / v.w); } + template + GLM_FUNC_DECL tvec4 operator/(tvec1 const & v1, tvec4 const & v2) + { + return tvec4( + v1.x / v2.x, + v1.x / v2.y, + v1.x / v2.z, + v1.x / v2.w); + } + template GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec4 const & v2) { diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index a7055fae..0832f7f3 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -170,6 +170,14 @@ namespace glm template GLM_FUNC_DECL tquat operator/(tquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tquat const & q1, tquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tquat const & q1, tquat const & q2); + /// Returns the length of the quaternion. /// /// @see gtc_quaternion diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 9bef77dd..cddf1fe6 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -130,16 +130,16 @@ namespace glm GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, tdualquat const & p); template - GLM_FUNC_DECL tvec3 operator*(tquat const & q, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(tdualquat const & q, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tquat const & q); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tdualquat const & q); template - GLM_FUNC_DECL tvec4 operator*(tquat const & q, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tdualquat const & q, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tquat const & q); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tdualquat const & q); template GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, T const & s); @@ -150,6 +150,14 @@ namespace glm template GLM_FUNC_DECL tdualquat operator/(tdualquat const & q, T const & s); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tdualquat const & q1, tdualquat const & q2); + + template + GLM_FUNC_DECL bool operator!=(tdualquat const & q1, tdualquat const & q2); + /// Returns the normalized quaternion. /// /// @see gtx_dual_quaternion diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 961dd1ca..fd41dcdc 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -194,11 +194,17 @@ namespace glm // -- Unary bit operators -- template - GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const & q) { return q; } + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) + { + return tdualquat(-q.real, -q.dual); + } + // -- Binary operators -- template