diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2020-04-18 13:15:52 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2020-04-18 13:15:52 -0500 |
| commit | bd067875e7e79a2ddddc8608ca278489bb6565aa (patch) | |
| tree | 2176e6fa084bff31149371b16bbe9bf68db09f75 /Source/Core | |
| parent | 2d8758daaa2e07a7fbfc4a17d5cb089b27a6d10c (diff) | |
WiimoteEmu: Apply "Tilt" rotations separately and before those of "Point" and "Swing" for proper tilted pointing.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp b/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp index 548d62638b..9980968cbe 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp @@ -96,7 +96,8 @@ void Nunchuk::Update() EmulateTilt(&m_tilt_state, m_tilt, 1.f / ::Wiimote::UPDATE_FREQ); EmulateShake(&m_shake_state, m_shake, 1.f / ::Wiimote::UPDATE_FREQ); - const auto transformation = GetRotationalMatrix(-m_tilt_state.angle - m_swing_state.angle); + const auto transformation = + GetRotationalMatrix(-m_tilt_state.angle) * GetRotationalMatrix(-m_swing_state.angle); Common::Vec3 accel = transformation * diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index cd05f70426..549f91ac5e 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -823,9 +823,9 @@ Common::Matrix44 Wiimote::GetTransformation(const Common::Matrix33& extra_rotati // TODO: Think about and clean up matrix order + make nunchuk match. return Common::Matrix44::Translate(-m_shake_state.position) * - Common::Matrix44::FromMatrix33( - extra_rotation * GetRotationalMatrix(-m_tilt_state.angle - m_swing_state.angle - - m_cursor_state.angle)) * + Common::Matrix44::FromMatrix33(extra_rotation * GetRotationalMatrix(-m_tilt_state.angle) * + GetRotationalMatrix(-m_cursor_state.angle) * + GetRotationalMatrix(-m_swing_state.angle)) * Common::Matrix44::Translate(-m_swing_state.position - m_cursor_state.position); } |
