Added support of defaulted functions to GLM types, to use them in unions #366

master
Christophe Riccio ago%!(EXTRA string=10 years)
parent 644e567e09
commit a56a40e1f2
  1. 10
      glm/detail/type_mat2x2.hpp
  2. 47
      glm/detail/type_mat2x2.inl
  3. 8
      glm/detail/type_mat2x3.hpp
  4. 47
      glm/detail/type_mat2x3.inl
  5. 6
      glm/detail/type_mat2x4.hpp
  6. 47
      glm/detail/type_mat2x4.inl
  7. 7
      glm/detail/type_mat3x2.hpp
  8. 53
      glm/detail/type_mat3x2.inl
  9. 7
      glm/detail/type_mat3x3.hpp
  10. 60
      glm/detail/type_mat3x3.inl
  11. 7
      glm/detail/type_mat3x4.hpp
  12. 53
      glm/detail/type_mat3x4.inl
  13. 7
      glm/detail/type_mat4x2.hpp
  14. 59
      glm/detail/type_mat4x2.inl
  15. 8
      glm/detail/type_mat4x3.hpp
  16. 58
      glm/detail/type_mat4x3.inl
  17. 8
      glm/detail/type_mat4x4.hpp
  18. 63
      glm/detail/type_mat4x4.inl
  19. 6
      glm/gtc/quaternion.hpp
  20. 42
      glm/gtc/quaternion.inl
  21. 6
      glm/gtx/dual_quaternion.hpp
  22. 42
      glm/gtx/dual_quaternion.inl
  23. 1
      readme.md
  24. 16
      test/core/core_type_mat2x2.cpp
  25. 18
      test/core/core_type_mat2x3.cpp
  26. 18
      test/core/core_type_mat2x4.cpp
  27. 18
      test/core/core_type_mat3x2.cpp
  28. 18
      test/core/core_type_mat3x3.cpp
  29. 18
      test/core/core_type_mat3x4.cpp
  30. 16
      test/core/core_type_mat4x2.cpp
  31. 16
      test/core/core_type_mat4x3.cpp
  32. 16
      test/core/core_type_mat4x4.cpp
  33. 16
      test/gtc/gtc_quaternion.cpp

@ -62,15 +62,14 @@ namespace glm
# endif//GLM_META_PROG_HELPERS # endif//GLM_META_PROG_HELPERS
private: private:
/// @cond DETAIL
col_type value[2]; col_type value[2];
/// @endcond
public: public:
////////////////////////////////////// //////////////////////////////////////
// Constructors // Constructors
GLM_FUNC_DECL tmat2x2();
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m); GLM_FUNC_DECL tmat2x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m); GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
@ -85,6 +84,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversions // Conversions
template <typename U, typename V, typename M, typename N> template <typename U, typename V, typename M, typename N>
GLM_FUNC_DECL tmat2x2( GLM_FUNC_DECL tmat2x2(
U const & x1, V const & y1, U const & x1, V const & y1,
@ -130,7 +130,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v); GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v) GLM_DEFAULT;;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m); GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);

@ -53,21 +53,23 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1); this->value[0] = col_type(1, 0);
# endif this->value[1] = col_type(0, 1);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -108,6 +110,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Conversion constructors // Conversion constructors
template <typename T, precision P> template <typename T, precision P>
template <typename X1, typename Y1, typename X2, typename Y2> template <typename X1, typename Y1, typename X2, typename Y2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2 GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
@ -243,13 +246,15 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
return *this; this->value[1] = m[1];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -58,14 +58,12 @@ namespace glm
# endif//GLM_META_PROG_HELPERS # endif//GLM_META_PROG_HELPERS
private: private:
/// @cond DETAIL
col_type value[2]; col_type value[2];
/// @endcond
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat2x3(); GLM_FUNC_DECL tmat2x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m); GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m); GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
@ -126,7 +124,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m); GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m); GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m);

@ -35,21 +35,23 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0); this->value[0] = col_type(1, 0, 0);
# endif this->value[1] = col_type(0, 1, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER 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[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -90,6 +92,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversion constructors // Conversion constructors
template <typename T, precision P> template <typename T, precision P>
template < template <
typename X1, typename Y1, typename Z1, typename X1, typename Y1, typename Z1,
@ -227,13 +230,15 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
return *this; this->value[1] = m[1];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -64,8 +64,8 @@ namespace glm
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat2x4(); GLM_FUNC_DECL tmat2x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m); GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m); GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
@ -127,7 +127,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m); GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m); GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);

