From eab004bfe5581963fe57578b748c89f1b9a663d1 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 23 May 2016 21:20:04 +0200 Subject: [PATCH] vec4 add, sub, mul and div binary operators use unary operators implementation --- glm/detail/type_vec4.inl | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index cd093916..17b4fe67 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -722,51 +722,31 @@ namespace detail template GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) { - return tvec4( - v.x / scalar, - v.y / scalar, - v.z / scalar, - v.w / scalar); + return tvec4(v) /= 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); + return tvec4(v1) /= v2; } template GLM_FUNC_QUALIFIER tvec4 operator/(T scalar, tvec4 const & v) { - return tvec4( - scalar / v.x, - scalar / v.y, - scalar / v.z, - scalar / v.w); + return tvec4(scalar) /= v; } template GLM_FUNC_QUALIFIER 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); + return tvec4(v1.x) /= v2; } template GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec4 const & v2) { - return tvec4( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); + return tvec4(v1) /= v2; } // -- Binary bit operators --