mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
WiimoteEmu: Improve emulated swing.
This commit is contained in:
@ -492,11 +492,19 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force)
|
||||
QRectF(-scale, raw_coord.z * scale - INPUT_DOT_RADIUS / 2, scale * 2, INPUT_DOT_RADIUS));
|
||||
|
||||
// Adjusted Z:
|
||||
if (adj_coord.y)
|
||||
const auto curve_point =
|
||||
std::max(std::abs(m_motion_state.angle.x), std::abs(m_motion_state.angle.z)) / MathUtil::TAU;
|
||||
if (adj_coord.y || curve_point)
|
||||
{
|
||||
p.setBrush(GetAdjustedInputColor());
|
||||
p.drawRect(
|
||||
QRectF(-scale, adj_coord.y * -scale - INPUT_DOT_RADIUS / 2, scale * 2, INPUT_DOT_RADIUS));
|
||||
// Show off the angle somewhat with a curved line.
|
||||
QPainterPath path;
|
||||
path.moveTo(-scale, (adj_coord.y + curve_point) * -scale);
|
||||
path.quadTo({0, (adj_coord.y - curve_point) * -scale},
|
||||
{scale, (adj_coord.y + curve_point) * -scale});
|
||||
|
||||
p.setBrush(Qt::NoBrush);
|
||||
p.setPen(QPen(GetAdjustedInputColor(), INPUT_DOT_RADIUS));
|
||||
p.drawPath(path);
|
||||
}
|
||||
|
||||
// Draw "gate" shape.
|
||||
|
Reference in New Issue
Block a user