summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkev4cards <kpholl01@gmail.com>2022-03-29 22:23:40 -0400
committerGitHub <noreply@github.com>2022-03-29 22:23:40 -0400
commit5505336a8a02e2f957a6748ccf1527d38038db75 (patch)
tree639fc2bbff985399f8daa7e192bd414f78af4fc0
parent98ddacef010b40d3f7039a9767b168af9c56ec00 (diff)
Replace uAxisThreshold with appropriate constant for octagon clamping (#83)
-rw-r--r--libultraship/libultraship/SDLController.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libultraship/libultraship/SDLController.cpp b/libultraship/libultraship/SDLController.cpp
index d1315c3e4..47fb57441 100644
--- a/libultraship/libultraship/SDLController.cpp
+++ b/libultraship/libultraship/SDLController.cpp
@@ -143,8 +143,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;
@@ -410,4 +410,4 @@ namespace Ship {
std::string SDLController::GetBindingConfSection() {
return GetControllerType() + " CONTROLLER BINDING " + guid;
}
-} \ No newline at end of file
+}