Skip to content

Commit

Permalink
- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed May 5, 2016
1 parent d0c4bba commit c50f3ed
Show file tree
Hide file tree
Showing 17 changed files with 281 additions and 281 deletions.
36 changes: 18 additions & 18 deletions glm/detail/type_mat2x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,45 +56,45 @@ namespace glm
public:
// -- Constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(tmat2x3<T, Q> const & m);
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);

GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x3(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x3(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(
GLM_FUNC_DECL explicit tmat2x3(T scalar);
GLM_FUNC_DECL tmat2x3(
T x0, T y0, T z0,
T x1, T y1, T z1);
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(
GLM_FUNC_DECL tmat2x3(
col_type const & v0,
col_type const & v1);

// -- Conversions --

template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(
GLM_FUNC_DECL tmat2x3(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2);

template <typename U, typename V>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x3(
GLM_FUNC_DECL tmat2x3(
tvec3<U, P> const & v1,
tvec3<V, P> const & v2);

// -- Matrix conversions --

template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat2x3<U, Q> const & m);

GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x3(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3<U, Q> const & m);

GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x3<T, P> const & x);

// -- Accesses --

Expand Down
34 changes: 17 additions & 17 deletions glm/detail/type_mat2x3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace glm

# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3()
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
Expand All @@ -47,7 +47,7 @@ namespace glm

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
Expand All @@ -56,7 +56,7 @@ namespace glm

template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
Expand All @@ -67,14 +67,14 @@ namespace glm
{}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(T scalar)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T scalar)
{
this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
T x0, T y0, T z0,
T x1, T y1, T z1
Expand All @@ -85,7 +85,7 @@ namespace glm
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
Expand All @@ -97,7 +97,7 @@ namespace glm
template <
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2
Expand All @@ -109,7 +109,7 @@ namespace glm

template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
Expand All @@ -119,63 +119,63 @@ namespace glm

template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}

template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m)
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
Expand Down
36 changes: 18 additions & 18 deletions glm/detail/type_mat2x4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ namespace glm
public:
// -- Constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(tmat2x4<T, Q> const & m);
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);

GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x4(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x4(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(
GLM_FUNC_DECL explicit tmat2x4(T scalar);
GLM_FUNC_DECL tmat2x4(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1);
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(
GLM_FUNC_DECL tmat2x4(
col_type const & v0,
col_type const & v1);

Expand All @@ -75,28 +75,28 @@ namespace glm
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(
GLM_FUNC_DECL tmat2x4(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2);

template <typename U, typename V>
GLM_FUNC_DECL GLM_CONSTEXPR tmat2x4(
GLM_FUNC_DECL tmat2x4(
tvec4<U, P> const & v1,
tvec4<V, P> const & v2);

// -- Matrix conversions --

template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat2x4<U, Q> const & m);

GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x4(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4<U, Q> const & m);

GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x3<T, P> const & x);

// -- Accesses --

Expand Down
Loading

0 comments on commit c50f3ed

Please sign in to comment.