1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-24 07:56:59 +00:00

fixed non-shader-based slr::get_inverse_exp

This commit is contained in:
Zeno Rogue 2020-07-27 19:02:53 +02:00
parent 26a98237e0
commit 42446f1925

View File

@ -1744,13 +1744,15 @@ EX namespace slr {
ld xy = hypot_d(2, h.h); ld xy = hypot_d(2, h.h);
ld phi = atan2(h[2], h[3]) + h.shift; ld phi = atan2(h[2], h[3]) + h.shift;
if(xy < 1e-6) return point31(0.,0.,phi);
bool flipped = phi > 0; bool flipped = phi > 0;
if(flipped) phi = -phi, h[2] *= -1, h[0] *= -1; if(flipped) phi = -phi;
ld SV = stretch::not_squared(); ld SV = stretch::not_squared();
ld K = -1; ld K = -1;
ld alpha = atan2(h[1], -h[0]); /* todo shift */ ld alpha = flipped ? atan2(h[1], h[0]) - h.shift : atan2(h[1], -h[0]) + h.shift;
hyperpoint res; hyperpoint res;