Fixed interactions with GLM_FORCE_NO_CTOR_INIT and default functions #366

This commit is contained in:
Christophe Riccio 2015-07-25 23:23:59 +02:00
parent 53e494bea9
commit afa193704c
53 changed files with 535 additions and 320 deletions

View File

@ -926,8 +926,14 @@
#if GLM_HAS_DEFAULTED_FUNCTIONS
# define GLM_DEFAULT = default
# ifdef GLM_FORCE_NO_CTOR_INIT
# define GLM_DEFAULT_CTOR = default
# else
# define GLM_DEFAULT_CTOR
# endif
#else
# define GLM_DEFAULT
# define GLM_DEFAULT_CTOR
#endif
#if GLM_HAS_CONSTEXPR

View File

@ -68,7 +68,7 @@ namespace glm
//////////////////////////////////////
// Constructors
GLM_FUNC_DECL tmat2x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);

View File

@ -53,7 +53,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
{
@ -62,7 +62,9 @@ namespace detail
this->value[1] = col_type(0, 1);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{

View File

@ -62,7 +62,8 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat2x3() 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 tmat2x3(tmat2x3<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
{
@ -44,7 +44,9 @@ namespace glm
this->value[1] = col_type(0, 1, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{

View File

@ -58,13 +58,12 @@ namespace glm
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat2x4() 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 tmat2x4(tmat2x4<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
{
@ -44,7 +44,9 @@ namespace glm
this->value[1] = col_type(0, 1, 0, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{

View File

@ -58,14 +58,12 @@ namespace glm
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat3x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
{
@ -45,7 +45,9 @@ namespace glm
this->value[2] = col_type(0, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{

View File

@ -69,7 +69,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);

View File

@ -59,7 +59,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
{
@ -69,7 +69,9 @@ namespace detail
this->value[2] = col_type(0, 0, 1);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{

View File

@ -65,7 +65,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat3x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
{
@ -45,7 +45,9 @@ namespace glm
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{

View File

@ -65,7 +65,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
{
@ -46,7 +46,9 @@ namespace glm
this->value[3] = col_type(0, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{

View File

@ -63,7 +63,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);

View File

@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
{
@ -46,7 +46,9 @@ namespace glm
this->value[3] = col_type(0, 0, 0);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{

View File

@ -66,7 +66,7 @@ namespace glm
public:
// Constructors
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);

View File

@ -95,7 +95,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
{
@ -106,7 +106,9 @@ namespace detail
this->value[3] = col_type(0, 0, 0, 1);
# endif
}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{

View File

@ -112,7 +112,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec1() GLM_DEFAULT;
GLM_FUNC_DECL tvec1() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);

View File

@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)

View File

@ -113,7 +113,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec2() GLM_DEFAULT;
GLM_FUNC_DECL tvec2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec2(tvec2<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);

View File

@ -31,14 +31,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, P> const & v)
: x(v.x), y(v.y)

View File

@ -114,7 +114,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec3() GLM_DEFAULT;
GLM_FUNC_DECL tvec3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec3(tvec3<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);

View File

@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)

View File

@ -171,7 +171,7 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec4() GLM_DEFAULT;
GLM_FUNC_DECL tvec4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec4(tvec4<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);

View File

@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)

View File

@ -95,7 +95,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tquat() GLM_DEFAULT;
GLM_FUNC_DECL tquat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tquat(tquat<T, P> const & q) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tquat(tquat<T, Q> const & q);

View File

@ -97,14 +97,16 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(1)
# endif
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tquat<T, P> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w)

View File

@ -94,7 +94,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tdualquat() GLM_DEFAULT;
GLM_FUNC_DECL tdualquat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d);

View File

@ -83,7 +83,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors
# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
# ifndef GLM_FORCE_NO_CTOR_INIT
@ -91,7 +91,9 @@ namespace glm
, dual(tquat<T, P>(0, 0, 0, 0))
# endif
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
: real(d.real)

View File

@ -85,7 +85,7 @@ namespace detail
//////////////////////////////////////
// Constructors
fmat4x4SIMD();
fmat4x4SIMD() GLM_DEFAULT_CTOR;
explicit fmat4x4SIMD(float const & s);
explicit fmat4x4SIMD(
float const & x0, float const & y0, float const & z0, float const & w0,
@ -120,7 +120,7 @@ namespace detail
fvec4SIMD const & operator[](length_t i) const;
// Unary updatable operators
fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
fmat4x4SIMD & operator= (fmat4x4SIMD const & m) GLM_DEFAULT;
fmat4x4SIMD & operator+= (float const & s);
fmat4x4SIMD & operator+= (fmat4x4SIMD const & m);
fmat4x4SIMD & operator-= (float const & s);

View File

@ -64,15 +64,17 @@ GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[]
//////////////////////////////////////////////////////////////
// Constructors
GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->Data[0] = fvec4SIMD(1, 0, 0, 0);
this->Data[1] = fvec4SIMD(0, 1, 0, 0);
this->Data[2] = fvec4SIMD(0, 0, 1, 0);
this->Data[3] = fvec4SIMD(0, 0, 0, 1);
# endif
}
#if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->Data[0] = fvec4SIMD(1, 0, 0, 0);
this->Data[1] = fvec4SIMD(0, 1, 0, 0);
this->Data[2] = fvec4SIMD(0, 0, 1, 0);
this->Data[3] = fvec4SIMD(0, 0, 0, 1);
# endif
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD(float const & s)
{
@ -135,17 +137,19 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD
//////////////////////////////////////////////////////////////
// mat4 operators
GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator=
(
fmat4x4SIMD const & m
)
{
this->Data[0] = m[0];
this->Data[1] = m[1];
this->Data[2] = m[2];
this->Data[3] = m[3];
return *this;
}
#if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator=
(
fmat4x4SIMD const & m
)
{
this->Data[0] = m[0];
this->Data[1] = m[1];
this->Data[2] = m[2];
this->Data[3] = m[3];
return *this;
}
#endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+=
(

View File

@ -94,9 +94,9 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
fquatSIMD();
fquatSIMD() GLM_DEFAULT_CTOR;
fquatSIMD(fquatSIMD const & q) GLM_DEFAULT;
fquatSIMD(__m128 const & Data);
fquatSIMD(fquatSIMD const & q);
//////////////////////////////////////
// Explicit basic constructors
@ -117,7 +117,7 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
fquatSIMD& operator =(fquatSIMD const & q);
fquatSIMD& operator= (fquatSIMD const & q) GLM_DEFAULT;
fquatSIMD& operator*=(float const & s);
fquatSIMD& operator/=(float const & s);
};

View File

@ -55,21 +55,24 @@ void print(const fvec4SIMD &v)
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD()
# ifdef GLM_FORCE_NO_CTOR_INIT
: Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f))
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD()
# ifdef GLM_FORCE_NO_CTOR_INIT
: Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f))
# endif
{}
# endif
{}
# if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(fquatSIMD const & q) :
Data(q.Data)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(__m128 const & Data) :
Data(Data)
{}
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(fquatSIMD const & q) :
Data(q.Data)
{}
//////////////////////////////////////
// Explicit basic constructors
@ -83,25 +86,27 @@ GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(quat const & q) :
GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(vec3 const & eulerAngles)
{
vec3 c = glm::cos(eulerAngles * 0.5f);
vec3 c = glm::cos(eulerAngles * 0.5f);
vec3 s = glm::sin(eulerAngles * 0.5f);
Data = _mm_set_ps(
(c.x * c.y * c.z) + (s.x * s.y * s.z),
(c.x * c.y * s.z) - (s.x * s.y * c.z),
(c.x * s.y * c.z) + (s.x * c.y * s.z),
(s.x * c.y * c.z) - (c.x * s.y * s.z));
Data = _mm_set_ps(
(c.x * c.y * c.z) + (s.x * s.y * s.z),
(c.x * c.y * s.z) - (s.x * s.y * c.z),
(c.x * s.y * c.z) + (s.x * c.y * s.z),
(s.x * c.y * c.z) - (c.x * s.y * s.z));
}
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator=(fquatSIMD const & q)
{
this->Data = q.Data;
return *this;
}
#if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator=(fquatSIMD const & q)
{
this->Data = q.Data;
return *this;
}
#endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator*=(float const & s)
{

View File

@ -117,9 +117,9 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
fvec4SIMD();
fvec4SIMD() GLM_DEFAULT_CTOR;
fvec4SIMD(fvec4SIMD const & v) GLM_DEFAULT;
fvec4SIMD(__m128 const & Data);
fvec4SIMD(fvec4SIMD const & v);
//////////////////////////////////////
// Explicit basic constructors
@ -150,7 +150,7 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
fvec4SIMD& operator= (fvec4SIMD const & v);
fvec4SIMD& operator= (fvec4SIMD const & v) GLM_DEFAULT;
fvec4SIMD& operator+=(fvec4SIMD const & v);
fvec4SIMD& operator-=(fvec4SIMD const & v);
fvec4SIMD& operator*=(fvec4SIMD const & v);

View File

@ -19,20 +19,24 @@ struct shuffle_mask
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD()
# ifdef GLM_FORCE_NO_CTOR_INIT
: Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f))
# endif
{}
#if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD()
# ifdef GLM_FORCE_NO_CTOR_INIT
: Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f))
# endif
{}
#endif//!GLM_HAS_DEFAULTED_FUNCTIONS
#if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) :
Data(v.Data)
{}
#endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(__m128 const & Data) :
Data(Data)
{}
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) :
Data(v.Data)
{}
GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec4 const & v) :
Data(_mm_set_ps(v.w, v.z, v.y, v.x))
{}
@ -92,11 +96,13 @@ GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) :
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v)
{
this->Data = v.Data;
return *this;
}
#if !GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v)
{
this->Data = v.Data;
return *this;
}
#endif//!GLM_HAS_DEFAULTED_FUNCTIONS
GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator+=(float const & s)
{

View File

@ -1,4 +1,5 @@
glmCreateTestGTC(core_type_cast)
glmCreateTestGTC(core_type_ctor)
glmCreateTestGTC(core_type_float)
glmCreateTestGTC(core_type_int)
glmCreateTestGTC(core_type_length)

View File

@ -0,0 +1,387 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @file test/core/core_type_ctor.cpp
/// @date 2015-07-25 / 2015-07-25
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_NO_CTOR_INIT
#include <glm/glm.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/gtc/quaternion.hpp>
int test_vec1_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec1 f;
glm::ivec1 i;
} A, B;
A.f = glm::vec1(0);
Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1;
B.f = glm::vec1(1);
Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
return Error;
}
int test_vec2_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec2 f;
glm::ivec2 i;
} A, B;
A.f = glm::vec2(0);
Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1;
B.f = glm::vec2(1);
Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
return Error;
}
int test_vec3_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec3 f;
glm::ivec3 i;
} A, B;
A.f = glm::vec3(0);
Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1;
B.f = glm::vec3(1);
Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
return Error;
}
int test_vec4_ctor()
{
int Error = 0;
# ifndef GLM_FORCE_NO_CTOR_INIT
{
glm::vec4 A;
glm::vec4 B(0);
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
}
# endif//GLM_FORCE_NO_CTOR_INIT
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec4 f;
glm::ivec4 i;
} A, B;
A.f = glm::vec4(0);
Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1;
B.f = glm::vec4(1);
Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
return Error;
}
int test_mat2x2_ctor()
{
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
return Error;
}
int test_mat2x3_ctor()
{
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
return Error;
}
int test_mat2x4_ctor()
{
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
return Error;
}
int test_mat3x2_ctor()
{
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
return Error;
}
int test_mat3x3_ctor()
{
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
return Error;
}
int test_mat3x4_ctor()
{
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
return Error;
}
int test_mat4x2_ctor()
{
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
return Error;
}
int test_mat4x3_ctor()
{
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
return Error;
}
int test_mat4x4_ctor()
{
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
return Error;
}
int test_quat_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS && defined(GLM_FORCE_NO_CTOR_INIT)
{
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
return Error;
}
int main()
{
int Error = 0;
Error += test_vec1_ctor();
Error += test_vec2_ctor();
Error += test_vec3_ctor();
Error += test_vec4_ctor();
Error += test_mat2x2_ctor();
Error += test_mat2x3_ctor();
Error += test_mat2x4_ctor();
Error += test_mat3x2_ctor();
Error += test_mat3x3_ctor();
Error += test_mat3x4_ctor();
Error += test_mat4x2_ctor();
Error += test_mat4x3_ctor();
Error += test_mat4x4_ctor();
Error += test_quat_ctor();
return Error;
}

