Merge pull request #1074 from szabolcsdombi/quaternion-constructor-parameters-fix

make quaternion constructor respect GLM_FORCE_QUAT_DATA_XYZW
This commit is contained in:
Christophe 2021-07-15 09:56:22 +02:00 committed by GitHub
commit f0066a2acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -88,7 +88,12 @@ namespace glm
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v);
# ifdef GLM_FORCE_QUAT_DATA_XYZW
GLM_FUNC_DECL GLM_CONSTEXPR qua(T x, T y, T z, T w);
# else
GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z);
# endif
// -- Conversion constructors --

View File

@ -141,10 +141,11 @@ namespace detail
{}
template <typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _w, T _x, T _y, T _z)
# ifdef GLM_FORCE_QUAT_DATA_XYZW
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _x, T _y, T _z, T _w)
: x(_x), y(_y), z(_z), w(_w)
# else
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)
# endif
{}