Added missing bvec* && and || operators

This commit is contained in:
Christophe Riccio
2015-10-15 04:28:08 +02:00
parent 560dcdbec0
commit a257beb5de
11 changed files with 95 additions and 0 deletions

View File

@@ -314,6 +314,12 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
// -- Is type --
template <typename T, precision P>

View File

@@ -601,4 +601,16 @@ namespace glm
{
return (v1.x != v2.x);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec1<bool, P> operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
{
return tvec1<bool, P>(v1.x && v2.x);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec1<bool, P> operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
{
return tvec1<bool, P>(v1.x || v2.x);
}
}//namespace glm

View File

@@ -406,6 +406,12 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
// -- Is type --
template <typename T, precision P>

View File

@@ -926,4 +926,16 @@ namespace glm
{
return (v1.x != v2.x) || (v1.y != v2.y);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec2<bool, P> operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2)
{
return tvec2<bool, P>(v1.x && v2.x, v1.y && v2.y);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec2<bool, P> operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2)
{
return tvec2<bool, P>(v1.x || v2.x, v1.y || v2.y);
}
}//namespace glm

View File

@@ -429,6 +429,12 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator&&(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator||(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
// -- Is type --
template <typename T, precision P>

View File

@@ -1058,4 +1058,16 @@ namespace glm
{
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec3<bool, P> operator&&(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2)
{
return tvec3<bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec3<bool, P> operator||(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2)
{
return tvec3<bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z);
}
}//namespace glm

View File

@@ -542,6 +542,12 @@ namespace detail
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator&&(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL bool operator||(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
// -- Is type --
template <typename T, precision P>

View File

@@ -1168,6 +1168,18 @@ namespace glm
{
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> operator&&(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2)
{
return tvec4<bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> operator||(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2)
{
return tvec4<bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w);
}
}//namespace glm
#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS