From 540a3ce66529157b18cce539b5e337b4398b87d9 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 2 Jan 2020 15:46:18 -0600 Subject: [PATCH] DolphinQt: Use FromQuaternion for a more accurate gyro indicator. --- Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp index d8fa5aaaaa..cf9c042599 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp @@ -797,9 +797,9 @@ void GyroMappingIndicator::paintEvent(QPaintEvent*) const auto gyro_state = m_gyro_group.GetState(); const auto angular_velocity = gyro_state.value_or(Common::Vec3{}); - m_state *= Common::Matrix33::RotateX(angular_velocity.x / -INDICATOR_UPDATE_FREQ) * - Common::Matrix33::RotateY(angular_velocity.y / INDICATOR_UPDATE_FREQ) * - Common::Matrix33::RotateZ(angular_velocity.z / -INDICATOR_UPDATE_FREQ); + m_state *= Common::Matrix33::FromQuaternion(angular_velocity.x / -INDICATOR_UPDATE_FREQ / 2, + angular_velocity.y / INDICATOR_UPDATE_FREQ / 2, + angular_velocity.z / -INDICATOR_UPDATE_FREQ / 2, 1); // Reset orientation when stable for a bit: constexpr u32 STABLE_RESET_STEPS = INDICATOR_UPDATE_FREQ;