Skip to content

Commit

Permalink
Bring back quaternion to xyzw storage to remain backward compatible #942
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Sep 7, 2019
1 parent 6ec2354 commit 0d0638e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion glm/detail/type_quat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace glm
# if GLM_LANG & GLM_LANG_CXXMS_FLAG
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;
};
Expand Down
10 changes: 5 additions & 5 deletions glm/detail/type_quat.inl
Original file line number Diff line number Diff line change
Expand Up @@ -103,30 +103,30 @@ namespace detail
template<typename T, qualifier Q>
template<qualifier P>
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 --

template<typename T, qualifier Q>
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>
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 --

template<typename T, qualifier Q>
template<typename U, qualifier P>
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))
, z(static_cast<T>(q.z))
, w(static_cast<T>(q.w))
{}

//template<typename valType>
Expand Down

0 comments on commit 0d0638e

Please sign in to comment.