mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
WiimoteEmu: Apply "Tilt" rotations separately and before those of "Point" and "Swing" for proper tilted pointing.
This commit is contained in:
parent
2d8758daaa
commit
bd067875e7
@ -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 *
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user