mirror of
https://github.com/g-truc/glm.git
synced 2024-11-12 21:31:47 +00:00
Simplify GLM_FORCE_EXPLICIT_CTOR declarations
- Instead of wrapping the declarations, use a macro for the keyword "explicit"
This commit is contained in:
parent
c2078afc12
commit
9cc7dc1763
@ -98,13 +98,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat2x2(tmat2x2<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat2x2(tmat2x2<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
|
||||||
|
@ -94,13 +94,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversion
|
// Matrix conversion
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat2x3(tmat2x3<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat2x3(tmat2x3<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x);
|
||||||
|
@ -95,13 +95,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat2x4(tmat2x4<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat2x4(tmat2x4<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
|
||||||
|
@ -101,13 +101,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat3x2(tmat3x2<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat3x2(tmat3x2<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
|
||||||
|
@ -105,13 +105,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat3x3(tmat3x3<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat3x3(tmat3x3<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
|
||||||
|
@ -100,13 +100,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversion
|
// Matrix conversion
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat3x4(tmat3x4<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat3x4(tmat3x4<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x);
|
||||||
|
@ -106,13 +106,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat4x2(tmat4x2<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat4x2(tmat4x2<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
|
||||||
|
@ -105,13 +105,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat4x3(tmat4x3<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat4x3(tmat4x3<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x);
|
||||||
|
@ -110,13 +110,8 @@ namespace glm
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Matrix conversions
|
// Matrix conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tmat4x4(tmat4x4<U, Q> const & m);
|
||||||
GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, Q> const & m);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tmat4x4(tmat4x4<U, Q> const & m);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x);
|
||||||
GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x);
|
||||||
|
@ -136,15 +136,9 @@ namespace glm
|
|||||||
template <typename U, precision Q>
|
template <typename U, precision Q>
|
||||||
GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
|
GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tvec1(tvec1<U, Q> const & v);
|
||||||
GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
|
|
||||||
# else
|
|
||||||
//! 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 tvec1(tvec1<U, Q> const & v);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Swizzle constructors
|
// Swizzle constructors
|
||||||
|
@ -144,15 +144,9 @@ namespace glm
|
|||||||
template <typename U, precision Q>
|
template <typename U, precision Q>
|
||||||
GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
|
GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tvec2(tvec2<U, Q> const & v);
|
||||||
GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v);
|
|
||||||
# else
|
|
||||||
//! 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 tvec2(tvec2<U, Q> const & v);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Swizzle constructors
|
// Swizzle constructors
|
||||||
|
@ -154,15 +154,9 @@ namespace glm
|
|||||||
template <typename U, precision Q>
|
template <typename U, precision Q>
|
||||||
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
|
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tvec3(tvec3<U, Q> const & v);
|
||||||
GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
|
|
||||||
# else
|
|
||||||
//! 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 tvec3(tvec3<U, Q> const & v);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Swizzle constructors
|
// Swizzle constructors
|
||||||
|
@ -229,16 +229,10 @@ namespace detail
|
|||||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||||
template <typename A, typename B, precision Q>
|
template <typename A, typename B, precision Q>
|
||||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
|
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tvec4(tvec4<U, Q> const & v);
|
||||||
GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
|
|
||||||
# else
|
|
||||||
//! 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 tvec4(tvec4<U, Q> const & v);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Swizzle constructors
|
// Swizzle constructors
|
||||||
|
@ -108,24 +108,19 @@ namespace glm
|
|||||||
GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z);
|
GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z);
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Convertions
|
// Conversions
|
||||||
|
|
||||||
|
template <typename U, precision Q>
|
||||||
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tquat(tquat<U, Q> const & q);
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL explicit tquat(tquat<U, Q> const & q);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tquat(tquat<U, Q> const & q);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// explicit conversion operators
|
// explicit conversion operators
|
||||||
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
|
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
|
||||||
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
|
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
|
||||||
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
|
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/// Create a quaternion from two normalized axis
|
/// Create a quaternion from two normalized axis
|
||||||
///
|
///
|
||||||
/// @param u A first normalized axis
|
/// @param u A first normalized axis
|
||||||
/// @param v A second normalized axis
|
/// @param v A second normalized axis
|
||||||
/// @see gtc_quaternion
|
/// @see gtc_quaternion
|
||||||
|
@ -110,13 +110,8 @@ namespace glm
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
// tdualquat conversions
|
// tdualquat conversions
|
||||||
|
|
||||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
template <typename U, precision Q>
|
||||||
template <typename U, precision Q>
|
GLM_FUNC_DECL GLM_EXPLICIT_CTOR_MAYBE tdualquat(tdualquat<U, Q> const & q);
|
||||||
GLM_FUNC_DECL explicit tdualquat(tdualquat<U, Q> const & q);
|
|
||||||
# else
|
|
||||||
template <typename U, precision Q>
|
|
||||||
GLM_FUNC_DECL tdualquat(tdualquat<U, Q> const & q);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
|
GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
|
||||||
GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
|
GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
|
||||||
|
Loading…
Reference in New Issue
Block a user