From fe50a61917e0daa92feeff84396ce23eb4e14de3 Mon Sep 17 00:00:00 2001 From: kev4cards Date: Thu, 24 Mar 2022 18:45:39 -0400 Subject: [PATCH] Replace uAxisThreshold with appropriate constant for octagon clamping --- libultraship/libultraship/SDLController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libultraship/libultraship/SDLController.cpp b/libultraship/libultraship/SDLController.cpp index 3d6d6800d..a35e05da5 100644 --- a/libultraship/libultraship/SDLController.cpp +++ b/libultraship/libultraship/SDLController.cpp @@ -147,8 +147,8 @@ namespace Ship { //bound diagonals to an octagonal range {-68 ... +68} if (ax != 0.0 && ay != 0.0) { auto slope = ay / ax; - auto edgex = copysign(85.0 / (abs(slope) + wAxisThreshold / 69.0), ax); - auto edgey = copysign(std::min(abs(edgex * slope), 85.0 / (1.0 / abs(slope) + wAxisThreshold / 69.0)), ay); + auto edgex = copysign(85.0 / (abs(slope) + 16.0 / 69.0), ax); + auto edgey = copysign(std::min(abs(edgex * slope), 85.0 / (1.0 / abs(slope) + 16.0 / 69.0)), ay); edgex = edgey / slope; auto scale = sqrt(edgex * edgex + edgey * edgey) / 85.0; @@ -406,4 +406,4 @@ namespace Ship { std::string SDLController::GetBindingConfSection() { return GetControllerType() + " CONTROLLER BINDING " + guid; } -} \ No newline at end of file +}