@ -35,21 +35,23 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0, 0); this->value[0] = col_type(1, 0, 0, 0);
# endif this->value[1] = col_type(0, 1, 0, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -91,6 +93,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversion constructors // Conversion constructors
template <typename T, precision P> template <typename T, precision P>
template < template <
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
@ -228,13 +231,15 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
return *this; this->value[1] = m[1];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -64,8 +64,9 @@ namespace glm
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat3x2();
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m); GLM_FUNC_DECL tmat3x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m); GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
@ -133,7 +134,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m); GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m); GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);

@ -35,23 +35,25 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1); this->value[0] = col_type(1, 0);
this->value[2] = col_type(0, 0); this->value[1] = col_type(0, 1);
# endif this->value[2] = col_type(0, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -102,6 +104,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversion constructors // Conversion constructors
template <typename T, precision P> template <typename T, precision P>
template < template <
typename X1, typename Y1, typename X1, typename Y1,
@ -257,14 +260,16 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
return *this; this->value[2] = m[2];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -68,8 +68,9 @@ namespace glm
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat3x3();
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m); GLM_FUNC_DECL tmat3x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m); GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
@ -137,7 +138,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m); GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m); GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);

@ -59,27 +59,25 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0); this->value[0] = col_type(1, 0, 0);
this->value[2] = col_type(0, 0, 1); this->value[1] = col_type(0, 1, 0);
# endif this->value[2] = col_type(0, 0, 1);
} # endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -90,6 +88,10 @@ namespace detail
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s) GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s)
{ {
@ -281,14 +283,16 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Operators // Operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
return *this; this->value[2] = m[2];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -64,8 +64,9 @@ namespace glm
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat3x4();
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m); GLM_FUNC_DECL tmat3x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m); GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
@ -132,7 +133,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m); GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m); GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);

@ -35,23 +35,25 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0, 0); this->value[0] = col_type(1, 0, 0, 0);
this->value[2] = col_type(0, 0, 1, 0); this->value[1] = col_type(0, 1, 0, 0);
# endif this->value[2] = col_type(0, 0, 1, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -103,6 +105,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversion constructors // Conversion constructors
template <typename T, precision P> template <typename T, precision P>
template < template <
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
@ -256,14 +259,16 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
return *this; this->value[2] = m[2];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -64,8 +64,9 @@ namespace glm
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat4x2();
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m); GLM_FUNC_DECL tmat4x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m); GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
@ -138,7 +139,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m); GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m); GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);

@ -35,25 +35,27 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1); this->value[0] = col_type(1, 0);
this->value[2] = col_type(0, 0); this->value[1] = col_type(0, 1);
this->value[3] = col_type(0, 0); this->value[2] = col_type(0, 0);
# endif this->value[3] = col_type(0, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
this->value[2] = m.value[2]; this->value[2] = m.value[2];
this->value[3] = m.value[3]; this->value[3] = m.value[3];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -150,6 +152,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Conversion // Conversion
template <typename T, precision P> template <typename T, precision P>
template <typename U, precision Q> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m) GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m)
@ -280,15 +283,17 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
this->value[3] = m[3]; this->value[2] = m[2];
return *this; this->value[3] = m[3];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -58,13 +58,13 @@ namespace glm
# endif//GLM_META_PROG_HELPERS # endif//GLM_META_PROG_HELPERS
private: private:
// Data
col_type value[4]; col_type value[4];
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat4x3();
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m); GLM_FUNC_DECL tmat4x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m); GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
@ -137,7 +137,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m); GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m); GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);

@ -35,25 +35,27 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0); this->value[0] = col_type(1, 0, 0);
this->value[2] = col_type(0, 0, 1); this->value[1] = col_type(0, 1, 0);
this->value[3] = col_type(0, 0, 0); this->value[2] = col_type(0, 0, 1);
# endif this->value[3] = col_type(0, 0, 0);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
this->value[2] = m.value[2]; this->value[2] = m.value[2];
this->value[3] = m.value[3]; this->value[3] = m.value[3];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -280,15 +282,17 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
this->value[0] = m[0]; {
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
this->value[3] = m[3]; this->value[2] = m[2];
return *this; this->value[3] = m[3];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -62,14 +62,12 @@ namespace glm
friend tvec4<U, Q> operator/(tvec4<U, Q> const & v, tmat4x4<U, Q> const & m); friend tvec4<U, Q> operator/(tvec4<U, Q> const & v, tmat4x4<U, Q> const & m);
private: private:
/// @cond DETAIL
col_type value[4]; col_type value[4];
/// @endcond
public: public:
// Constructors // Constructors
GLM_FUNC_DECL tmat4x4(); GLM_FUNC_DECL tmat4x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m); GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m); GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
@ -142,7 +140,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m); GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m); GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);

