mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-02 05:20:32 +00:00
solv:: fixed lazy inv_exp
This commit is contained in:
parent
d4ad45c4da
commit
3ae542b241
9
sol.cpp
9
sol.cpp
@ -125,13 +125,15 @@ namespace solv {
|
||||
iy *= PRECY-1;
|
||||
iz *= PRECZ-1;
|
||||
|
||||
if(lazy) {
|
||||
auto r = inverse_exp_table[(iz*PRECY+iy)*PRECX+ix];
|
||||
hyperpoint res = C0;
|
||||
|
||||
if(lazy) {
|
||||
auto r = inverse_exp_table[(int(iz)*PRECY+int(iy))*PRECX+int(ix)];
|
||||
for(int i=0; i<3; i++) res[i] = r[i];
|
||||
return res;
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
if(ix >= PRECX-1) ix = PRECX-2;
|
||||
if(iy >= PRECX-1) iy = PRECX-2;
|
||||
if(iz >= PRECZ-1) iz = PRECZ-2;
|
||||
@ -148,6 +150,7 @@ namespace solv {
|
||||
|
||||
for(int t=0; t<3; t++)
|
||||
res[t] = S2(ax) * (bx-ix) + S2(bx) * (ix-ax);
|
||||
}
|
||||
|
||||
if(h[2] < 0.) { swap(res[0], res[1]); res[2] = -res[2]; }
|
||||
if(h[0] < 0.) res[0] = -res[0];
|
||||
|
Loading…
Reference in New Issue
Block a user