mirror of
https://github.com/g-truc/glm.git
synced 2025-04-08 06:43:10 +00:00
Completed GTC_vec1
This commit is contained in:
parent
6d1610ce0d
commit
8a1bf4410b
10 changed files with 1092 additions and 697 deletions
|
@ -130,6 +130,17 @@ namespace glm
|
|||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
template <int E0>
|
||||
GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1<T, P>, E0, -1,-2,-3> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
|
||||
|
|
|
@ -117,25 +117,14 @@ namespace glm
|
|||
GLM_FUNC_DECL explicit tvec2(T const & s);
|
||||
GLM_FUNC_DECL tvec2(T const & s1, T const & s2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1,-1,-2> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
|
||||
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_DECL tvec2(U const & x, V const & y);
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_DECL tvec2(tvec1<U, P> const & v1, tvec1<V, P> const & v2);
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_DECL tvec2(A const & x, B const & y);
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_DECL tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
|
@ -150,6 +139,17 @@ namespace glm
|
|||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1,-1,-2> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
|
||||
|
|
|
@ -104,17 +104,17 @@ namespace glm
|
|||
// Conversion scalar constructors
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(U const & a, V const & b) :
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(A const & a, B const & b) :
|
||||
x(static_cast<T>(a)),
|
||||
y(static_cast<T>(b))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<U, P> const & v1, tvec1<V, P> const & v2) :
|
||||
x(v1.x),
|
||||
y(v2.x)
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b) :
|
||||
x(a.x),
|
||||
y(b.x)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -111,10 +111,48 @@ namespace glm
|
|||
template <precision Q>
|
||||
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL explicit tvec3(ctor);
|
||||
GLM_FUNC_DECL explicit tvec3(T const & s);
|
||||
GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_DECL tvec3(A const & a, B const & b, C const & c);
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_DECL tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, B const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(A const & a, tvec2<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
template <int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
|
||||
{
|
||||
|
@ -132,71 +170,38 @@ namespace glm
|
|||
{
|
||||
*this = tvec3<T, P>(s, v());
|
||||
}
|
||||
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL explicit tvec3(ctor);
|
||||
GLM_FUNC_DECL explicit tvec3(T const & s);
|
||||
GLM_FUNC_DECL tvec3(T const & s1, T const & s2, T const & s3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
|
||||
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, typename V, typename W>
|
||||
GLM_FUNC_DECL tvec3(
|
||||
U const & x,
|
||||
V const & y,
|
||||
W const & z);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & v, B const & s);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(A const & s, tvec2<B, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
|
||||
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<T, P> const & v);
|
||||
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -99,15 +99,10 @@ namespace glm
|
|||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
T const & s0,
|
||||
T const & s1,
|
||||
T const & s2
|
||||
) :
|
||||
x(s0),
|
||||
y(s1),
|
||||
z(s2)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(T const & a, T const & b, T const & c) :
|
||||
x(a),
|
||||
y(b),
|
||||
z(c)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
@ -115,15 +110,18 @@ namespace glm
|
|||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
A const & x,
|
||||
B const & y,
|
||||
C const & z
|
||||
) :
|
||||
x(static_cast<T>(x)),
|
||||
y(static_cast<T>(y)),
|
||||
z(static_cast<T>(z))
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, B const & b, C const & c) :
|
||||
x(static_cast<T>(a)),
|
||||
y(static_cast<T>(b)),
|
||||
z(static_cast<T>(c))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c) :
|
||||
x(static_cast<T>(a)),
|
||||
y(static_cast<T>(b)),
|
||||
z(static_cast<T>(c))
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
@ -131,34 +129,39 @@ namespace glm
|
|||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
tvec2<A, Q> const & v,
|
||||
B const & s
|
||||
) :
|
||||
x(static_cast<T>(v.x)),
|
||||
y(static_cast<T>(v.y)),
|
||||
z(static_cast<T>(s))
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, B const & b) :
|
||||
x(static_cast<T>(a.x)),
|
||||
y(static_cast<T>(a.y)),
|
||||
z(static_cast<T>(b))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
A const & s,
|
||||
tvec2<B, Q> const & v
|
||||
) :
|
||||
x(static_cast<T>(s)),
|
||||
y(static_cast<T>(v.x)),
|
||||
z(static_cast<T>(v.y))
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b) :
|
||||
x(static_cast<T>(a.x)),
|
||||
y(static_cast<T>(a.y)),
|
||||
z(static_cast<T>(b.x))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, tvec2<B, Q> const & b) :
|
||||
x(static_cast<T>(a)),
|
||||
y(static_cast<T>(b.x)),
|
||||
z(static_cast<T>(b.y))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b) :
|
||||
x(static_cast<T>(a.x)),
|
||||
y(static_cast<T>(b.x)),
|
||||
z(static_cast<T>(b.y))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
tvec3<U, Q> const & v
|
||||
) :
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<U, Q> const & v) :
|
||||
x(static_cast<T>(v.x)),
|
||||
y(static_cast<T>(v.y)),
|
||||
z(static_cast<T>(v.z))
|
||||
|
@ -166,10 +169,7 @@ namespace glm
|
|||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
|
||||
(
|
||||
tvec4<U, Q> const & v
|
||||
) :
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec4<U, Q> const & v) :
|
||||
x(static_cast<T>(v.x)),
|
||||
y(static_cast<T>(v.y)),
|
||||
z(static_cast<T>(v.z))
|
||||
|
@ -179,7 +179,7 @@ namespace glm
|
|||
// Unary arithmetic operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator= (tvec3<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v)
|
||||
{
|
||||
this->x = v.x;
|
||||
this->y = v.y;
|
||||
|
@ -189,7 +189,7 @@ namespace glm
|
|||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator= (tvec3<U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<U, P> const & v)
|
||||
{
|
||||
this->x = static_cast<T>(v.x);
|
||||
this->y = static_cast<T>(v.y);
|
||||
|
@ -199,7 +199,7 @@ namespace glm
|
|||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+= (U s)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(U s)
|
||||
{
|
||||
this->x += static_cast<T>(s);
|
||||
this->y += static_cast<T>(s);
|
||||
|
@ -207,6 +207,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x += static_cast<T>(v.x);
|
||||
this->y += static_cast<T>(v.x);
|
||||
this->z += static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+= (tvec3<U, P> const & v)
|
||||
|
@ -227,6 +237,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x -= static_cast<T>(v.x);
|
||||
this->y -= static_cast<T>(v.x);
|
||||
this->z -= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-= (tvec3<U, P> const & v)
|
||||
|
@ -247,6 +267,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x *= static_cast<T>(v.x);
|
||||
this->y *= static_cast<T>(v.x);
|
||||
this->z *= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*= (tvec3<U, P> const & v)
|
||||
|
@ -267,6 +297,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x /= static_cast<T>(v.x);
|
||||
this->y /= static_cast<T>(v.x);
|
||||
this->z /= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/= (tvec3<U, P> const & v)
|
||||
|
@ -314,29 +354,6 @@ namespace glm
|
|||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
{
|
||||
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
{
|
||||
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
|
||||
|
@ -350,6 +367,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x %= v.x;
|
||||
this->y %= v.x;
|
||||
this->z %= v.x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%= (tvec3<U, P> const & v)
|
||||
|
@ -370,6 +397,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x &= v.x;
|
||||
this->y &= v.x;
|
||||
this->z &= v.x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&= (tvec3<U, P> const & v)
|
||||
|
@ -390,6 +427,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x |= v.x;
|
||||
this->y |= v.x;
|
||||
this->z |= v.x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|= (tvec3<U, P> const & v)
|
||||
|
@ -410,6 +457,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x ^= v.x;
|
||||
this->y ^= v.x;
|
||||
this->z ^= v.x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^= (tvec3<U, P> const & v)
|
||||
|
@ -430,6 +487,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x <<= static_cast<T>(v.x);
|
||||
this->y <<= static_cast<T>(v.x);
|
||||
this->z <<= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<= (tvec3<U, P> const & v)
|
||||
|
@ -450,6 +517,16 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>= (tvec1<U, P> const & v)
|
||||
{
|
||||
this->x >>= static_cast<T>(v.x);
|
||||
this->y >>= static_cast<T>(v.x);
|
||||
this->z >>= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>= (tvec3<U, P> const & v)
|
||||
|
@ -460,15 +537,26 @@ namespace glm
|
|||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Binary arithmetic operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x + s,
|
||||
|
@ -476,12 +564,17 @@ namespace glm
|
|||
v.z + s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x + s.x,
|
||||
v.y + s.x,
|
||||
v.z + s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s + v.x,
|
||||
|
@ -489,12 +582,17 @@ namespace glm
|
|||
s + v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x + v.x,
|
||||
s.x + v.y,
|
||||
s.x + v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x + v2.x,
|
||||
|
@ -503,12 +601,8 @@ namespace glm
|
|||
}
|
||||
|
||||
//operator-
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x - s,
|
||||
|
@ -516,12 +610,17 @@ namespace glm
|
|||
v.z - s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x - s.x,
|
||||
v.y - s.x,
|
||||
v.z - s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s - v.x,
|
||||
|
@ -530,11 +629,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x - v.x,
|
||||
s.x - v.y,
|
||||
s.x - v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x - v2.x,
|
||||
|
@ -543,12 +647,8 @@ namespace glm
|
|||
}
|
||||
|
||||
//operator*
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x * s,
|
||||
|
@ -556,12 +656,17 @@ namespace glm
|
|||
v.z * s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x * s.x,
|
||||
v.y * s.x,
|
||||
v.z * s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s * v.x,
|
||||
|
@ -569,12 +674,17 @@ namespace glm
|
|||
s * v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x * v.x,
|
||||
s.x * v.y,
|
||||
s.x * v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x * v2.x,
|
||||
|
@ -583,12 +693,8 @@ namespace glm
|
|||
}
|
||||
|
||||
//operator/
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x / s,
|
||||
|
@ -596,12 +702,17 @@ namespace glm
|
|||
v.z / s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x / s.x,
|
||||
v.y / s.x,
|
||||
v.z / s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s / v.x,
|
||||
|
@ -609,12 +720,17 @@ namespace glm
|
|||
s / v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x / v.x,
|
||||
s.x / v.y,
|
||||
s.x / v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x / v2.x,
|
||||
|
@ -623,11 +739,8 @@ namespace glm
|
|||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-
|
||||
(
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
-v.x,
|
||||
|
@ -639,11 +752,7 @@ namespace glm
|
|||
// Binary bit operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x % s,
|
||||
|
@ -652,11 +761,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x % s.x,
|
||||
v.y % s.x,
|
||||
v.z % s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s % v.x,
|
||||
|
@ -665,11 +779,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x % v.x,
|
||||
s.x % v.y,
|
||||
s.x % v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x % v2.x,
|
||||
|
@ -678,11 +797,7 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x & s,
|
||||
|
@ -691,11 +806,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x & s.x,
|
||||
v.y & s.x,
|
||||
v.z & s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s & v.x,
|
||||
|
@ -704,11 +824,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x & v.x,
|
||||
s.x & v.y,
|
||||
s.x & v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x & v2.x,
|
||||
|
@ -717,11 +842,7 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x | s,
|
||||
|
@ -730,11 +851,16 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x | s.x,
|
||||
v.y | s.x,
|
||||
v.z | s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s | v.x,
|
||||
|
@ -743,24 +869,25 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x | v.x,
|
||||
s.x | v.y,
|
||||
s.x | v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x | v2.x,
|
||||
v1.y | v2.y,
|
||||
v1.z | v2.z);
|
||||
}
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x ^ s,
|
||||
|
@ -769,114 +896,133 @@ namespace glm
|
|||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
T(s) ^ v.x,
|
||||
T(s) ^ v.y,
|
||||
T(s) ^ v.z);
|
||||
v.x ^ s.x,
|
||||
v.y ^ s.x,
|
||||
v.z ^ s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x ^ T(v2.x),
|
||||
v1.y ^ T(v2.y),
|
||||
v1.z ^ T(v2.z));
|
||||
s ^ v.x,
|
||||
s ^ v.y,
|
||||
s ^ v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x << T(s),
|
||||
v.y << T(s),
|
||||
v.z << T(s));
|
||||
s.x ^ v.x,
|
||||
s.x ^ v.y,
|
||||
s.x ^ v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
T(s) << v.x,
|
||||
T(s) << v.y,
|
||||
T(s) << v.z);
|
||||
v1.x ^ v2.x,
|
||||
v1.y ^ v2.y,
|
||||
v1.z ^ v2.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x << T(v2.x),
|
||||
v1.y << T(v2.y),
|
||||
v1.z << T(v2.z));
|
||||
v.x << s,
|
||||
v.y << s,
|
||||
v.z << s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>
|
||||
(
|
||||
tvec3<T, P> const & v,
|
||||
T const & s
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x >> T(s),
|
||||
v.y >> T(s),
|
||||
v.z >> T(s));
|
||||
v.x << s.x,
|
||||
v.y << s.x,
|
||||
v.z << s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>
|
||||
(
|
||||
T const & s,
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s >> T(v.x),
|
||||
s >> T(v.y),
|
||||
s >> T(v.z));
|
||||
s << v.x,
|
||||
s << v.y,
|
||||
s << v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>
|
||||
(
|
||||
tvec3<T, P> const & v1,
|
||||
tvec3<T, P> const & v2
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x >> T(v2.x),
|
||||
v1.y >> T(v2.y),
|
||||
v1.z >> T(v2.z));
|
||||
s.x << v.x,
|
||||
s.x << v.y,
|
||||
s.x << v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x << v2.x,
|
||||
v1.y << v2.y,
|
||||
v1.z << v2.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x >> s,
|
||||
v.y >> s,
|
||||
v.z >> s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v.x >> s.x,
|
||||
v.y >> s.x,
|
||||
v.z >> s.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s >> v.x,
|
||||
s >> v.y,
|
||||
s >> v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
s.x >> v.x,
|
||||
s.x >> v.y,
|
||||
s.x >> v.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
v1.x >> v2.x,
|
||||
v1.y >> v2.y,
|
||||
v1.z >> v2.z);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator~
|
||||
(
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator~(tvec3<T, P> const & v)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
~v.x,
|
||||
|
|
|
@ -153,48 +153,55 @@ namespace glm
|
|||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL explicit tvec4(
|
||||
ctor);
|
||||
GLM_FUNC_DECL explicit tvec4(
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tvec4(
|
||||
T const & s0,
|
||||
T const & s1,
|
||||
T const & s2,
|
||||
T const & s3);
|
||||
GLM_FUNC_DECL explicit tvec4(ctor);
|
||||
GLM_FUNC_DECL explicit tvec4(T const & s);
|
||||
GLM_FUNC_DECL tvec4(T const & s0, T const & s1, T const & s2, T const & s3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
GLM_FUNC_DECL tvec4(
|
||||
A const & x,
|
||||
B const & y,
|
||||
C const & z,
|
||||
D const & w);
|
||||
GLM_FUNC_DECL tvec4(A const & x, B const & y, C const & z, D const & w);
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
GLM_FUNC_DECL tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & v, B const & s1, C const & s2);
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, B const & b, C const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2<B, Q> const & v, C const & s2);
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2<C, Q> const & v);
|
||||
GLM_FUNC_DECL explicit tvec4(A const & a, tvec2<B, Q> const & b, C const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A const & a, B const & b, tvec2<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & v, B const & s);
|
||||
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, B const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A const & s, tvec3<B, Q> const & v);
|
||||
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & v1, tvec2<B, Q> const & v2);
|
||||
GLM_FUNC_DECL explicit tvec4(A const & a, tvec3<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
|
||||
|
@ -251,32 +258,31 @@ namespace glm
|
|||
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<T, P> const & v);
|
||||
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator+=(T v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator-=(T v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(T v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(T v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<T, P> const & v);
|
||||
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, Q> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
|
@ -293,62 +299,98 @@ namespace glm
|
|||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator%= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator%= (tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator%= (tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator&= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator&= (tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator&= (tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator|= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator|= (tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator|= (tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator^= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator^= (tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator^= (tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator<<=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec4<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator>>=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v);
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator- (tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
|
@ -364,54 +406,90 @@ namespace glm
|
|||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(T const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -50,7 +50,7 @@ GLM 0.9.6.0: 2014-XX-XX
|
|||
- Added move contructors and assignment operators #141
|
||||
- Use pragma once
|
||||
- Fixed Visual Studio 14 compiler warnings
|
||||
- Added *vec1 support to *vec2 and *vec3 types
|
||||
- Added GTC_vec1 extension, *vec1 support to *vec2 and *vec3 types
|
||||
- Limited extended integer type redifinition #233
|
||||
- Improved linearRand: support precision and integers #230
|
||||
- Added vec3 slerp #237
|
||||
|
|
|
@ -8,9 +8,11 @@
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_SWIZZLE
|
||||
#include <glm/vector_relational.hpp>
|
||||
#include <glm/gtc/vec1.hpp>
|
||||
#include <vector>
|
||||
|
||||
int test_operators()
|
||||
int test_vec1_operators()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
|
@ -38,7 +40,69 @@ int test_operators()
|
|||
return Error;
|
||||
}
|
||||
|
||||
int test_operator_increment()
|
||||
int test_vec1_ctor()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
/*
|
||||
#if GLM_HAS_INITIALIZER_LISTS
|
||||
{
|
||||
glm::vec1 a{ 0 };
|
||||
std::vector<glm::vec1> v = {
|
||||
{0.f},
|
||||
{4.f},
|
||||
{8.f}};
|
||||
}
|
||||
|
||||
{
|
||||
glm::dvec2 a{ 0 };
|
||||
std::vector<glm::dvec1> v = {
|
||||
{0.0},
|
||||
{4.0},
|
||||
{8.0}};
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
#if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
{
|
||||
glm::vec2 A = glm::vec2(1.0f, 2.0f);
|
||||
glm::vec2 B = A.xy;
|
||||
glm::vec2 C(A.xy);
|
||||
glm::vec2 D(A.xy());
|
||||
|
||||
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(A, C)) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(A, D)) ? 0 : 1;
|
||||
}
|
||||
#endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
|
||||
{
|
||||
glm::vec2 A = glm::vec2(2.0f);
|
||||
glm::vec2 B = glm::vec2(2.0f, 3.0f);
|
||||
glm::vec2 C = glm::vec2(2.0f, 3.0);
|
||||
//glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says?
|
||||
glm::vec2 E(glm::dvec2(2.0));
|
||||
glm::vec2 F(glm::ivec2(2));
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_vec1_size()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1;
|
||||
Error += 8 == sizeof(glm::mediump_vec1) ? 0 : 1;
|
||||
Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1;
|
||||
Error += 16 == sizeof(glm::highp_dvec1) ? 0 : 1;
|
||||
Error += glm::vec1().length() == 2 ? 0 : 1;
|
||||
Error += glm::dvec1().length() == 2 ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_vec1_operator_increment()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
|
@ -69,8 +133,13 @@ int main()
|
|||
{
|
||||
int Error = 0;
|
||||
|
||||
Error += test_operators();
|
||||
Error += test_operator_increment();
|
||||
glm::vec1 v;
|
||||
assert(v.length() == 1);
|
||||
|
||||
Error += test_vec1_size();
|
||||
Error += test_vec1_ctor();
|
||||
Error += test_vec1_operators();
|
||||
Error += test_vec1_operator_increment();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ int test_vec2_ctor()
|
|||
{
|
||||
int Error = 0;
|
||||
|
||||
#if(GLM_HAS_INITIALIZER_LISTS)
|
||||
#if GLM_HAS_INITIALIZER_LISTS
|
||||
{
|
||||
glm::vec2 a{ 0, 1 };
|
||||
std::vector<glm::vec2> v = {
|
||||
|
@ -219,7 +219,7 @@ int test_vec2_ctor()
|
|||
}
|
||||
#endif
|
||||
|
||||
#if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
#if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
{
|
||||
glm::vec2 A = glm::vec2(1.0f, 2.0f);
|
||||
glm::vec2 B = A.xy;
|
||||
|
@ -230,7 +230,7 @@ int test_vec2_ctor()
|
|||
Error += glm::all(glm::equal(A, C)) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(A, D)) ? 0 : 1;
|
||||
}
|
||||
#endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
#endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
|
||||
{
|
||||
glm::vec2 A = glm::vec2(2.0f);
|
||||
|
@ -239,7 +239,6 @@ int test_vec2_ctor()
|
|||
//glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says?
|
||||
glm::vec2 E(glm::dvec2(2.0));
|
||||
glm::vec2 F(glm::ivec2(2));
|
||||
|
||||
}
|
||||
|
||||
return Error;
|
||||
|
|
Loading…
Add table
Reference in a new issue