View File

@ -82,22 +82,6 @@ int test_ctr()
{
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
glm::mat2x2 m0(
glm::vec2(0, 1),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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
glm::mat2x3 m0(
glm::vec3(0, 1, 2),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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)
glm::mat2x4 m0(
glm::vec4(0, 1, 2, 3),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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)
glm::mat3x2 m0(
glm::vec2(0, 1),

View File

@ -115,22 +115,6 @@ int test_ctr()
{
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)
glm::mat3x3 m0(
glm::vec3(0, 1, 2),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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)
glm::mat3x4 m0(
glm::vec4(0, 1, 2, 3),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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)
glm::mat4x2 m0(
glm::vec2(0, 1),

View File

@ -56,22 +56,6 @@ int test_ctr()
{
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)
glm::mat4x3 m0(
glm::vec3(0, 1, 2),

View File

@ -203,22 +203,6 @@ int test_ctr()
{
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
//Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;

View File

@ -69,22 +69,6 @@ int test_vec1_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec1 f;
glm::ivec1 i;
} A, B;
A.f = glm::vec1(0);
Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1;
B.f = glm::vec1(1);
Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;

View File

@ -229,22 +229,6 @@ int test_vec2_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec2 f;
glm::ivec2 i;
} A, B;
A.f = glm::vec2(0);
Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1;
B.f = glm::vec2(1);
Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;

View File

@ -45,22 +45,6 @@ int test_vec3_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec3 f;
glm::ivec3 i;
} A, B;
A.f = glm::vec3(0);
Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1;
B.f = glm::vec3(1);
Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;

View File

@ -68,22 +68,6 @@ int test_vec4_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec4 f;
glm::ivec4 i;
} A, B;
A.f = glm::vec4(0);
Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1;
B.f = glm::vec4(1);
Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
{
glm::ivec4 A(1, 2, 3, 4);
glm::ivec4 B(A);

View File

@ -243,6 +243,7 @@ int test_quat_mul()
glm::quat temp5 = glm::normalize(temp1 * temp2);
glm::vec3 temp6 = temp5 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp5);
# ifndef GLM_FORCE_NO_CTOR_INIT
{
glm::quat temp7;
@ -251,6 +252,7 @@ int test_quat_mul()
Error += temp7 != glm::quat();
}
# endif
return Error;
}
@ -296,22 +298,6 @@ int test_quat_ctr()
{
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
// Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1;
// Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;