Don't clamp to a circle in the virtual stick.

This commit is contained in:
Henrik Rydgard committed 2013-06-19 20:46:06 +02:00
1 parent 0e5cab2b0c
commit d1df63036a
1 file changed
+9 -6
+9 -6
View File
@@ -130,12 +130,15 @@ void TouchStick::update(InputState &input_state)
if (!dragging_[i])
goto skip;
// Clamp to a circle
float len = sqrtf(dx * dx + dy * dy);
if (len > 1.0f) {
dx /= len;
dy /= len;
}
// Do not clamp to a circle! The PSP has nearly square range!
// Old code to clamp to a circle
// float len = sqrtf(dx * dx + dy * dy);
// if (len > 1.0f) {
// dx /= len;
// dy /= len;
//}
if (stick_ == 0) {
input_state.pad_lstick_x = dx;
input_state.pad_lstick_y = -dy;