mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
WiimoteEmu: Apply "Tilt" rotations separately and before those of "Point" and "Swing" for proper tilted pointing.
This commit is contained in:
@ -96,7 +96,8 @@ void Nunchuk::Update()
|
|||||||
EmulateTilt(&m_tilt_state, m_tilt, 1.f / ::Wiimote::UPDATE_FREQ);
|
EmulateTilt(&m_tilt_state, m_tilt, 1.f / ::Wiimote::UPDATE_FREQ);
|
||||||
EmulateShake(&m_shake_state, m_shake, 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 =
|
Common::Vec3 accel =
|
||||||
transformation *
|
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.
|
// TODO: Think about and clean up matrix order + make nunchuk match.
|
||||||
return Common::Matrix44::Translate(-m_shake_state.position) *
|
return Common::Matrix44::Translate(-m_shake_state.position) *
|
||||||
Common::Matrix44::FromMatrix33(
|
Common::Matrix44::FromMatrix33(extra_rotation * GetRotationalMatrix(-m_tilt_state.angle) *
|
||||||
extra_rotation * GetRotationalMatrix(-m_tilt_state.angle - m_swing_state.angle -
|
GetRotationalMatrix(-m_cursor_state.angle) *
|
||||||
m_cursor_state.angle)) *
|
GetRotationalMatrix(-m_swing_state.angle)) *
|
||||||
Common::Matrix44::Translate(-m_swing_state.position - m_cursor_state.position);
|
Common::Matrix44::Translate(-m_swing_state.position - m_cursor_state.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user