mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-28 21:49:27 +00:00
Attempt to improve trajectory.
This commit is contained in:
parent
308b3ca448
commit
1d8b33d7ae
@ -322,10 +322,10 @@ class ConcreteMachine:
|
|||||||
|
|
||||||
if(abs(y_diff) > MaxStep || abs(x_diff) > MaxStep) {
|
if(abs(y_diff) > MaxStep || abs(x_diff) > MaxStep) {
|
||||||
if(abs(y_diff) > abs(x_diff)) {
|
if(abs(y_diff) > abs(x_diff)) {
|
||||||
x_diff = (x_diff * MaxStep + abs(y_diff) - 1) / abs(y_diff);
|
x_diff = (x_diff * MaxStep + (abs(y_diff) >> 1)) / abs(y_diff);
|
||||||
y_diff = std::clamp(y_diff, -MaxStep, MaxStep);
|
y_diff = std::clamp(y_diff, -MaxStep, MaxStep);
|
||||||
} else {
|
} else {
|
||||||
y_diff = (y_diff * MaxStep + abs(x_diff) - 1) / abs(x_diff);
|
y_diff = (y_diff * MaxStep + (abs(x_diff) >> 1)) / abs(x_diff);
|
||||||
x_diff = std::clamp(x_diff, -MaxStep, MaxStep);
|
x_diff = std::clamp(x_diff, -MaxStep, MaxStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user