@ -95,25 +95,27 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4() template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
# ifndef GLM_FORCE_NO_CTOR_INIT {
this->value[0] = col_type(1, 0, 0, 0); # ifndef GLM_FORCE_NO_CTOR_INIT
this->value[1] = col_type(0, 1, 0, 0); this->value[0] = col_type(1, 0, 0, 0);
this->value[2] = col_type(0, 0, 1, 0); this->value[1] = col_type(0, 1, 0, 0);
this->value[3] = col_type(0, 0, 0, 1); this->value[2] = col_type(0, 0, 1, 0);
# endif this->value[3] = col_type(0, 0, 0, 1);
} # endif
}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
this->value[1] = m[1]; this->value[1] = m[1];
this->value[2] = m[2]; this->value[2] = m[2];
this->value[3] = m[3]; this->value[3] = m[3];
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -246,6 +248,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Matrix convertion constructors // Matrix convertion constructors
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m)
{ {
@ -366,17 +369,19 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Operators // Operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
//memcpy could be faster {
//memcpy(&this->value, &m.value, 16 * sizeof(valType)); //memcpy could be faster
this->value[0] = m[0]; //memcpy(&this->value, &m.value, 16 * sizeof(valType));
this->value[1] = m[1]; this->value[0] = m[0];
this->value[2] = m[2]; this->value[1] = m[1];
this->value[3] = m[3]; this->value[2] = m[2];
return *this; this->value[3] = m[3];
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -95,8 +95,8 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
GLM_FUNC_DECL tquat(); GLM_FUNC_DECL tquat() GLM_DEFAULT;
GLM_FUNC_DECL tquat(tquat<T, P> const & q); GLM_FUNC_DECL tquat(tquat<T, P> const & q) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tquat(tquat<T, Q> const & q); GLM_FUNC_DECL tquat(tquat<T, Q> const & q);
@ -135,7 +135,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Operators // Operators
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m); GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m); GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m);

@ -97,17 +97,19 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tquat<T, P>::tquat() template <typename T, precision P>
# ifndef GLM_FORCE_NO_CTOR_INIT GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
: x(0), y(0), z(0), w(1) # ifndef GLM_FORCE_NO_CTOR_INIT
# endif : x(0), y(0), z(0), w(1)
{} # endif
{}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, P> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w) : x(q.x), y(q.y), z(q.z), w(q.w)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -225,15 +227,17 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// tquat<valType> operators // tquat<valType> operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
this->w = q.w; {
this->x = q.x; this->w = q.w;
this->y = q.y; this->x = q.x;
this->z = q.z; this->y = q.y;
return *this; this->z = q.z;
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -94,8 +94,8 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
GLM_FUNC_DECL tdualquat(); GLM_FUNC_DECL tdualquat() GLM_DEFAULT;
GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d); GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d) GLM_DEFAULT;
template <precision Q> template <precision Q>
GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d); GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d);
@ -117,7 +117,7 @@ namespace glm
GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat); GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
// Operators // Operators
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const & m); GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const & m) GLM_DEFAULT;
template <typename U> template <typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const & m); GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const & m);

@ -83,19 +83,21 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat() template <typename T, precision P>
# ifndef GLM_FORCE_NO_CTOR_INIT GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
: real(tquat<T, P>()) # ifndef GLM_FORCE_NO_CTOR_INIT
, dual(tquat<T, P>(0, 0, 0, 0)) : real(tquat<T, P>())
# endif , dual(tquat<T, P>(0, 0, 0, 0))
{} # endif
{}
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d) GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
: real(d.real) : real(d.real)
, dual(d.dual) , dual(d.dual)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <precision Q> template <precision Q>
@ -155,13 +157,15 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// tdualquat operators // tdualquat operators
template <typename T, precision P> # if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q) template <typename T, precision P>
{ GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q)
this->real = q.real; {
this->dual = q.dual; this->real = q.real;
return *this; this->dual = q.dual;
} return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>

@ -60,6 +60,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Added <glm/gtx/wrap.hpp> for texcoord wrapping - Added <glm/gtx/wrap.hpp> for texcoord wrapping
- Added static components and precision members to all vector and quat types #350 - Added static components and precision members to all vector and quat types #350
- Added .gitignore #349 - Added .gitignore #349
- Added support of defaulted functions to GLM types, to use them in unions #366
##### Improvements: ##### Improvements:
- Changed usage of __has_include to support Intel compiler #307 - Changed usage of __has_include to support Intel compiler #307

