Bring back quaternion to xyzw storage to remain backward compatible #942

This commit is contained in:
Christophe Riccio 2019-09-07 10:40:06 +02:00
parent 6ec2354cae
commit 0d0638e7e7
2 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ namespace glm
# if GLM_LANG & GLM_LANG_CXXMS_FLAG # if GLM_LANG & GLM_LANG_CXXMS_FLAG
union union
{ {
struct { T w, x, y, z;}; struct { T x, y, z, w;};
typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data; typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
}; };

View File

@ -103,19 +103,19 @@ namespace detail
template<typename T, qualifier Q> template<typename T, qualifier Q>
template<qualifier P> template<qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<T, P> const& q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<T, P> const& q)
: w(q.w), x(q.x), y(q.y), z(q.z) : x(q.x), y(q.y), z(q.z), w(q.w)
{} {}
// -- Explicit basic constructors -- // -- Explicit basic constructors --
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T s, vec<3, T, Q> const& v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T s, vec<3, T, Q> const& v)
: w(s), x(v.x), y(v.y), z(v.z) : x(v.x), y(v.y), z(v.z), w(s)
{} {}
template <typename T, qualifier Q> template <typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _w, T _x, T _y, T _z) GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _w, T _x, T _y, T _z)
: w(_w), x(_x), y(_y), z(_z) : x(_x), y(_y), z(_z), w(_w)
{} {}
// -- Conversion constructors -- // -- Conversion constructors --
@ -123,10 +123,10 @@ namespace detail
template<typename T, qualifier Q> template<typename T, qualifier Q>
template<typename U, qualifier P> template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<U, P> const& q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<U, P> const& q)
: w(static_cast<T>(q.w)) : x(static_cast<T>(q.x))
, x(static_cast<T>(q.x))
, y(static_cast<T>(q.y)) , y(static_cast<T>(q.y))
, z(static_cast<T>(q.z)) , z(static_cast<T>(q.z))
, w(static_cast<T>(q.w))
{} {}
//template<typename valType> //template<typename valType>