From 820a2c0e625f26000c688d841836bb10483be34d Mon Sep 17 00:00:00 2001 From: Szabolcs Dombi Date: Mon, 17 May 2021 08:40:22 +0300 Subject: [PATCH] make quaternion constructor respect GLM_FORCE_QUAT_DATA_XYZW --- glm/detail/type_quat.hpp | 5 +++++ glm/detail/type_quat.inl | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/glm/detail/type_quat.hpp b/glm/detail/type_quat.hpp index 3ac014d9..376c0dc8 100644 --- a/glm/detail/type_quat.hpp +++ b/glm/detail/type_quat.hpp @@ -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 -- diff --git a/glm/detail/type_quat.inl b/glm/detail/type_quat.inl index f5966c9c..52deed45 100644 --- a/glm/detail/type_quat.inl +++ b/glm/detail/type_quat.inl @@ -141,12 +141,13 @@ namespace detail {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) -# ifdef GLM_FORCE_QUAT_DATA_XYZW +# ifdef GLM_FORCE_QUAT_DATA_XYZW + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) -# else +# else + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) : w(_w), x(_x), y(_y), z(_z) -# endif +# endif {} // -- Conversion constructors --