diff --git a/glm/detail/type_quat.inl b/glm/detail/type_quat.inl index 692f434d..3aefb3f8 100644 --- a/glm/detail/type_quat.inl +++ b/glm/detail/type_quat.inl @@ -74,14 +74,22 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) { assert(i >= 0 && i < this->length()); - return (&x)[i]; +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif } template GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const { assert(i >= 0 && i < this->length()); - return (&x)[i]; +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif } // -- Implicit basic constructors --