From 7d96eb8c62d69ecefb6130f360cd73530f25c647 Mon Sep 17 00:00:00 2001 From: Chase LaCas Date: Sun, 1 Jul 2012 16:26:12 -0400 Subject: [PATCH] Fixed bug in the Windows joystick handling converting POV hat angles to their PovX and PovY component axes. --- src/SFML/Window/Win32/JoystickImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/Window/Win32/JoystickImpl.cpp b/src/SFML/Window/Win32/JoystickImpl.cpp index f14cecfc1..294f7c84c 100644 --- a/src/SFML/Window/Win32/JoystickImpl.cpp +++ b/src/SFML/Window/Win32/JoystickImpl.cpp @@ -139,7 +139,7 @@ JoystickState JoystickImpl::update() // Special case for POV, it is given as an angle if (pos.dwPOV != 0xFFFF) { - float angle = pos.dwPOV / 36000.f * 3.141592654f; + float angle = pos.dwPOV / 18000.f * 3.141592654f; state.axes[Joystick::PovX] = std::cos(angle) * 100; state.axes[Joystick::PovY] = std::sin(angle) * 100; }