DolphinQt: Use FromQuaternion for a more accurate gyro indicator.

This commit is contained in:
Jordan Woyak 2020-01-02 15:46:18 -06:00
parent 8ab3694f51
commit 540a3ce665
1 changed files with 3 additions and 3 deletions

View File

@ -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;