Fixed merge

This commit is contained in:
Christophe Riccio
2013-05-27 14:54:02 +00:00
24 changed files with 463 additions and 464 deletions

View File

@@ -56,127 +56,127 @@ namespace glm
/// @todo Implement epsilon for half-precision floating point type.
/// @see gtc_constants
template <typename genType>
genType epsilon();
GLM_FUNC_DECL genType epsilon();
/// Return 0.
/// @see gtc_constants
template <typename genType>
genType zero();
GLM_FUNC_DECL genType zero();
/// Return 1.
/// @see gtc_constants
template <typename genType>
genType one();
GLM_FUNC_DECL genType one();
/// Return the pi constant.
/// @see gtc_constants
template <typename genType>
genType pi();
GLM_FUNC_DECL genType pi();
/// Return square root of pi.
/// @see gtc_constants
template <typename genType>
genType root_pi();
GLM_FUNC_DECL genType root_pi();
/// Return pi / 2.
/// @see gtc_constants
template <typename genType>
genType half_pi();
GLM_FUNC_DECL genType half_pi();
/// Return pi / 4.
/// @see gtc_constants
template <typename genType>
genType quarter_pi();
GLM_FUNC_DECL genType quarter_pi();
/// Return 1 / pi.
/// @see gtc_constants
template <typename genType>
genType one_over_pi();
GLM_FUNC_DECL genType one_over_pi();
/// Return 2 / pi.
/// @see gtc_constants
template <typename genType>
genType two_over_pi();
GLM_FUNC_DECL genType two_over_pi();
/// Return 2 / sqrt(pi).
/// @see gtc_constants
template <typename genType>
genType two_over_root_pi();
GLM_FUNC_DECL genType two_over_root_pi();
/// Return 1 / sqrt(2).
/// @see gtc_constants
template <typename genType>
genType one_over_root_two();
GLM_FUNC_DECL genType one_over_root_two();
/// Return sqrt(pi / 2).
/// @see gtc_constants
template <typename genType>
genType root_half_pi();
GLM_FUNC_DECL genType root_half_pi();
/// Return sqrt(2 * pi).
/// @see gtc_constants
template <typename genType>
genType root_two_pi();
GLM_FUNC_DECL genType root_two_pi();
/// Return sqrt(ln(4)).
/// @see gtc_constants
template <typename genType>
genType root_ln_four();
GLM_FUNC_DECL genType root_ln_four();
/// Return e constant.
/// @see gtc_constants
template <typename genType>
genType e();
GLM_FUNC_DECL genType e();
/// Return Euler's constant.
/// @see gtc_constants
template <typename genType>
genType euler();
GLM_FUNC_DECL genType euler();
/// Return sqrt(2).
/// @see gtc_constants
template <typename genType>
genType root_two();
GLM_FUNC_DECL genType root_two();
/// Return sqrt(3).
/// @see gtc_constants
template <typename genType>
genType root_three();
GLM_FUNC_DECL genType root_three();
/// Return sqrt(5).
/// @see gtc_constants
template <typename genType>
genType root_five();
GLM_FUNC_DECL genType root_five();
/// Return ln(2).
/// @see gtc_constants
template <typename genType>
genType ln_two();
GLM_FUNC_DECL genType ln_two();
/// Return ln(10).
/// @see gtc_constants
template <typename genType>
genType ln_ten();
GLM_FUNC_DECL genType ln_ten();
/// Return ln(ln(2)).
/// @see gtc_constants
template <typename genType>
genType ln_ln_two();
GLM_FUNC_DECL genType ln_ln_two();
/// Return 1 / 3.
/// @see gtc_constants
template <typename genType>
genType third();
GLM_FUNC_DECL genType third();
/// Return 2 / 3.
/// @see gtc_constants
template <typename genType>
genType two_thirds();
GLM_FUNC_DECL genType two_thirds();
/// Return the golden ratio constant.
/// @see gtc_constants
template <typename genType>
genType golden_ratio();
GLM_FUNC_DECL genType golden_ratio();
/// @}
} //namespace glm

View File

