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)
{