mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-21 17:05:04 -05:00
Replace uAxisThreshold with appropriate constant for octagon clamping (#83)
This commit is contained in:
parent
98ddacef01
commit
5505336a8a
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user