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. 5
      glm/detail/type_mat2x2.inl
  3. 8
      glm/detail/type_mat2x3.hpp
  4. 5
      glm/detail/type_mat2x3.inl
  5. 6
      glm/detail/type_mat2x4.hpp
  6. 5
      glm/detail/type_mat2x4.inl
  7. 7
      glm/detail/type_mat3x2.hpp
  8. 5
      glm/detail/type_mat3x2.inl
  9. 7
      glm/detail/type_mat3x3.hpp
  10. 12
      glm/detail/type_mat3x3.inl
  11. 7
      glm/detail/type_mat3x4.hpp
  12. 5
      glm/detail/type_mat3x4.inl
  13. 7
      glm/detail/type_mat4x2.hpp
  14. 5
      glm/detail/type_mat4x2.inl
  15. 8
      glm/detail/type_mat4x3.hpp
  16. 4
      glm/detail/type_mat4x3.inl
  17. 8
      glm/detail/type_mat4x4.hpp
  18. 5
      glm/detail/type_mat4x4.inl
  19. 6
      glm/gtc/quaternion.hpp
  20. 4
      glm/gtc/quaternion.inl
  21. 6
      glm/gtx/dual_quaternion.hpp
  22. 4
      glm/gtx/dual_quaternion.inl
  23. 1
      readme.md
  24. 16
      test/core/core_type_mat2x2.cpp
  25. 16
      test/core/core_type_mat2x3.cpp
  26. 16
      test/core/core_type_mat2x4.cpp
  27. 16
      test/core/core_type_mat3x2.cpp
  28. 16
      test/core/core_type_mat3x3.cpp
  29. 16
      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,6 +53,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2() GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
{ {
@ -68,6 +69,7 @@ namespace detail
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,6 +246,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
{ {
@ -250,6 +254,7 @@ namespace detail
this->value[1] = m[1]; this->value[1] = m[1];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3() GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
{ {
@ -50,6 +51,7 @@ namespace glm
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,6 +230,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
{ {
@ -234,6 +238,7 @@ namespace glm
this->value[1] = m[1]; this->value[1] = m[1];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4() GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
{ {
@ -50,6 +51,7 @@ namespace glm
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,6 +231,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
{ {
@ -235,6 +239,7 @@ namespace glm
this->value[1] = m[1]; this->value[1] = m[1];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2() GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
{ {
@ -52,6 +53,7 @@ namespace glm
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,6 +260,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
{ {
@ -265,6 +269,7 @@ namespace glm
this->value[2] = m[2]; this->value[2] = m[2];
return *this; 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,6 +59,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3() GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
{ {
@ -69,10 +70,6 @@ namespace detail
# endif # 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)
{ {
@ -80,6 +77,7 @@ namespace detail
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,6 +283,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Operators // Operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
{ {
@ -289,6 +292,7 @@ namespace detail
this->value[2] = m[2]; this->value[2] = m[2];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4() GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
{ {
@ -52,6 +53,7 @@ namespace glm
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,6 +259,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
{ {
@ -264,6 +268,7 @@ namespace glm
this->value[2] = m[2]; this->value[2] = m[2];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2() GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
{ {
@ -54,6 +55,7 @@ namespace glm
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,6 +283,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
{ {
@ -289,6 +293,7 @@ namespace glm
this->value[3] = m[3]; this->value[3] = m[3];
return *this; 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,6 +35,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3() GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
{ {
@ -54,6 +55,7 @@ namespace glm
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,6 +282,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Unary updatable operators // Unary updatable operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
{ {
@ -289,6 +292,7 @@ namespace glm
this->value[3] = m[3]; this->value[3] = m[3];
return *this; 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,6 +95,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Constructors // Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4() GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
{ {
@ -114,6 +115,7 @@ namespace detail
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,6 +369,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Operators // Operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
{ {
@ -377,6 +381,7 @@ namespace detail
this->value[3] = m[3]; this->value[3] = m[3];
return *this; 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,6 +97,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat() GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@ -108,6 +109,7 @@ namespace detail
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,6 +227,7 @@ namespace detail
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// tquat<valType> operators // tquat<valType> operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
{ {
@ -234,6 +237,7 @@ namespace detail
this->z = q.z; this->z = q.z;
return *this; 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,6 +83,7 @@ namespace glm
////////////////////////////////////// //////////////////////////////////////
// Implicit basic constructors // Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat() GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@ -96,6 +97,7 @@ namespace glm
: 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,6 +157,7 @@ namespace glm
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// tdualquat operators // tdualquat operators
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q) GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q)
{ {
@ -162,6 +165,7 @@ namespace glm
this->dual = q.dual; this->dual = q.dual;
return *this; 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),

@ -56,6 +56,22 @@ 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),

@ -56,6 +56,22 @@ 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),

@ -56,6 +56,22 @@ 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),

@ -115,6 +115,22 @@ 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),

@ -56,6 +56,22 @@ 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