1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-29 16:57:56 +00:00

used cyclefix and raddif in more places; (c)spin90, (c)spin180 and spin180 functions; rephrased M_PI in terms of TAU and x._deg when applicable

This commit is contained in:
Zeno Rogue
2022-11-12 22:38:45 +01:00
parent 563b9c1f74
commit 06523e063e
100 changed files with 750 additions and 757 deletions

View File

@@ -237,19 +237,17 @@ EX namespace fake {
auto h1 = V * befake(FPIU(get_corner_position(c, (i+1) % c->type)));
ld b0 = atan2(unshift(h0));
ld b1 = atan2(unshift(h1));
while(b1 < b0) b1 += 2 * M_PI;
while(b1 < b0) b1 += TAU;
if(a0 == -1) {
draw_recursive(c->move(i), optimized_shift(V * adj(c, i)), b0, b1, c, depth+1);
}
else {
if(b1 - b0 > M_PI) continue;
if(b0 < a0 - M_PI) b0 += 2 * M_PI;
if(b0 > a0 + M_PI) b0 -= 2 * M_PI;
cyclefix(b0, a0);
if(b0 < a0) b0 = a0;
if(b1 > a1 + M_PI) b1 -= 2 * M_PI;
if(b1 < a1 - M_PI) b1 += 2 * M_PI;
cyclefix(b1, a1);
if(b1 > a1) b1 = a1;
if(b0 > b1) continue;