@@ -68,77 +68,77 @@ namespace detail
//////////////////////////////////////
// Accesses
half & operator[](size_type i);
half const & operator[](size_type i) const;
GLM_FUNC_DECL half & operator[](size_type i);
GLM_FUNC_DECL half const & operator[](size_type i) const;
//////////////////////////////////////
// Implicit basic constructors
tvec2();
tvec2(tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2();
GLM_FUNC_DECL tvec2(tvec2<half, P> const & v);
//////////////////////////////////////
// Explicit basic constructors
explicit tvec2(ctor){}
explicit tvec2(
GLM_FUNC_DECL explicit tvec2(ctor){}
GLM_FUNC_DECL explicit tvec2(
half const & s);
explicit tvec2(
GLM_FUNC_DECL explicit tvec2(
half const & s1,
half const & s2);
//////////////////////////////////////
// Swizzle constructors
tvec2(tref2<half, P> const & r);
GLM_FUNC_DECL tvec2(tref2<half, P> const & r);
//////////////////////////////////////
// Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec2(U const & x);
GLM_FUNC_DECL explicit tvec2(U const & x);
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, typename V>
explicit tvec2(U const & x, V const & y);
template <typename U, typename V>
GLM_FUNC_DECL explicit tvec2(U const & x, V const & y);
//////////////////////////////////////
// Convertion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
explicit tvec2(tvec2<U, Q> const & v);
GLM_FUNC_DECL explicit tvec2(tvec2<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>
explicit tvec2(tvec3<U, Q> const & v);
GLM_FUNC_DECL explicit tvec2(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>
explicit tvec2(tvec4<U, Q> const & v);
GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec2<half, P>& operator= (tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2<half, P>& operator= (tvec2<half, P> const & v);
tvec2<half, P>& operator+=(half const & s);
tvec2<half, P>& operator+=(tvec2<half, P> const & v);
tvec2<half, P>& operator-=(half const & s);
tvec2<half, P>& operator-=(tvec2<half, P> const & v);
tvec2<half, P>& operator*=(half const & s);
tvec2<half, P>& operator*=(tvec2<half, P> const & v);
tvec2<half, P>& operator/=(half const & s);
tvec2<half, P>& operator/=(tvec2<half, P> const & v);
tvec2<half, P>& operator++();
tvec2<half, P>& operator--();
GLM_FUNC_DECL tvec2<half, P>& operator+=(half const & s);
GLM_FUNC_DECL tvec2<half, P>& operator+=(tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2<half, P>& operator-=(half const & s);
GLM_FUNC_DECL tvec2<half, P>& operator-=(tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2<half, P>& operator*=(half const & s);
GLM_FUNC_DECL tvec2<half, P>& operator*=(tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2<half, P>& operator/=(half const & s);
GLM_FUNC_DECL tvec2<half, P>& operator/=(tvec2<half, P> const & v);
GLM_FUNC_DECL tvec2<half, P>& operator++();
GLM_FUNC_DECL tvec2<half, P>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half, P> swizzle(comp X, comp Y) const;
tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
tref2<half, P> swizzle(comp X, comp Y);
GLM_FUNC_DECL half swizzle(comp X) const;
GLM_FUNC_DECL tvec2<half, P> swizzle(comp X, comp Y) const;
GLM_FUNC_DECL tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
GLM_FUNC_DECL tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
GLM_FUNC_DECL tref2<half, P> swizzle(comp X, comp Y);
};
template <precision P>
@@ -160,22 +160,22 @@ namespace detail
//////////////////////////////////////
// Accesses
half & operator[](size_type i);
half const & operator[](size_type i) const;
GLM_FUNC_DECL half & operator[](size_type i);
GLM_FUNC_DECL half const & operator[](size_type i) const;
//////////////////////////////////////
// Implicit basic constructors
tvec3();
tvec3(tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3();
GLM_FUNC_DECL tvec3(tvec3<half, P> const & v);
//////////////////////////////////////
// Explicit basic constructors
explicit tvec3(ctor){}
explicit tvec3(
GLM_FUNC_DECL explicit tvec3(ctor){}
GLM_FUNC_DECL explicit tvec3(
half const & s);
explicit tvec3(
GLM_FUNC_DECL explicit tvec3(
half const & s1,
half const & s2,
half const & s3);
@@ -183,58 +183,59 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
tvec3(tref3<half, P> const & r);
GLM_FUNC_DECL tvec3(tref3<half, P> const & r);
//////////////////////////////////////
// Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec3(U const & x);
GLM_FUNC_DECL explicit tvec3(U const & x);
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, typename V, typename W>
explicit tvec3(U const & x, V const & y, W const & z);
GLM_FUNC_DECL explicit tvec3(U const & x, V const & y, W const & z);
//////////////////////////////////////
// Convertion 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>
explicit tvec3(tvec2<A, Q> const & v, B const & s);
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>
explicit tvec3(A const & s, tvec2<B, Q> const & v);
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>
explicit tvec3(tvec3<U, Q> const & v);
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>
explicit tvec3(tvec4<U, Q> const & v);
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec3<half, P>& operator= (tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3<half, P>& operator= (tvec3<half, P> const & v);
tvec3<half, P>& operator+=(half const & s);
tvec3<half, P>& operator+=(tvec3<half, P> const & v);
tvec3<half, P>& operator-=(half const & s);
tvec3<half, P>& operator-=(tvec3<half, P> const & v);
tvec3<half, P>& operator*=(half const & s);
tvec3<half, P>& operator*=(tvec3<half, P> const & v);
tvec3<half, P>& operator/=(half const & s);
tvec3<half, P>& operator/=(tvec3<half, P> const & v);
tvec3<half, P>& operator++();
tvec3<half, P>& operator--();
GLM_FUNC_DECL tvec3<half, P>& operator+=(half const & s);
GLM_FUNC_DECL tvec3<half, P>& operator+=(tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3<half, P>& operator-=(half const & s);
GLM_FUNC_DECL tvec3<half, P>& operator-=(tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3<half, P>& operator*=(half const & s);
GLM_FUNC_DECL tvec3<half, P>& operator*=(tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3<half, P>& operator/=(half const & s);
GLM_FUNC_DECL tvec3<half, P>& operator/=(tvec3<half, P> const & v);
GLM_FUNC_DECL tvec3<half, P>& operator++();
GLM_FUNC_DECL tvec3<half, P>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half, P> swizzle(comp X, comp Y) const;
tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
tref3<half, P> swizzle(comp X, comp Y, comp Z);
GLM_FUNC_DECL half swizzle(comp X) const;
GLM_FUNC_DECL tvec2<half, P> swizzle(comp X, comp Y) const;
GLM_FUNC_DECL tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
GLM_FUNC_DECL tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
GLM_FUNC_DECL tref3<half, P> swizzle(comp X, comp Y, comp Z);
};
template <precision P>
@@ -256,22 +257,23 @@ namespace detail
//////////////////////////////////////
// Accesses
half & operator[](size_type i);
half const & operator[](size_type i) const;
GLM_FUNC_DECL half & operator[](size_type i);
GLM_FUNC_DECL half const & operator[](size_type i) const;
//////////////////////////////////////
// Implicit basic constructors
tvec4();
tvec4(tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4();
GLM_FUNC_DECL tvec4(tvec4<half, P> const & v);
//////////////////////////////////////
// Explicit basic constructors
explicit tvec4(ctor){}
explicit tvec4(
GLM_FUNC_DECL explicit tvec4(ctor){}
GLM_FUNC_DECL explicit tvec4(
half const & s);
explicit tvec4(
GLM_FUNC_DECL explicit tvec4(
half const & s0,
half const & s1,
half const & s2,
@@ -280,67 +282,67 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
tvec4(tref4<half, P> const & r);
GLM_FUNC_DECL tvec4(tref4<half, P> const & r);
//////////////////////////////////////
// Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec4(U const & x);
GLM_FUNC_DECL explicit tvec4(U const & x);
//! 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>
explicit tvec4(A const & x, B const & y, C const & z, D const & w);
GLM_FUNC_DECL explicit tvec4(A const & x, B const & y, C const & z, D const & w);
//////////////////////////////////////
// Convertion 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>
explicit tvec4(tvec2<A, Q> const & v, B const & s1, C const & s2);
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> 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, precision Q>
explicit tvec4(A const & s1, tvec2<B, Q> const & v, C const & s2);
GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2<B, Q> 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, precision Q>
explicit tvec4(A const & s1, B const & s2, tvec2<C, Q> const & v);
GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2<C, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
explicit tvec4(tvec3<A, Q> const & v, B const & s);
GLM_FUNC_DECL explicit tvec4(tvec3<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>
explicit tvec4(A const & s, tvec3<B, Q> const & v);
GLM_FUNC_DECL explicit tvec4(A const & s, tvec3<B, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
explicit tvec4(tvec2<A, Q> const & v1, tvec2<B, Q> const & v2);
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & v1, tvec2<B, Q> const & v2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
explicit tvec4(tvec4<U, Q> const & v);
GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec4<half, P>& operator= (tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4<half, P>& operator= (tvec4<half, P> const & v);
tvec4<half, P>& operator+=(half const & s);
tvec4<half, P>& operator+=(tvec4<half, P> const & v);
tvec4<half, P>& operator-=(half const & s);
tvec4<half, P>& operator-=(tvec4<half, P> const & v);
tvec4<half, P>& operator*=(half const & s);
tvec4<half, P>& operator*=(tvec4<half, P> const & v);
tvec4<half, P>& operator/=(half const & s);
tvec4<half, P>& operator/=(tvec4<half, P> const & v);
tvec4<half, P>& operator++();
tvec4<half, P>& operator--();
GLM_FUNC_DECL tvec4<half, P>& operator+=(half const & s);
GLM_FUNC_DECL tvec4<half, P>& operator+=(tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4<half, P>& operator-=(half const & s);
GLM_FUNC_DECL tvec4<half, P>& operator-=(tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4<half, P>& operator*=(half const & s);
GLM_FUNC_DECL tvec4<half, P>& operator*=(tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4<half, P>& operator/=(half const & s);
GLM_FUNC_DECL tvec4<half, P>& operator/=(tvec4<half, P> const & v);
GLM_FUNC_DECL tvec4<half, P>& operator++();
GLM_FUNC_DECL tvec4<half, P>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half, P> swizzle(comp X, comp Y) const;
tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<half, P> swizzle(comp X, comp Y, comp Z, comp W);
GLM_FUNC_DECL half swizzle(comp X) const;
GLM_FUNC_DECL tvec2<half, P> swizzle(comp X, comp Y) const;
GLM_FUNC_DECL tvec3<half, P> swizzle(comp X, comp Y, comp Z) const;
GLM_FUNC_DECL tvec4<half, P> swizzle(comp X, comp Y, comp Z, comp W) const;
GLM_FUNC_DECL tref4<half, P> swizzle(comp X, comp Y, comp Z, comp W);
};
#endif//(GLM_COMPONENT == GLM_COMPONENT_CXX98)
}
@@ -647,19 +649,19 @@ namespace detail
/// Returns the absolute value of a half-precision floating-point value
/// @see gtc_half_float
half abs(half const & x);
GLM_FUNC_DECL half abs(half const & x);
/// Returns the absolute value of a half-precision floating-point two dimensional vector
/// @see gtc_half_float
hvec2 abs(hvec2 const & x);
GLM_FUNC_DECL hvec2 abs(hvec2 const & x);
/// Returns the absolute value of a half-precision floating-point three dimensional vector
/// @see gtc_half_float
hvec3 abs(hvec3 const & x);
GLM_FUNC_DECL hvec3 abs(hvec3 const & x);
/// Returns the absolute value of a half-precision floating-point four dimensional vector
/// @see gtc_half_float
hvec4 abs(hvec4 const & x);
GLM_FUNC_DECL hvec4 abs(hvec4 const & x);
/// Selects which vector each returned component comes
/// from. For a component of <a> that is false, the
@@ -673,7 +675,7 @@ namespace detail
/// where a is a Boolean vector.
///
/// @see gtc_half_float
half mix(half const & x, half const & y, bool const & a);
GLM_FUNC_DECL half mix(half const & x, half const & y, bool const & a);
/// @}
}// namespace glm