mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 18:24:35 +00:00
Merge branch '0.9.2' into 0.9.3
This commit is contained in:
commit
30e2682230
@ -101,11 +101,6 @@ namespace detail
|
||||
value_type const & s2,
|
||||
value_type const & s3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
GLM_FUNC_DECL tvec3(tref3<T> const & r);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Convertion scalar constructors
|
||||
|
||||
@ -136,6 +131,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
|
||||
|
||||
|
@ -131,6 +131,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
|
||||
|
||||
|
@ -103,11 +103,6 @@ namespace detail
|
||||
value_type const & s2,
|
||||
value_type const & s3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
GLM_FUNC_DECL tvec4(tref4<T> const & r);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Convertion scalar constructors
|
||||
|
||||
@ -148,6 +143,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
|
||||
|
||||
|
@ -137,6 +137,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
|
||||
|
||||
|
@ -48,6 +48,11 @@ generation distribution.
|
||||
- Removed many unused namespaces
|
||||
- Fixed half based type contructors
|
||||
|
||||
================================================================================
|
||||
GLM 0.9.2.7: 2011-1X-XX
|
||||
--------------------------------------------------------------------------------
|
||||
- Added more swizzling constructors
|
||||
|
||||
================================================================================
|
||||
GLM 0.9.2.6: 2011-10-01
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -121,13 +121,83 @@ int test_swizzle_vec4_const_static()
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_swizzle_vec3_partial()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::ivec3 A(0, 1, 2);
|
||||
|
||||
{
|
||||
glm::ivec3 B(A.swizzle(glm::R, glm::G, glm::B));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec3 B(A.swizzle(glm::R, glm::G), 2);
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec3 B(0, A.swizzle(glm::G, glm::B));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_swizzle_vec4_partial()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::ivec4 A(0, 1, 2, 3);
|
||||
|
||||
{
|
||||
glm::ivec4 B(A.swizzle(glm::R, glm::G, glm::B), 3);
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(A.swizzle(glm::R, glm::G), 2, 3);
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(0, A.swizzle(glm::G, glm::B), 3);
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(0, 1, A.swizzle(glm::B, glm::A));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(A.swizzle(glm::X, glm::Y), A.swizzle(glm::Z, glm::W));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(A.swizzle(glm::X, glm::Y), glm::vec2(2, 3));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::ivec4 B(glm::vec2(0, 1), A.swizzle(glm::Z, glm::W));
|
||||
Error += (A == B) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += test_swizzle_vec3_partial();
|
||||
Error += test_swizzle_vec4_ref_dynamic();
|
||||
Error += test_swizzle_vec4_ref_static();
|
||||
Error += test_swizzle_vec4_const_dynamic();
|
||||
Error += test_swizzle_vec4_const_static();
|
||||
Error += test_swizzle_vec4_partial();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user