WiimoteEmu: Improve emulated swing.

This commit is contained in:
Jordan Woyak
2019-04-07 07:57:04 -05:00
parent 4374600367
commit ba1b335118
8 changed files with 199 additions and 68 deletions

View File

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