mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 01:12:19 -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}
|
//bound diagonals to an octagonal range {-68 ... +68}
|
||||||
if (ax != 0.0 && ay != 0.0) {
|
if (ax != 0.0 && ay != 0.0) {
|
||||||
auto slope = ay / ax;
|
auto slope = ay / ax;
|
||||||
auto edgex = copysign(85.0 / (abs(slope) + wAxisThreshold / 69.0), ax);
|
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) + wAxisThreshold / 69.0)), ay);
|
auto edgey = copysign(std::min(abs(edgex * slope), 85.0 / (1.0 / abs(slope) + 16.0 / 69.0)), ay);
|
||||||
edgex = edgey / slope;
|
edgex = edgey / slope;
|
||||||
|
|
||||||
auto scale = sqrt(edgex * edgex + edgey * edgey) / 85.0;
|
auto scale = sqrt(edgex * edgex + edgey * edgey) / 85.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user