Added constructor taking partial swizzle operation parameter

This commit is contained in:
Christophe Riccio
2011-10-02 01:26:35 +01:00
parent f1975617c0
commit e8ee34e397
5 changed files with 242 additions and 10 deletions

View File

@@ -82,11 +82,6 @@ namespace detail
value_type const & s2,
value_type const & s3);
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_DECL tvec3(tref3<T> const & r);
//////////////////////////////////////
// Convertion scalar constructors
@@ -117,6 +112,17 @@ namespace detail
template <typename U>
GLM_FUNC_DECL explicit tvec3(tvec4<U> const & v);
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_DECL tvec3(tref3<T> const & r);
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec3(tref2<A> const & v, B const & s);
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec3(A const & s, tref2<B> const & v);
//////////////////////////////////////
// Unary arithmetic operators

View File

@@ -112,6 +112,30 @@ namespace detail
z(r.z)
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<T>::tvec3
(
tref2<A> const & v,
B const & s
) :
x(value_type(v.x)),
y(value_type(v.y)),
z(value_type(s))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<T>::tvec3
(
A const & s,
tref2<B> const & v
) :
x(value_type(s)),
y(value_type(v.x)),
z(value_type(v.y))
{}
//////////////////////////////////////
// Convertion scalar constructors

View File

@@ -84,11 +84,6 @@ namespace detail
value_type const & s2,
value_type const & s3);
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_DECL tvec4(tref4<T> const & r);
//////////////////////////////////////
// Convertion scalar constructors
@@ -129,6 +124,36 @@ namespace detail
template <typename U>
GLM_FUNC_DECL explicit tvec4(tvec4<U> const & v);
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_DECL tvec4(tref4<T> const & r);
//! Explicit conversions (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 explicit tvec4(tref2<A> const & v, B const & s1, C const & s2);
//! Explicit conversions (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 explicit tvec4(A const & s1, tref2<B> const & v, C const & s2);
//! Explicit conversions (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 explicit tvec4(A const & s1, B const & s2, tref2<C> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec4(tref3<A> 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>
GLM_FUNC_DECL explicit tvec4(A const & s, tref3<B> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec4(tref2<A> const & v1, tref2<B> const & v2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec4(tvec2<A> const & v1, tref2<B> const & v2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
GLM_FUNC_DECL explicit tvec4(tref2<A> const & v1, tvec2<B> const & v2);
//////////////////////////////////////
// Unary arithmetic operators

View File

@@ -118,6 +118,113 @@ namespace detail
w(r.w)
{}
template <typename T>
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
tref2<A> const & v,
B const & s1,
C const & s2
) :
x(value_type(v.x)),
y(value_type(v.y)),
z(value_type(s1)),
w(value_type(s2))
{}
template <typename T>
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
A const & s1,
tref2<B> const & v,
C const & s2
) :
x(value_type(s1)),
y(value_type(v.x)),
z(value_type(v.y)),
w(value_type(s2))
{}
template <typename T>
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
A const & s1,
B const & s2,
tref2<C> const & v
) :
x(value_type(s1)),
y(value_type(s2)),
z(value_type(v.x)),
w(value_type(v.y))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
tref3<A> const & v,
B const & s
) :
x(value_type(v.x)),
y(value_type(v.y)),
z(value_type(v.z)),
w(value_type(s))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
A const & s,
tref3<B> const & v
) :
x(value_type(s)),
y(value_type(v.x)),
z(value_type(v.y)),
w(value_type(v.z))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
tref2<A> const & v1,
tref2<B> const & v2
) :
x(value_type(v1.x)),
y(value_type(v1.y)),
z(value_type(v2.x)),
w(value_type(v2.y))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
tvec2<A> const & v1,
tref2<B> const & v2
) :
x(value_type(v1.x)),
y(value_type(v1.y)),
z(value_type(v2.x)),
w(value_type(v2.y))
{}
template <typename T>
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<T>::tvec4
(
tref2<A> const & v1,
tvec2<B> const & v2
) :
x(value_type(v1.x)),
y(value_type(v1.y)),
z(value_type(v2.x)),
w(value_type(v2.y))
{}
//////////////////////////////////////
// Convertion scalar constructors