@ -82,6 +82,22 @@ int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat2x2 f;
glm::mat2x2 i;
} A, B;
A.f = glm::mat2x2(0);
Error += glm::all(glm::equal(A.i[0], glm::vec2(0))) ? 0 : 1;
B.f = glm::mat2x2(1);
Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if GLM_HAS_INITIALIZER_LISTS #if GLM_HAS_INITIALIZER_LISTS
glm::mat2x2 m0( glm::mat2x2 m0(
glm::vec2(0, 1), glm::vec2(0, 1),

@ -55,7 +55,23 @@ static int test_operators()
int test_ctr() int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat2x3 f;
glm::mat2x3 i;
} A, B;
A.f = glm::mat2x3(0);
Error += glm::all(glm::equal(A.i[0], glm::vec3(0))) ? 0 : 1;
B.f = glm::mat2x3(1);
Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if GLM_HAS_INITIALIZER_LISTS #if GLM_HAS_INITIALIZER_LISTS
glm::mat2x3 m0( glm::mat2x3 m0(
glm::vec3(0, 1, 2), glm::vec3(0, 1, 2),

@ -55,7 +55,23 @@ static int test_operators()
int test_ctr() int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat2x4 f;
glm::mat2x4 i;
} A, B;
A.f = glm::mat2x4(0);
Error += glm::all(glm::equal(A.i[0], glm::vec4(0))) ? 0 : 1;
B.f = glm::mat2x4(1);
Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat2x4 m0( glm::mat2x4 m0(
glm::vec4(0, 1, 2, 3), glm::vec4(0, 1, 2, 3),

@ -55,7 +55,23 @@ static bool test_operators()
int test_ctr() int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat3x2 f;
glm::mat3x2 i;
} A, B;
A.f = glm::mat3x2(0);
Error += glm::all(glm::equal(A.i[0], glm::vec2(0))) ? 0 : 1;
B.f = glm::mat3x2(1);
Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat3x2 m0( glm::mat3x2 m0(
glm::vec2(0, 1), glm::vec2(0, 1),

@ -114,7 +114,23 @@ int test_inverse()
int test_ctr() int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat3x3 f;
glm::mat3x3 i;
} A, B;
A.f = glm::mat3x3(0);
Error += glm::all(glm::equal(A.i[0], glm::vec3(0))) ? 0 : 1;
B.f = glm::mat3x3(1);
Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat3x3 m0( glm::mat3x3 m0(
glm::vec3(0, 1, 2), glm::vec3(0, 1, 2),

@ -55,7 +55,23 @@ static bool test_operators()
int test_ctr() int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat3x4 f;
glm::mat3x4 i;
} A, B;
A.f = glm::mat3x4(0);
Error += glm::all(glm::equal(A.i[0], glm::vec4(0))) ? 0 : 1;
B.f = glm::mat3x4(1);
Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat3x4 m0( glm::mat3x4 m0(
glm::vec4(0, 1, 2, 3), glm::vec4(0, 1, 2, 3),

@ -56,6 +56,22 @@ int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat4x2 f;
glm::mat4x2 i;
} A, B;
A.f = glm::mat4x2(0);
Error += glm::all(glm::equal(A.i[0], glm::vec2(0))) ? 0 : 1;
B.f = glm::mat4x2(1);
Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat4x2 m0( glm::mat4x2 m0(
glm::vec2(0, 1), glm::vec2(0, 1),

@ -56,6 +56,22 @@ int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat4x3 f;
glm::mat4x3 i;
} A, B;
A.f = glm::mat4x3(0);
Error += glm::all(glm::equal(A.i[0], glm::vec3(0))) ? 0 : 1;
B.f = glm::mat4x3(1);
Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if(GLM_HAS_INITIALIZER_LISTS) #if(GLM_HAS_INITIALIZER_LISTS)
glm::mat4x3 m0( glm::mat4x3 m0(
glm::vec3(0, 1, 2), glm::vec3(0, 1, 2),

@ -203,6 +203,22 @@ int test_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::mat4 f;
glm::mat4 i;
} A, B;
A.f = glm::mat4(0);
Error += glm::all(glm::equal(A.i[0], glm::vec4(0))) ? 0 : 1;
B.f = glm::mat4(1);
Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
#if GLM_HAS_TRIVIAL_QUERIES #if GLM_HAS_TRIVIAL_QUERIES
//Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1; //Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1; //Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;

@ -296,6 +296,22 @@ int test_quat_ctr()
{ {
int Error(0); int Error(0);
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::quat f;
glm::quat i;
} A, B;
A.f = glm::quat(0, 0, 0, 0);
Error += glm::all(glm::equal(A.i, glm::quat(0, 0, 0, 0))) ? 0 : 1;
B.f = glm::quat(1, 1, 1, 1);
Error += glm::all(glm::equal(B.i, glm::quat(1, 1, 1, 1))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES # if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1; // Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1;
// Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1; // Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;

Loading…
Cancel
Save